Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenactypes.h
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Name: actypes.h - Common data types for the entire ACPI subsystem 00004 * 00005 *****************************************************************************/ 00006 00007 /****************************************************************************** 00008 * 00009 * 1. Copyright Notice 00010 * 00011 * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. 00012 * All rights reserved. 00013 * 00014 * 2. License 00015 * 00016 * 2.1. This is your license from Intel Corp. under its intellectual property 00017 * rights. You may have additional license terms from the party that provided 00018 * you this software, covering your right to use that party's intellectual 00019 * property rights. 00020 * 00021 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 00022 * copy of the source code appearing in this file ("Covered Code") an 00023 * irrevocable, perpetual, worldwide license under Intel's copyrights in the 00024 * base code distributed originally by Intel ("Original Intel Code") to copy, 00025 * make derivatives, distribute, use and display any portion of the Covered 00026 * Code in any form, with the right to sublicense such rights; and 00027 * 00028 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 00029 * license (with the right to sublicense), under only those claims of Intel 00030 * patents that are infringed by the Original Intel Code, to make, use, sell, 00031 * offer to sell, and import the Covered Code and derivative works thereof 00032 * solely to the minimum extent necessary to exercise the above copyright 00033 * license, and in no event shall the patent license extend to any additions 00034 * to or modifications of the Original Intel Code. No other license or right 00035 * is granted directly or by implication, estoppel or otherwise; 00036 * 00037 * The above copyright and patent license is granted only if the following 00038 * conditions are met: 00039 * 00040 * 3. Conditions 00041 * 00042 * 3.1. Redistribution of Source with Rights to Further Distribute Source. 00043 * Redistribution of source code of any substantial portion of the Covered 00044 * Code or modification with rights to further distribute source must include 00045 * the above Copyright Notice, the above License, this list of Conditions, 00046 * and the following Disclaimer and Export Compliance provision. In addition, 00047 * Licensee must cause all Covered Code to which Licensee contributes to 00048 * contain a file documenting the changes Licensee made to create that Covered 00049 * Code and the date of any change. Licensee must include in that file the 00050 * documentation of any changes made by any predecessor Licensee. Licensee 00051 * must include a prominent statement that the modification is derived, 00052 * directly or indirectly, from Original Intel Code. 00053 * 00054 * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 00055 * Redistribution of source code of any substantial portion of the Covered 00056 * Code or modification without rights to further distribute source must 00057 * include the following Disclaimer and Export Compliance provision in the 00058 * documentation and/or other materials provided with distribution. In 00059 * addition, Licensee may not authorize further sublicense of source of any 00060 * portion of the Covered Code, and must include terms to the effect that the 00061 * license from Licensee to its licensee is limited to the intellectual 00062 * property embodied in the software Licensee provides to its licensee, and 00063 * not to intellectual property embodied in modifications its licensee may 00064 * make. 00065 * 00066 * 3.3. Redistribution of Executable. Redistribution in executable form of any 00067 * substantial portion of the Covered Code or modification must reproduce the 00068 * above Copyright Notice, and the following Disclaimer and Export Compliance 00069 * provision in the documentation and/or other materials provided with the 00070 * distribution. 00071 * 00072 * 3.4. Intel retains all right, title, and interest in and to the Original 00073 * Intel Code. 00074 * 00075 * 3.5. Neither the name Intel nor any other trademark owned or controlled by 00076 * Intel shall be used in advertising or otherwise to promote the sale, use or 00077 * other dealings in products derived from or relating to the Covered Code 00078 * without prior written authorization from Intel. 00079 * 00080 * 4. Disclaimer and Export Compliance 00081 * 00082 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 00083 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 00084 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 00085 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 00086 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 00087 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 00088 * PARTICULAR PURPOSE. 00089 * 00090 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 00091 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 00092 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 00093 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 00094 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 00095 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 00096 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 00097 * LIMITED REMEDY. 00098 * 00099 * 4.3. Licensee shall not export, either directly or indirectly, any of this 00100 * software or system incorporating such software without first obtaining any 00101 * required license or other approval from the U. S. Department of Commerce or 00102 * any other agency or department of the United States Government. In the 00103 * event Licensee exports any such software from the United States or 00104 * re-exports any such software from a foreign destination, Licensee shall 00105 * ensure that the distribution and export/re-export of the software is in 00106 * compliance with all laws, regulations, orders, or other restrictions of the 00107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor 00108 * any of its subsidiaries will export/re-export any technical data, process, 00109 * software, or service, directly or indirectly, to any country for which the 00110 * United States government or any agency thereof requires an export license, 00111 * other governmental approval, or letter of assurance, without first obtaining 00112 * such license, approval or letter. 00113 * 00114 *****************************************************************************/ 00115 00116 #ifndef __ACTYPES_H__ 00117 #define __ACTYPES_H__ 00118 00119 /* acpisrc:StructDefs -- for acpisrc conversion */ 00120 00121 /* 00122 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 00123 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of 00124 * 12/2006. 00125 */ 00126 #ifndef ACPI_MACHINE_WIDTH 00127 #error ACPI_MACHINE_WIDTH not defined 00128 #endif 00129 00132 /* 00133 * Data type ranges 00134 * Note: These macros are designed to be compiler independent as well as 00135 * working around problems that some 32-bit compilers have with 64-bit 00136 * constants. 00137 */ 00138 #define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ 00139 #define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ 00140 #define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ 00141 #define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 00142 #define ACPI_ASCII_MAX 0x7F 00143 00144 00145 /* 00146 * Architecture-specific ACPICA Subsystem Data Types 00147 * 00148 * The goal of these types is to provide source code portability across 00149 * 16-bit, 32-bit, and 64-bit targets. 00150 * 00151 * 1) The following types are of fixed size for all targets (16/32/64): 00152 * 00153 * BOOLEAN Logical boolean 00154 * 00155 * UINT8 8-bit (1 byte) unsigned value 00156 * UINT16 16-bit (2 byte) unsigned value 00157 * UINT32 32-bit (4 byte) unsigned value 00158 * UINT64 64-bit (8 byte) unsigned value 00159 * 00160 * INT16 16-bit (2 byte) signed value 00161 * INT32 32-bit (4 byte) signed value 00162 * INT64 64-bit (8 byte) signed value 00163 * 00164 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the 00165 * compiler-dependent header(s) and were introduced because there is no common 00166 * 64-bit integer type across the various compilation models, as shown in 00167 * the table below. 00168 * 00169 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit 00170 * char 8 8 8 8 8 8 00171 * short 16 16 16 16 16 16 00172 * _int32 32 00173 * int 32 64 32 32 16 16 00174 * long 64 64 32 32 32 32 00175 * long long 64 64 00176 * pointer 64 64 64 32 32 32 00177 * 00178 * Note: ILP64 and LP32 are currently not supported. 00179 * 00180 * 00181 * 2) These types represent the native word size of the target mode of the 00182 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are 00183 * usually used for memory allocation, efficient loop counters, and array 00184 * indexes. The types are similar to the size_t type in the C library and are 00185 * required because there is no C type that consistently represents the native 00186 * data width. ACPI_SIZE is needed because there is no guarantee that a 00187 * kernel-level C library is present. 00188 * 00189 * ACPI_SIZE 16/32/64-bit unsigned value 00190 * ACPI_NATIVE_INT 16/32/64-bit signed value 00191 */ 00192 00193 /******************************************************************************* 00194 * 00195 * Common types for all compilers, all targets 00196 * 00197 ******************************************************************************/ 00198 00199 //typedef unsigned char BOOLEAN; 00200 //typedef unsigned char UINT8; 00201 //typedef unsigned short UINT16; 00202 //typedef COMPILER_DEPENDENT_UINT64 UINT64; 00203 //typedef COMPILER_DEPENDENT_INT64 INT64; 00204 00207 /* 00208 * Value returned by AcpiOsGetThreadId. There is no standard "thread_id" 00209 * across operating systems or even the various UNIX systems. Since ACPICA 00210 * only needs the thread ID as a unique thread identifier, we use a UINT64 00211 * as the only common data type - it will accommodate any type of pointer or 00212 * any type of integer. It is up to the host-dependent OSL to cast the 00213 * native thread ID type to a UINT64 (in AcpiOsGetThreadId). 00214 */ 00215 #define ACPI_THREAD_ID UINT64 00216 00217 00218 /******************************************************************************* 00219 * 00220 * Types specific to 64-bit targets 00221 * 00222 ******************************************************************************/ 00223 00224 #if ACPI_MACHINE_WIDTH == 64 00225 00228 //typedef unsigned int UINT32; 00229 //typedef int INT32; 00230 00234 typedef INT64 ACPI_NATIVE_INT; 00235 typedef UINT64 ACPI_SIZE; 00236 typedef UINT64 ACPI_IO_ADDRESS; 00237 typedef UINT64 ACPI_PHYSICAL_ADDRESS; 00238 00239 #define ACPI_MAX_PTR ACPI_UINT64_MAX 00240 #define ACPI_SIZE_MAX ACPI_UINT64_MAX 00241 #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ 00242 00243 /* 00244 * In the case of the Itanium Processor Family (IPF), the hardware does not 00245 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 00246 * to indicate that special precautions must be taken to avoid alignment faults. 00247 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 00248 * 00249 * Note: EM64T and other X86-64 processors support misaligned transfers, 00250 * so there is no need to define this flag. 00251 */ 00252 #if defined (__IA64__) || defined (__ia64__) 00253 #define ACPI_MISALIGNMENT_NOT_SUPPORTED 00254 #endif 00255 00256 00257 /******************************************************************************* 00258 * 00259 * Types specific to 32-bit targets 00260 * 00261 ******************************************************************************/ 00262 00263 #elif ACPI_MACHINE_WIDTH == 32 00264 00267 //typedef unsigned int UINT32; 00268 //typedef int INT32; 00269 00273 typedef INT32 ACPI_NATIVE_INT; 00274 typedef UINT32 ACPI_SIZE; 00275 typedef UINT32 ACPI_IO_ADDRESS; 00276 typedef UINT32 ACPI_PHYSICAL_ADDRESS; 00277 00278 #define ACPI_MAX_PTR ACPI_UINT32_MAX 00279 #define ACPI_SIZE_MAX ACPI_UINT32_MAX 00280 00281 #else 00282 00283 /* ACPI_MACHINE_WIDTH must be either 64 or 32 */ 00284 00285 #error unknown ACPI_MACHINE_WIDTH 00286 #endif 00287 00288 00289 /******************************************************************************* 00290 * 00291 * OS-dependent types 00292 * 00293 * If the defaults below are not appropriate for the host system, they can 00294 * be defined in the OS-specific header, and this will take precedence. 00295 * 00296 ******************************************************************************/ 00297 00298 /* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */ 00299 00300 #ifndef ACPI_CPU_FLAGS 00301 #define ACPI_CPU_FLAGS ACPI_SIZE 00302 #endif 00303 00304 /* Object returned from AcpiOsCreateCache */ 00305 00306 #ifndef ACPI_CACHE_T 00307 #ifdef ACPI_USE_LOCAL_CACHE 00308 #define ACPI_CACHE_T ACPI_MEMORY_LIST 00309 #else 00310 #define ACPI_CACHE_T void * 00311 #endif 00312 #endif 00313 00314 /* 00315 * Synchronization objects - Mutexes, Semaphores, and SpinLocks 00316 */ 00317 #if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE) 00318 /* 00319 * These macros are used if the host OS does not support a mutex object. 00320 * Map the OSL Mutex interfaces to binary semaphores. 00321 */ 00322 #define ACPI_MUTEX ACPI_SEMAPHORE 00323 #define AcpiOsCreateMutex(OutHandle) AcpiOsCreateSemaphore (1, 1, OutHandle) 00324 #define AcpiOsDeleteMutex(Handle) (void) AcpiOsDeleteSemaphore (Handle) 00325 #define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time) 00326 #define AcpiOsReleaseMutex(Handle) (void) AcpiOsSignalSemaphore (Handle, 1) 00327 #endif 00328 00329 /* Configurable types for synchronization objects */ 00330 00331 #ifndef ACPI_SPINLOCK 00332 #define ACPI_SPINLOCK void * 00333 #endif 00334 00335 #ifndef ACPI_SEMAPHORE 00336 #define ACPI_SEMAPHORE void * 00337 #endif 00338 00339 #ifndef ACPI_MUTEX 00340 #define ACPI_MUTEX void * 00341 #endif 00342 00343 00344 /******************************************************************************* 00345 * 00346 * Compiler-dependent types 00347 * 00348 * If the defaults below are not appropriate for the host compiler, they can 00349 * be defined in the compiler-specific header, and this will take precedence. 00350 * 00351 ******************************************************************************/ 00352 00353 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 00354 00355 #ifndef ACPI_UINTPTR_T 00356 #define ACPI_UINTPTR_T void * 00357 #endif 00358 00359 /* 00360 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because 00361 * some compilers can catch printf format string problems 00362 */ 00363 #ifndef ACPI_PRINTF_LIKE 00364 #define ACPI_PRINTF_LIKE(c) 00365 #endif 00366 00367 /* 00368 * Some compilers complain about unused variables. Sometimes we don't want to 00369 * use all the variables (for example, _AcpiModuleName). This allows us 00370 * to to tell the compiler in a per-variable manner that a variable 00371 * is unused 00372 */ 00373 #ifndef ACPI_UNUSED_VAR 00374 #define ACPI_UNUSED_VAR 00375 #endif 00376 00377 /* 00378 * All ACPICA functions that are available to the rest of the kernel are 00379 * tagged with this macro which can be defined as appropriate for the host. 00380 */ 00381 #ifndef ACPI_EXPORT_SYMBOL 00382 #define ACPI_EXPORT_SYMBOL(Symbol) 00383 #endif 00384 00385 00386 /****************************************************************************** 00387 * 00388 * ACPI Specification constants (Do not change unless the specification changes) 00389 * 00390 *****************************************************************************/ 00391 00392 /* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */ 00393 00394 #define ACPI_MAX_GPE_BLOCKS 2 00395 00396 /* Default ACPI register widths */ 00397 00398 #define ACPI_GPE_REGISTER_WIDTH 8 00399 #define ACPI_PM1_REGISTER_WIDTH 16 00400 #define ACPI_PM2_REGISTER_WIDTH 8 00401 #define ACPI_PM_TIMER_WIDTH 32 00402 00403 /* Names within the namespace are 4 bytes long */ 00404 00405 #define ACPI_NAME_SIZE 4 00406 #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ 00407 #define ACPI_PATH_SEPARATOR '.' 00408 00409 /* Sizes for ACPI table headers */ 00410 00411 #define ACPI_OEM_ID_SIZE 6 00412 #define ACPI_OEM_TABLE_ID_SIZE 8 00413 00414 /* ACPI/PNP hardware IDs */ 00415 00416 #define PCI_ROOT_HID_STRING "PNP0A03" 00417 #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" 00418 00419 /* PM Timer ticks per second (HZ) */ 00420 00421 #define PM_TIMER_FREQUENCY 3579545 00422 00423 00424 /******************************************************************************* 00425 * 00426 * Independent types 00427 * 00428 ******************************************************************************/ 00429 00430 /* Logical defines and NULL */ 00431 00432 #ifdef FALSE 00433 #undef FALSE 00434 #endif 00435 #define FALSE (1 == 0) 00436 00437 #ifdef TRUE 00438 #undef TRUE 00439 #endif 00440 #define TRUE (1 == 1) 00441 00442 #ifndef NULL 00443 #define NULL (void *) 0 00444 #endif 00445 00446 00447 /* 00448 * Miscellaneous types 00449 */ 00450 typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */ 00451 typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */ 00452 typedef char * ACPI_STRING; /* Null terminated ASCII string */ 00453 typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */ 00454 00455 00456 /* Owner IDs are used to track namespace nodes for selective deletion */ 00457 00458 typedef UINT8 ACPI_OWNER_ID; 00459 #define ACPI_OWNER_ID_MAX 0xFF 00460 00461 00462 #define ACPI_INTEGER_BIT_SIZE 64 00463 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 00464 #define ACPI_MAX64_DECIMAL_DIGITS 20 00465 #define ACPI_MAX32_DECIMAL_DIGITS 10 00466 #define ACPI_MAX16_DECIMAL_DIGITS 5 00467 #define ACPI_MAX8_DECIMAL_DIGITS 3 00468 00469 /* 00470 * Constants with special meanings 00471 */ 00472 #define ACPI_ROOT_OBJECT ACPI_ADD_PTR (ACPI_HANDLE, NULL, ACPI_MAX_PTR) 00473 #define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */ 00474 #define ACPI_DO_NOT_WAIT 0 00475 00476 /* 00477 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. 00478 * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this 00479 * pertains to the ACPI integer type only, not to other integers used in the 00480 * implementation of the ACPICA subsystem. 00481 * 00482 * 01/2010: This type is obsolete and has been removed from the entire ACPICA 00483 * code base. It remains here for compatibility with device drivers that use 00484 * the type. However, it will be removed in the future. 00485 */ 00486 typedef UINT64 ACPI_INTEGER; 00487 #define ACPI_INTEGER_MAX ACPI_UINT64_MAX 00488 00489 00490 /******************************************************************************* 00491 * 00492 * Commonly used macros 00493 * 00494 ******************************************************************************/ 00495 00496 /* Data manipulation */ 00497 00498 #define ACPI_LOBYTE(Integer) ((UINT8) (UINT16)(Integer)) 00499 #define ACPI_HIBYTE(Integer) ((UINT8) (((UINT16)(Integer)) >> 8)) 00500 #define ACPI_LOWORD(Integer) ((UINT16) (UINT32)(Integer)) 00501 #define ACPI_HIWORD(Integer) ((UINT16)(((UINT32)(Integer)) >> 16)) 00502 #define ACPI_LODWORD(Integer64) ((UINT32) (UINT64)(Integer64)) 00503 #define ACPI_HIDWORD(Integer64) ((UINT32)(((UINT64)(Integer64)) >> 32)) 00504 00505 #define ACPI_SET_BIT(target,bit) ((target) |= (bit)) 00506 #define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) 00507 #define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) 00508 #define ACPI_MAX(a,b) (((a)>(b))?(a):(b)) 00509 00510 /* Size calculation */ 00511 00512 #define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) 00513 00514 /* Pointer manipulation */ 00515 00516 #define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) 00517 #define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) 00518 #define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b))) 00519 #define ACPI_PTR_DIFF(a, b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b))) 00520 00521 /* Pointer/Integer type conversions */ 00522 00523 #define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i) 00524 #define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) 00525 #define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) 00526 #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 00527 #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 00528 00529 #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 00530 #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) 00531 #else 00532 #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) 00533 #endif 00534 00535 00536 /******************************************************************************* 00537 * 00538 * Miscellaneous constants 00539 * 00540 ******************************************************************************/ 00541 00542 /* 00543 * Initialization sequence 00544 */ 00545 #define ACPI_FULL_INITIALIZATION 0x00 00546 #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 00547 #define ACPI_NO_HARDWARE_INIT 0x02 00548 #define ACPI_NO_EVENT_INIT 0x04 00549 #define ACPI_NO_HANDLER_INIT 0x08 00550 #define ACPI_NO_ACPI_ENABLE 0x10 00551 #define ACPI_NO_DEVICE_INIT 0x20 00552 #define ACPI_NO_OBJECT_INIT 0x40 00553 00554 /* 00555 * Initialization state 00556 */ 00557 #define ACPI_SUBSYSTEM_INITIALIZE 0x01 00558 #define ACPI_INITIALIZED_OK 0x02 00559 00560 /* 00561 * Power state values 00562 */ 00563 #define ACPI_STATE_UNKNOWN (UINT8) 0xFF 00564 00565 #define ACPI_STATE_S0 (UINT8) 0 00566 #define ACPI_STATE_S1 (UINT8) 1 00567 #define ACPI_STATE_S2 (UINT8) 2 00568 #define ACPI_STATE_S3 (UINT8) 3 00569 #define ACPI_STATE_S4 (UINT8) 4 00570 #define ACPI_STATE_S5 (UINT8) 5 00571 #define ACPI_S_STATES_MAX ACPI_STATE_S5 00572 #define ACPI_S_STATE_COUNT 6 00573 00574 #define ACPI_STATE_D0 (UINT8) 0 00575 #define ACPI_STATE_D1 (UINT8) 1 00576 #define ACPI_STATE_D2 (UINT8) 2 00577 #define ACPI_STATE_D3 (UINT8) 3 00578 #define ACPI_D_STATES_MAX ACPI_STATE_D3 00579 #define ACPI_D_STATE_COUNT 4 00580 00581 #define ACPI_STATE_C0 (UINT8) 0 00582 #define ACPI_STATE_C1 (UINT8) 1 00583 #define ACPI_STATE_C2 (UINT8) 2 00584 #define ACPI_STATE_C3 (UINT8) 3 00585 #define ACPI_C_STATES_MAX ACPI_STATE_C3 00586 #define ACPI_C_STATE_COUNT 4 00587 00588 /* 00589 * Sleep type invalid value 00590 */ 00591 #define ACPI_SLEEP_TYPE_MAX 0x7 00592 #define ACPI_SLEEP_TYPE_INVALID 0xFF 00593 00594 /* 00595 * Standard notify values 00596 */ 00597 #define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00 00598 #define ACPI_NOTIFY_DEVICE_CHECK (UINT8) 0x01 00599 #define ACPI_NOTIFY_DEVICE_WAKE (UINT8) 0x02 00600 #define ACPI_NOTIFY_EJECT_REQUEST (UINT8) 0x03 00601 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (UINT8) 0x04 00602 #define ACPI_NOTIFY_FREQUENCY_MISMATCH (UINT8) 0x05 00603 #define ACPI_NOTIFY_BUS_MODE_MISMATCH (UINT8) 0x06 00604 #define ACPI_NOTIFY_POWER_FAULT (UINT8) 0x07 00605 #define ACPI_NOTIFY_CAPABILITIES_CHECK (UINT8) 0x08 00606 #define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09 00607 #define ACPI_NOTIFY_RESERVED (UINT8) 0x0A 00608 #define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B 00609 00610 #define ACPI_NOTIFY_MAX 0x0B 00611 00612 /* 00613 * Types associated with ACPI names and objects. The first group of 00614 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition 00615 * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore, 00616 * only add to the first group if the spec changes. 00617 * 00618 * NOTE: Types must be kept in sync with the global AcpiNsProperties 00619 * and AcpiNsTypeNames arrays. 00620 */ 00621 typedef UINT32 ACPI_OBJECT_TYPE; 00622 00623 #define ACPI_TYPE_ANY 0x00 00624 #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ 00625 #define ACPI_TYPE_STRING 0x02 00626 #define ACPI_TYPE_BUFFER 0x03 00627 #define ACPI_TYPE_PACKAGE 0x04 /* ByteConst, multiple DataTerm/Constant/SuperName */ 00628 #define ACPI_TYPE_FIELD_UNIT 0x05 00629 #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ 00630 #define ACPI_TYPE_EVENT 0x07 00631 #define ACPI_TYPE_METHOD 0x08 /* Name, ByteConst, multiple Code */ 00632 #define ACPI_TYPE_MUTEX 0x09 00633 #define ACPI_TYPE_REGION 0x0A 00634 #define ACPI_TYPE_POWER 0x0B /* Name,ByteConst,WordConst,multi Node */ 00635 #define ACPI_TYPE_PROCESSOR 0x0C /* Name,ByteConst,DWordConst,ByteConst,multi NmO */ 00636 #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ 00637 #define ACPI_TYPE_BUFFER_FIELD 0x0E 00638 #define ACPI_TYPE_DDB_HANDLE 0x0F 00639 #define ACPI_TYPE_DEBUG_OBJECT 0x10 00640 00641 #define ACPI_TYPE_EXTERNAL_MAX 0x10 00642 00643 /* 00644 * These are object types that do not map directly to the ACPI 00645 * ObjectType() operator. They are used for various internal purposes only. 00646 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these 00647 * internal types must move upwards. (There is code that depends on these 00648 * values being contiguous with the external types above.) 00649 */ 00650 #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 00651 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 00652 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 00653 #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, RefOf, Index */ 00654 #define ACPI_TYPE_LOCAL_ALIAS 0x15 00655 #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 00656 #define ACPI_TYPE_LOCAL_NOTIFY 0x17 00657 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 00658 #define ACPI_TYPE_LOCAL_RESOURCE 0x19 00659 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A 00660 #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */ 00661 00662 #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ 00663 00664 /* 00665 * These are special object types that never appear in 00666 * a Namespace node, only in an ACPI_OPERAND_OBJECT 00667 */ 00668 #define ACPI_TYPE_LOCAL_EXTRA 0x1C 00669 #define ACPI_TYPE_LOCAL_DATA 0x1D 00670 00671 #define ACPI_TYPE_LOCAL_MAX 0x1D 00672 00673 /* All types above here are invalid */ 00674 00675 #define ACPI_TYPE_INVALID 0x1E 00676 #define ACPI_TYPE_NOT_FOUND 0xFF 00677 00678 #define ACPI_NUM_NS_TYPES (ACPI_TYPE_INVALID + 1) 00679 00680 00681 /* 00682 * All I/O 00683 */ 00684 #define ACPI_READ 0 00685 #define ACPI_WRITE 1 00686 #define ACPI_IO_MASK 1 00687 00688 /* 00689 * Event Types: Fixed & General Purpose 00690 */ 00691 typedef UINT32 ACPI_EVENT_TYPE; 00692 00693 /* 00694 * Fixed events 00695 */ 00696 #define ACPI_EVENT_PMTIMER 0 00697 #define ACPI_EVENT_GLOBAL 1 00698 #define ACPI_EVENT_POWER_BUTTON 2 00699 #define ACPI_EVENT_SLEEP_BUTTON 3 00700 #define ACPI_EVENT_RTC 4 00701 #define ACPI_EVENT_MAX 4 00702 #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 00703 00704 /* 00705 * Event Status - Per event 00706 * ------------- 00707 * The encoding of ACPI_EVENT_STATUS is illustrated below. 00708 * Note that a set bit (1) indicates the property is TRUE 00709 * (e.g. if bit 0 is set then the event is enabled). 00710 * +-------------+-+-+-+ 00711 * | Bits 31:3 |2|1|0| 00712 * +-------------+-+-+-+ 00713 * | | | | 00714 * | | | +- Enabled? 00715 * | | +--- Enabled for wake? 00716 * | +----- Set? 00717 * +----------- <Reserved> 00718 */ 00719 typedef UINT32 ACPI_EVENT_STATUS; 00720 00721 #define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00 00722 #define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01 00723 #define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02 00724 #define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04 00725 00726 /* 00727 * General Purpose Events (GPE) 00728 */ 00729 #define ACPI_GPE_INVALID 0xFF 00730 #define ACPI_GPE_MAX 0xFF 00731 #define ACPI_NUM_GPE 256 00732 00733 /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */ 00734 00735 #define ACPI_GPE_ENABLE 0 00736 #define ACPI_GPE_DISABLE 1 00737 #define ACPI_GPE_CONDITIONAL_ENABLE 2 00738 00739 /* 00740 * GPE info flags - Per GPE 00741 * +-------+-+-+---+ 00742 * | 7:4 |3|2|1:0| 00743 * +-------+-+-+---+ 00744 * | | | | 00745 * | | | +-- Type of dispatch:to method, handler, notify, or none 00746 * | | +----- Interrupt type: edge or level triggered 00747 * | +------- Is a Wake GPE 00748 * +------------ <Reserved> 00749 */ 00750 #define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00 00751 #define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01 00752 #define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02 00753 #define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03 00754 #define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03 00755 00756 #define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04 00757 #define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00 00758 #define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04 00759 00760 #define ACPI_GPE_CAN_WAKE (UINT8) 0x08 00761 00762 /* 00763 * Flags for GPE and Lock interfaces 00764 */ 00765 #define ACPI_NOT_ISR 0x1 00766 #define ACPI_ISR 0x0 00767 00768 00769 /* Notify types */ 00770 00771 #define ACPI_SYSTEM_NOTIFY 0x1 00772 #define ACPI_DEVICE_NOTIFY 0x2 00773 #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) 00774 #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 00775 00776 #define ACPI_MAX_SYS_NOTIFY 0x7f 00777 00778 00779 /* Address Space (Operation Region) Types */ 00780 00781 typedef UINT8 ACPI_ADR_SPACE_TYPE; 00782 00783 #define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0 00784 #define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1 00785 #define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2 00786 #define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3 00787 #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4 00788 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 00789 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 00790 #define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 00791 00792 #define ACPI_NUM_PREDEFINED_REGIONS 8 00793 00794 /* 00795 * Special Address Spaces 00796 * 00797 * Note: A Data Table region is a special type of operation region 00798 * that has its own AML opcode. However, internally, the AML 00799 * interpreter simply creates an operation region with an an address 00800 * space type of ACPI_ADR_SPACE_DATA_TABLE. 00801 */ 00802 #define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */ 00803 #define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F 00804 00805 /* Values for _REG connection code */ 00806 00807 #define ACPI_REG_DISCONNECT 0 00808 #define ACPI_REG_CONNECT 1 00809 00810 /* 00811 * BitRegister IDs 00812 * 00813 * These values are intended to be used by the hardware interfaces 00814 * and are mapped to individual bitfields defined within the ACPI 00815 * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c 00816 * for this mapping. 00817 */ 00818 00819 /* PM1 Status register */ 00820 00821 #define ACPI_BITREG_TIMER_STATUS 0x00 00822 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01 00823 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 00824 #define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 00825 #define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 00826 #define ACPI_BITREG_RT_CLOCK_STATUS 0x05 00827 #define ACPI_BITREG_WAKE_STATUS 0x06 00828 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 00829 00830 /* PM1 Enable register */ 00831 00832 #define ACPI_BITREG_TIMER_ENABLE 0x08 00833 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09 00834 #define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A 00835 #define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B 00836 #define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C 00837 #define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0D 00838 00839 /* PM1 Control register */ 00840 00841 #define ACPI_BITREG_SCI_ENABLE 0x0E 00842 #define ACPI_BITREG_BUS_MASTER_RLD 0x0F 00843 #define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10 00844 #define ACPI_BITREG_SLEEP_TYPE 0x11 00845 #define ACPI_BITREG_SLEEP_ENABLE 0x12 00846 00847 /* PM2 Control register */ 00848 00849 #define ACPI_BITREG_ARB_DISABLE 0x13 00850 00851 #define ACPI_BITREG_MAX 0x13 00852 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 00853 00854 00855 /* Status register values. A 1 clears a status bit. 0 = no effect */ 00856 00857 #define ACPI_CLEAR_STATUS 1 00858 00859 /* Enable and Control register values */ 00860 00861 #define ACPI_ENABLE_EVENT 1 00862 #define ACPI_DISABLE_EVENT 0 00863 00864 00865 /* 00866 * External ACPI object definition 00867 */ 00868 00869 /* 00870 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element 00871 * or an unresolved named reference. 00872 */ 00873 typedef union acpi_object 00874 { 00875 ACPI_OBJECT_TYPE Type; /* See definition of AcpiNsType for values */ 00876 struct 00877 { 00878 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ 00879 UINT64 Value; /* The actual number */ 00880 } Integer; 00881 00882 struct 00883 { 00884 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_STRING */ 00885 UINT32 Length; /* # of bytes in string, excluding trailing null */ 00886 char *Pointer; /* points to the string value */ 00887 } String; 00888 00889 struct 00890 { 00891 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_BUFFER */ 00892 UINT32 Length; /* # of bytes in buffer */ 00893 UINT8 *Pointer; /* points to the buffer */ 00894 } Buffer; 00895 00896 struct 00897 { 00898 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PACKAGE */ 00899 UINT32 Count; /* # of elements in package */ 00900 union acpi_object *Elements; /* Pointer to an array of ACPI_OBJECTs */ 00901 } Package; 00902 00903 struct 00904 { 00905 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_LOCAL_REFERENCE */ 00906 ACPI_OBJECT_TYPE ActualType; /* Type associated with the Handle */ 00907 ACPI_HANDLE Handle; /* object reference */ 00908 } Reference; 00909 00910 struct 00911 { 00912 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PROCESSOR */ 00913 UINT32 ProcId; 00914 ACPI_IO_ADDRESS PblkAddress; 00915 UINT32 PblkLength; 00916 } Processor; 00917 00918 struct 00919 { 00920 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_POWER */ 00921 UINT32 SystemLevel; 00922 UINT32 ResourceOrder; 00923 } PowerResource; 00924 00925 } ACPI_OBJECT; 00926 00927 00928 /* 00929 * List of objects, used as a parameter list for control method evaluation 00930 */ 00931 typedef struct acpi_object_list 00932 { 00933 UINT32 Count; 00934 ACPI_OBJECT *Pointer; 00935 00936 } ACPI_OBJECT_LIST; 00937 00938 00939 /* 00940 * Miscellaneous common Data Structures used by the interfaces 00941 */ 00942 #define ACPI_NO_BUFFER 0 00943 #define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) 00944 #define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) 00945 00946 typedef struct acpi_buffer 00947 { 00948 ACPI_SIZE Length; /* Length in bytes of the buffer */ 00949 void *Pointer; /* pointer to buffer */ 00950 00951 } ACPI_BUFFER; 00952 00953 00954 /* 00955 * NameType for AcpiGetName 00956 */ 00957 #define ACPI_FULL_PATHNAME 0 00958 #define ACPI_SINGLE_NAME 1 00959 #define ACPI_NAME_TYPE_MAX 1 00960 00961 00962 /* 00963 * Predefined Namespace items 00964 */ 00965 typedef struct acpi_predefined_names 00966 { 00967 char *Name; 00968 UINT8 Type; 00969 char *Val; 00970 00971 } ACPI_PREDEFINED_NAMES; 00972 00973 00974 /* 00975 * Structure and flags for AcpiGetSystemInfo 00976 */ 00977 #define ACPI_SYS_MODE_UNKNOWN 0x0000 00978 #define ACPI_SYS_MODE_ACPI 0x0001 00979 #define ACPI_SYS_MODE_LEGACY 0x0002 00980 #define ACPI_SYS_MODES_MASK 0x0003 00981 00982 00983 /* 00984 * System info returned by AcpiGetSystemInfo() 00985 */ 00986 typedef struct acpi_system_info 00987 { 00988 UINT32 AcpiCaVersion; 00989 UINT32 Flags; 00990 UINT32 TimerResolution; 00991 UINT32 Reserved1; 00992 UINT32 Reserved2; 00993 UINT32 DebugLevel; 00994 UINT32 DebugLayer; 00995 00996 } ACPI_SYSTEM_INFO; 00997 00998 00999 /* 01000 * System statistics returned by AcpiGetStatistics() 01001 */ 01002 typedef struct acpi_statistics 01003 { 01004 UINT32 SciCount; 01005 UINT32 GpeCount; 01006 UINT32 FixedEventCount[ACPI_NUM_FIXED_EVENTS]; 01007 UINT32 MethodCount; 01008 01009 } ACPI_STATISTICS; 01010 01011 01012 /* Table Event Types */ 01013 01014 #define ACPI_TABLE_EVENT_LOAD 0x0 01015 #define ACPI_TABLE_EVENT_UNLOAD 0x1 01016 #define ACPI_NUM_TABLE_EVENTS 2 01017 01018 01019 /* 01020 * Types specific to the OS service interfaces 01021 */ 01022 typedef UINT32 01023 (ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) ( 01024 void *Context); 01025 01026 typedef void 01027 (ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) ( 01028 void *Context); 01029 01030 /* 01031 * Various handlers and callback procedures 01032 */ 01033 typedef 01034 void (*ACPI_GBL_EVENT_HANDLER) ( 01035 UINT32 EventType, 01036 ACPI_HANDLE Device, 01037 UINT32 EventNumber, 01038 void *Context); 01039 01040 #define ACPI_EVENT_TYPE_GPE 0 01041 #define ACPI_EVENT_TYPE_FIXED 1 01042 01043 typedef 01044 UINT32 (*ACPI_EVENT_HANDLER) ( 01045 void *Context); 01046 01047 typedef 01048 UINT32 (*ACPI_GPE_HANDLER) ( 01049 ACPI_HANDLE GpeDevice, 01050 UINT32 GpeNumber, 01051 void *Context); 01052 01053 typedef 01054 void (*ACPI_NOTIFY_HANDLER) ( 01055 ACPI_HANDLE Device, 01056 UINT32 Value, 01057 void *Context); 01058 01059 typedef 01060 void (*ACPI_OBJECT_HANDLER) ( 01061 ACPI_HANDLE Object, 01062 void *Data); 01063 01064 typedef 01065 ACPI_STATUS (*ACPI_INIT_HANDLER) ( 01066 ACPI_HANDLE Object, 01067 UINT32 Function); 01068 01069 #define ACPI_INIT_DEVICE_INI 1 01070 01071 typedef 01072 ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) ( 01073 ACPI_STATUS AmlStatus, 01074 ACPI_NAME Name, 01075 UINT16 Opcode, 01076 UINT32 AmlOffset, 01077 void *Context); 01078 01079 /* Table Event handler (Load, LoadTable, etc.) and types */ 01080 01081 typedef 01082 ACPI_STATUS (*ACPI_TABLE_HANDLER) ( 01083 UINT32 Event, 01084 void *Table, 01085 void *Context); 01086 01087 #define ACPI_TABLE_LOAD 0x0 01088 #define ACPI_TABLE_UNLOAD 0x1 01089 #define ACPI_NUM_TABLE_EVENTS 2 01090 01091 01092 /* Address Spaces (For Operation Regions) */ 01093 01094 typedef 01095 ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( 01096 UINT32 Function, 01097 ACPI_PHYSICAL_ADDRESS Address, 01098 UINT32 BitWidth, 01099 UINT64 *Value, 01100 void *HandlerContext, 01101 void *RegionContext); 01102 01103 #define ACPI_DEFAULT_HANDLER NULL 01104 01105 typedef 01106 ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( 01107 ACPI_HANDLE RegionHandle, 01108 UINT32 Function, 01109 void *HandlerContext, 01110 void **RegionContext); 01111 01112 #define ACPI_REGION_ACTIVATE 0 01113 #define ACPI_REGION_DEACTIVATE 1 01114 01115 typedef 01116 ACPI_STATUS (*ACPI_WALK_CALLBACK) ( 01117 ACPI_HANDLE Object, 01118 UINT32 NestingLevel, 01119 void *Context, 01120 void **ReturnValue); 01121 01122 typedef 01123 UINT32 (*ACPI_INTERFACE_HANDLER) ( 01124 ACPI_STRING InterfaceName, 01125 UINT32 Supported); 01126 01127 01128 /* Interrupt handler return values */ 01129 01130 #define ACPI_INTERRUPT_NOT_HANDLED 0x00 01131 #define ACPI_INTERRUPT_HANDLED 0x01 01132 01133 /* GPE handler return values */ 01134 01135 #define ACPI_REENABLE_GPE 0x80 01136 01137 01138 /* Length of 32-bit EISAID values when converted back to a string */ 01139 01140 #define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ 01141 01142 /* Length of UUID (string) values */ 01143 01144 #define ACPI_UUID_LENGTH 16 01145 01146 01147 /* Structures used for device/processor HID, UID, CID */ 01148 01149 typedef struct acpi_device_id 01150 { 01151 UINT32 Length; /* Length of string + null */ 01152 char *String; 01153 01154 } ACPI_DEVICE_ID; 01155 01156 typedef struct acpi_device_id_list 01157 { 01158 UINT32 Count; /* Number of IDs in Ids array */ 01159 UINT32 ListSize; /* Size of list, including ID strings */ 01160 ACPI_DEVICE_ID Ids[1]; /* ID array */ 01161 01162 } ACPI_DEVICE_ID_LIST; 01163 01164 /* 01165 * Structure returned from AcpiGetObjectInfo. 01166 * Optimized for both 32- and 64-bit builds 01167 */ 01168 typedef struct acpi_device_info 01169 { 01170 UINT32 InfoSize; /* Size of info, including ID strings */ 01171 UINT32 Name; /* ACPI object Name */ 01172 ACPI_OBJECT_TYPE Type; /* ACPI object Type */ 01173 UINT8 ParamCount; /* If a method, required parameter count */ 01174 UINT8 Valid; /* Indicates which optional fields are valid */ 01175 UINT8 Flags; /* Miscellaneous info */ 01176 UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ 01177 UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ 01178 UINT32 CurrentStatus; /* _STA value */ 01179 UINT64 Address; /* _ADR value */ 01180 ACPI_DEVICE_ID HardwareId; /* _HID value */ 01181 ACPI_DEVICE_ID UniqueId; /* _UID value */ 01182 ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ 01183 01184 } ACPI_DEVICE_INFO; 01185 01186 /* Values for Flags field above (AcpiGetObjectInfo) */ 01187 01188 #define ACPI_PCI_ROOT_BRIDGE 0x01 01189 01190 /* Flags for Valid field above (AcpiGetObjectInfo) */ 01191 01192 #define ACPI_VALID_STA 0x01 01193 #define ACPI_VALID_ADR 0x02 01194 #define ACPI_VALID_HID 0x04 01195 #define ACPI_VALID_UID 0x08 01196 #define ACPI_VALID_CID 0x10 01197 #define ACPI_VALID_SXDS 0x20 01198 #define ACPI_VALID_SXWS 0x40 01199 01200 /* Flags for _STA method */ 01201 01202 #define ACPI_STA_DEVICE_PRESENT 0x01 01203 #define ACPI_STA_DEVICE_ENABLED 0x02 01204 #define ACPI_STA_DEVICE_UI 0x04 01205 #define ACPI_STA_DEVICE_FUNCTIONING 0x08 01206 #define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ 01207 #define ACPI_STA_BATTERY_PRESENT 0x10 01208 01209 01210 /* Context structs for address space handlers */ 01211 01212 typedef struct acpi_pci_id 01213 { 01214 UINT16 Segment; 01215 UINT16 Bus; 01216 UINT16 Device; 01217 UINT16 Function; 01218 01219 } ACPI_PCI_ID; 01220 01221 typedef struct acpi_mem_space_context 01222 { 01223 UINT32 Length; 01224 ACPI_PHYSICAL_ADDRESS Address; 01225 ACPI_PHYSICAL_ADDRESS MappedPhysicalAddress; 01226 UINT8 *MappedLogicalAddress; 01227 ACPI_SIZE MappedLength; 01228 01229 } ACPI_MEM_SPACE_CONTEXT; 01230 01231 01232 /* 01233 * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled 01234 */ 01235 typedef struct acpi_memory_list 01236 { 01237 char *ListName; 01238 void *ListHead; 01239 UINT16 ObjectSize; 01240 UINT16 MaxDepth; 01241 UINT16 CurrentDepth; 01242 UINT16 LinkOffset; 01243 01244 #ifdef ACPI_DBG_TRACK_ALLOCATIONS 01245 01246 /* Statistics for debug memory tracking only */ 01247 01248 UINT32 TotalAllocated; 01249 UINT32 TotalFreed; 01250 UINT32 MaxOccupied; 01251 UINT32 TotalSize; 01252 UINT32 CurrentTotalSize; 01253 UINT32 Requests; 01254 UINT32 Hits; 01255 #endif 01256 01257 } ACPI_MEMORY_LIST; 01258 01259 01260 #endif /* __ACTYPES_H__ */ Generated on Sun May 27 2012 04:27:20 for ReactOS by
1.7.6.1
|