xref: /illumos-gate/usr/src/uts/intel/sys/acpi/platform/acsolaris.h (revision f63f7506be0210195779706f51c58646e568cc40)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _ACSOLARIS_H_
27 #define	_ACSOLARIS_H_
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #include <sys/types.h>
36 #include <sys/sunddi.h>
37 #include <sys/varargs.h>
38 #include <sys/cpu.h>
39 
40 #define	strtoul simple_strtoul
41 
42 uint32_t __acpi_acquire_global_lock(uint32_t *);
43 uint32_t __acpi_release_global_lock(uint32_t *);
44 void	 __acpi_wbinvd(void);
45 
46 #ifdef	_ILP32
47 #define	ACPI_MACHINE_WIDTH	32
48 #elif	defined(_LP64)
49 #define	ACPI_MACHINE_WIDTH	64
50 #endif
51 
52 #define	COMPILER_DEPENDENT_INT64	int64_t
53 #define	COMPILER_DEPENDENT_UINT64	uint64_t
54 
55 #define	ACPI_THREAD_ID		kt_did_t
56 
57 #define	ACPI_PRINTF_LIKE_FUNC
58 #define	ACPI_UNUSED_VAR
59 #define	ACPI_USE_NATIVE_DIVIDE
60 #define	ACPI_FLUSH_CPU_CACHE()	(__acpi_wbinvd())
61 
62 #define	ACPI_DISASSEMBLER
63 #define	ACPI_PACKED_POINTERS_NOT_SUPPORTED
64 
65 /*
66  * Calling conventions:
67  *
68  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
69  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
70  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
71  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
72  */
73 #define	ACPI_SYSTEM_XFACE
74 #define	ACPI_EXTERNAL_XFACE
75 #define	ACPI_INTERNAL_XFACE
76 #define	ACPI_INTERNAL_VAR_XFACE
77 
78 #define	ACPI_ASM_MACROS
79 #define	BREAKPOINT3
80 #define	ACPI_DISABLE_IRQS()	cli()
81 #define	ACPI_ENABLE_IRQS()	sti()
82 #define	ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)	\
83 	((Acq) = __acpi_acquire_global_lock(GLptr))
84 
85 #define	ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)	\
86 	((Acq) = __acpi_release_global_lock(GLptr))
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* _ACSOLARIS_H_ */
93