Print this page
update to acpica-unix2-20131218
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/sys/acpi/actypes.h
+++ new/usr/src/common/acpica/include/actypes.h
1 1 /******************************************************************************
2 2 *
3 3 * Name: actypes.h - Common data types for the entire ACPI subsystem
4 4 *
5 5 *****************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2013, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44 #ifndef __ACTYPES_H__
45 45 #define __ACTYPES_H__
46 46
47 47 /* acpisrc:StructDefs -- for acpisrc conversion */
48 48
49 49 /*
50 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
51 51 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
52 52 * 12/2006.
53 53 */
54 54 #ifndef ACPI_MACHINE_WIDTH
55 55 #error ACPI_MACHINE_WIDTH not defined
56 56 #endif
57 57
58 58 /*! [Begin] no source code translation */
59 59
60 60 /*
61 61 * Data type ranges
62 62 * Note: These macros are designed to be compiler independent as well as
63 63 * working around problems that some 32-bit compilers have with 64-bit
64 64 * constants.
65 65 */
66 66 #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */
67 67 #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */
68 68 #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */
69 69 #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */
70 70 #define ACPI_ASCII_MAX 0x7F
71 71
72 72
73 73 /*
74 74 * Architecture-specific ACPICA Subsystem Data Types
75 75 *
76 76 * The goal of these types is to provide source code portability across
77 77 * 16-bit, 32-bit, and 64-bit targets.
78 78 *
79 79 * 1) The following types are of fixed size for all targets (16/32/64):
80 80 *
81 81 * BOOLEAN Logical boolean
82 82 *
83 83 * UINT8 8-bit (1 byte) unsigned value
84 84 * UINT16 16-bit (2 byte) unsigned value
85 85 * UINT32 32-bit (4 byte) unsigned value
86 86 * UINT64 64-bit (8 byte) unsigned value
87 87 *
88 88 * INT16 16-bit (2 byte) signed value
89 89 * INT32 32-bit (4 byte) signed value
90 90 * INT64 64-bit (8 byte) signed value
91 91 *
92 92 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the
93 93 * compiler-dependent header(s) and were introduced because there is no common
94 94 * 64-bit integer type across the various compilation models, as shown in
95 95 * the table below.
96 96 *
97 97 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit
98 98 * char 8 8 8 8 8 8
99 99 * short 16 16 16 16 16 16
100 100 * _int32 32
101 101 * int 32 64 32 32 16 16
102 102 * long 64 64 32 32 32 32
103 103 * long long 64 64
104 104 * pointer 64 64 64 32 32 32
105 105 *
106 106 * Note: ILP64 and LP32 are currently not supported.
107 107 *
108 108 *
109 109 * 2) These types represent the native word size of the target mode of the
110 110 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are
111 111 * usually used for memory allocation, efficient loop counters, and array
112 112 * indexes. The types are similar to the size_t type in the C library and are
113 113 * required because there is no C type that consistently represents the native
114 114 * data width. ACPI_SIZE is needed because there is no guarantee that a
115 115 * kernel-level C library is present.
116 116 *
117 117 * ACPI_SIZE 16/32/64-bit unsigned value
118 118 * ACPI_NATIVE_INT 16/32/64-bit signed value
119 119 */
120 120
121 121 /*******************************************************************************
122 122 *
123 123 * Common types for all compilers, all targets
124 124 *
125 125 ******************************************************************************/
126 126
127 127 typedef unsigned char BOOLEAN;
128 128 typedef unsigned char UINT8;
129 129 typedef unsigned short UINT16;
130 130 typedef COMPILER_DEPENDENT_UINT64 UINT64;
131 131 typedef COMPILER_DEPENDENT_INT64 INT64;
132 132
133 133 /*! [End] no source code translation !*/
134 134
135 135 /*
136 136 * Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
137 137 * across operating systems or even the various UNIX systems. Since ACPICA
138 138 * only needs the thread ID as a unique thread identifier, we use a UINT64
139 139 * as the only common data type - it will accommodate any type of pointer or
140 140 * any type of integer. It is up to the host-dependent OSL to cast the
141 141 * native thread ID type to a UINT64 (in AcpiOsGetThreadId).
142 142 */
143 143 #define ACPI_THREAD_ID UINT64
144 144
145 145
146 146 /*******************************************************************************
147 147 *
148 148 * Types specific to 64-bit targets
149 149 *
150 150 ******************************************************************************/
151 151
152 152 #if ACPI_MACHINE_WIDTH == 64
153 153
154 154 /*! [Begin] no source code translation (keep the typedefs as-is) */
155 155
156 156 typedef unsigned int UINT32;
157 157 typedef int INT32;
158 158
159 159 /*! [End] no source code translation !*/
160 160
161 161
162 162 typedef INT64 ACPI_NATIVE_INT;
163 163 typedef UINT64 ACPI_SIZE;
164 164 typedef UINT64 ACPI_IO_ADDRESS;
165 165 typedef UINT64 ACPI_PHYSICAL_ADDRESS;
166 166
167 167 #define ACPI_MAX_PTR ACPI_UINT64_MAX
168 168 #define ACPI_SIZE_MAX ACPI_UINT64_MAX
169 169 #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */
170 170
171 171 /*
172 172 * In the case of the Itanium Processor Family (IPF), the hardware does not
173 173 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag
174 174 * to indicate that special precautions must be taken to avoid alignment faults.
175 175 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.)
176 176 *
177 177 * Note: EM64T and other X86-64 processors support misaligned transfers,
178 178 * so there is no need to define this flag.
179 179 */
180 180 #if defined (__IA64__) || defined (__ia64__)
181 181 #define ACPI_MISALIGNMENT_NOT_SUPPORTED
182 182 #endif
183 183
184 184
185 185 /*******************************************************************************
186 186 *
187 187 * Types specific to 32-bit targets
188 188 *
189 189 ******************************************************************************/
190 190
191 191 #elif ACPI_MACHINE_WIDTH == 32
192 192
193 193 /*! [Begin] no source code translation (keep the typedefs as-is) */
194 194
195 195 typedef unsigned int UINT32;
196 196 typedef int INT32;
197 197
198 198 /*! [End] no source code translation !*/
199 199
200 200
201 201 typedef INT32 ACPI_NATIVE_INT;
202 202 typedef UINT32 ACPI_SIZE;
203 203 typedef UINT32 ACPI_IO_ADDRESS;
204 204 typedef UINT32 ACPI_PHYSICAL_ADDRESS;
205 205
206 206 #define ACPI_MAX_PTR ACPI_UINT32_MAX
207 207 #define ACPI_SIZE_MAX ACPI_UINT32_MAX
208 208
209 209 #else
210 210
211 211 /* ACPI_MACHINE_WIDTH must be either 64 or 32 */
212 212
213 213 #error unknown ACPI_MACHINE_WIDTH
214 214 #endif
215 215
216 216
217 217 /*******************************************************************************
218 218 *
219 219 * OS-dependent types
220 220 *
221 221 * If the defaults below are not appropriate for the host system, they can
222 222 * be defined in the OS-specific header, and this will take precedence.
223 223 *
224 224 ******************************************************************************/
225 225
226 226 /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
227 227
228 228 #ifndef ACPI_CPU_FLAGS
229 229 #define ACPI_CPU_FLAGS ACPI_SIZE
230 230 #endif
231 231
232 232 /* Object returned from AcpiOsCreateCache */
233 233
234 234 #ifndef ACPI_CACHE_T
235 235 #ifdef ACPI_USE_LOCAL_CACHE
236 236 #define ACPI_CACHE_T ACPI_MEMORY_LIST
237 237 #else
238 238 #define ACPI_CACHE_T void *
239 239 #endif
240 240 #endif
241 241
242 242 /*
243 243 * Synchronization objects - Mutexes, Semaphores, and SpinLocks
244 244 */
245 245 #if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE)
246 246 /*
247 247 * These macros are used if the host OS does not support a mutex object.
248 248 * Map the OSL Mutex interfaces to binary semaphores.
249 249 */
250 250 #define ACPI_MUTEX ACPI_SEMAPHORE
251 251 #define AcpiOsCreateMutex(OutHandle) AcpiOsCreateSemaphore (1, 1, OutHandle)
252 252 #define AcpiOsDeleteMutex(Handle) (void) AcpiOsDeleteSemaphore (Handle)
253 253 #define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time)
254 254 #define AcpiOsReleaseMutex(Handle) (void) AcpiOsSignalSemaphore (Handle, 1)
255 255 #endif
256 256
257 257 /* Configurable types for synchronization objects */
258 258
259 259 #ifndef ACPI_SPINLOCK
260 260 #define ACPI_SPINLOCK void *
261 261 #endif
262 262
263 263 #ifndef ACPI_SEMAPHORE
264 264 #define ACPI_SEMAPHORE void *
265 265 #endif
266 266
267 267 #ifndef ACPI_MUTEX
268 268 #define ACPI_MUTEX void *
269 269 #endif
270 270
271 271
272 272 /*******************************************************************************
273 273 *
274 274 * Compiler-dependent types
275 275 *
276 276 * If the defaults below are not appropriate for the host compiler, they can
277 277 * be defined in the compiler-specific header, and this will take precedence.
278 278 *
279 279 ******************************************************************************/
280 280
281 281 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
282 282
283 283 #ifndef ACPI_UINTPTR_T
284 284 #define ACPI_UINTPTR_T void *
285 285 #endif
286 286
287 287 /*
↓ open down ↓ |
269 lines elided |
↑ open up ↑ |
288 288 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because
289 289 * some compilers can catch printf format string problems
290 290 */
291 291 #ifndef ACPI_PRINTF_LIKE
292 292 #define ACPI_PRINTF_LIKE(c)
293 293 #endif
294 294
295 295 /*
296 296 * Some compilers complain about unused variables. Sometimes we don't want to
297 297 * use all the variables (for example, _AcpiModuleName). This allows us
298 - * to to tell the compiler in a per-variable manner that a variable
298 + * to tell the compiler in a per-variable manner that a variable
299 299 * is unused
300 300 */
301 301 #ifndef ACPI_UNUSED_VAR
302 302 #define ACPI_UNUSED_VAR
303 303 #endif
304 304
305 305 /*
306 - * All ACPICA functions that are available to the rest of the kernel are
307 - * tagged with this macro which can be defined as appropriate for the host.
306 + * All ACPICA external functions that are available to the rest of the kernel
307 + * are tagged with thes macros which can be defined as appropriate for the host.
308 + *
309 + * Notes:
310 + * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
311 + * interfaces that may need special processing.
312 + * ACPI_EXPORT_SYMBOL is used for all other public external functions.
308 313 */
314 +#ifndef ACPI_EXPORT_SYMBOL_INIT
315 +#define ACPI_EXPORT_SYMBOL_INIT(Symbol)
316 +#endif
317 +
309 318 #ifndef ACPI_EXPORT_SYMBOL
310 319 #define ACPI_EXPORT_SYMBOL(Symbol)
311 320 #endif
312 321
322 +/*
323 + * Compiler/Clibrary-dependent debug initialization. Used for ACPICA
324 + * utilities only.
325 + */
326 +#ifndef ACPI_DEBUG_INITIALIZE
327 +#define ACPI_DEBUG_INITIALIZE()
328 +#endif
313 329
330 +
331 +/*******************************************************************************
332 + *
333 + * Configuration
334 + *
335 + ******************************************************************************/
336 +
337 +#ifdef ACPI_DBG_TRACK_ALLOCATIONS
338 +/*
339 + * Memory allocation tracking (used by AcpiExec to detect memory leaks)
340 + */
341 +#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
342 +#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
343 +#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
344 +#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
345 +#define ACPI_MEM_TRACKING(a) a
346 +
347 +#else
348 +/*
349 + * Normal memory allocation directly via the OS services layer
350 + */
351 +#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a))
352 +#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
353 +#define ACPI_FREE(a) AcpiOsFree (a)
354 +#define ACPI_MEM_TRACKING(a)
355 +
356 +#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
357 +
358 +
314 359 /******************************************************************************
315 360 *
316 361 * ACPI Specification constants (Do not change unless the specification changes)
317 362 *
318 363 *****************************************************************************/
319 364
320 365 /* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */
321 366
322 367 #define ACPI_MAX_GPE_BLOCKS 2
323 368
324 369 /* Default ACPI register widths */
325 370
326 371 #define ACPI_GPE_REGISTER_WIDTH 8
327 372 #define ACPI_PM1_REGISTER_WIDTH 16
328 373 #define ACPI_PM2_REGISTER_WIDTH 8
329 374 #define ACPI_PM_TIMER_WIDTH 32
375 +#define ACPI_RESET_REGISTER_WIDTH 8
330 376
331 377 /* Names within the namespace are 4 bytes long */
332 378
333 379 #define ACPI_NAME_SIZE 4
334 380 #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
335 381 #define ACPI_PATH_SEPARATOR '.'
336 382
337 383 /* Sizes for ACPI table headers */
338 384
339 385 #define ACPI_OEM_ID_SIZE 6
340 386 #define ACPI_OEM_TABLE_ID_SIZE 8
341 387
342 388 /* ACPI/PNP hardware IDs */
343 389
344 390 #define PCI_ROOT_HID_STRING "PNP0A03"
345 391 #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
346 392
347 393 /* PM Timer ticks per second (HZ) */
348 394
349 -#define PM_TIMER_FREQUENCY 3579545
395 +#define ACPI_PM_TIMER_FREQUENCY 3579545
350 396
351 397
352 398 /*******************************************************************************
353 399 *
354 400 * Independent types
355 401 *
356 402 ******************************************************************************/
357 403
358 404 /* Logical defines and NULL */
359 405
360 406 #ifdef FALSE
361 407 #undef FALSE
362 408 #endif
363 409 #define FALSE (1 == 0)
364 410
365 411 #ifdef TRUE
366 412 #undef TRUE
367 413 #endif
368 414 #define TRUE (1 == 1)
369 415
370 416 #ifndef NULL
371 417 #define NULL (void *) 0
372 418 #endif
373 419
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
374 420
375 421 /*
376 422 * Miscellaneous types
377 423 */
378 424 typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */
379 425 typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */
380 426 typedef char * ACPI_STRING; /* Null terminated ASCII string */
381 427 typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */
382 428
383 429
430 +/* Time constants for timer calculations */
431 +
432 +#define ACPI_MSEC_PER_SEC 1000L
433 +
434 +#define ACPI_USEC_PER_MSEC 1000L
435 +#define ACPI_USEC_PER_SEC 1000000L
436 +
437 +#define ACPI_100NSEC_PER_USEC 10L
438 +#define ACPI_100NSEC_PER_MSEC 10000L
439 +#define ACPI_100NSEC_PER_SEC 10000000L
440 +
441 +#define ACPI_NSEC_PER_USEC 1000L
442 +#define ACPI_NSEC_PER_MSEC 1000000L
443 +#define ACPI_NSEC_PER_SEC 1000000000L
444 +
445 +
384 446 /* Owner IDs are used to track namespace nodes for selective deletion */
385 447
386 448 typedef UINT8 ACPI_OWNER_ID;
387 449 #define ACPI_OWNER_ID_MAX 0xFF
388 450
389 451
390 452 #define ACPI_INTEGER_BIT_SIZE 64
391 453 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
392 454 #define ACPI_MAX64_DECIMAL_DIGITS 20
393 455 #define ACPI_MAX32_DECIMAL_DIGITS 10
394 456 #define ACPI_MAX16_DECIMAL_DIGITS 5
395 457 #define ACPI_MAX8_DECIMAL_DIGITS 3
396 458
397 459 /*
398 460 * Constants with special meanings
399 461 */
400 462 #define ACPI_ROOT_OBJECT ACPI_ADD_PTR (ACPI_HANDLE, NULL, ACPI_MAX_PTR)
401 463 #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */
402 464 #define ACPI_DO_NOT_WAIT 0
403 465
404 466 /*
405 467 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits.
406 468 * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this
407 469 * pertains to the ACPI integer type only, not to other integers used in the
408 470 * implementation of the ACPICA subsystem.
409 471 *
410 472 * 01/2010: This type is obsolete and has been removed from the entire ACPICA
411 473 * code base. It remains here for compatibility with device drivers that use
412 474 * the type. However, it will be removed in the future.
413 475 */
414 476 typedef UINT64 ACPI_INTEGER;
415 477 #define ACPI_INTEGER_MAX ACPI_UINT64_MAX
416 478
417 479
418 480 /*******************************************************************************
419 481 *
420 482 * Commonly used macros
421 483 *
422 484 ******************************************************************************/
423 485
424 486 /* Data manipulation */
425 487
426 488 #define ACPI_LOBYTE(Integer) ((UINT8) (UINT16)(Integer))
427 489 #define ACPI_HIBYTE(Integer) ((UINT8) (((UINT16)(Integer)) >> 8))
428 490 #define ACPI_LOWORD(Integer) ((UINT16) (UINT32)(Integer))
429 491 #define ACPI_HIWORD(Integer) ((UINT16)(((UINT32)(Integer)) >> 16))
430 492 #define ACPI_LODWORD(Integer64) ((UINT32) (UINT64)(Integer64))
431 493 #define ACPI_HIDWORD(Integer64) ((UINT32)(((UINT64)(Integer64)) >> 32))
432 494
433 495 #define ACPI_SET_BIT(target,bit) ((target) |= (bit))
434 496 #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
435 497 #define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
436 498 #define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
437 499
438 500 /* Size calculation */
439 501
440 502 #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
441 503
442 504 /* Pointer manipulation */
443 505
444 506 #define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p))
445 507 #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p))
446 508 #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b)))
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
447 509 #define ACPI_PTR_DIFF(a, b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b)))
448 510
449 511 /* Pointer/Integer type conversions */
450 512
451 513 #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
452 514 #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
453 515 #define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
454 516 #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
455 517 #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
456 518
519 +/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
520 +
457 521 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
458 522 #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b)))
523 +#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
459 524 #else
460 525 #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
526 +#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
461 527 #endif
462 528
529 +/* Support for the special RSDP signature (8 characters) */
463 530
531 +#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
532 +#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
533 +
534 +
464 535 /*******************************************************************************
465 536 *
466 537 * Miscellaneous constants
467 538 *
468 539 ******************************************************************************/
469 540
470 541 /*
471 542 * Initialization sequence
472 543 */
473 544 #define ACPI_FULL_INITIALIZATION 0x00
474 545 #define ACPI_NO_ADDRESS_SPACE_INIT 0x01
475 546 #define ACPI_NO_HARDWARE_INIT 0x02
476 547 #define ACPI_NO_EVENT_INIT 0x04
477 548 #define ACPI_NO_HANDLER_INIT 0x08
478 549 #define ACPI_NO_ACPI_ENABLE 0x10
479 550 #define ACPI_NO_DEVICE_INIT 0x20
480 551 #define ACPI_NO_OBJECT_INIT 0x40
481 552
482 553 /*
483 554 * Initialization state
484 555 */
485 556 #define ACPI_SUBSYSTEM_INITIALIZE 0x01
486 557 #define ACPI_INITIALIZED_OK 0x02
487 558
488 559 /*
489 560 * Power state values
490 561 */
491 562 #define ACPI_STATE_UNKNOWN (UINT8) 0xFF
492 563
493 564 #define ACPI_STATE_S0 (UINT8) 0
494 565 #define ACPI_STATE_S1 (UINT8) 1
495 566 #define ACPI_STATE_S2 (UINT8) 2
496 567 #define ACPI_STATE_S3 (UINT8) 3
497 568 #define ACPI_STATE_S4 (UINT8) 4
498 569 #define ACPI_STATE_S5 (UINT8) 5
499 570 #define ACPI_S_STATES_MAX ACPI_STATE_S5
500 571 #define ACPI_S_STATE_COUNT 6
501 572
502 573 #define ACPI_STATE_D0 (UINT8) 0
503 574 #define ACPI_STATE_D1 (UINT8) 1
504 575 #define ACPI_STATE_D2 (UINT8) 2
505 576 #define ACPI_STATE_D3 (UINT8) 3
506 577 #define ACPI_D_STATES_MAX ACPI_STATE_D3
507 578 #define ACPI_D_STATE_COUNT 4
508 579
509 580 #define ACPI_STATE_C0 (UINT8) 0
510 581 #define ACPI_STATE_C1 (UINT8) 1
511 582 #define ACPI_STATE_C2 (UINT8) 2
512 583 #define ACPI_STATE_C3 (UINT8) 3
513 584 #define ACPI_C_STATES_MAX ACPI_STATE_C3
514 585 #define ACPI_C_STATE_COUNT 4
515 586
516 587 /*
517 588 * Sleep type invalid value
518 589 */
519 590 #define ACPI_SLEEP_TYPE_MAX 0x7
520 591 #define ACPI_SLEEP_TYPE_INVALID 0xFF
521 592
522 593 /*
523 594 * Standard notify values
524 595 */
525 596 #define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00
526 597 #define ACPI_NOTIFY_DEVICE_CHECK (UINT8) 0x01
↓ open down ↓ |
53 lines elided |
↑ open up ↑ |
527 598 #define ACPI_NOTIFY_DEVICE_WAKE (UINT8) 0x02
528 599 #define ACPI_NOTIFY_EJECT_REQUEST (UINT8) 0x03
529 600 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (UINT8) 0x04
530 601 #define ACPI_NOTIFY_FREQUENCY_MISMATCH (UINT8) 0x05
531 602 #define ACPI_NOTIFY_BUS_MODE_MISMATCH (UINT8) 0x06
532 603 #define ACPI_NOTIFY_POWER_FAULT (UINT8) 0x07
533 604 #define ACPI_NOTIFY_CAPABILITIES_CHECK (UINT8) 0x08
534 605 #define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09
535 606 #define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
536 607 #define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
608 +#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
537 609
538 -#define ACPI_NOTIFY_MAX 0x0B
610 +#define ACPI_NOTIFY_MAX 0x0C
539 611
540 612 /*
541 613 * Types associated with ACPI names and objects. The first group of
542 614 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
543 615 * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore,
544 616 * only add to the first group if the spec changes.
545 617 *
546 618 * NOTE: Types must be kept in sync with the global AcpiNsProperties
547 619 * and AcpiNsTypeNames arrays.
548 620 */
549 621 typedef UINT32 ACPI_OBJECT_TYPE;
550 622
551 623 #define ACPI_TYPE_ANY 0x00
552 624 #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */
553 625 #define ACPI_TYPE_STRING 0x02
554 626 #define ACPI_TYPE_BUFFER 0x03
555 627 #define ACPI_TYPE_PACKAGE 0x04 /* ByteConst, multiple DataTerm/Constant/SuperName */
556 628 #define ACPI_TYPE_FIELD_UNIT 0x05
557 629 #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */
558 630 #define ACPI_TYPE_EVENT 0x07
559 631 #define ACPI_TYPE_METHOD 0x08 /* Name, ByteConst, multiple Code */
560 632 #define ACPI_TYPE_MUTEX 0x09
561 633 #define ACPI_TYPE_REGION 0x0A
562 634 #define ACPI_TYPE_POWER 0x0B /* Name,ByteConst,WordConst,multi Node */
563 635 #define ACPI_TYPE_PROCESSOR 0x0C /* Name,ByteConst,DWordConst,ByteConst,multi NmO */
564 636 #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */
565 637 #define ACPI_TYPE_BUFFER_FIELD 0x0E
566 638 #define ACPI_TYPE_DDB_HANDLE 0x0F
567 639 #define ACPI_TYPE_DEBUG_OBJECT 0x10
568 640
569 641 #define ACPI_TYPE_EXTERNAL_MAX 0x10
570 642
571 643 /*
572 644 * These are object types that do not map directly to the ACPI
573 645 * ObjectType() operator. They are used for various internal purposes only.
574 646 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these
575 647 * internal types must move upwards. (There is code that depends on these
576 648 * values being contiguous with the external types above.)
577 649 */
578 650 #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11
579 651 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12
580 652 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13
581 653 #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, RefOf, Index */
582 654 #define ACPI_TYPE_LOCAL_ALIAS 0x15
583 655 #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16
↓ open down ↓ |
35 lines elided |
↑ open up ↑ |
584 656 #define ACPI_TYPE_LOCAL_NOTIFY 0x17
585 657 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18
586 658 #define ACPI_TYPE_LOCAL_RESOURCE 0x19
587 659 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A
588 660 #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */
589 661
590 662 #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */
591 663
592 664 /*
593 665 * These are special object types that never appear in
594 - * a Namespace node, only in an ACPI_OPERAND_OBJECT
666 + * a Namespace node, only in an object of ACPI_OPERAND_OBJECT
595 667 */
596 668 #define ACPI_TYPE_LOCAL_EXTRA 0x1C
597 669 #define ACPI_TYPE_LOCAL_DATA 0x1D
598 670
599 671 #define ACPI_TYPE_LOCAL_MAX 0x1D
600 672
601 673 /* All types above here are invalid */
602 674
603 675 #define ACPI_TYPE_INVALID 0x1E
604 676 #define ACPI_TYPE_NOT_FOUND 0xFF
605 677
606 678 #define ACPI_NUM_NS_TYPES (ACPI_TYPE_INVALID + 1)
607 679
608 680
609 681 /*
610 682 * All I/O
611 683 */
612 684 #define ACPI_READ 0
613 685 #define ACPI_WRITE 1
614 686 #define ACPI_IO_MASK 1
615 687
616 688 /*
617 689 * Event Types: Fixed & General Purpose
618 690 */
619 691 typedef UINT32 ACPI_EVENT_TYPE;
620 692
621 693 /*
622 694 * Fixed events
623 695 */
624 696 #define ACPI_EVENT_PMTIMER 0
625 697 #define ACPI_EVENT_GLOBAL 1
626 698 #define ACPI_EVENT_POWER_BUTTON 2
627 699 #define ACPI_EVENT_SLEEP_BUTTON 3
628 700 #define ACPI_EVENT_RTC 4
629 701 #define ACPI_EVENT_MAX 4
630 702 #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1
631 703
632 704 /*
633 705 * Event Status - Per event
634 706 * -------------
635 707 * The encoding of ACPI_EVENT_STATUS is illustrated below.
636 708 * Note that a set bit (1) indicates the property is TRUE
637 709 * (e.g. if bit 0 is set then the event is enabled).
638 710 * +-------------+-+-+-+
639 711 * | Bits 31:3 |2|1|0|
640 712 * +-------------+-+-+-+
641 713 * | | | |
642 714 * | | | +- Enabled?
643 715 * | | +--- Enabled for wake?
↓ open down ↓ |
39 lines elided |
↑ open up ↑ |
644 716 * | +----- Set?
645 717 * +----------- <Reserved>
646 718 */
647 719 typedef UINT32 ACPI_EVENT_STATUS;
648 720
649 721 #define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00
650 722 #define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
651 723 #define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
652 724 #define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
653 725
654 -/*
655 - * General Purpose Events (GPE)
656 - */
657 -#define ACPI_GPE_INVALID 0xFF
658 -#define ACPI_GPE_MAX 0xFF
659 -#define ACPI_NUM_GPE 256
660 -
661 726 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
662 727
663 728 #define ACPI_GPE_ENABLE 0
664 729 #define ACPI_GPE_DISABLE 1
665 730 #define ACPI_GPE_CONDITIONAL_ENABLE 2
666 731
667 732 /*
668 733 * GPE info flags - Per GPE
669 734 * +-------+-+-+---+
670 735 * | 7:4 |3|2|1:0|
671 736 * +-------+-+-+---+
672 737 * | | | |
673 738 * | | | +-- Type of dispatch:to method, handler, notify, or none
674 739 * | | +----- Interrupt type: edge or level triggered
675 740 * | +------- Is a Wake GPE
676 741 * +------------ <Reserved>
677 742 */
678 743 #define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00
679 744 #define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01
680 745 #define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02
681 746 #define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03
682 747 #define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03
683 748
684 749 #define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04
685 750 #define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00
686 751 #define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04
687 752
688 753 #define ACPI_GPE_CAN_WAKE (UINT8) 0x08
689 754
690 755 /*
691 756 * Flags for GPE and Lock interfaces
692 757 */
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
693 758 #define ACPI_NOT_ISR 0x1
694 759 #define ACPI_ISR 0x0
695 760
696 761
697 762 /* Notify types */
698 763
699 764 #define ACPI_SYSTEM_NOTIFY 0x1
700 765 #define ACPI_DEVICE_NOTIFY 0x2
701 766 #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
702 767 #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3
768 +#define ACPI_NUM_NOTIFY_TYPES 2
703 769
704 -#define ACPI_MAX_SYS_NOTIFY 0x7f
770 +#define ACPI_MAX_SYS_NOTIFY 0x7F
771 +#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF
705 772
773 +#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */
774 +#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */
706 775
776 +
707 777 /* Address Space (Operation Region) Types */
708 778
709 779 typedef UINT8 ACPI_ADR_SPACE_TYPE;
710 780
711 781 #define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0
712 782 #define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1
713 783 #define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2
714 784 #define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3
715 785 #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4
716 786 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
717 787 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
718 788 #define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7
789 +#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8
790 +#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9
791 +#define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10
719 792
720 -#define ACPI_NUM_PREDEFINED_REGIONS 8
793 +#define ACPI_NUM_PREDEFINED_REGIONS 11
721 794
722 795 /*
723 796 * Special Address Spaces
724 797 *
725 798 * Note: A Data Table region is a special type of operation region
726 799 * that has its own AML opcode. However, internally, the AML
727 800 * interpreter simply creates an operation region with an an address
728 801 * space type of ACPI_ADR_SPACE_DATA_TABLE.
729 802 */
730 803 #define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
731 804 #define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F
732 805
733 806 /* Values for _REG connection code */
734 807
735 808 #define ACPI_REG_DISCONNECT 0
736 809 #define ACPI_REG_CONNECT 1
737 810
738 811 /*
739 812 * BitRegister IDs
740 813 *
741 814 * These values are intended to be used by the hardware interfaces
742 815 * and are mapped to individual bitfields defined within the ACPI
743 816 * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c
744 817 * for this mapping.
745 818 */
746 819
747 820 /* PM1 Status register */
748 821
749 822 #define ACPI_BITREG_TIMER_STATUS 0x00
750 823 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01
751 824 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02
752 825 #define ACPI_BITREG_POWER_BUTTON_STATUS 0x03
753 826 #define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04
754 827 #define ACPI_BITREG_RT_CLOCK_STATUS 0x05
755 828 #define ACPI_BITREG_WAKE_STATUS 0x06
756 829 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07
757 830
758 831 /* PM1 Enable register */
759 832
760 833 #define ACPI_BITREG_TIMER_ENABLE 0x08
761 834 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09
762 835 #define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A
763 836 #define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B
764 837 #define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C
765 838 #define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0D
766 839
767 840 /* PM1 Control register */
768 841
769 842 #define ACPI_BITREG_SCI_ENABLE 0x0E
770 843 #define ACPI_BITREG_BUS_MASTER_RLD 0x0F
771 844 #define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10
772 845 #define ACPI_BITREG_SLEEP_TYPE 0x11
773 846 #define ACPI_BITREG_SLEEP_ENABLE 0x12
774 847
775 848 /* PM2 Control register */
776 849
777 850 #define ACPI_BITREG_ARB_DISABLE 0x13
778 851
779 852 #define ACPI_BITREG_MAX 0x13
780 853 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1
781 854
782 855
↓ open down ↓ |
52 lines elided |
↑ open up ↑ |
783 856 /* Status register values. A 1 clears a status bit. 0 = no effect */
784 857
785 858 #define ACPI_CLEAR_STATUS 1
786 859
787 860 /* Enable and Control register values */
788 861
789 862 #define ACPI_ENABLE_EVENT 1
790 863 #define ACPI_DISABLE_EVENT 0
791 864
792 865
866 +/* Sleep function dispatch */
867 +
868 +typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
869 + UINT8 SleepState);
870 +
871 +typedef struct acpi_sleep_functions
872 +{
873 + ACPI_SLEEP_FUNCTION LegacyFunction;
874 + ACPI_SLEEP_FUNCTION ExtendedFunction;
875 +
876 +} ACPI_SLEEP_FUNCTIONS;
877 +
878 +
793 879 /*
794 880 * External ACPI object definition
795 881 */
796 882
797 883 /*
798 884 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
799 885 * or an unresolved named reference.
800 886 */
801 887 typedef union acpi_object
802 888 {
803 889 ACPI_OBJECT_TYPE Type; /* See definition of AcpiNsType for values */
804 890 struct
805 891 {
806 892 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */
807 893 UINT64 Value; /* The actual number */
808 894 } Integer;
809 895
810 896 struct
811 897 {
812 898 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_STRING */
813 899 UINT32 Length; /* # of bytes in string, excluding trailing null */
814 900 char *Pointer; /* points to the string value */
815 901 } String;
816 902
817 903 struct
818 904 {
819 905 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_BUFFER */
820 906 UINT32 Length; /* # of bytes in buffer */
821 907 UINT8 *Pointer; /* points to the buffer */
822 908 } Buffer;
823 909
824 910 struct
825 911 {
826 912 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PACKAGE */
827 913 UINT32 Count; /* # of elements in package */
828 914 union acpi_object *Elements; /* Pointer to an array of ACPI_OBJECTs */
829 915 } Package;
830 916
831 917 struct
832 918 {
833 919 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_LOCAL_REFERENCE */
834 920 ACPI_OBJECT_TYPE ActualType; /* Type associated with the Handle */
835 921 ACPI_HANDLE Handle; /* object reference */
836 922 } Reference;
837 923
838 924 struct
839 925 {
840 926 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PROCESSOR */
841 927 UINT32 ProcId;
842 928 ACPI_IO_ADDRESS PblkAddress;
843 929 UINT32 PblkLength;
844 930 } Processor;
845 931
846 932 struct
847 933 {
848 934 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_POWER */
849 935 UINT32 SystemLevel;
850 936 UINT32 ResourceOrder;
851 937 } PowerResource;
852 938
853 939 } ACPI_OBJECT;
854 940
855 941
856 942 /*
857 943 * List of objects, used as a parameter list for control method evaluation
858 944 */
859 945 typedef struct acpi_object_list
860 946 {
↓ open down ↓ |
58 lines elided |
↑ open up ↑ |
861 947 UINT32 Count;
862 948 ACPI_OBJECT *Pointer;
863 949
864 950 } ACPI_OBJECT_LIST;
865 951
866 952
867 953 /*
868 954 * Miscellaneous common Data Structures used by the interfaces
869 955 */
870 956 #define ACPI_NO_BUFFER 0
871 -#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
872 -#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
957 +#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
958 +#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
873 959
874 960 typedef struct acpi_buffer
875 961 {
876 962 ACPI_SIZE Length; /* Length in bytes of the buffer */
877 963 void *Pointer; /* pointer to buffer */
878 964
879 965 } ACPI_BUFFER;
880 966
881 967
882 968 /*
883 969 * NameType for AcpiGetName
884 970 */
885 971 #define ACPI_FULL_PATHNAME 0
886 972 #define ACPI_SINGLE_NAME 1
887 973 #define ACPI_NAME_TYPE_MAX 1
888 974
889 975
890 976 /*
891 977 * Predefined Namespace items
892 978 */
893 979 typedef struct acpi_predefined_names
894 980 {
895 981 char *Name;
896 982 UINT8 Type;
897 983 char *Val;
898 984
899 985 } ACPI_PREDEFINED_NAMES;
900 986
901 987
902 988 /*
903 989 * Structure and flags for AcpiGetSystemInfo
904 990 */
905 991 #define ACPI_SYS_MODE_UNKNOWN 0x0000
906 992 #define ACPI_SYS_MODE_ACPI 0x0001
907 993 #define ACPI_SYS_MODE_LEGACY 0x0002
908 994 #define ACPI_SYS_MODES_MASK 0x0003
909 995
910 996
911 997 /*
912 998 * System info returned by AcpiGetSystemInfo()
913 999 */
914 1000 typedef struct acpi_system_info
915 1001 {
916 1002 UINT32 AcpiCaVersion;
917 1003 UINT32 Flags;
918 1004 UINT32 TimerResolution;
919 1005 UINT32 Reserved1;
920 1006 UINT32 Reserved2;
921 1007 UINT32 DebugLevel;
922 1008 UINT32 DebugLayer;
923 1009
924 1010 } ACPI_SYSTEM_INFO;
925 1011
926 1012
927 1013 /*
928 1014 * System statistics returned by AcpiGetStatistics()
929 1015 */
930 1016 typedef struct acpi_statistics
931 1017 {
932 1018 UINT32 SciCount;
933 1019 UINT32 GpeCount;
934 1020 UINT32 FixedEventCount[ACPI_NUM_FIXED_EVENTS];
935 1021 UINT32 MethodCount;
936 1022
937 1023 } ACPI_STATISTICS;
938 1024
939 1025
940 1026 /* Table Event Types */
941 1027
942 1028 #define ACPI_TABLE_EVENT_LOAD 0x0
943 1029 #define ACPI_TABLE_EVENT_UNLOAD 0x1
944 1030 #define ACPI_NUM_TABLE_EVENTS 2
945 1031
946 1032
947 1033 /*
948 1034 * Types specific to the OS service interfaces
949 1035 */
950 1036 typedef UINT32
951 1037 (ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) (
↓ open down ↓ |
69 lines elided |
↑ open up ↑ |
952 1038 void *Context);
953 1039
954 1040 typedef void
955 1041 (ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) (
956 1042 void *Context);
957 1043
958 1044 /*
959 1045 * Various handlers and callback procedures
960 1046 */
961 1047 typedef
1048 +UINT32 (*ACPI_SCI_HANDLER) (
1049 + void *Context);
1050 +
1051 +typedef
962 1052 void (*ACPI_GBL_EVENT_HANDLER) (
963 1053 UINT32 EventType,
964 1054 ACPI_HANDLE Device,
965 1055 UINT32 EventNumber,
966 1056 void *Context);
967 1057
968 1058 #define ACPI_EVENT_TYPE_GPE 0
969 1059 #define ACPI_EVENT_TYPE_FIXED 1
970 1060
971 1061 typedef
972 1062 UINT32 (*ACPI_EVENT_HANDLER) (
973 1063 void *Context);
974 1064
975 1065 typedef
976 1066 UINT32 (*ACPI_GPE_HANDLER) (
977 1067 ACPI_HANDLE GpeDevice,
978 1068 UINT32 GpeNumber,
979 1069 void *Context);
980 1070
981 1071 typedef
982 1072 void (*ACPI_NOTIFY_HANDLER) (
983 1073 ACPI_HANDLE Device,
984 1074 UINT32 Value,
985 1075 void *Context);
986 1076
987 1077 typedef
988 1078 void (*ACPI_OBJECT_HANDLER) (
989 1079 ACPI_HANDLE Object,
990 1080 void *Data);
991 1081
992 1082 typedef
993 1083 ACPI_STATUS (*ACPI_INIT_HANDLER) (
994 1084 ACPI_HANDLE Object,
995 1085 UINT32 Function);
996 1086
997 1087 #define ACPI_INIT_DEVICE_INI 1
998 1088
999 1089 typedef
1000 1090 ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) (
1001 1091 ACPI_STATUS AmlStatus,
1002 1092 ACPI_NAME Name,
1003 1093 UINT16 Opcode,
1004 1094 UINT32 AmlOffset,
1005 1095 void *Context);
1006 1096
1007 1097 /* Table Event handler (Load, LoadTable, etc.) and types */
1008 1098
1009 1099 typedef
1010 1100 ACPI_STATUS (*ACPI_TABLE_HANDLER) (
1011 1101 UINT32 Event,
1012 1102 void *Table,
1013 1103 void *Context);
1014 1104
1015 1105 #define ACPI_TABLE_LOAD 0x0
1016 1106 #define ACPI_TABLE_UNLOAD 0x1
1017 1107 #define ACPI_NUM_TABLE_EVENTS 2
1018 1108
1019 1109
1020 1110 /* Address Spaces (For Operation Regions) */
1021 1111
1022 1112 typedef
↓ open down ↓ |
51 lines elided |
↑ open up ↑ |
1023 1113 ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
1024 1114 UINT32 Function,
1025 1115 ACPI_PHYSICAL_ADDRESS Address,
1026 1116 UINT32 BitWidth,
1027 1117 UINT64 *Value,
1028 1118 void *HandlerContext,
1029 1119 void *RegionContext);
1030 1120
1031 1121 #define ACPI_DEFAULT_HANDLER NULL
1032 1122
1123 +/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
1124 +
1125 +typedef struct acpi_connection_info
1126 +{
1127 + UINT8 *Connection;
1128 + UINT16 Length;
1129 + UINT8 AccessLength;
1130 +
1131 +} ACPI_CONNECTION_INFO;
1132 +
1133 +
1033 1134 typedef
1034 1135 ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
1035 1136 ACPI_HANDLE RegionHandle,
1036 1137 UINT32 Function,
1037 1138 void *HandlerContext,
1038 1139 void **RegionContext);
1039 1140
1040 1141 #define ACPI_REGION_ACTIVATE 0
1041 1142 #define ACPI_REGION_DEACTIVATE 1
1042 1143
1043 1144 typedef
1044 1145 ACPI_STATUS (*ACPI_WALK_CALLBACK) (
1045 1146 ACPI_HANDLE Object,
1046 1147 UINT32 NestingLevel,
1047 1148 void *Context,
1048 1149 void **ReturnValue);
1049 1150
1050 1151 typedef
1051 1152 UINT32 (*ACPI_INTERFACE_HANDLER) (
1052 1153 ACPI_STRING InterfaceName,
1053 1154 UINT32 Supported);
1054 1155
1055 1156
1056 1157 /* Interrupt handler return values */
1057 1158
1058 1159 #define ACPI_INTERRUPT_NOT_HANDLED 0x00
1059 1160 #define ACPI_INTERRUPT_HANDLED 0x01
1060 1161
1061 1162 /* GPE handler return values */
1062 1163
1063 1164 #define ACPI_REENABLE_GPE 0x80
1064 1165
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
1065 1166
1066 1167 /* Length of 32-bit EISAID values when converted back to a string */
1067 1168
1068 1169 #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */
1069 1170
1070 1171 /* Length of UUID (string) values */
1071 1172
1072 1173 #define ACPI_UUID_LENGTH 16
1073 1174
1074 1175
1075 -/* Structures used for device/processor HID, UID, CID */
1176 +/* Structures used for device/processor HID, UID, CID, and SUB */
1076 1177
1077 -typedef struct acpi_device_id
1178 +typedef struct acpi_pnp_device_id
1078 1179 {
1079 1180 UINT32 Length; /* Length of string + null */
1080 1181 char *String;
1081 1182
1082 -} ACPI_DEVICE_ID;
1183 +} ACPI_PNP_DEVICE_ID;
1083 1184
1084 -typedef struct acpi_device_id_list
1185 +typedef struct acpi_pnp_device_id_list
1085 1186 {
1086 1187 UINT32 Count; /* Number of IDs in Ids array */
1087 1188 UINT32 ListSize; /* Size of list, including ID strings */
1088 - ACPI_DEVICE_ID Ids[1]; /* ID array */
1189 + ACPI_PNP_DEVICE_ID Ids[1]; /* ID array */
1089 1190
1090 -} ACPI_DEVICE_ID_LIST;
1191 +} ACPI_PNP_DEVICE_ID_LIST;
1091 1192
1092 1193 /*
1093 1194 * Structure returned from AcpiGetObjectInfo.
1094 1195 * Optimized for both 32- and 64-bit builds
1095 1196 */
1096 1197 typedef struct acpi_device_info
1097 1198 {
1098 1199 UINT32 InfoSize; /* Size of info, including ID strings */
1099 1200 UINT32 Name; /* ACPI object Name */
1100 1201 ACPI_OBJECT_TYPE Type; /* ACPI object Type */
1101 1202 UINT8 ParamCount; /* If a method, required parameter count */
1102 1203 UINT8 Valid; /* Indicates which optional fields are valid */
1103 1204 UINT8 Flags; /* Miscellaneous info */
1104 1205 UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */
1105 1206 UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */
1106 1207 UINT32 CurrentStatus; /* _STA value */
1107 1208 UINT64 Address; /* _ADR value */
1108 - ACPI_DEVICE_ID HardwareId; /* _HID value */
1109 - ACPI_DEVICE_ID UniqueId; /* _UID value */
1110 - ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
1209 + ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */
1210 + ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */
1211 + ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */
1212 + ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
1111 1213
1112 1214 } ACPI_DEVICE_INFO;
1113 1215
1114 1216 /* Values for Flags field above (AcpiGetObjectInfo) */
1115 1217
1116 1218 #define ACPI_PCI_ROOT_BRIDGE 0x01
1117 1219
1118 1220 /* Flags for Valid field above (AcpiGetObjectInfo) */
1119 1221
1120 1222 #define ACPI_VALID_STA 0x01
1121 1223 #define ACPI_VALID_ADR 0x02
1122 1224 #define ACPI_VALID_HID 0x04
1123 1225 #define ACPI_VALID_UID 0x08
1124 -#define ACPI_VALID_CID 0x10
1125 -#define ACPI_VALID_SXDS 0x20
1126 -#define ACPI_VALID_SXWS 0x40
1226 +#define ACPI_VALID_SUB 0x10
1227 +#define ACPI_VALID_CID 0x20
1228 +#define ACPI_VALID_SXDS 0x40
1229 +#define ACPI_VALID_SXWS 0x80
1127 1230
1128 -/* Flags for _STA method */
1231 +/* Flags for _STA return value (CurrentStatus above) */
1129 1232
1130 1233 #define ACPI_STA_DEVICE_PRESENT 0x01
1131 1234 #define ACPI_STA_DEVICE_ENABLED 0x02
1132 1235 #define ACPI_STA_DEVICE_UI 0x04
1133 1236 #define ACPI_STA_DEVICE_FUNCTIONING 0x08
1134 1237 #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */
1135 1238 #define ACPI_STA_BATTERY_PRESENT 0x10
1136 1239
1137 1240
1138 1241 /* Context structs for address space handlers */
1139 1242
1140 1243 typedef struct acpi_pci_id
1141 1244 {
1142 1245 UINT16 Segment;
1143 1246 UINT16 Bus;
1144 1247 UINT16 Device;
1145 1248 UINT16 Function;
1146 1249
1147 1250 } ACPI_PCI_ID;
1148 1251
1149 1252 typedef struct acpi_mem_space_context
1150 1253 {
1151 1254 UINT32 Length;
1152 1255 ACPI_PHYSICAL_ADDRESS Address;
1153 1256 ACPI_PHYSICAL_ADDRESS MappedPhysicalAddress;
1154 1257 UINT8 *MappedLogicalAddress;
1155 1258 ACPI_SIZE MappedLength;
1156 1259
1157 1260 } ACPI_MEM_SPACE_CONTEXT;
1158 1261
1159 1262
↓ open down ↓ |
21 lines elided |
↑ open up ↑ |
1160 1263 /*
1161 1264 * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled
1162 1265 */
1163 1266 typedef struct acpi_memory_list
1164 1267 {
1165 1268 char *ListName;
1166 1269 void *ListHead;
1167 1270 UINT16 ObjectSize;
1168 1271 UINT16 MaxDepth;
1169 1272 UINT16 CurrentDepth;
1170 - UINT16 LinkOffset;
1171 1273
1172 1274 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
1173 1275
1174 1276 /* Statistics for debug memory tracking only */
1175 1277
1176 1278 UINT32 TotalAllocated;
1177 1279 UINT32 TotalFreed;
1178 1280 UINT32 MaxOccupied;
1179 1281 UINT32 TotalSize;
1180 1282 UINT32 CurrentTotalSize;
1181 1283 UINT32 Requests;
1182 1284 UINT32 Hits;
1183 1285 #endif
1184 1286
1185 1287 } ACPI_MEMORY_LIST;
1186 1288
1187 1289
1290 +/* Definitions of _OSI support */
1291 +
1292 +#define ACPI_VENDOR_STRINGS 0x01
1293 +#define ACPI_FEATURE_STRINGS 0x02
1294 +#define ACPI_ENABLE_INTERFACES 0x00
1295 +#define ACPI_DISABLE_INTERFACES 0x04
1296 +
1297 +#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1298 +#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1299 +#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1300 +#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1301 +#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1302 +#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1303 +
1304 +#define ACPI_OSI_WIN_2000 0x01
1305 +#define ACPI_OSI_WIN_XP 0x02
1306 +#define ACPI_OSI_WIN_XP_SP1 0x03
1307 +#define ACPI_OSI_WINSRV_2003 0x04
1308 +#define ACPI_OSI_WIN_XP_SP2 0x05
1309 +#define ACPI_OSI_WINSRV_2003_SP1 0x06
1310 +#define ACPI_OSI_WIN_VISTA 0x07
1311 +#define ACPI_OSI_WINSRV_2008 0x08
1312 +#define ACPI_OSI_WIN_VISTA_SP1 0x09
1313 +#define ACPI_OSI_WIN_VISTA_SP2 0x0A
1314 +#define ACPI_OSI_WIN_7 0x0B
1315 +#define ACPI_OSI_WIN_8 0x0C
1316 +
1317 +
1188 1318 #endif /* __ACTYPES_H__ */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX