1 /*
2  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef __ACSOLARIS_H__
7 #define	__ACSOLARIS_H__
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #include <sys/types.h>
16 #include <sys/sunddi.h>
17 #include <sys/varargs.h>
18 #include <sys/cpu.h>
19 
20 #define	strtoul simple_strtoul
21 
22 uint32_t __acpi_acquire_global_lock(uint32_t *);
23 uint32_t __acpi_release_global_lock(uint32_t *);
24 void	 __acpi_wbinvd(void);
25 
26 #ifdef	_ILP32
27 #define	ACPI_MACHINE_WIDTH	32
28 #elif	defined(_LP64)
29 #define	ACPI_MACHINE_WIDTH	64
30 #endif
31 
32 #define	COMPILER_DEPENDENT_INT64	int64_t
33 #define	COMPILER_DEPENDENT_UINT64	uint64_t
34 
35 #define	ACPI_PRINTF_LIKE_FUNC
36 #define	ACPI_UNUSED_VAR
37 #define	ACPI_USE_NATIVE_DIVIDE
38 #define	ACPI_FLUSH_CPU_CACHE()	(__acpi_wbinvd())
39 
40 /*
41  * Calling conventions:
42  *
43  * ACPI_SYSTEM_XFACE        - Interfaces to host OS (handlers, threads)
44  * ACPI_EXTERNAL_XFACE      - External ACPI interfaces
45  * ACPI_INTERNAL_XFACE      - Internal ACPI interfaces
46  * ACPI_INTERNAL_VAR_XFACE  - Internal variable-parameter list interfaces
47  */
48 #define	ACPI_SYSTEM_XFACE
49 #define	ACPI_EXTERNAL_XFACE
50 #define	ACPI_INTERNAL_XFACE
51 #define	ACPI_INTERNAL_VAR_XFACE
52 
53 #define	ACPI_ASM_MACROS
54 #define	BREAKPOINT3
55 #define	ACPI_DISABLE_IRQS()	cli()
56 #define	ACPI_ENABLE_IRQS()	sti()
57 #define	ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq)	\
58 	((Acq) = __acpi_acquire_global_lock(GLptr))
59 
60 #define	ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq)	\
61 	((Acq) = __acpi_release_global_lock(GLptr))
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* __ACSOLARIS_H__ */
68