acpica_machdep.h revision 252280
1208963Srdivacky/*-
2208963Srdivacky * Copyright (c) 2002 Mitsuru IWASAKI
3231057Sdim * All rights reserved.
4231057Sdim *
5208963Srdivacky * Redistribution and use in source and binary forms, with or without
6208963Srdivacky * modification, are permitted provided that the following conditions
7208963Srdivacky * are met:
8212904Sdim * 1. Redistributions of source code must retain the above copyright
9226633Sdim *    notice, this list of conditions and the following disclaimer.
10212904Sdim * 2. Redistributions in binary form must reproduce the above copyright
11210299Sed *    notice, this list of conditions and the following disclaimer in the
12210299Sed *    documentation and/or other materials provided with the distribution.
13263508Sdim *
14210299Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15210299Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16239462Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17239462Sdim * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18226633Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19210299Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20218893Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21221345Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22218893Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23212904Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24210299Sed * SUCH DAMAGE.
25263508Sdim *
26263508Sdim * $FreeBSD: head/sys/amd64/include/acpica_machdep.h 252280 2013-06-27 00:22:40Z jkim $
27210299Sed */
28210299Sed
29226633Sdim/******************************************************************************
30239462Sdim *
31210299Sed * Name: acpica_machdep.h - arch-specific defines, etc.
32218893Sdim *       $Revision$
33239462Sdim *
34263508Sdim *****************************************************************************/
35210299Sed
36263508Sdim#ifndef __ACPICA_MACHDEP_H__
37226633Sdim#define	__ACPICA_MACHDEP_H__
38210299Sed
39263508Sdim#ifdef _KERNEL
40210299Sed/*
41218893Sdim * Calling conventions:
42239462Sdim *
43263508Sdim * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
44210299Sed * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
45210299Sed * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
46210299Sed * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
47210299Sed */
48210299Sed#define	ACPI_SYSTEM_XFACE
49224145Sdim#define	ACPI_EXTERNAL_XFACE
50210299Sed#define	ACPI_INTERNAL_XFACE
51263508Sdim#define	ACPI_INTERNAL_VAR_XFACE
52239462Sdim
53223017Sdim/* Asm macros */
54210299Sed
55224145Sdim#define	ACPI_ASM_MACROS
56210299Sed#define	BREAKPOINT3
57210299Sed#define	ACPI_DISABLE_IRQS() disable_intr()
58208963Srdivacky#define	ACPI_ENABLE_IRQS()  enable_intr()
59255722Semaste
60231057Sdim#define	ACPI_FLUSH_CPU_CACHE()	wbinvd()
61231057Sdim
62231057Sdim/* Section 5.2.9.1:  global lock acquire/release functions */
63208963Srdivackyextern int	acpi_acquire_global_lock(uint32_t *lock);
64extern int	acpi_release_global_lock(uint32_t *lock);
65#define	ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)	do {			\
66	(Acq) = acpi_acquire_global_lock(&((GLptr)->GlobalLock));	\
67} while (0)
68#define	ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)	do {			\
69	(Acq) = acpi_release_global_lock(&((GLptr)->GlobalLock));	\
70} while (0)
71
72void	acpi_SetDefaultIntrModel(int model);
73void	acpi_cpu_c1(void);
74void	*acpi_map_table(vm_paddr_t pa, const char *sig);
75void	acpi_unmap_table(void *table);
76vm_paddr_t acpi_find_table(const char *sig);
77
78#endif /* _KERNEL */
79
80#endif /* __ACPICA_MACHDEP_H__ */
81