aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acdisasm.h22
-rw-r--r--include/acpi/acdispat.h3
-rw-r--r--include/acpi/acglobal.h8
-rw-r--r--include/acpi/aclocal.h31
-rw-r--r--include/acpi/acmacros.h24
-rw-r--r--include/acpi/actbl.h6
-rw-r--r--include/acpi/actypes.h303
-rw-r--r--include/acpi/acutils.h24
9 files changed, 255 insertions, 168 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index f48b9ee9a876..1f2477eb95fe 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20051202 66#define ACPI_CA_VERSION 0x20051216
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 99250ee1b9d1..0a8f49f5d2f1 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -57,27 +57,11 @@ struct acpi_external_list {
57}; 57};
58 58
59extern struct acpi_external_list *acpi_gbl_external_list; 59extern struct acpi_external_list *acpi_gbl_external_list;
60extern const char *acpi_gbl_io_decode[2]; 60
61/* Strings used for decoding flags to ASL keywords */
62
61extern const char *acpi_gbl_word_decode[4]; 63extern const char *acpi_gbl_word_decode[4];
62extern const char *acpi_gbl_consume_decode[2];
63extern const char *acpi_gbl_config_decode[4];
64extern const char *acpi_gbl_min_decode[2];
65extern const char *acpi_gbl_max_decode[2];
66extern const char *acpi_gbl_DECdecode[2];
67extern const char *acpi_gbl_RNGdecode[4];
68extern const char *acpi_gbl_MEMdecode[4];
69extern const char *acpi_gbl_RWdecode[2];
70extern const char *acpi_gbl_irq_decode[2]; 64extern const char *acpi_gbl_irq_decode[2];
71extern const char *acpi_gbl_HEdecode[2];
72extern const char *acpi_gbl_LLdecode[2];
73extern const char *acpi_gbl_SHRdecode[2];
74extern const char *acpi_gbl_TYPdecode[4];
75extern const char *acpi_gbl_BMdecode[2];
76extern const char *acpi_gbl_SIZdecode[4];
77extern const char *acpi_gbl_TTPdecode[2];
78extern const char *acpi_gbl_MTPdecode[4];
79extern const char *acpi_gbl_TRSdecode[2];
80
81extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 65extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
82extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 66extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
83extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 67extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 065f24a77cfc..cc6407eef701 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -201,6 +201,9 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
201 union acpi_operand_object *obj_desc, 201 union acpi_operand_object *obj_desc,
202 struct acpi_namespace_node *calling_method_node); 202 struct acpi_namespace_node *calling_method_node);
203 203
204acpi_status
205acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
206
204/* 207/*
205 * dsinit 208 * dsinit
206 */ 209 */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 3f37560c26ab..dfb3b2493ae5 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -98,11 +98,15 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
98/* 98/*
99 * Enable "slack" in the AML interpreter? Default is FALSE, and the 99 * Enable "slack" in the AML interpreter? Default is FALSE, and the
100 * interpreter strictly follows the ACPI specification. Setting to TRUE 100 * interpreter strictly follows the ACPI specification. Setting to TRUE
101 * allows the interpreter to forgive certain bad AML constructs. Currently: 101 * allows the interpreter to ignore certain errors and/or bad AML constructs.
102 *
103 * Currently, these features are enabled by this flag:
104 *
102 * 1) Allow "implicit return" of last value in a control method 105 * 1) Allow "implicit return" of last value in a control method
103 * 2) Allow access beyond end of operation region 106 * 2) Allow access beyond the end of an operation region
104 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
105 * 4) Allow ANY object type to be a source operand for the Store() operator 108 * 4) Allow ANY object type to be a source operand for the Store() operator
109 * 5) Allow unresolved references (invalid target name) in package objects
106 */ 110 */
107ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 111ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
108 112
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 0cb61a72d971..da7f1cb96f5d 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -276,6 +276,37 @@ struct acpi_create_field_info {
276 u8 field_type; 276 u8 field_type;
277}; 277};
278 278
279/*
280 * Bitmapped ACPI types. Used internally only
281 */
282#define ACPI_BTYPE_ANY 0x00000000
283#define ACPI_BTYPE_INTEGER 0x00000001
284#define ACPI_BTYPE_STRING 0x00000002
285#define ACPI_BTYPE_BUFFER 0x00000004
286#define ACPI_BTYPE_PACKAGE 0x00000008
287#define ACPI_BTYPE_FIELD_UNIT 0x00000010
288#define ACPI_BTYPE_DEVICE 0x00000020
289#define ACPI_BTYPE_EVENT 0x00000040
290#define ACPI_BTYPE_METHOD 0x00000080
291#define ACPI_BTYPE_MUTEX 0x00000100
292#define ACPI_BTYPE_REGION 0x00000200
293#define ACPI_BTYPE_POWER 0x00000400
294#define ACPI_BTYPE_PROCESSOR 0x00000800
295#define ACPI_BTYPE_THERMAL 0x00001000
296#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
297#define ACPI_BTYPE_DDB_HANDLE 0x00004000
298#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
299#define ACPI_BTYPE_REFERENCE 0x00010000
300#define ACPI_BTYPE_RESOURCE 0x00020000
301
302#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
303
304#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
305#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
306#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
307#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
308#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
309
279/***************************************************************************** 310/*****************************************************************************
280 * 311 *
281 * Event typedefs and structs 312 * Event typedefs and structs
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 65a1a5c1a689..0fa8f72dbace 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -60,7 +60,7 @@
60 60
61/* 61/*
62 * For 16-bit addresses, we have to assume that the upper 32 bits 62 * For 16-bit addresses, we have to assume that the upper 32 bits
63 * are zero. 63 * (out of 64) are zero.
64 */ 64 */
65#define ACPI_LODWORD(l) ((u32)(l)) 65#define ACPI_LODWORD(l) ((u32)(l))
66#define ACPI_HIDWORD(l) ((u32)(0)) 66#define ACPI_HIDWORD(l) ((u32)(0))
@@ -104,8 +104,9 @@
104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i) 104#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
105 105
106/* 106/*
107 * Extract a byte of data using a pointer. Any more than a byte and we 107 * Extract data using a pointer. Any more than a byte and we
108 * get into potential aligment issues -- see the STORE macros below 108 * get into potential aligment issues -- see the STORE macros below.
109 * Use with care.
109 */ 110 */
110#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr) 111#define ACPI_GET8(ptr) *ACPI_CAST_PTR (u8, ptr)
111#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr) 112#define ACPI_GET16(ptr) *ACPI_CAST_PTR (u16, ptr)
@@ -116,16 +117,17 @@
116#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr) 117#define ACPI_SET32(ptr) *ACPI_CAST_PTR (u32, ptr)
117#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr) 118#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr)
118 119
119/* Pointer manipulation */ 120/*
120 121 * Pointer manipulation
121#define ACPI_CAST_PTR(t, p) ((t *)(void *)(p)) 122 */
122#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **)(void *)(p)) 123#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
123#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_native_uint)(b))) 124#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
124#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) ((char *)(a) - (char *)(b)) 125#define ACPI_ADD_PTR(t,a,b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8,(a)) + (acpi_native_uint)(b)))
126#define ACPI_PTR_DIFF(a,b) (acpi_native_uint) (ACPI_CAST_PTR (u8,(a)) - ACPI_CAST_PTR (u8,(b)))
125 127
126/* Pointer/Integer type conversions */ 128/* Pointer/Integer type conversions */
127 129
128#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_native_uint)i) 130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
129#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
130#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
131#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f) 133#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
@@ -133,7 +135,7 @@
133#if ACPI_MACHINE_WIDTH == 16 135#if ACPI_MACHINE_WIDTH == 16
134#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 136#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
135#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i) 137#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
136#define ACPI_PTR_TO_PHYSADDR(i) (u32) (char *)(i) 138#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
137#else 139#else
138#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 140#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
139#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 141#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index a46f406e1c94..ef2ddcadfe61 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -45,6 +45,12 @@
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47/* 47/*
48 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
49 * This is the only type that is even remotely portable. Anything else is not
50 * portable, so do not use any other bitfield types.
51 */
52
53/*
48 * Values for description table header signatures 54 * Values for description table header signatures
49 */ 55 */
50#define RSDP_NAME "RSDP" 56#define RSDP_NAME "RSDP"
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 11847592ed1b..18e1338c5c7f 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -44,7 +44,15 @@
44#ifndef __ACTYPES_H__ 44#ifndef __ACTYPES_H__
45#define __ACTYPES_H__ 45#define __ACTYPES_H__
46 46
47/*! [Begin] no source code translation (keep the typedefs) */ 47/*
48 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
49 * and must be either 16, 32, or 64
50 */
51#ifndef ACPI_MACHINE_WIDTH
52#error ACPI_MACHINE_WIDTH not defined
53#endif
54
55/*! [Begin] no source code translation */
48 56
49/* 57/*
50 * Data type ranges 58 * Data type ranges
@@ -58,154 +66,210 @@
58#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 66#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
59#define ACPI_ASCII_MAX 0x7F 67#define ACPI_ASCII_MAX 0x7F
60 68
61#ifdef DEFINE_ALTERNATE_TYPES
62/* 69/*
63 * Types used only in translated source, defined here to enable 70 * Architecture-specific ACPICA Subsystem Data Types
64 * cross-platform compilation only. 71 *
72 * The goal of these types is to provide source code portability across
73 * 16-bit, 32-bit, and 64-bit targets.
74 *
75 * 1) The following types are of fixed size for all targets (16/32/64):
76 *
77 * BOOLEAN Logical boolean
78 *
79 * UINT8 8-bit (1 byte) unsigned value
80 * UINT16 16-bit (2 byte) unsigned value
81 * UINT32 32-bit (4 byte) unsigned value
82 * UINT64 64-bit (8 byte) unsigned value
83 *
84 * INT16 16-bit (2 byte) signed value
85 * INT32 32-bit (4 byte) signed value
86 * INT64 64-bit (8 byte) signed value
87 *
88 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
89 * compiler-dependent header(s) and were introduced because there is no common
90 * 64-bit integer type across the various compilation models, as shown in
91 * the table below.
92 *
93 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
94 * char 8 8 8 8 8 8
95 * short 16 16 16 16 16 16
96 * _int32 32
97 * int 32 64 32 32 16 16
98 * long 64 64 32 32 32 32
99 * long long 64 64
100 * pointer 64 64 64 32 32 32
101 *
102 * Note: ILP64 and LP32 are currently not supported.
103 *
104 *
105 * 2) These types represent the native word size of the target mode of the
106 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
107 * usually used for memory allocation, efficient loop counters, and array
108 * indexes. The types are similar to the size_t type in the C library and are
109 * required because there is no C type that consistently represents the native
110 * data width.
111 *
112 * ACPI_SIZE 16/32/64-bit unsigned value
113 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value
114 * ACPI_NATIVE_INT 16/32/64-bit signed value
115 *
65 */ 116 */
66typedef int s32;
67typedef unsigned char u8;
68typedef unsigned short u16;
69typedef unsigned int u32;
70typedef COMPILER_DEPENDENT_UINT64 u64;
71 117
72#endif 118/*******************************************************************************
73
74/*
75 * Data types - Fixed across all compilation models (16/32/64)
76 * 119 *
77 * BOOLEAN Logical Boolean. 120 * Common types for all compilers, all targets
78 * INT8 8-bit (1 byte) signed value 121 *
79 * UINT8 8-bit (1 byte) unsigned value 122 ******************************************************************************/
80 * INT16 16-bit (2 byte) signed value 123
81 * UINT16 16-bit (2 byte) unsigned value 124typedef unsigned char BOOLEAN;
82 * INT32 32-bit (4 byte) signed value 125typedef unsigned char UINT8;
83 * UINT32 32-bit (4 byte) unsigned value 126typedef unsigned short UINT16;
84 * INT64 64-bit (8 byte) signed value 127typedef COMPILER_DEPENDENT_UINT64 UINT64;
85 * UINT64 64-bit (8 byte) unsigned value 128typedef COMPILER_DEPENDENT_INT64 INT64;
86 * ACPI_NATIVE_UINT 32-bit on IA-32, 64-bit on x86_64/IA-64 unsigned value
87 */
88 129
89typedef unsigned long acpi_native_uint; 130/*! [End] no source code translation !*/
90 131
91#ifndef ACPI_MACHINE_WIDTH 132/*******************************************************************************
92#error ACPI_MACHINE_WIDTH not defined 133 *
93#endif 134 * Types specific to 64-bit targets
135 *
136 ******************************************************************************/
94 137
95#if ACPI_MACHINE_WIDTH == 64 138#if ACPI_MACHINE_WIDTH == 64
96 139
97/*! [Begin] no source code translation (keep the typedefs) */ 140/*! [Begin] no source code translation (keep the typedefs as-is) */
98 141
99/*
100 * 64-bit type definitions
101 */
102typedef unsigned char UINT8;
103typedef unsigned char BOOLEAN;
104typedef unsigned short UINT16;
105typedef int INT32;
106typedef unsigned int UINT32; 142typedef unsigned int UINT32;
107typedef COMPILER_DEPENDENT_INT64 INT64; 143typedef int INT32;
108typedef COMPILER_DEPENDENT_UINT64 UINT64;
109 144
110/*! [End] no source code translation !*/ 145/*! [End] no source code translation !*/
111 146
147typedef u64 acpi_native_uint;
148typedef s64 acpi_native_int;
149
112typedef u64 acpi_table_ptr; 150typedef u64 acpi_table_ptr;
113typedef u64 acpi_io_address; 151typedef u64 acpi_io_address;
114typedef u64 acpi_physical_address; 152typedef u64 acpi_physical_address;
115typedef u64 acpi_size;
116 153
117#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
118#define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
119#define ACPI_MAX_PTR ACPI_UINT64_MAX 154#define ACPI_MAX_PTR ACPI_UINT64_MAX
120#define ACPI_SIZE_MAX ACPI_UINT64_MAX 155#define ACPI_SIZE_MAX ACPI_UINT64_MAX
121 156
157#define ALIGNED_ADDRESS_BOUNDARY 0x00000008
158#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
159
122/* 160/*
123 * In the case of the Itanium Processor Family (IPF), the hardware does not 161 * In the case of the Itanium Processor Family (IPF), the hardware does not
124 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 162 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
125 * to indicate that special precautions must be taken to avoid alignment faults. 163 * to indicate that special precautions must be taken to avoid alignment faults.
126 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 164 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
127 * 165 *
128 * Note: Em64_t and other X86-64 processors do support misaligned transfers, 166 * Note: Em64_t and other X86-64 processors support misaligned transfers,
129 * so there is no need to define this flag. 167 * so there is no need to define this flag.
130 */ 168 */
131#if defined (__IA64__) || defined (__ia64__) 169#if defined (__IA64__) || defined (__ia64__)
132#define ACPI_MISALIGNMENT_NOT_SUPPORTED 170#define ACPI_MISALIGNMENT_NOT_SUPPORTED
133#endif 171#endif
134 172
173/*******************************************************************************
174 *
175 * Types specific to 32-bit targets
176 *
177 ******************************************************************************/
178
179#elif ACPI_MACHINE_WIDTH == 32
180
181/*! [Begin] no source code translation (keep the typedefs as-is) */
182
183typedef unsigned int UINT32;
184typedef int INT32;
185
186/*! [End] no source code translation !*/
187
188typedef u32 acpi_native_uint;
189typedef s32 acpi_native_int;
190
191typedef u64 acpi_table_ptr;
192typedef u32 acpi_io_address;
193typedef u64 acpi_physical_address;
194
195#define ACPI_MAX_PTR ACPI_UINT32_MAX
196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
197
198#define ALIGNED_ADDRESS_BOUNDARY 0x00000004
199
200/*******************************************************************************
201 *
202 * Types specific to 16-bit targets
203 *
204 ******************************************************************************/
205
135#elif ACPI_MACHINE_WIDTH == 16 206#elif ACPI_MACHINE_WIDTH == 16
136 207
137/*! [Begin] no source code translation (keep the typedefs as-is) */ 208/*! [Begin] no source code translation (keep the typedefs as-is) */
138 209
139/*
140 * 16-bit type definitions
141 */
142typedef unsigned char UINT8;
143typedef unsigned char BOOLEAN;
144typedef unsigned int UINT16;
145typedef long INT32;
146typedef int INT16;
147typedef unsigned long UINT32; 210typedef unsigned long UINT32;
148 211typedef short INT16;
149struct { 212typedef long INT32;
150 UINT32 Lo;
151 UINT32 Hi;
152};
153 213
154/*! [End] no source code translation !*/ 214/*! [End] no source code translation !*/
155 215
216typedef u16 acpi_native_uint;
217typedef s16 acpi_native_int;
218
156typedef u32 acpi_table_ptr; 219typedef u32 acpi_table_ptr;
157typedef u32 acpi_io_address; 220typedef u32 acpi_io_address;
158typedef char *acpi_physical_address; 221typedef char *acpi_physical_address;
159typedef u16 acpi_size;
160 222
161#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
162#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
163#define ACPI_MAX_PTR ACPI_UINT16_MAX 223#define ACPI_MAX_PTR ACPI_UINT16_MAX
164#define ACPI_SIZE_MAX ACPI_UINT16_MAX 224#define ACPI_SIZE_MAX ACPI_UINT16_MAX
165 225
166/* 226#define ALIGNED_ADDRESS_BOUNDARY 0x00000002
167 * (16-bit only) internal integers must be 32-bits, so 227#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
168 * 64-bit integers cannot be supported
169 */
170#define ACPI_NO_INTEGER64_SUPPORT
171 228
172#elif ACPI_MACHINE_WIDTH == 32 229/* 64-bit integers cannot be supported */
173 230
174/*! [Begin] no source code translation (keep the typedefs) */ 231#define ACPI_NO_INTEGER64_SUPPORT
175 232
176/* 233#else
177 * 32-bit type definitions (default)
178 */
179typedef unsigned char UINT8;
180typedef unsigned char BOOLEAN;
181typedef unsigned short UINT16;
182typedef int INT32;
183typedef unsigned int UINT32;
184typedef COMPILER_DEPENDENT_INT64 INT64;
185typedef COMPILER_DEPENDENT_UINT64 UINT64;
186 234
187/*! [End] no source code translation !*/ 235/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */
188 236
189typedef u64 acpi_table_ptr; 237#error unknown ACPI_MACHINE_WIDTH
190typedef u32 acpi_io_address; 238#endif
191typedef u64 acpi_physical_address;
192typedef u32 acpi_size;
193 239
194#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 240/*******************************************************************************
195#define ACPI_MAX_PTR ACPI_UINT32_MAX 241 *
196#define ACPI_SIZE_MAX ACPI_UINT32_MAX 242 * OS- or compiler-dependent types
243 *
244 ******************************************************************************/
197 245
198#else 246/*
199#error unknown ACPI_MACHINE_WIDTH 247 * If acpi_uintptr_t was not defined in the OS- or compiler-dependent header,
248 * define it now (use C99 uintptr_t for pointer casting if available,
249 * "void *" otherwise)
250 */
251#ifndef acpi_uintptr_t
252#define acpi_uintptr_t void *
200#endif 253#endif
201 254
202/* 255/*
203 * This type is used for bitfields in ACPI tables. The only type that is 256 * If acpi_cache_t was not defined in the OS-dependent header,
204 * even remotely portable is u8. Anything else is not portable, so 257 * define it now. This is typically the case where the local cache
205 * do not add any more bitfield types. 258 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
206 */ 259 */
207typedef u8 UINT8_BIT; 260#ifndef acpi_cache_t
208typedef acpi_native_uint ACPI_PTRDIFF; 261#define acpi_cache_t struct acpi_memory_list
262#endif
263
264/* Variable-width type, used instead of clib size_t */
265
266typedef acpi_native_uint acpi_size;
267
268/*******************************************************************************
269 *
270 * Independent types
271 *
272 ******************************************************************************/
209 273
210/* 274/*
211 * Pointer overlays to avoid lots of typecasting for 275 * Pointer overlays to avoid lots of typecasting for
@@ -237,18 +301,8 @@ struct acpi_pointer {
237#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER 301#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
238#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER 302#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
239 303
240/* 304/* Logical defines and NULL */
241 * If acpi_cache_t was not defined in the OS-dependent header,
242 * define it now. This is typically the case where the local cache
243 * manager implementation is to be used (ACPI_USE_LOCAL_CACHE)
244 */
245#ifndef acpi_cache_t
246#define acpi_cache_t struct acpi_memory_list
247#endif
248 305
249/*
250 * Useful defines
251 */
252#ifdef FALSE 306#ifdef FALSE
253#undef FALSE 307#undef FALSE
254#endif 308#endif
@@ -264,12 +318,12 @@ struct acpi_pointer {
264#endif 318#endif
265 319
266/* 320/*
267 * Local datatypes 321 * Mescellaneous types
268 */ 322 */
269typedef u32 acpi_status; /* All ACPI Exceptions */ 323typedef u32 acpi_status; /* All ACPI Exceptions */
270typedef u32 acpi_name; /* 4-byte ACPI name */ 324typedef u32 acpi_name; /* 4-byte ACPI name */
271typedef char *acpi_string; /* Null terminated ASCII string */ 325typedef char *acpi_string; /* Null terminated ASCII string */
272typedef void *acpi_handle; /* Actually a ptr to an Node */ 326typedef void *acpi_handle; /* Actually a ptr to a NS Node */
273 327
274struct uint64_struct { 328struct uint64_struct {
275 u32 lo; 329 u32 lo;
@@ -473,37 +527,6 @@ typedef u32 acpi_object_type;
473#define ACPI_TYPE_NOT_FOUND 0xFF 527#define ACPI_TYPE_NOT_FOUND 0xFF
474 528
475/* 529/*
476 * Bitmapped ACPI types. Used internally only
477 */
478#define ACPI_BTYPE_ANY 0x00000000
479#define ACPI_BTYPE_INTEGER 0x00000001
480#define ACPI_BTYPE_STRING 0x00000002
481#define ACPI_BTYPE_BUFFER 0x00000004
482#define ACPI_BTYPE_PACKAGE 0x00000008
483#define ACPI_BTYPE_FIELD_UNIT 0x00000010
484#define ACPI_BTYPE_DEVICE 0x00000020
485#define ACPI_BTYPE_EVENT 0x00000040
486#define ACPI_BTYPE_METHOD 0x00000080
487#define ACPI_BTYPE_MUTEX 0x00000100
488#define ACPI_BTYPE_REGION 0x00000200
489#define ACPI_BTYPE_POWER 0x00000400
490#define ACPI_BTYPE_PROCESSOR 0x00000800
491#define ACPI_BTYPE_THERMAL 0x00001000
492#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
493#define ACPI_BTYPE_DDB_HANDLE 0x00004000
494#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
495#define ACPI_BTYPE_REFERENCE 0x00010000
496#define ACPI_BTYPE_RESOURCE 0x00020000
497
498#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
499
500#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
501#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
502#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
503#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
504#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
505
506/*
507 * All I/O 530 * All I/O
508 */ 531 */
509#define ACPI_READ 0 532#define ACPI_READ 0
@@ -856,6 +879,14 @@ struct acpi_compatible_id_list {
856#define ACPI_VALID_CID 0x0010 879#define ACPI_VALID_CID 0x0010
857#define ACPI_VALID_SXDS 0x0020 880#define ACPI_VALID_SXDS 0x0020
858 881
882/* Flags for _STA method */
883
884#define ACPI_STA_DEVICE_PRESENT 0x01
885#define ACPI_STA_DEVICE_ENABLED 0x02
886#define ACPI_STA_DEVICE_UI 0x04
887#define ACPI_STA_DEVICE_OK 0x08
888#define ACPI_STA_BATTERY_PRESENT 0x10
889
859#define ACPI_COMMON_OBJ_INFO \ 890#define ACPI_COMMON_OBJ_INFO \
860 acpi_object_type type; /* ACPI object type */ \ 891 acpi_object_type type; /* ACPI object type */ \
861 acpi_name name /* ACPI object Name */ 892 acpi_name name /* ACPI object Name */
@@ -921,7 +952,9 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (length+3) = (6
921#define ACPI_ISA_ONLY_RANGES (u8) 0x02 952#define ACPI_ISA_ONLY_RANGES (u8) 0x02
922#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 953#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
923 954
924#define ACPI_SPARSE_TRANSLATION (u8) 0x03 955/* Type of translation - 1=Sparse, 0=Dense */
956
957#define ACPI_SPARSE_TRANSLATION (u8) 0x01
925 958
926/* 959/*
927 * IO Port Descriptor Decode 960 * IO Port Descriptor Decode
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 4ff963323de3..5fa21e03a62f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -46,6 +46,30 @@
46 46
47extern const u8 acpi_gbl_resource_aml_sizes[]; 47extern const u8 acpi_gbl_resource_aml_sizes[];
48 48
49/* Strings used by the disassembler and debugger resource dump routines */
50
51#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
52
53extern const char *acpi_gbl_BMdecode[2];
54extern const char *acpi_gbl_config_decode[4];
55extern const char *acpi_gbl_consume_decode[2];
56extern const char *acpi_gbl_DECdecode[2];
57extern const char *acpi_gbl_HEdecode[2];
58extern const char *acpi_gbl_io_decode[2];
59extern const char *acpi_gbl_LLdecode[2];
60extern const char *acpi_gbl_max_decode[2];
61extern const char *acpi_gbl_MEMdecode[4];
62extern const char *acpi_gbl_min_decode[2];
63extern const char *acpi_gbl_MTPdecode[4];
64extern const char *acpi_gbl_RNGdecode[4];
65extern const char *acpi_gbl_RWdecode[2];
66extern const char *acpi_gbl_SHRdecode[2];
67extern const char *acpi_gbl_SIZdecode[4];
68extern const char *acpi_gbl_TRSdecode[2];
69extern const char *acpi_gbl_TTPdecode[2];
70extern const char *acpi_gbl_TYPdecode[4];
71#endif
72
49/* Types for Resource descriptor entries */ 73/* Types for Resource descriptor entries */
50 74
51#define ACPI_INVALID_RESOURCE 0 75#define ACPI_INVALID_RESOURCE 0