1100969Siwasaki/*- 2100969Siwasaki * Copyright (c) 2002 Mitsuru IWASAKI 3100969Siwasaki * All rights reserved. 4100969Siwasaki * 5100969Siwasaki * Redistribution and use in source and binary forms, with or without 6100969Siwasaki * modification, are permitted provided that the following conditions 7100969Siwasaki * are met: 8100969Siwasaki * 1. Redistributions of source code must retain the above copyright 9100969Siwasaki * notice, this list of conditions and the following disclaimer. 10100969Siwasaki * 2. Redistributions in binary form must reproduce the above copyright 11100969Siwasaki * notice, this list of conditions and the following disclaimer in the 12100969Siwasaki * documentation and/or other materials provided with the distribution. 13100969Siwasaki * 14100969Siwasaki * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15100969Siwasaki * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16100969Siwasaki * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17100969Siwasaki * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18100969Siwasaki * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19100969Siwasaki * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20100969Siwasaki * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21100969Siwasaki * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22100969Siwasaki * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23100969Siwasaki * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24100969Siwasaki * SUCH DAMAGE. 25100969Siwasaki * 26100969Siwasaki * $FreeBSD$ 27100969Siwasaki */ 28100969Siwasaki 29100969Siwasaki/****************************************************************************** 30100969Siwasaki * 31100969Siwasaki * Name: acpica_machdep.h - arch-specific defines, etc. 32100969Siwasaki * $Revision$ 33100969Siwasaki * 34100969Siwasaki *****************************************************************************/ 35100969Siwasaki 36100969Siwasaki#ifndef __ACPICA_MACHDEP_H__ 37167814Sjkim#define __ACPICA_MACHDEP_H__ 38100969Siwasaki 39100969Siwasaki#ifdef _KERNEL 40100969Siwasaki/* 41100969Siwasaki * Calling conventions: 42100969Siwasaki * 43100969Siwasaki * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 44100969Siwasaki * ACPI_EXTERNAL_XFACE - External ACPI interfaces 45100969Siwasaki * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 46100969Siwasaki * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 47100969Siwasaki */ 48167814Sjkim#define ACPI_SYSTEM_XFACE 49167814Sjkim#define ACPI_EXTERNAL_XFACE 50167814Sjkim#define ACPI_INTERNAL_XFACE 51167814Sjkim#define ACPI_INTERNAL_VAR_XFACE 52100969Siwasaki 53100969Siwasaki/* Asm macros */ 54100969Siwasaki 55167814Sjkim#define ACPI_ASM_MACROS 56167814Sjkim#define BREAKPOINT3 57167814Sjkim#define ACPI_DISABLE_IRQS() disable_intr() 58167814Sjkim#define ACPI_ENABLE_IRQS() enable_intr() 59100969Siwasaki 60167814Sjkim#define ACPI_FLUSH_CPU_CACHE() wbinvd() 61100969Siwasaki 62254300Sjkim/* Section 5.2.10.1: global lock acquire/release functions */ 63254300Sjkimint acpi_acquire_global_lock(volatile uint32_t *); 64254300Sjkimint acpi_release_global_lock(volatile uint32_t *); 65167814Sjkim#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) do { \ 66167814Sjkim (Acq) = acpi_acquire_global_lock(&((GLptr)->GlobalLock)); \ 67167814Sjkim} while (0) 68167814Sjkim#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) do { \ 69167814Sjkim (Acq) = acpi_release_global_lock(&((GLptr)->GlobalLock)); \ 70167814Sjkim} while (0) 71128979Snjl 72136366Snjlvoid acpi_SetDefaultIntrModel(int model); 73136366Snjlvoid acpi_cpu_c1(void); 74197439Sjhbvoid *acpi_map_table(vm_paddr_t pa, const char *sig); 75197439Sjhbvoid acpi_unmap_table(void *table); 76197439Sjhbvm_paddr_t acpi_find_table(const char *sig); 77120347Speter 78252280Sjkim#endif /* _KERNEL */ 79252280Sjkim 80100969Siwasaki#endif /* __ACPICA_MACHDEP_H__ */ 81