acstruct.h revision 99679
1219019Sgabor/****************************************************************************** 2219019Sgabor * 3219019Sgabor * Name: acstruct.h - Internal structs 4219019Sgabor * $Revision: 19 $ 5219019Sgabor * 6219019Sgabor *****************************************************************************/ 7219019Sgabor 8219019Sgabor/****************************************************************************** 9219019Sgabor * 10219019Sgabor * 1. Copyright Notice 11219019Sgabor * 12219019Sgabor * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp. 13219019Sgabor * All rights reserved. 14219019Sgabor * 15219019Sgabor * 2. License 16219019Sgabor * 17219019Sgabor * 2.1. This is your license from Intel Corp. under its intellectual property 18219019Sgabor * rights. You may have additional license terms from the party that provided 19219019Sgabor * you this software, covering your right to use that party's intellectual 20219019Sgabor * property rights. 21219019Sgabor * 22219019Sgabor * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 23219019Sgabor * copy of the source code appearing in this file ("Covered Code") an 24219019Sgabor * irrevocable, perpetual, worldwide license under Intel's copyrights in the 25219019Sgabor * base code distributed originally by Intel ("Original Intel Code") to copy, 26219019Sgabor * make derivatives, distribute, use and display any portion of the Covered 27219019Sgabor * Code in any form, with the right to sublicense such rights; and 28219019Sgabor * 29219019Sgabor * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 30219019Sgabor * license (with the right to sublicense), under only those claims of Intel 31219019Sgabor * patents that are infringed by the Original Intel Code, to make, use, sell, 32219019Sgabor * offer to sell, and import the Covered Code and derivative works thereof 33219019Sgabor * solely to the minimum extent necessary to exercise the above copyright 34219019Sgabor * license, and in no event shall the patent license extend to any additions 35219019Sgabor * to or modifications of the Original Intel Code. No other license or right 36219019Sgabor * is granted directly or by implication, estoppel or otherwise; 37219019Sgabor * 38219019Sgabor * The above copyright and patent license is granted only if the following 39219019Sgabor * conditions are met: 40219019Sgabor * 41219019Sgabor * 3. Conditions 42219019Sgabor * 43219019Sgabor * 3.1. Redistribution of Source with Rights to Further Distribute Source. 44219019Sgabor * Redistribution of source code of any substantial portion of the Covered 45219019Sgabor * Code or modification with rights to further distribute source must include 46219019Sgabor * the above Copyright Notice, the above License, this list of Conditions, 47219019Sgabor * and the following Disclaimer and Export Compliance provision. In addition, 48219019Sgabor * Licensee must cause all Covered Code to which Licensee contributes to 49219019Sgabor * contain a file documenting the changes Licensee made to create that Covered 50219019Sgabor * Code and the date of any change. Licensee must include in that file the 51219019Sgabor * documentation of any changes made by any predecessor Licensee. Licensee 52219019Sgabor * must include a prominent statement that the modification is derived, 53219019Sgabor * directly or indirectly, from Original Intel Code. 54219019Sgabor * 55219019Sgabor * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 56219019Sgabor * Redistribution of source code of any substantial portion of the Covered 57219019Sgabor * Code or modification without rights to further distribute source must 58219019Sgabor * include the following Disclaimer and Export Compliance provision in the 59219019Sgabor * documentation and/or other materials provided with distribution. In 60219019Sgabor * addition, Licensee may not authorize further sublicense of source of any 61219019Sgabor * portion of the Covered Code, and must include terms to the effect that the 62219019Sgabor * license from Licensee to its licensee is limited to the intellectual 63219019Sgabor * property embodied in the software Licensee provides to its licensee, and 64219019Sgabor * not to intellectual property embodied in modifications its licensee may 65219019Sgabor * make. 66219019Sgabor * 67219019Sgabor * 3.3. Redistribution of Executable. Redistribution in executable form of any 68219019Sgabor * substantial portion of the Covered Code or modification must reproduce the 69219019Sgabor * above Copyright Notice, and the following Disclaimer and Export Compliance 70219019Sgabor * provision in the documentation and/or other materials provided with the 71219019Sgabor * distribution. 72219019Sgabor * 73219019Sgabor * 3.4. Intel retains all right, title, and interest in and to the Original 74219019Sgabor * Intel Code. 75219019Sgabor * 76219019Sgabor * 3.5. Neither the name Intel nor any other trademark owned or controlled by 77219019Sgabor * Intel shall be used in advertising or otherwise to promote the sale, use or 78219019Sgabor * other dealings in products derived from or relating to the Covered Code 79219019Sgabor * without prior written authorization from Intel. 80219019Sgabor * 81219019Sgabor * 4. Disclaimer and Export Compliance 82219019Sgabor * 83219019Sgabor * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 84219019Sgabor * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 85219019Sgabor * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 86219019Sgabor * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 87219019Sgabor * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 88219019Sgabor * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 89219019Sgabor * PARTICULAR PURPOSE. 90219019Sgabor * 91219019Sgabor * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 92219019Sgabor * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 93219019Sgabor * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 94219019Sgabor * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 95219019Sgabor * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 96219019Sgabor * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 97219019Sgabor * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 98219019Sgabor * LIMITED REMEDY. 99219019Sgabor * 100219019Sgabor * 4.3. Licensee shall not export, either directly or indirectly, any of this 101219019Sgabor * software or system incorporating such software without first obtaining any 102219019Sgabor * required license or other approval from the U. S. Department of Commerce or 103219019Sgabor * any other agency or department of the United States Government. In the 104219019Sgabor * event Licensee exports any such software from the United States or 105219019Sgabor * re-exports any such software from a foreign destination, Licensee shall 106219019Sgabor * ensure that the distribution and export/re-export of the software is in 107219019Sgabor * compliance with all laws, regulations, orders, or other restrictions of the 108219019Sgabor * U.S. Export Administration Regulations. Licensee agrees that neither it nor 109219019Sgabor * any of its subsidiaries will export/re-export any technical data, process, 110219019Sgabor * software, or service, directly or indirectly, to any country for which the 111219019Sgabor * United States government or any agency thereof requires an export license, 112219019Sgabor * other governmental approval, or letter of assurance, without first obtaining 113219019Sgabor * such license, approval or letter. 114219019Sgabor * 115219019Sgabor *****************************************************************************/ 116219019Sgabor 117219019Sgabor#ifndef __ACSTRUCT_H__ 118219019Sgabor#define __ACSTRUCT_H__ 119219019Sgabor 120219019Sgabor 121219019Sgabor/***************************************************************************** 122219019Sgabor * 123219019Sgabor * Tree walking typedefs and structs 124219019Sgabor * 125219019Sgabor ****************************************************************************/ 126219019Sgabor 127219019Sgabor 128219019Sgabor/* 129219019Sgabor * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through 130219019Sgabor * the tree (for whatever reason), and for control method execution. 131219019Sgabor */ 132219019Sgabor 133219019Sgabor#define ACPI_NEXT_OP_DOWNWARD 1 134219019Sgabor#define ACPI_NEXT_OP_UPWARD 2 135219019Sgabor 136219019Sgabor#define ACPI_WALK_NON_METHOD 0 137219019Sgabor#define ACPI_WALK_METHOD 1 138219019Sgabor#define ACPI_WALK_METHOD_RESTART 2 139219019Sgabor#define ACPI_WALK_CONST_REQUIRED 3 140219019Sgabor#define ACPI_WALK_CONST_OPTIONAL 4 141219019Sgabor 142219019Sgabortypedef struct acpi_walk_state 143219019Sgabor{ 144219019Sgabor UINT8 DataType; /* To differentiate various internal objs MUST BE FIRST!*/\ 145219019Sgabor ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */ 146219019Sgabor BOOLEAN LastPredicate; /* Result of last predicate */ 147219019Sgabor UINT8 CurrentResult; /* */ 148219019Sgabor UINT8 NextOpInfo; /* Info about NextOp */ 149219019Sgabor UINT8 NumOperands; /* Stack pointer for Operands[] array */ 150219019Sgabor UINT8 ReturnUsed; 151219019Sgabor UINT8 WalkType; 152219019Sgabor UINT16 Opcode; /* Current AML opcode */ 153219019Sgabor UINT32 ArgCount; /* push for fixed or var args */ 154219019Sgabor UINT32 AmlOffset; 155219019Sgabor UINT32 ArgTypes; 156219019Sgabor UINT32 MethodBreakpoint; /* For single stepping */ 157219019Sgabor UINT32 UserBreakpoint; /* User AML breakpoint */ 158219019Sgabor UINT32 ParseFlags; 159219019Sgabor UINT32 PrevArgTypes; 160219019Sgabor 161219019Sgabor 162219019Sgabor UINT8 *AmlLastWhile; 163219019Sgabor struct acpi_node Arguments[MTH_NUM_ARGS]; /* Control method arguments */ 164219019Sgabor union acpi_operand_obj **CallerReturnDesc; 165219019Sgabor ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */ 166219019Sgabor struct acpi_node LocalVariables[MTH_NUM_LOCALS]; /* Control method locals */ 167219019Sgabor struct acpi_node *MethodCallNode; /* Called method Node*/ 168219019Sgabor ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */ 169219019Sgabor union acpi_operand_obj *MethodDesc; /* Method descriptor if running a method */ 170219019Sgabor struct acpi_node *MethodNode; /* Method Node if running a method */ 171219019Sgabor ACPI_PARSE_OBJECT *Op; /* Current parser op */ 172219019Sgabor union acpi_operand_obj *Operands[OBJ_NUM_OPERANDS+1]; /* Operands passed to the interpreter (+1 for NULL terminator) */ 173219019Sgabor const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */ 174219019Sgabor ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */ 175219019Sgabor union acpi_operand_obj **Params; 176219019Sgabor ACPI_PARSE_STATE ParserState; /* Current state of parser */ 177219019Sgabor union acpi_operand_obj *ResultObj; 178219019Sgabor ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */ 179219019Sgabor union acpi_operand_obj *ReturnDesc; /* Return object, if any */ 180219019Sgabor ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */ 181219019Sgabor 182219019Sgabor ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */ 183219019Sgabor ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */ 184219019Sgabor ACPI_PARSE_DOWNWARDS DescendingCallback; 185219019Sgabor ACPI_PARSE_UPWARDS AscendingCallback; 186219019Sgabor ACPI_THREAD_STATE *Thread; 187219019Sgabor struct acpi_walk_state *Next; /* Next WalkState in list */ 188219019Sgabor 189219019Sgabor 190219019Sgabor} ACPI_WALK_STATE; 191219019Sgabor 192219019Sgabor 193219019Sgabor/* Info used by AcpiPsInitObjects */ 194219019Sgabor 195219019Sgabortypedef struct acpi_init_walk_info 196219019Sgabor{ 197219019Sgabor UINT16 MethodCount; 198219019Sgabor UINT16 DeviceCount; 199219019Sgabor UINT16 OpRegionCount; 200219019Sgabor UINT16 FieldCount; 201219019Sgabor UINT16 BufferCount; 202219019Sgabor UINT16 PackageCount; 203219019Sgabor UINT16 OpRegionInit; 204219019Sgabor UINT16 FieldInit; 205219019Sgabor UINT16 BufferInit; 206219019Sgabor UINT16 PackageInit; 207219019Sgabor UINT16 ObjectCount; 208219019Sgabor ACPI_TABLE_DESC *TableDesc; 209219019Sgabor 210219019Sgabor} ACPI_INIT_WALK_INFO; 211219019Sgabor 212219019Sgabor 213219019Sgabor/* Info used by AcpiNsInitializeDevices */ 214219019Sgabor 215219019Sgabortypedef struct acpi_device_walk_info 216219019Sgabor{ 217219019Sgabor UINT16 DeviceCount; 218219019Sgabor UINT16 Num_STA; 219219019Sgabor UINT16 Num_INI; 220219019Sgabor ACPI_TABLE_DESC *TableDesc; 221219019Sgabor 222219019Sgabor} ACPI_DEVICE_WALK_INFO; 223219019Sgabor 224219019Sgabor 225219019Sgabor/* TBD: [Restructure] Merge with struct above */ 226219019Sgabor 227219019Sgabortypedef struct acpi_walk_info 228219019Sgabor{ 229219019Sgabor UINT32 DebugLevel; 230219019Sgabor UINT32 OwnerId; 231219019Sgabor UINT8 DisplayType; 232219019Sgabor 233219019Sgabor} ACPI_WALK_INFO; 234219019Sgabor 235219019Sgabor/* Display Types */ 236219019Sgabor 237219019Sgabor#define ACPI_DISPLAY_SUMMARY 0 238219019Sgabor#define ACPI_DISPLAY_OBJECTS 1 239219019Sgabor 240219019Sgabortypedef struct acpi_get_devices_info 241219019Sgabor{ 242219019Sgabor ACPI_WALK_CALLBACK UserFunction; 243219019Sgabor void *Context; 244219019Sgabor NATIVE_CHAR *Hid; 245219019Sgabor 246219019Sgabor} ACPI_GET_DEVICES_INFO; 247219019Sgabor 248219019Sgabor 249219019Sgabortypedef union acpi_aml_operands 250219019Sgabor{ 251219019Sgabor ACPI_OPERAND_OBJECT *Operands[7]; 252219019Sgabor 253219019Sgabor struct 254219019Sgabor { 255219019Sgabor ACPI_OBJECT_INTEGER *Type; 256219019Sgabor ACPI_OBJECT_INTEGER *Code; 257219019Sgabor ACPI_OBJECT_INTEGER *Argument; 258219019Sgabor 259219019Sgabor } Fatal; 260219019Sgabor 261219019Sgabor struct 262219019Sgabor { 263219019Sgabor ACPI_OPERAND_OBJECT *Source; 264219019Sgabor ACPI_OBJECT_INTEGER *Index; 265219019Sgabor ACPI_OPERAND_OBJECT *Target; 266219019Sgabor 267219019Sgabor } Index; 268219019Sgabor 269219019Sgabor struct 270219019Sgabor { 271219019Sgabor ACPI_OPERAND_OBJECT *Source; 272219019Sgabor ACPI_OBJECT_INTEGER *Index; 273219019Sgabor ACPI_OBJECT_INTEGER *Length; 274219019Sgabor ACPI_OPERAND_OBJECT *Target; 275219019Sgabor 276219019Sgabor } Mid; 277219019Sgabor 278219019Sgabor} ACPI_AML_OPERANDS; 279219019Sgabor 280219019Sgabor 281219019Sgabor#endif 282219019Sgabor