Merge commit '9276b3991ba20d5a5660887ba81b0bc7bed25a0c'
[unleashed.git] / arch / x86 / include / sys / acpi / platform / acsolaris.h
blob207ef4723d23c7560fd19f6f2dc62120bae62765
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2016 Joyent, Inc.
23 * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
24 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
28 #ifndef _ACSOLARIS_H_
29 #define _ACSOLARIS_H_
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
35 #include <sys/types.h>
36 #include <sys/sunddi.h>
37 #include <sys/varargs.h>
38 #include <sys/cpu.h>
39 #include <sys/thread.h>
41 #ifdef _KERNEL
42 #include <sys/ctype.h>
43 #else
44 #include <ctype.h>
45 #include <strings.h>
46 #include <stdlib.h>
47 #endif
49 /* Function name used for debug output. */
50 #define ACPI_GET_FUNCTION_NAME __func__
52 uint32_t __acpi_acquire_global_lock(void *);
53 uint32_t __acpi_release_global_lock(void *);
54 void __acpi_wbinvd(void);
55 uint32_t acpi_strtoul(const char *, char **, int);
57 #ifdef _ILP32
58 #define ACPI_MACHINE_WIDTH 32
59 #elif defined(_LP64)
60 #define ACPI_MACHINE_WIDTH 64
61 #endif
63 #define COMPILER_DEPENDENT_INT64 int64_t
64 #define COMPILER_DEPENDENT_UINT64 uint64_t
66 #define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread))
69 * We should use acgcc.h, but lint does not like it. Until lint is removed
70 * we need to have private definitions here.
72 #define ACPI_PRINTF_LIKE(c) __PRINTFLIKE(c)
73 #define ACPI_UNUSED_VAR __unused
74 #define ACPI_USE_NATIVE_DIVIDE
75 #define ACPI_FLUSH_CPU_CACHE() (__acpi_wbinvd())
77 #define ACPI_DISASSEMBLER
78 #define ACPI_PACKED_POINTERS_NOT_SUPPORTED
81 * Calling conventions:
83 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
84 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
85 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
86 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
88 #define ACPI_SYSTEM_XFACE
89 #define ACPI_EXTERNAL_XFACE
90 #define ACPI_INTERNAL_XFACE
91 #define ACPI_INTERNAL_VAR_XFACE
93 #ifdef _KERNEL
94 #define strtoul(s, r, b) acpi_strtoul(s, r, b)
95 #define toupper(x) (islower(x) ? (x) - 'a' + 'A' : (x))
96 #define tolower(x) (isupper(x) ? (x) - 'A' + 'a' : (x))
99 * The ACPI headers shipped from Intel defines a bunch of functions which are
100 * already provided by the kernel. The variable below prevents those from
101 * being loaded as part of accommon.h.
103 #define ACPI_USE_SYSTEM_CLIBRARY
104 #endif
106 #define ACPI_ASM_MACROS
107 #define BREAKPOINT3
108 #define ACPI_DISABLE_IRQS() cli()
109 #define ACPI_ENABLE_IRQS() sti()
110 #define ACPI_ACQUIRE_GLOBAL_LOCK(Facs, Acq) \
111 ((Acq) = __acpi_acquire_global_lock(Facs))
113 #define ACPI_RELEASE_GLOBAL_LOCK(Facs, Acq) \
114 ((Acq) = __acpi_release_global_lock(Facs))
116 #ifdef __cplusplus
118 #endif
120 #endif /* _ACSOLARIS_H_ */