Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenaclocal.h
Go to the documentation of this file.
00001 /****************************************************************************** 00002 * 00003 * Name: aclocal.h - Internal data types used across the 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 __ACLOCAL_H__ 00117 #define __ACLOCAL_H__ 00118 00119 00120 /* acpisrc:StructDefs -- for acpisrc conversion */ 00121 00122 #define ACPI_SERIALIZED 0xFF 00123 00124 typedef UINT32 ACPI_MUTEX_HANDLE; 00125 #define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1) 00126 00127 /* Total number of aml opcodes defined */ 00128 00129 #define AML_NUM_OPCODES 0x7F 00130 00131 00132 /* Forward declarations */ 00133 00134 struct acpi_walk_state; 00135 struct acpi_obj_mutex; 00136 union acpi_parse_object; 00137 00138 00139 /***************************************************************************** 00140 * 00141 * Mutex typedefs and structs 00142 * 00143 ****************************************************************************/ 00144 00145 00146 /* 00147 * Predefined handles for the mutex objects used within the subsystem 00148 * All mutex objects are automatically created by AcpiUtMutexInitialize. 00149 * 00150 * The acquire/release ordering protocol is implied via this list. Mutexes 00151 * with a lower value must be acquired before mutexes with a higher value. 00152 * 00153 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames 00154 * table below also! 00155 */ 00156 #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 00157 #define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */ 00158 #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ 00159 #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 00160 #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 00161 #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 00162 #define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */ 00163 #define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */ 00164 00165 #define ACPI_MAX_MUTEX 7 00166 #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1 00167 00168 00169 /* Lock structure for reader/writer interfaces */ 00170 00171 typedef struct acpi_rw_lock 00172 { 00173 ACPI_MUTEX WriterMutex; 00174 ACPI_MUTEX ReaderMutex; 00175 UINT32 NumReaders; 00176 00177 } ACPI_RW_LOCK; 00178 00179 00180 /* 00181 * Predefined handles for spinlocks used within the subsystem. 00182 * These spinlocks are created by AcpiUtMutexInitialize 00183 */ 00184 #define ACPI_LOCK_GPES 0 00185 #define ACPI_LOCK_HARDWARE 1 00186 00187 #define ACPI_MAX_LOCK 1 00188 #define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 00189 00190 00191 /* This Thread ID means that the mutex is not in use (unlocked) */ 00192 00193 #define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1 00194 00195 /* Table for the global mutexes */ 00196 00197 typedef struct acpi_mutex_info 00198 { 00199 ACPI_MUTEX Mutex; 00200 UINT32 UseCount; 00201 ACPI_THREAD_ID ThreadId; 00202 00203 } ACPI_MUTEX_INFO; 00204 00205 00206 /* Lock flag parameter for various interfaces */ 00207 00208 #define ACPI_MTX_DO_NOT_LOCK 0 00209 #define ACPI_MTX_LOCK 1 00210 00211 00212 /* Field access granularities */ 00213 00214 #define ACPI_FIELD_BYTE_GRANULARITY 1 00215 #define ACPI_FIELD_WORD_GRANULARITY 2 00216 #define ACPI_FIELD_DWORD_GRANULARITY 4 00217 #define ACPI_FIELD_QWORD_GRANULARITY 8 00218 00219 00220 #define ACPI_ENTRY_NOT_FOUND NULL 00221 00222 00223 /***************************************************************************** 00224 * 00225 * Namespace typedefs and structs 00226 * 00227 ****************************************************************************/ 00228 00229 /* Operational modes of the AML interpreter/scanner */ 00230 00231 typedef enum 00232 { 00233 ACPI_IMODE_LOAD_PASS1 = 0x01, 00234 ACPI_IMODE_LOAD_PASS2 = 0x02, 00235 ACPI_IMODE_EXECUTE = 0x03 00236 00237 } ACPI_INTERPRETER_MODE; 00238 00239 00240 /* 00241 * The Namespace Node describes a named object that appears in the AML. 00242 * DescriptorType is used to differentiate between internal descriptors. 00243 * 00244 * The node is optimized for both 32-bit and 64-bit platforms: 00245 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. 00246 * 00247 * Note: The DescriptorType and Type fields must appear in the identical 00248 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 00249 * structures. 00250 */ 00251 typedef struct acpi_namespace_node 00252 { 00253 union acpi_operand_object *Object; /* Interpreter object */ 00254 UINT8 DescriptorType; /* Differentiate object descriptor types */ 00255 UINT8 Type; /* ACPI Type associated with this name */ 00256 UINT8 Flags; /* Miscellaneous flags */ 00257 ACPI_OWNER_ID OwnerId; /* Node creator */ 00258 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */ 00259 struct acpi_namespace_node *Parent; /* Parent node */ 00260 struct acpi_namespace_node *Child; /* First child */ 00261 struct acpi_namespace_node *Peer; /* First peer */ 00262 00263 /* 00264 * The following fields are used by the ASL compiler and disassembler only 00265 */ 00266 #ifdef ACPI_LARGE_NAMESPACE_NODE 00267 union acpi_parse_object *Op; 00268 UINT32 Value; 00269 UINT32 Length; 00270 #endif 00271 00272 } ACPI_NAMESPACE_NODE; 00273 00274 00275 /* Namespace Node flags */ 00276 00277 #define ANOBJ_RESERVED 0x01 /* Available for use */ 00278 #define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */ 00279 #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 00280 #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 00281 #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 00282 #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ 00283 #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ 00284 00285 #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ 00286 #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ 00287 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ 00288 #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ 00289 00290 00291 /* Internal ACPI table management - master table list */ 00292 00293 typedef struct acpi_table_list 00294 { 00295 ACPI_TABLE_DESC *Tables; /* Table descriptor array */ 00296 UINT32 CurrentTableCount; /* Tables currently in the array */ 00297 UINT32 MaxTableCount; /* Max tables array will hold */ 00298 UINT8 Flags; 00299 00300 } ACPI_TABLE_LIST; 00301 00302 /* Flags for above */ 00303 00304 #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */ 00305 #define ACPI_ROOT_ORIGIN_ALLOCATED (1) 00306 #define ACPI_ROOT_ALLOW_RESIZE (2) 00307 00308 00309 /* Predefined (fixed) table indexes */ 00310 00311 #define ACPI_TABLE_INDEX_DSDT (0) 00312 #define ACPI_TABLE_INDEX_FACS (1) 00313 00314 00315 typedef struct acpi_find_context 00316 { 00317 char *SearchFor; 00318 ACPI_HANDLE *List; 00319 UINT32 *Count; 00320 00321 } ACPI_FIND_CONTEXT; 00322 00323 00324 typedef struct acpi_ns_search_data 00325 { 00326 ACPI_NAMESPACE_NODE *Node; 00327 00328 } ACPI_NS_SEARCH_DATA; 00329 00330 00331 /* Object types used during package copies */ 00332 00333 #define ACPI_COPY_TYPE_SIMPLE 0 00334 #define ACPI_COPY_TYPE_PACKAGE 1 00335 00336 00337 /* Info structure used to convert external<->internal namestrings */ 00338 00339 typedef struct acpi_namestring_info 00340 { 00341 const char *ExternalName; 00342 const char *NextExternalChar; 00343 char *InternalName; 00344 UINT32 Length; 00345 UINT32 NumSegments; 00346 UINT32 NumCarats; 00347 BOOLEAN FullyQualified; 00348 00349 } ACPI_NAMESTRING_INFO; 00350 00351 00352 /* Field creation info */ 00353 00354 typedef struct acpi_create_field_info 00355 { 00356 ACPI_NAMESPACE_NODE *RegionNode; 00357 ACPI_NAMESPACE_NODE *FieldNode; 00358 ACPI_NAMESPACE_NODE *RegisterNode; 00359 ACPI_NAMESPACE_NODE *DataRegisterNode; 00360 UINT32 BankValue; 00361 UINT32 FieldBitPosition; 00362 UINT32 FieldBitLength; 00363 UINT8 FieldFlags; 00364 UINT8 Attribute; 00365 UINT8 FieldType; 00366 00367 } ACPI_CREATE_FIELD_INFO; 00368 00369 00370 typedef 00371 ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( 00372 struct acpi_walk_state *WalkState); 00373 00374 00375 /* 00376 * Bitmapped ACPI types. Used internally only 00377 */ 00378 #define ACPI_BTYPE_ANY 0x00000000 00379 #define ACPI_BTYPE_INTEGER 0x00000001 00380 #define ACPI_BTYPE_STRING 0x00000002 00381 #define ACPI_BTYPE_BUFFER 0x00000004 00382 #define ACPI_BTYPE_PACKAGE 0x00000008 00383 #define ACPI_BTYPE_FIELD_UNIT 0x00000010 00384 #define ACPI_BTYPE_DEVICE 0x00000020 00385 #define ACPI_BTYPE_EVENT 0x00000040 00386 #define ACPI_BTYPE_METHOD 0x00000080 00387 #define ACPI_BTYPE_MUTEX 0x00000100 00388 #define ACPI_BTYPE_REGION 0x00000200 00389 #define ACPI_BTYPE_POWER 0x00000400 00390 #define ACPI_BTYPE_PROCESSOR 0x00000800 00391 #define ACPI_BTYPE_THERMAL 0x00001000 00392 #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 00393 #define ACPI_BTYPE_DDB_HANDLE 0x00004000 00394 #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 00395 #define ACPI_BTYPE_REFERENCE 0x00010000 00396 #define ACPI_BTYPE_RESOURCE 0x00020000 00397 00398 #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) 00399 00400 #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 00401 #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE) 00402 #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 00403 #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 00404 #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 00405 00406 00407 /* 00408 * Information structure for ACPI predefined names. 00409 * Each entry in the table contains the following items: 00410 * 00411 * Name - The ACPI reserved name 00412 * ParamCount - Number of arguments to the method 00413 * ExpectedReturnBtypes - Allowed type(s) for the return value 00414 */ 00415 typedef struct acpi_name_info 00416 { 00417 char Name[ACPI_NAME_SIZE]; 00418 UINT8 ParamCount; 00419 UINT8 ExpectedBtypes; 00420 00421 } ACPI_NAME_INFO; 00422 00423 /* 00424 * Secondary information structures for ACPI predefined objects that return 00425 * package objects. This structure appears as the next entry in the table 00426 * after the NAME_INFO structure above. 00427 * 00428 * The reason for this is to minimize the size of the predefined name table. 00429 */ 00430 00431 /* 00432 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 00433 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT 00434 */ 00435 typedef struct acpi_package_info 00436 { 00437 UINT8 Type; 00438 UINT8 ObjectType1; 00439 UINT8 Count1; 00440 UINT8 ObjectType2; 00441 UINT8 Count2; 00442 UINT8 Reserved; 00443 00444 } ACPI_PACKAGE_INFO; 00445 00446 /* Used for ACPI_PTYPE2_FIXED */ 00447 00448 typedef struct acpi_package_info2 00449 { 00450 UINT8 Type; 00451 UINT8 Count; 00452 UINT8 ObjectType[4]; 00453 00454 } ACPI_PACKAGE_INFO2; 00455 00456 /* Used for ACPI_PTYPE1_OPTION */ 00457 00458 typedef struct acpi_package_info3 00459 { 00460 UINT8 Type; 00461 UINT8 Count; 00462 UINT8 ObjectType[2]; 00463 UINT8 TailObjectType; 00464 UINT8 Reserved; 00465 00466 } ACPI_PACKAGE_INFO3; 00467 00468 typedef union acpi_predefined_info 00469 { 00470 ACPI_NAME_INFO Info; 00471 ACPI_PACKAGE_INFO RetInfo; 00472 ACPI_PACKAGE_INFO2 RetInfo2; 00473 ACPI_PACKAGE_INFO3 RetInfo3; 00474 00475 } ACPI_PREDEFINED_INFO; 00476 00477 00478 /* Data block used during object validation */ 00479 00480 typedef struct acpi_predefined_data 00481 { 00482 char *Pathname; 00483 const ACPI_PREDEFINED_INFO *Predefined; 00484 union acpi_operand_object *ParentPackage; 00485 ACPI_NAMESPACE_NODE *Node; 00486 UINT32 Flags; 00487 UINT8 NodeFlags; 00488 00489 } ACPI_PREDEFINED_DATA; 00490 00491 /* Defines for Flags field above */ 00492 00493 #define ACPI_OBJECT_REPAIRED 1 00494 00495 00496 /* 00497 * Bitmapped return value types 00498 * Note: the actual data types must be contiguous, a loop in nspredef.c 00499 * depends on this. 00500 */ 00501 #define ACPI_RTYPE_ANY 0x00 00502 #define ACPI_RTYPE_NONE 0x01 00503 #define ACPI_RTYPE_INTEGER 0x02 00504 #define ACPI_RTYPE_STRING 0x04 00505 #define ACPI_RTYPE_BUFFER 0x08 00506 #define ACPI_RTYPE_PACKAGE 0x10 00507 #define ACPI_RTYPE_REFERENCE 0x20 00508 #define ACPI_RTYPE_ALL 0x3F 00509 00510 #define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 00511 00512 00513 /***************************************************************************** 00514 * 00515 * Event typedefs and structs 00516 * 00517 ****************************************************************************/ 00518 00519 /* Dispatch info for each GPE -- either a method or handler, cannot be both */ 00520 00521 typedef struct acpi_gpe_handler_info 00522 { 00523 ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 00524 void *Context; /* Context to be passed to handler */ 00525 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 00526 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 00527 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 00528 00529 } ACPI_GPE_HANDLER_INFO; 00530 00531 /* 00532 * GPE dispatch info. At any time, the GPE can have at most one type 00533 * of dispatch - Method, Handler, or Implicit Notify. 00534 */ 00535 typedef union acpi_gpe_dispatch_info 00536 { 00537 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 00538 struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */ 00539 ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */ 00540 00541 } ACPI_GPE_DISPATCH_INFO; 00542 00543 /* 00544 * Information about a GPE, one per each GPE in an array. 00545 * NOTE: Important to keep this struct as small as possible. 00546 */ 00547 typedef struct acpi_gpe_event_info 00548 { 00549 union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */ 00550 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 00551 UINT8 Flags; /* Misc info about this GPE */ 00552 UINT8 GpeNumber; /* This GPE */ 00553 UINT8 RuntimeCount; /* References to a run GPE */ 00554 00555 } ACPI_GPE_EVENT_INFO; 00556 00557 /* Information about a GPE register pair, one per each status/enable pair in an array */ 00558 00559 typedef struct acpi_gpe_register_info 00560 { 00561 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 00562 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 00563 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 00564 UINT8 EnableForRun; /* GPEs to keep enabled when running */ 00565 UINT8 BaseGpeNumber; /* Base GPE number for this register */ 00566 00567 } ACPI_GPE_REGISTER_INFO; 00568 00569 /* 00570 * Information about a GPE register block, one per each installed block -- 00571 * GPE0, GPE1, and one per each installed GPE Block Device. 00572 */ 00573 typedef struct acpi_gpe_block_info 00574 { 00575 ACPI_NAMESPACE_NODE *Node; 00576 struct acpi_gpe_block_info *Previous; 00577 struct acpi_gpe_block_info *Next; 00578 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 00579 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 00580 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 00581 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */ 00582 UINT32 RegisterCount; /* Number of register pairs in block */ 00583 UINT16 GpeCount; /* Number of individual GPEs in block */ 00584 UINT8 BlockBaseNumber;/* Base GPE number for this block */ 00585 BOOLEAN Initialized; /* TRUE if this block is initialized */ 00586 00587 } ACPI_GPE_BLOCK_INFO; 00588 00589 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 00590 00591 typedef struct acpi_gpe_xrupt_info 00592 { 00593 struct acpi_gpe_xrupt_info *Previous; 00594 struct acpi_gpe_xrupt_info *Next; 00595 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 00596 UINT32 InterruptNumber; /* System interrupt number */ 00597 00598 } ACPI_GPE_XRUPT_INFO; 00599 00600 typedef struct acpi_gpe_walk_info 00601 { 00602 ACPI_NAMESPACE_NODE *GpeDevice; 00603 ACPI_GPE_BLOCK_INFO *GpeBlock; 00604 UINT16 Count; 00605 ACPI_OWNER_ID OwnerId; 00606 BOOLEAN ExecuteByOwnerId; 00607 00608 } ACPI_GPE_WALK_INFO; 00609 00610 typedef struct acpi_gpe_device_info 00611 { 00612 UINT32 Index; 00613 UINT32 NextBlockBaseIndex; 00614 ACPI_STATUS Status; 00615 ACPI_NAMESPACE_NODE *GpeDevice; 00616 00617 } ACPI_GPE_DEVICE_INFO; 00618 00619 typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 00620 ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 00621 ACPI_GPE_BLOCK_INFO *GpeBlock, 00622 void *Context); 00623 00624 00625 /* Information about each particular fixed event */ 00626 00627 typedef struct acpi_fixed_event_handler 00628 { 00629 ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 00630 void *Context; /* Context to be passed to handler */ 00631 00632 } ACPI_FIXED_EVENT_HANDLER; 00633 00634 typedef struct acpi_fixed_event_info 00635 { 00636 UINT8 StatusRegisterId; 00637 UINT8 EnableRegisterId; 00638 UINT16 StatusBitMask; 00639 UINT16 EnableBitMask; 00640 00641 } ACPI_FIXED_EVENT_INFO; 00642 00643 /* Information used during field processing */ 00644 00645 typedef struct acpi_field_info 00646 { 00647 UINT8 SkipField; 00648 UINT8 FieldFlag; 00649 UINT32 PkgLength; 00650 00651 } ACPI_FIELD_INFO; 00652 00653 00654 /***************************************************************************** 00655 * 00656 * Generic "state" object for stacks 00657 * 00658 ****************************************************************************/ 00659 00660 #define ACPI_CONTROL_NORMAL 0xC0 00661 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 00662 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 00663 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 00664 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 00665 00666 00667 #define ACPI_STATE_COMMON \ 00668 void *Next; \ 00669 UINT8 DescriptorType; /* To differentiate various internal objs */\ 00670 UINT8 Flags; \ 00671 UINT16 Value; \ 00672 UINT16 State; 00673 00674 /* There are 2 bytes available here until the next natural alignment boundary */ 00675 00676 typedef struct acpi_common_state 00677 { 00678 ACPI_STATE_COMMON 00679 } ACPI_COMMON_STATE; 00680 00681 00682 /* 00683 * Update state - used to traverse complex objects such as packages 00684 */ 00685 typedef struct acpi_update_state 00686 { 00687 ACPI_STATE_COMMON 00688 union acpi_operand_object *Object; 00689 00690 } ACPI_UPDATE_STATE; 00691 00692 00693 /* 00694 * Pkg state - used to traverse nested package structures 00695 */ 00696 typedef struct acpi_pkg_state 00697 { 00698 ACPI_STATE_COMMON 00699 UINT16 Index; 00700 union acpi_operand_object *SourceObject; 00701 union acpi_operand_object *DestObject; 00702 struct acpi_walk_state *WalkState; 00703 void *ThisTargetObj; 00704 UINT32 NumPackages; 00705 00706 } ACPI_PKG_STATE; 00707 00708 00709 /* 00710 * Control state - one per if/else and while constructs. 00711 * Allows nesting of these constructs 00712 */ 00713 typedef struct acpi_control_state 00714 { 00715 ACPI_STATE_COMMON 00716 UINT16 Opcode; 00717 union acpi_parse_object *PredicateOp; 00718 UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 00719 UINT8 *PackageEnd; /* End of if/while block */ 00720 UINT32 LoopCount; /* While() loop counter */ 00721 00722 } ACPI_CONTROL_STATE; 00723 00724 00725 /* 00726 * Scope state - current scope during namespace lookups 00727 */ 00728 typedef struct acpi_scope_state 00729 { 00730 ACPI_STATE_COMMON 00731 ACPI_NAMESPACE_NODE *Node; 00732 00733 } ACPI_SCOPE_STATE; 00734 00735 00736 typedef struct acpi_pscope_state 00737 { 00738 ACPI_STATE_COMMON 00739 UINT32 ArgCount; /* Number of fixed arguments */ 00740 union acpi_parse_object *Op; /* Current op being parsed */ 00741 UINT8 *ArgEnd; /* Current argument end */ 00742 UINT8 *PkgEnd; /* Current package end */ 00743 UINT32 ArgList; /* Next argument to parse */ 00744 00745 } ACPI_PSCOPE_STATE; 00746 00747 00748 /* 00749 * Thread state - one per thread across multiple walk states. Multiple walk 00750 * states are created when there are nested control methods executing. 00751 */ 00752 typedef struct acpi_thread_state 00753 { 00754 ACPI_STATE_COMMON 00755 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 00756 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 00757 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 00758 ACPI_THREAD_ID ThreadId; /* Running thread ID */ 00759 00760 } ACPI_THREAD_STATE; 00761 00762 00763 /* 00764 * Result values - used to accumulate the results of nested 00765 * AML arguments 00766 */ 00767 typedef struct acpi_result_values 00768 { 00769 ACPI_STATE_COMMON 00770 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 00771 00772 } ACPI_RESULT_VALUES; 00773 00774 00775 typedef 00776 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 00777 struct acpi_walk_state *WalkState, 00778 union acpi_parse_object **OutOp); 00779 00780 typedef 00781 ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 00782 struct acpi_walk_state *WalkState); 00783 00784 00785 /* 00786 * Notify info - used to pass info to the deferred notify 00787 * handler/dispatcher. 00788 */ 00789 typedef struct acpi_notify_info 00790 { 00791 ACPI_STATE_COMMON 00792 ACPI_NAMESPACE_NODE *Node; 00793 union acpi_operand_object *HandlerObj; 00794 00795 } ACPI_NOTIFY_INFO; 00796 00797 00798 /* Generic state is union of structs above */ 00799 00800 typedef union acpi_generic_state 00801 { 00802 ACPI_COMMON_STATE Common; 00803 ACPI_CONTROL_STATE Control; 00804 ACPI_UPDATE_STATE Update; 00805 ACPI_SCOPE_STATE Scope; 00806 ACPI_PSCOPE_STATE ParseScope; 00807 ACPI_PKG_STATE Pkg; 00808 ACPI_THREAD_STATE Thread; 00809 ACPI_RESULT_VALUES Results; 00810 ACPI_NOTIFY_INFO Notify; 00811 00812 } ACPI_GENERIC_STATE; 00813 00814 00815 /***************************************************************************** 00816 * 00817 * Interpreter typedefs and structs 00818 * 00819 ****************************************************************************/ 00820 00821 typedef 00822 ACPI_STATUS (*ACPI_EXECUTE_OP) ( 00823 struct acpi_walk_state *WalkState); 00824 00825 00826 /***************************************************************************** 00827 * 00828 * Parser typedefs and structs 00829 * 00830 ****************************************************************************/ 00831 00832 /* 00833 * AML opcode, name, and argument layout 00834 */ 00835 typedef struct acpi_opcode_info 00836 { 00837 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 00838 char *Name; /* Opcode name (disassembler/debug only) */ 00839 #endif 00840 UINT32 ParseArgs; /* Grammar/Parse time arguments */ 00841 UINT32 RuntimeArgs; /* Interpret time arguments */ 00842 UINT16 Flags; /* Misc flags */ 00843 UINT8 ObjectType; /* Corresponding internal object type */ 00844 UINT8 Class; /* Opcode class */ 00845 UINT8 Type; /* Opcode type */ 00846 00847 } ACPI_OPCODE_INFO; 00848 00849 /* Structure for Resource Tag information */ 00850 00851 typedef struct acpi_tag_info 00852 { 00853 UINT32 BitOffset; 00854 UINT32 BitLength; 00855 00856 } ACPI_TAG_INFO; 00857 00858 /* Value associated with the parse object */ 00859 00860 typedef union acpi_parse_value 00861 { 00862 UINT64 Integer; /* Integer constant (Up to 64 bits) */ 00863 UINT32 Size; /* bytelist or field size */ 00864 char *String; /* NULL terminated string */ 00865 UINT8 *Buffer; /* buffer or string */ 00866 char *Name; /* NULL terminated string */ 00867 union acpi_parse_object *Arg; /* arguments and contained ops */ 00868 ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 00869 00870 } ACPI_PARSE_VALUE; 00871 00872 00873 #ifdef ACPI_DISASSEMBLER 00874 #define ACPI_DISASM_ONLY_MEMBERS(a) a; 00875 #else 00876 #define ACPI_DISASM_ONLY_MEMBERS(a) 00877 #endif 00878 00879 #define ACPI_PARSE_COMMON \ 00880 union acpi_parse_object *Parent; /* Parent op */\ 00881 UINT8 DescriptorType; /* To differentiate various internal objs */\ 00882 UINT8 Flags; /* Type of Op */\ 00883 UINT16 AmlOpcode; /* AML opcode */\ 00884 UINT32 AmlOffset; /* Offset of declaration in AML */\ 00885 union acpi_parse_object *Next; /* Next op */\ 00886 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 00887 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 00888 UINT8 ArgListLength; /* Number of elements in the arg list */\ 00889 ACPI_DISASM_ONLY_MEMBERS (\ 00890 UINT8 DisasmFlags; /* Used during AML disassembly */\ 00891 UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 00892 char AmlOpName[16]) /* Op name (debug only) */ 00893 00894 00895 #define ACPI_DASM_BUFFER 0x00 00896 #define ACPI_DASM_RESOURCE 0x01 00897 #define ACPI_DASM_STRING 0x02 00898 #define ACPI_DASM_UNICODE 0x03 00899 #define ACPI_DASM_EISAID 0x04 00900 #define ACPI_DASM_MATCHOP 0x05 00901 #define ACPI_DASM_LNOT_PREFIX 0x06 00902 #define ACPI_DASM_LNOT_SUFFIX 0x07 00903 #define ACPI_DASM_IGNORE 0x08 00904 00905 /* 00906 * Generic operation (for example: If, While, Store) 00907 */ 00908 typedef struct acpi_parse_obj_common 00909 { 00910 ACPI_PARSE_COMMON 00911 } ACPI_PARSE_OBJ_COMMON; 00912 00913 00914 /* 00915 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 00916 * and bytelists. 00917 */ 00918 typedef struct acpi_parse_obj_named 00919 { 00920 ACPI_PARSE_COMMON 00921 UINT8 *Path; 00922 UINT8 *Data; /* AML body or bytelist data */ 00923 UINT32 Length; /* AML length */ 00924 UINT32 Name; /* 4-byte name or zero if no name */ 00925 00926 } ACPI_PARSE_OBJ_NAMED; 00927 00928 00929 /* This version is used by the iASL compiler only */ 00930 00931 #define ACPI_MAX_PARSEOP_NAME 20 00932 00933 typedef struct acpi_parse_obj_asl 00934 { 00935 ACPI_PARSE_COMMON 00936 union acpi_parse_object *Child; 00937 union acpi_parse_object *ParentMethod; 00938 char *Filename; 00939 char *ExternalName; 00940 char *Namepath; 00941 char NameSeg[4]; 00942 UINT32 ExtraValue; 00943 UINT32 Column; 00944 UINT32 LineNumber; 00945 UINT32 LogicalLineNumber; 00946 UINT32 LogicalByteOffset; 00947 UINT32 EndLine; 00948 UINT32 EndLogicalLine; 00949 UINT32 AcpiBtype; 00950 UINT32 AmlLength; 00951 UINT32 AmlSubtreeLength; 00952 UINT32 FinalAmlLength; 00953 UINT32 FinalAmlOffset; 00954 UINT32 CompileFlags; 00955 UINT16 ParseOpcode; 00956 UINT8 AmlOpcodeLength; 00957 UINT8 AmlPkgLenBytes; 00958 UINT8 Extra; 00959 char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 00960 00961 } ACPI_PARSE_OBJ_ASL; 00962 00963 typedef union acpi_parse_object 00964 { 00965 ACPI_PARSE_OBJ_COMMON Common; 00966 ACPI_PARSE_OBJ_NAMED Named; 00967 ACPI_PARSE_OBJ_ASL Asl; 00968 00969 } ACPI_PARSE_OBJECT; 00970 00971 00972 /* 00973 * Parse state - one state per parser invocation and each control 00974 * method. 00975 */ 00976 typedef struct acpi_parse_state 00977 { 00978 UINT8 *AmlStart; /* First AML byte */ 00979 UINT8 *Aml; /* Next AML byte */ 00980 UINT8 *AmlEnd; /* (last + 1) AML byte */ 00981 UINT8 *PkgStart; /* Current package begin */ 00982 UINT8 *PkgEnd; /* Current package end */ 00983 union acpi_parse_object *StartOp; /* Root of parse tree */ 00984 struct acpi_namespace_node *StartNode; 00985 union acpi_generic_state *Scope; /* Current scope */ 00986 union acpi_parse_object *StartScope; 00987 UINT32 AmlSize; 00988 00989 } ACPI_PARSE_STATE; 00990 00991 00992 /* Parse object flags */ 00993 00994 #define ACPI_PARSEOP_GENERIC 0x01 00995 #define ACPI_PARSEOP_NAMED 0x02 00996 #define ACPI_PARSEOP_DEFERRED 0x04 00997 #define ACPI_PARSEOP_BYTELIST 0x08 00998 #define ACPI_PARSEOP_IN_STACK 0x10 00999 #define ACPI_PARSEOP_TARGET 0x20 01000 #define ACPI_PARSEOP_IN_CACHE 0x80 01001 01002 /* Parse object DisasmFlags */ 01003 01004 #define ACPI_PARSEOP_IGNORE 0x01 01005 #define ACPI_PARSEOP_PARAMLIST 0x02 01006 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 01007 #define ACPI_PARSEOP_SPECIAL 0x10 01008 01009 01010 /***************************************************************************** 01011 * 01012 * Hardware (ACPI registers) and PNP 01013 * 01014 ****************************************************************************/ 01015 01016 typedef struct acpi_bit_register_info 01017 { 01018 UINT8 ParentRegister; 01019 UINT8 BitPosition; 01020 UINT16 AccessBitMask; 01021 01022 } ACPI_BIT_REGISTER_INFO; 01023 01024 01025 /* 01026 * Some ACPI registers have bits that must be ignored -- meaning that they 01027 * must be preserved. 01028 */ 01029 #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 01030 01031 /* Write-only bits must be zeroed by software */ 01032 01033 #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 01034 01035 /* For control registers, both ignored and reserved bits must be preserved */ 01036 01037 /* 01038 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 01039 * ACPI specification to be a "preserved" bit - "OSPM always preserves this 01040 * bit position", section 4.7.3.2.1. However, on some machines the OS must 01041 * write a one to this bit after resume for the machine to work properly. 01042 * To enable this, we no longer attempt to preserve this bit. No machines 01043 * are known to fail if the bit is not preserved. (May 2009) 01044 */ 01045 #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 01046 #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 01047 #define ACPI_PM1_CONTROL_PRESERVED_BITS \ 01048 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 01049 01050 #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 01051 01052 /* 01053 * Register IDs 01054 * These are the full ACPI registers 01055 */ 01056 #define ACPI_REGISTER_PM1_STATUS 0x01 01057 #define ACPI_REGISTER_PM1_ENABLE 0x02 01058 #define ACPI_REGISTER_PM1_CONTROL 0x03 01059 #define ACPI_REGISTER_PM2_CONTROL 0x04 01060 #define ACPI_REGISTER_PM_TIMER 0x05 01061 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 01062 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 01063 01064 01065 /* Masks used to access the BitRegisters */ 01066 01067 #define ACPI_BITMASK_TIMER_STATUS 0x0001 01068 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 01069 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 01070 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 01071 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 01072 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 01073 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 01074 #define ACPI_BITMASK_WAKE_STATUS 0x8000 01075 01076 #define ACPI_BITMASK_ALL_FIXED_STATUS (\ 01077 ACPI_BITMASK_TIMER_STATUS | \ 01078 ACPI_BITMASK_BUS_MASTER_STATUS | \ 01079 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 01080 ACPI_BITMASK_POWER_BUTTON_STATUS | \ 01081 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 01082 ACPI_BITMASK_RT_CLOCK_STATUS | \ 01083 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 01084 ACPI_BITMASK_WAKE_STATUS) 01085 01086 #define ACPI_BITMASK_TIMER_ENABLE 0x0001 01087 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 01088 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 01089 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 01090 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 01091 #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 01092 01093 #define ACPI_BITMASK_SCI_ENABLE 0x0001 01094 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 01095 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 01096 #define ACPI_BITMASK_SLEEP_TYPE 0x1C00 01097 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000 01098 01099 #define ACPI_BITMASK_ARB_DISABLE 0x0001 01100 01101 01102 /* Raw bit position of each BitRegister */ 01103 01104 #define ACPI_BITPOSITION_TIMER_STATUS 0x00 01105 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 01106 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 01107 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 01108 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 01109 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 01110 #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 01111 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F 01112 01113 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 01114 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 01115 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 01116 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 01117 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 01118 #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 01119 01120 #define ACPI_BITPOSITION_SCI_ENABLE 0x00 01121 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 01122 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 01123 #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 01124 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 01125 01126 #define ACPI_BITPOSITION_ARB_DISABLE 0x00 01127 01128 01129 /* Structs and definitions for _OSI support and I/O port validation */ 01130 01131 #define ACPI_OSI_WIN_2000 0x01 01132 #define ACPI_OSI_WIN_XP 0x02 01133 #define ACPI_OSI_WIN_XP_SP1 0x03 01134 #define ACPI_OSI_WINSRV_2003 0x04 01135 #define ACPI_OSI_WIN_XP_SP2 0x05 01136 #define ACPI_OSI_WINSRV_2003_SP1 0x06 01137 #define ACPI_OSI_WIN_VISTA 0x07 01138 #define ACPI_OSI_WINSRV_2008 0x08 01139 #define ACPI_OSI_WIN_VISTA_SP1 0x09 01140 #define ACPI_OSI_WIN_VISTA_SP2 0x0A 01141 #define ACPI_OSI_WIN_7 0x0B 01142 01143 #define ACPI_ALWAYS_ILLEGAL 0x00 01144 01145 typedef struct acpi_interface_info 01146 { 01147 char *Name; 01148 struct acpi_interface_info *Next; 01149 UINT8 Flags; 01150 UINT8 Value; 01151 01152 } ACPI_INTERFACE_INFO; 01153 01154 #define ACPI_OSI_INVALID 0x01 01155 #define ACPI_OSI_DYNAMIC 0x02 01156 01157 typedef struct acpi_port_info 01158 { 01159 char *Name; 01160 UINT16 Start; 01161 UINT16 End; 01162 UINT8 OsiDependency; 01163 01164 } ACPI_PORT_INFO; 01165 01166 01167 /***************************************************************************** 01168 * 01169 * Resource descriptors 01170 * 01171 ****************************************************************************/ 01172 01173 /* ResourceType values */ 01174 01175 #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 01176 #define ACPI_ADDRESS_TYPE_IO_RANGE 1 01177 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 01178 01179 /* Resource descriptor types and masks */ 01180 01181 #define ACPI_RESOURCE_NAME_LARGE 0x80 01182 #define ACPI_RESOURCE_NAME_SMALL 0x00 01183 01184 #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 01185 #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 01186 #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 01187 01188 01189 /* 01190 * Small resource descriptor "names" as defined by the ACPI specification. 01191 * Note: Bits 2:0 are used for the descriptor length 01192 */ 01193 #define ACPI_RESOURCE_NAME_IRQ 0x20 01194 #define ACPI_RESOURCE_NAME_DMA 0x28 01195 #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 01196 #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 01197 #define ACPI_RESOURCE_NAME_IO 0x40 01198 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 01199 #define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 01200 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 01201 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 01202 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 01203 #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 01204 #define ACPI_RESOURCE_NAME_END_TAG 0x78 01205 01206 /* 01207 * Large resource descriptor "names" as defined by the ACPI specification. 01208 * Note: includes the Large Descriptor bit in bit[7] 01209 */ 01210 #define ACPI_RESOURCE_NAME_MEMORY24 0x81 01211 #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 01212 #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 01213 #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 01214 #define ACPI_RESOURCE_NAME_MEMORY32 0x85 01215 #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 01216 #define ACPI_RESOURCE_NAME_ADDRESS32 0x87 01217 #define ACPI_RESOURCE_NAME_ADDRESS16 0x88 01218 #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 01219 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 01220 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 01221 #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B 01222 01223 01224 /***************************************************************************** 01225 * 01226 * Miscellaneous 01227 * 01228 ****************************************************************************/ 01229 01230 #define ACPI_ASCII_ZERO 0x30 01231 01232 01233 /***************************************************************************** 01234 * 01235 * Disassembler 01236 * 01237 ****************************************************************************/ 01238 01239 typedef struct acpi_external_list 01240 { 01241 char *Path; 01242 char *InternalPath; 01243 struct acpi_external_list *Next; 01244 UINT32 Value; 01245 UINT16 Length; 01246 UINT8 Type; 01247 UINT8 Flags; 01248 01249 } ACPI_EXTERNAL_LIST; 01250 01251 /* Values for Flags field above */ 01252 01253 #define ACPI_IPATH_ALLOCATED 0x01 01254 01255 01256 typedef struct acpi_external_file 01257 { 01258 char *Path; 01259 struct acpi_external_file *Next; 01260 01261 } ACPI_EXTERNAL_FILE; 01262 01263 01264 /***************************************************************************** 01265 * 01266 * Debugger 01267 * 01268 ****************************************************************************/ 01269 01270 typedef struct acpi_db_method_info 01271 { 01272 ACPI_HANDLE MainThreadGate; 01273 ACPI_HANDLE ThreadCompleteGate; 01274 ACPI_HANDLE InfoGate; 01275 ACPI_THREAD_ID *Threads; 01276 UINT32 NumThreads; 01277 UINT32 NumCreated; 01278 UINT32 NumCompleted; 01279 01280 char *Name; 01281 UINT32 Flags; 01282 UINT32 NumLoops; 01283 char Pathname[128]; 01284 char **Args; 01285 ACPI_OBJECT_TYPE *Types; 01286 01287 /* 01288 * Arguments to be passed to method for the command 01289 * Threads - 01290 * the Number of threads, ID of current thread and 01291 * Index of current thread inside all them created. 01292 */ 01293 char InitArgs; 01294 ACPI_OBJECT_TYPE ArgTypes[4]; 01295 char *Arguments[4]; 01296 char NumThreadsStr[11]; 01297 char IdOfThreadStr[11]; 01298 char IndexOfThreadStr[11]; 01299 01300 } ACPI_DB_METHOD_INFO; 01301 01302 typedef struct acpi_integrity_info 01303 { 01304 UINT32 Nodes; 01305 UINT32 Objects; 01306 01307 } ACPI_INTEGRITY_INFO; 01308 01309 01310 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 01311 #define ACPI_DB_CONSOLE_OUTPUT 0x02 01312 #define ACPI_DB_DUPLICATE_OUTPUT 0x03 01313 01314 01315 /***************************************************************************** 01316 * 01317 * Debug 01318 * 01319 ****************************************************************************/ 01320 01321 /* Entry for a memory allocation (debug only) */ 01322 01323 #define ACPI_MEM_MALLOC 0 01324 #define ACPI_MEM_CALLOC 1 01325 #define ACPI_MAX_MODULE_NAME 16 01326 01327 #define ACPI_COMMON_DEBUG_MEM_HEADER \ 01328 struct acpi_debug_mem_block *Previous; \ 01329 struct acpi_debug_mem_block *Next; \ 01330 UINT32 Size; \ 01331 UINT32 Component; \ 01332 UINT32 Line; \ 01333 char Module[ACPI_MAX_MODULE_NAME]; \ 01334 UINT8 AllocType; 01335 01336 typedef struct acpi_debug_mem_header 01337 { 01338 ACPI_COMMON_DEBUG_MEM_HEADER 01339 01340 } ACPI_DEBUG_MEM_HEADER; 01341 01342 typedef struct acpi_debug_mem_block 01343 { 01344 ACPI_COMMON_DEBUG_MEM_HEADER 01345 UINT64 UserSpace; 01346 01347 } ACPI_DEBUG_MEM_BLOCK; 01348 01349 01350 #define ACPI_MEM_LIST_GLOBAL 0 01351 #define ACPI_MEM_LIST_NSNODE 1 01352 #define ACPI_MEM_LIST_MAX 1 01353 #define ACPI_NUM_MEM_LISTS 2 01354 01355 01356 #endif /* __ACLOCAL_H__ */ Generated on Sun May 27 2012 04:27:18 for ReactOS by
1.7.6.1
|