acstruct.h revision 129684
1127664Sbms/****************************************************************************** 2127664Sbms * 3127664Sbms * Name: acstruct.h - Internal structs 4127664Sbms * $Revision: 28 $ 5127664Sbms * 6127664Sbms *****************************************************************************/ 7127664Sbms 8127664Sbms/****************************************************************************** 9127664Sbms * 10127664Sbms * 1. Copyright Notice 11127664Sbms * 12146768Ssam * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp. 13162012Ssam * All rights reserved. 14162012Ssam * 15162012Ssam * 2. License 16127664Sbms * 17127664Sbms * 2.1. This is your license from Intel Corp. under its intellectual property 18127664Sbms * rights. You may have additional license terms from the party that provided 19127664Sbms * you this software, covering your right to use that party's intellectual 20127664Sbms * property rights. 21127664Sbms * 22127664Sbms * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23127664Sbms * copy of the source code appearing in this file ("Covered Code") an 24127664Sbms * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25127664Sbms * base code distributed originally by Intel ("Original Intel Code") to copy, 26127664Sbms * make derivatives, distribute, use and display any portion of the Covered 27127664Sbms * Code in any form, with the right to sublicense such rights; and 28127664Sbms * 29127664Sbms * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30127664Sbms * license (with the right to sublicense), under only those claims of Intel 31127664Sbms * patents that are infringed by the Original Intel Code, to make, use, sell, 32127664Sbms * offer to sell, and import the Covered Code and derivative works thereof 33127664Sbms * solely to the minimum extent necessary to exercise the above copyright 34127664Sbms * license, and in no event shall the patent license extend to any additions 35127664Sbms * to or modifications of the Original Intel Code. No other license or right 36127664Sbms * is granted directly or by implication, estoppel or otherwise; 37127664Sbms * 38127664Sbms * The above copyright and patent license is granted only if the following 39127664Sbms * conditions are met: 40127664Sbms * 41146768Ssam * 3. Conditions 42146768Ssam * 43127664Sbms * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44190225Srpaulo * Redistribution of source code of any substantial portion of the Covered 45190225Srpaulo * Code or modification with rights to further distribute source must include 46251129Sdelphij * the above Copyright Notice, the above License, this list of Conditions, 47251129Sdelphij * and the following Disclaimer and Export Compliance provision. In addition, 48276768Sdelphij * Licensee must cause all Covered Code to which Licensee contributes to 49276768Sdelphij * contain a file documenting the changes Licensee made to create that Covered 50251129Sdelphij * Code and the date of any change. Licensee must include in that file the 51276768Sdelphij * documentation of any changes made by any predecessor Licensee. Licensee 52276768Sdelphij * must include a prominent statement that the modification is derived, 53276768Sdelphij * directly or indirectly, from Original Intel Code. 54251129Sdelphij * 55146768Ssam * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56146768Ssam * Redistribution of source code of any substantial portion of the Covered 57127664Sbms * Code or modification without rights to further distribute source must 58172677Smlaier * include the following Disclaimer and Export Compliance provision in the 59172677Smlaier * documentation and/or other materials provided with distribution. In 60172677Smlaier * addition, Licensee may not authorize further sublicense of source of any 61172677Smlaier * portion of the Covered Code, and must include terms to the effect that the 62172677Smlaier * license from Licensee to its licensee is limited to the intellectual 63172677Smlaier * property embodied in the software Licensee provides to its licensee, and 64172677Smlaier * not to intellectual property embodied in modifications its licensee may 65172677Smlaier * make. 66172677Smlaier * 67172677Smlaier * 3.3. Redistribution of Executable. Redistribution in executable form of any 68172677Smlaier * substantial portion of the Covered Code or modification must reproduce the 69172677Smlaier * above Copyright Notice, and the following Disclaimer and Export Compliance 70146768Ssam * provision in the documentation and/or other materials provided with the 71146768Ssam * distribution. 72146768Ssam * 73146768Ssam * 3.4. Intel retains all right, title, and interest in and to the Original 74146768Ssam * Intel Code. 75146768Ssam * 76146768Ssam * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77276768Sdelphij * Intel shall be used in advertising or otherwise to promote the sale, use or 78276768Sdelphij * other dealings in products derived from or relating to the Covered Code 79276768Sdelphij * without prior written authorization from Intel. 80276768Sdelphij * 81276768Sdelphij * 4. Disclaimer and Export Compliance 82276768Sdelphij * 83276768Sdelphij * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84276768Sdelphij * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85276768Sdelphij * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86276768Sdelphij * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87276768Sdelphij * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88276768Sdelphij * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89276768Sdelphij * PARTICULAR PURPOSE. 90276768Sdelphij * 91276768Sdelphij * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92276768Sdelphij * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93276768Sdelphij * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94276768Sdelphij * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95276768Sdelphij * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96276768Sdelphij * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97276768Sdelphij * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98127664Sbms * LIMITED REMEDY. 99146768Ssam * 100146768Ssam * 4.3. Licensee shall not export, either directly or indirectly, any of this 101146768Ssam * software or system incorporating such software without first obtaining any 102127664Sbms * required license or other approval from the U. S. Department of Commerce or 103127664Sbms * any other agency or department of the United States Government. In the 104127664Sbms * event Licensee exports any such software from the United States or 105127664Sbms * re-exports any such software from a foreign destination, Licensee shall 106127664Sbms * ensure that the distribution and export/re-export of the software is in 107127664Sbms * compliance with all laws, regulations, orders, or other restrictions of the 108127664Sbms * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109127664Sbms * any of its subsidiaries will export/re-export any technical data, process, 110172677Smlaier * software, or service, directly or indirectly, to any country for which the 111172677Smlaier * United States government or any agency thereof requires an export license, 112172677Smlaier * other governmental approval, or letter of assurance, without first obtaining 113172677Smlaier * such license, approval or letter. 114127664Sbms * 115127664Sbms *****************************************************************************/ 116127664Sbms 117127664Sbms#ifndef __ACSTRUCT_H__ 118127664Sbms#define __ACSTRUCT_H__ 119127664Sbms 120146768Ssam 121146768Ssam/***************************************************************************** 122146768Ssam * 123146768Ssam * Tree walking typedefs and structs 124127664Sbms * 125146768Ssam ****************************************************************************/ 126146768Ssam 127146768Ssam 128127664Sbms/* 129146768Ssam * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 130146768Ssam * the tree (for whatever reason), and for control method execution. 131146768Ssam */ 132146768Ssam 133146768Ssam#define ACPI_NEXT_OP_DOWNWARD 1 134146768Ssam#define ACPI_NEXT_OP_UPWARD 2 135146768Ssam 136127664Sbms#define ACPI_WALK_NON_METHOD 0 137127664Sbms#define ACPI_WALK_METHOD 1 138127664Sbms#define ACPI_WALK_METHOD_RESTART 2 139127664Sbms#define ACPI_WALK_CONST_REQUIRED 3 140127664Sbms#define ACPI_WALK_CONST_OPTIONAL 4 141127664Sbms 142127664Sbmstypedef struct acpi_walk_state 143146768Ssam{ 144190225Srpaulo UINT8 DataType; /* To differentiate various internal objs MUST BE FIRST!*/\ 145146768Ssam UINT8 WalkType; 146276768Sdelphij ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */ 147276768Sdelphij BOOLEAN LastPredicate; /* Result of last predicate */ 148162012Ssam UINT8 Reserved; /* For alignment */ 149276768Sdelphij UINT8 CurrentResult; /* */ 150162012Ssam UINT8 NextOpInfo; /* Info about NextOp */ 151276768Sdelphij UINT8 NumOperands; /* Stack pointer for Operands[] array */ 152162012Ssam UINT8 ReturnUsed; 153146768Ssam UINT16 Opcode; /* Current AML opcode */ 154276768Sdelphij UINT8 ScopeDepth; 155162012Ssam UINT8 Reserved1; 156127664Sbms UINT32 ArgCount; /* push for fixed or var args */ 157146768Ssam UINT32 AmlOffset; 158146768Ssam UINT32 ArgTypes; 159162012Ssam UINT32 MethodBreakpoint; /* For single stepping */ 160190225Srpaulo UINT32 UserBreakpoint; /* User AML breakpoint */ 161190225Srpaulo UINT32 ParseFlags; 162190225Srpaulo UINT32 PrevArgTypes; 163190225Srpaulo 164190225Srpaulo UINT8 *AmlLastWhile; 165190225Srpaulo struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 166190225Srpaulo union acpi_operand_object **CallerReturnDesc; 167146768Ssam ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */ 168146768Ssam struct acpi_namespace_node *DeferredNode; /* Used when executing deferred opcodes */ 169127664Sbms struct acpi_gpe_event_info *GpeEventInfo; /* Info for GPE (_Lxx/_Exx methods only */ 170127664Sbms struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ 171146768Ssam struct acpi_namespace_node *MethodCallNode; /* Called method Node*/ 172146768Ssam ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */ 173146768Ssam union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */ 174146768Ssam struct acpi_namespace_node *MethodNode; /* Method node if running a method. */ 175146768Ssam ACPI_PARSE_OBJECT *Op; /* Current parser op */ 176190225Srpaulo union acpi_operand_object *Operands[ACPI_OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ 177146768Ssam const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */ 178146768Ssam ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */ 179146768Ssam union acpi_operand_object **Params; 180146768Ssam ACPI_PARSE_STATE ParserState; /* Current state of parser */ 181127664Sbms union acpi_operand_object *ResultObj; 182127664Sbms ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */ 183146768Ssam union acpi_operand_object *ReturnDesc; /* Return object, if any */ 184146768Ssam ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */ 185146768Ssam 186146768Ssam ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */ 187127664Sbms ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */ 188146768Ssam ACPI_PARSE_DOWNWARDS DescendingCallback; 189146768Ssam ACPI_PARSE_UPWARDS AscendingCallback; 190146768Ssam ACPI_THREAD_STATE *Thread; 191127664Sbms struct acpi_walk_state *Next; /* Next WalkState in list */ 192146768Ssam 193146768Ssam} ACPI_WALK_STATE; 194146768Ssam 195146768Ssam 196127664Sbms/* Info used by AcpiPsInitObjects */ 197146768Ssam 198146768Ssamtypedef struct acpi_init_walk_info 199146768Ssam{ 200127664Sbms UINT16 MethodCount; 201146768Ssam UINT16 DeviceCount; 202127664Sbms UINT16 OpRegionCount; 203146768Ssam UINT16 FieldCount; 204127664Sbms UINT16 BufferCount; 205127664Sbms UINT16 PackageCount; 206190225Srpaulo UINT16 OpRegionInit; 207190225Srpaulo UINT16 FieldInit; 208190225Srpaulo UINT16 BufferInit; 209190225Srpaulo UINT16 PackageInit; 210190225Srpaulo UINT16 ObjectCount; 211190225Srpaulo ACPI_TABLE_DESC *TableDesc; 212190225Srpaulo 213190225Srpaulo} ACPI_INIT_WALK_INFO; 214190225Srpaulo 215190225Srpaulo 216190225Srpaulo/* Info used by AcpiNsInitializeDevices */ 217190225Srpaulo 218190225Srpaulotypedef struct acpi_device_walk_info 219190225Srpaulo{ 220190225Srpaulo UINT16 DeviceCount; 221190225Srpaulo UINT16 Num_STA; 222190225Srpaulo UINT16 Num_INI; 223190225Srpaulo ACPI_TABLE_DESC *TableDesc; 224190225Srpaulo 225190225Srpaulo} ACPI_DEVICE_WALK_INFO; 226276768Sdelphij 227190225Srpaulo 228190225Srpaulo/* TBD: [Restructure] Merge with struct above */ 229190225Srpaulo 230190225Srpaulotypedef struct acpi_walk_info 231190225Srpaulo{ 232190225Srpaulo UINT32 DebugLevel; 233190225Srpaulo UINT32 OwnerId; 234190225Srpaulo UINT8 DisplayType; 235190225Srpaulo 236190225Srpaulo} ACPI_WALK_INFO; 237190225Srpaulo 238127664Sbms/* Display Types */ 239127664Sbms 240127664Sbms#define ACPI_DISPLAY_SUMMARY 0 241127664Sbms#define ACPI_DISPLAY_OBJECTS 1 242127664Sbms 243146768Ssamtypedef struct acpi_get_devices_info 244146768Ssam{ 245146768Ssam ACPI_WALK_CALLBACK UserFunction; 246276768Sdelphij void *Context; 247127664Sbms char *Hid; 248276768Sdelphij 249127664Sbms} ACPI_GET_DEVICES_INFO; 250190225Srpaulo 251127664Sbms 252162012Ssamtypedef union acpi_aml_operands 253276768Sdelphij{ 254127664Sbms ACPI_OPERAND_OBJECT *Operands[7]; 255162012Ssam 256162012Ssam struct 257162012Ssam { 258162012Ssam ACPI_OBJECT_INTEGER *Type; 259127664Sbms ACPI_OBJECT_INTEGER *Code; 260162012Ssam ACPI_OBJECT_INTEGER *Argument; 261162012Ssam 262162012Ssam } Fatal; 263127664Sbms 264162012Ssam struct 265162012Ssam { 266162012Ssam ACPI_OPERAND_OBJECT *Source; 267127664Sbms ACPI_OBJECT_INTEGER *Index; 268162012Ssam ACPI_OPERAND_OBJECT *Target; 269162012Ssam 270162012Ssam } Index; 271162012Ssam 272162012Ssam struct 273162012Ssam { 274162012Ssam ACPI_OPERAND_OBJECT *Source; 275162012Ssam ACPI_OBJECT_INTEGER *Index; 276162012Ssam ACPI_OBJECT_INTEGER *Length; 277162012Ssam ACPI_OPERAND_OBJECT *Target; 278162012Ssam 279162012Ssam } Mid; 280276768Sdelphij 281190225Srpaulo} ACPI_AML_OPERANDS; 282190225Srpaulo 283162012Ssam 284162012Ssam/* Internal method parameter list */ 285276768Sdelphij 286162012Ssamtypedef struct acpi_parameter_info 287162012Ssam{ 288276768Sdelphij ACPI_NAMESPACE_NODE *Node; 289162012Ssam ACPI_OPERAND_OBJECT **Parameters; 290162012Ssam ACPI_OPERAND_OBJECT *ReturnObject; 291162012Ssam UINT8 ParameterType; 292127664Sbms UINT8 ReturnObjectType; 293162012Ssam 294162012Ssam} ACPI_PARAMETER_INFO; 295276768Sdelphij 296276768Sdelphij/* Types for ParameterType above */ 297162012Ssam 298162012Ssam#define ACPI_PARAM_ARGS 0 299162012Ssam#define ACPI_PARAM_GPE 1 300162012Ssam 301162012Ssam 302162012Ssam#endif 303146768Ssam