1a9f12690SJung-uk Kim /****************************************************************************** 2a9f12690SJung-uk Kim * 3a9f12690SJung-uk Kim * Name: aclocal.h - Internal data types used across the ACPI subsystem 4a9f12690SJung-uk Kim * 5a9f12690SJung-uk Kim *****************************************************************************/ 6a9f12690SJung-uk Kim 70d84335fSJung-uk Kim /****************************************************************************** 80d84335fSJung-uk Kim * 90d84335fSJung-uk Kim * 1. Copyright Notice 100d84335fSJung-uk Kim * 11e5e1f58aSJung-uk Kim * Some or all of this work - Copyright (c) 1999 - 2019, Intel Corp. 12a9f12690SJung-uk Kim * All rights reserved. 13a9f12690SJung-uk Kim * 140d84335fSJung-uk Kim * 2. License 150d84335fSJung-uk Kim * 160d84335fSJung-uk Kim * 2.1. This is your license from Intel Corp. under its intellectual property 170d84335fSJung-uk Kim * rights. You may have additional license terms from the party that provided 180d84335fSJung-uk Kim * you this software, covering your right to use that party's intellectual 190d84335fSJung-uk Kim * property rights. 200d84335fSJung-uk Kim * 210d84335fSJung-uk Kim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 220d84335fSJung-uk Kim * copy of the source code appearing in this file ("Covered Code") an 230d84335fSJung-uk Kim * irrevocable, perpetual, worldwide license under Intel's copyrights in the 240d84335fSJung-uk Kim * base code distributed originally by Intel ("Original Intel Code") to copy, 250d84335fSJung-uk Kim * make derivatives, distribute, use and display any portion of the Covered 260d84335fSJung-uk Kim * Code in any form, with the right to sublicense such rights; and 270d84335fSJung-uk Kim * 280d84335fSJung-uk Kim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 290d84335fSJung-uk Kim * license (with the right to sublicense), under only those claims of Intel 300d84335fSJung-uk Kim * patents that are infringed by the Original Intel Code, to make, use, sell, 310d84335fSJung-uk Kim * offer to sell, and import the Covered Code and derivative works thereof 320d84335fSJung-uk Kim * solely to the minimum extent necessary to exercise the above copyright 330d84335fSJung-uk Kim * license, and in no event shall the patent license extend to any additions 340d84335fSJung-uk Kim * to or modifications of the Original Intel Code. No other license or right 350d84335fSJung-uk Kim * is granted directly or by implication, estoppel or otherwise; 360d84335fSJung-uk Kim * 370d84335fSJung-uk Kim * The above copyright and patent license is granted only if the following 380d84335fSJung-uk Kim * conditions are met: 390d84335fSJung-uk Kim * 400d84335fSJung-uk Kim * 3. Conditions 410d84335fSJung-uk Kim * 420d84335fSJung-uk Kim * 3.1. Redistribution of Source with Rights to Further Distribute Source. 430d84335fSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 440d84335fSJung-uk Kim * Code or modification with rights to further distribute source must include 450d84335fSJung-uk Kim * the above Copyright Notice, the above License, this list of Conditions, 460d84335fSJung-uk Kim * and the following Disclaimer and Export Compliance provision. In addition, 470d84335fSJung-uk Kim * Licensee must cause all Covered Code to which Licensee contributes to 480d84335fSJung-uk Kim * contain a file documenting the changes Licensee made to create that Covered 490d84335fSJung-uk Kim * Code and the date of any change. Licensee must include in that file the 500d84335fSJung-uk Kim * documentation of any changes made by any predecessor Licensee. Licensee 510d84335fSJung-uk Kim * must include a prominent statement that the modification is derived, 520d84335fSJung-uk Kim * directly or indirectly, from Original Intel Code. 530d84335fSJung-uk Kim * 540d84335fSJung-uk Kim * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 550d84335fSJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 560d84335fSJung-uk Kim * Code or modification without rights to further distribute source must 570d84335fSJung-uk Kim * include the following Disclaimer and Export Compliance provision in the 580d84335fSJung-uk Kim * documentation and/or other materials provided with distribution. In 590d84335fSJung-uk Kim * addition, Licensee may not authorize further sublicense of source of any 600d84335fSJung-uk Kim * portion of the Covered Code, and must include terms to the effect that the 610d84335fSJung-uk Kim * license from Licensee to its licensee is limited to the intellectual 620d84335fSJung-uk Kim * property embodied in the software Licensee provides to its licensee, and 630d84335fSJung-uk Kim * not to intellectual property embodied in modifications its licensee may 640d84335fSJung-uk Kim * make. 650d84335fSJung-uk Kim * 660d84335fSJung-uk Kim * 3.3. Redistribution of Executable. Redistribution in executable form of any 670d84335fSJung-uk Kim * substantial portion of the Covered Code or modification must reproduce the 680d84335fSJung-uk Kim * above Copyright Notice, and the following Disclaimer and Export Compliance 690d84335fSJung-uk Kim * provision in the documentation and/or other materials provided with the 700d84335fSJung-uk Kim * distribution. 710d84335fSJung-uk Kim * 720d84335fSJung-uk Kim * 3.4. Intel retains all right, title, and interest in and to the Original 730d84335fSJung-uk Kim * Intel Code. 740d84335fSJung-uk Kim * 750d84335fSJung-uk Kim * 3.5. Neither the name Intel nor any other trademark owned or controlled by 760d84335fSJung-uk Kim * Intel shall be used in advertising or otherwise to promote the sale, use or 770d84335fSJung-uk Kim * other dealings in products derived from or relating to the Covered Code 780d84335fSJung-uk Kim * without prior written authorization from Intel. 790d84335fSJung-uk Kim * 800d84335fSJung-uk Kim * 4. Disclaimer and Export Compliance 810d84335fSJung-uk Kim * 820d84335fSJung-uk Kim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 830d84335fSJung-uk Kim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 840d84335fSJung-uk Kim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 850d84335fSJung-uk Kim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 860d84335fSJung-uk Kim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 870d84335fSJung-uk Kim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 880d84335fSJung-uk Kim * PARTICULAR PURPOSE. 890d84335fSJung-uk Kim * 900d84335fSJung-uk Kim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 910d84335fSJung-uk Kim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 920d84335fSJung-uk Kim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 930d84335fSJung-uk Kim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 940d84335fSJung-uk Kim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 950d84335fSJung-uk Kim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 960d84335fSJung-uk Kim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 970d84335fSJung-uk Kim * LIMITED REMEDY. 980d84335fSJung-uk Kim * 990d84335fSJung-uk Kim * 4.3. Licensee shall not export, either directly or indirectly, any of this 1000d84335fSJung-uk Kim * software or system incorporating such software without first obtaining any 1010d84335fSJung-uk Kim * required license or other approval from the U. S. Department of Commerce or 1020d84335fSJung-uk Kim * any other agency or department of the United States Government. In the 1030d84335fSJung-uk Kim * event Licensee exports any such software from the United States or 1040d84335fSJung-uk Kim * re-exports any such software from a foreign destination, Licensee shall 1050d84335fSJung-uk Kim * ensure that the distribution and export/re-export of the software is in 1060d84335fSJung-uk Kim * compliance with all laws, regulations, orders, or other restrictions of the 1070d84335fSJung-uk Kim * U.S. Export Administration Regulations. Licensee agrees that neither it nor 1080d84335fSJung-uk Kim * any of its subsidiaries will export/re-export any technical data, process, 1090d84335fSJung-uk Kim * software, or service, directly or indirectly, to any country for which the 1100d84335fSJung-uk Kim * United States government or any agency thereof requires an export license, 1110d84335fSJung-uk Kim * other governmental approval, or letter of assurance, without first obtaining 1120d84335fSJung-uk Kim * such license, approval or letter. 1130d84335fSJung-uk Kim * 1140d84335fSJung-uk Kim ***************************************************************************** 1150d84335fSJung-uk Kim * 1160d84335fSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 1170d84335fSJung-uk Kim * following license: 1180d84335fSJung-uk Kim * 119d244b227SJung-uk Kim * Redistribution and use in source and binary forms, with or without 120d244b227SJung-uk Kim * modification, are permitted provided that the following conditions 121d244b227SJung-uk Kim * are met: 122d244b227SJung-uk Kim * 1. Redistributions of source code must retain the above copyright 123d244b227SJung-uk Kim * notice, this list of conditions, and the following disclaimer, 124d244b227SJung-uk Kim * without modification. 125d244b227SJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 126d244b227SJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 127d244b227SJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 128d244b227SJung-uk Kim * including a substantially similar Disclaimer requirement for further 129d244b227SJung-uk Kim * binary redistribution. 130d244b227SJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 131d244b227SJung-uk Kim * of any contributors may be used to endorse or promote products derived 132d244b227SJung-uk Kim * from this software without specific prior written permission. 133a9f12690SJung-uk Kim * 1340d84335fSJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1350d84335fSJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1360d84335fSJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1370d84335fSJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 1380d84335fSJung-uk Kim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1390d84335fSJung-uk Kim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1400d84335fSJung-uk Kim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 1410d84335fSJung-uk Kim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 1420d84335fSJung-uk Kim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 1430d84335fSJung-uk Kim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 1440d84335fSJung-uk Kim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1450d84335fSJung-uk Kim * 1460d84335fSJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 147d244b227SJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 148d244b227SJung-uk Kim * Software Foundation. 149a9f12690SJung-uk Kim * 1500d84335fSJung-uk Kim *****************************************************************************/ 151a9f12690SJung-uk Kim 152a9f12690SJung-uk Kim #ifndef __ACLOCAL_H__ 153a9f12690SJung-uk Kim #define __ACLOCAL_H__ 154a9f12690SJung-uk Kim 155a9f12690SJung-uk Kim 156a9f12690SJung-uk Kim /* acpisrc:StructDefs -- for acpisrc conversion */ 157a9f12690SJung-uk Kim 158a9f12690SJung-uk Kim #define ACPI_SERIALIZED 0xFF 159a9f12690SJung-uk Kim 160a9f12690SJung-uk Kim typedef UINT32 ACPI_MUTEX_HANDLE; 161a9f12690SJung-uk Kim #define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1) 162a9f12690SJung-uk Kim 163a9f12690SJung-uk Kim /* Total number of aml opcodes defined */ 164a9f12690SJung-uk Kim 1650d84335fSJung-uk Kim #define AML_NUM_OPCODES 0x83 166a9f12690SJung-uk Kim 167a9f12690SJung-uk Kim 168a9f12690SJung-uk Kim /* Forward declarations */ 169a9f12690SJung-uk Kim 170a9f12690SJung-uk Kim struct acpi_walk_state; 171a9f12690SJung-uk Kim struct acpi_obj_mutex; 172a9f12690SJung-uk Kim union acpi_parse_object; 173a9f12690SJung-uk Kim 174a9f12690SJung-uk Kim 175a9f12690SJung-uk Kim /***************************************************************************** 176a9f12690SJung-uk Kim * 177a9f12690SJung-uk Kim * Mutex typedefs and structs 178a9f12690SJung-uk Kim * 179a9f12690SJung-uk Kim ****************************************************************************/ 180a9f12690SJung-uk Kim 181a9f12690SJung-uk Kim 182a9f12690SJung-uk Kim /* 183a9f12690SJung-uk Kim * Predefined handles for the mutex objects used within the subsystem 184a9f12690SJung-uk Kim * All mutex objects are automatically created by AcpiUtMutexInitialize. 185a9f12690SJung-uk Kim * 186a9f12690SJung-uk Kim * The acquire/release ordering protocol is implied via this list. Mutexes 187a9f12690SJung-uk Kim * with a lower value must be acquired before mutexes with a higher value. 188a9f12690SJung-uk Kim * 189a9f12690SJung-uk Kim * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames 190a9f12690SJung-uk Kim * table below also! 191a9f12690SJung-uk Kim */ 192a9f12690SJung-uk Kim #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 193a9f12690SJung-uk Kim #define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */ 194a9f12690SJung-uk Kim #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */ 195a9f12690SJung-uk Kim #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 196a9f12690SJung-uk Kim #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 197a9f12690SJung-uk Kim #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 198a9f12690SJung-uk Kim 199f8146b88SJung-uk Kim #define ACPI_MAX_MUTEX 5 200f8146b88SJung-uk Kim #define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1) 201a9f12690SJung-uk Kim 202a9f12690SJung-uk Kim 203a9f12690SJung-uk Kim /* Lock structure for reader/writer interfaces */ 204a9f12690SJung-uk Kim 205a9f12690SJung-uk Kim typedef struct acpi_rw_lock 206a9f12690SJung-uk Kim { 207a9f12690SJung-uk Kim ACPI_MUTEX WriterMutex; 208a9f12690SJung-uk Kim ACPI_MUTEX ReaderMutex; 209a9f12690SJung-uk Kim UINT32 NumReaders; 210a9f12690SJung-uk Kim 211a9f12690SJung-uk Kim } ACPI_RW_LOCK; 212a9f12690SJung-uk Kim 213a9f12690SJung-uk Kim 214a9f12690SJung-uk Kim /* 215a9f12690SJung-uk Kim * Predefined handles for spinlocks used within the subsystem. 216a9f12690SJung-uk Kim * These spinlocks are created by AcpiUtMutexInitialize 217a9f12690SJung-uk Kim */ 218a9f12690SJung-uk Kim #define ACPI_LOCK_GPES 0 219a9f12690SJung-uk Kim #define ACPI_LOCK_HARDWARE 1 220a9f12690SJung-uk Kim 221a9f12690SJung-uk Kim #define ACPI_MAX_LOCK 1 222f8146b88SJung-uk Kim #define ACPI_NUM_LOCK (ACPI_MAX_LOCK+1) 223a9f12690SJung-uk Kim 224a9f12690SJung-uk Kim 225a9f12690SJung-uk Kim /* This Thread ID means that the mutex is not in use (unlocked) */ 226a9f12690SJung-uk Kim 227f8146b88SJung-uk Kim #define ACPI_MUTEX_NOT_ACQUIRED ((ACPI_THREAD_ID) -1) 228f8146b88SJung-uk Kim 229f8146b88SJung-uk Kim /* This Thread ID means an invalid thread ID */ 230f8146b88SJung-uk Kim 231f8146b88SJung-uk Kim #ifdef ACPI_OS_INVALID_THREAD_ID 232f8146b88SJung-uk Kim #define ACPI_INVALID_THREAD_ID ACPI_OS_INVALID_THREAD_ID 233f8146b88SJung-uk Kim #else 234f8146b88SJung-uk Kim #define ACPI_INVALID_THREAD_ID ((ACPI_THREAD_ID) 0xFFFFFFFF) 235f8146b88SJung-uk Kim #endif 236a9f12690SJung-uk Kim 237a9f12690SJung-uk Kim /* Table for the global mutexes */ 238a9f12690SJung-uk Kim 239a9f12690SJung-uk Kim typedef struct acpi_mutex_info 240a9f12690SJung-uk Kim { 241a9f12690SJung-uk Kim ACPI_MUTEX Mutex; 242a9f12690SJung-uk Kim UINT32 UseCount; 243a9f12690SJung-uk Kim ACPI_THREAD_ID ThreadId; 244a9f12690SJung-uk Kim 245a9f12690SJung-uk Kim } ACPI_MUTEX_INFO; 246a9f12690SJung-uk Kim 247a9f12690SJung-uk Kim 248a9f12690SJung-uk Kim /* Lock flag parameter for various interfaces */ 249a9f12690SJung-uk Kim 250a9f12690SJung-uk Kim #define ACPI_MTX_DO_NOT_LOCK 0 251a9f12690SJung-uk Kim #define ACPI_MTX_LOCK 1 252a9f12690SJung-uk Kim 253a9f12690SJung-uk Kim 254a9f12690SJung-uk Kim /* Field access granularities */ 255a9f12690SJung-uk Kim 256a9f12690SJung-uk Kim #define ACPI_FIELD_BYTE_GRANULARITY 1 257a9f12690SJung-uk Kim #define ACPI_FIELD_WORD_GRANULARITY 2 258a9f12690SJung-uk Kim #define ACPI_FIELD_DWORD_GRANULARITY 4 259a9f12690SJung-uk Kim #define ACPI_FIELD_QWORD_GRANULARITY 8 260a9f12690SJung-uk Kim 261a9f12690SJung-uk Kim 262a9f12690SJung-uk Kim #define ACPI_ENTRY_NOT_FOUND NULL 263a9f12690SJung-uk Kim 264a9f12690SJung-uk Kim 265a9f12690SJung-uk Kim /***************************************************************************** 266a9f12690SJung-uk Kim * 267a9f12690SJung-uk Kim * Namespace typedefs and structs 268a9f12690SJung-uk Kim * 269a9f12690SJung-uk Kim ****************************************************************************/ 270a9f12690SJung-uk Kim 271a9f12690SJung-uk Kim /* Operational modes of the AML interpreter/scanner */ 272a9f12690SJung-uk Kim 273a9f12690SJung-uk Kim typedef enum 274a9f12690SJung-uk Kim { 275a9f12690SJung-uk Kim ACPI_IMODE_LOAD_PASS1 = 0x01, 276a9f12690SJung-uk Kim ACPI_IMODE_LOAD_PASS2 = 0x02, 277a9f12690SJung-uk Kim ACPI_IMODE_EXECUTE = 0x03 278a9f12690SJung-uk Kim 279a9f12690SJung-uk Kim } ACPI_INTERPRETER_MODE; 280a9f12690SJung-uk Kim 281a9f12690SJung-uk Kim 282a9f12690SJung-uk Kim /* 283a9f12690SJung-uk Kim * The Namespace Node describes a named object that appears in the AML. 284a9f12690SJung-uk Kim * DescriptorType is used to differentiate between internal descriptors. 285a9f12690SJung-uk Kim * 286a9f12690SJung-uk Kim * The node is optimized for both 32-bit and 64-bit platforms: 2873d90091dSJung-uk Kim * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. 288a9f12690SJung-uk Kim * 289a9f12690SJung-uk Kim * Note: The DescriptorType and Type fields must appear in the identical 290a9f12690SJung-uk Kim * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 291a9f12690SJung-uk Kim * structures. 292a9f12690SJung-uk Kim */ 293a9f12690SJung-uk Kim typedef struct acpi_namespace_node 294a9f12690SJung-uk Kim { 295a9f12690SJung-uk Kim union acpi_operand_object *Object; /* Interpreter object */ 296a9f12690SJung-uk Kim UINT8 DescriptorType; /* Differentiate object descriptor types */ 297a9f12690SJung-uk Kim UINT8 Type; /* ACPI Type associated with this name */ 298*a009b7dcSJung-uk Kim UINT16 Flags; /* Miscellaneous flags */ 299a9f12690SJung-uk Kim ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */ 300a88e22b7SJung-uk Kim struct acpi_namespace_node *Parent; /* Parent node */ 301a9f12690SJung-uk Kim struct acpi_namespace_node *Child; /* First child */ 302a88e22b7SJung-uk Kim struct acpi_namespace_node *Peer; /* First peer */ 303*a009b7dcSJung-uk Kim ACPI_OWNER_ID OwnerId; /* Node creator */ 304a9f12690SJung-uk Kim 305a9f12690SJung-uk Kim /* 3063d90091dSJung-uk Kim * The following fields are used by the ASL compiler and disassembler only 307a9f12690SJung-uk Kim */ 308a9f12690SJung-uk Kim #ifdef ACPI_LARGE_NAMESPACE_NODE 309a9f12690SJung-uk Kim union acpi_parse_object *Op; 310fe0f0bbbSJung-uk Kim void *MethodLocals; 311fe0f0bbbSJung-uk Kim void *MethodArgs; 312a9f12690SJung-uk Kim UINT32 Value; 313a9f12690SJung-uk Kim UINT32 Length; 314fe0f0bbbSJung-uk Kim UINT8 ArgCount; 3153d90091dSJung-uk Kim 316a9f12690SJung-uk Kim #endif 317a9f12690SJung-uk Kim 318a9f12690SJung-uk Kim } ACPI_NAMESPACE_NODE; 319a9f12690SJung-uk Kim 320a9f12690SJung-uk Kim 321a9f12690SJung-uk Kim /* Namespace Node flags */ 322a9f12690SJung-uk Kim 323a88e22b7SJung-uk Kim #define ANOBJ_RESERVED 0x01 /* Available for use */ 324a9f12690SJung-uk Kim #define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */ 325a9f12690SJung-uk Kim #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 326a9f12690SJung-uk Kim #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 327a9f12690SJung-uk Kim #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 328a9f12690SJung-uk Kim #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */ 329a9f12690SJung-uk Kim #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */ 33051f42badSJung-uk Kim #define ANOBJ_NODE_EARLY_INIT 0x80 /* AcpiExec only: Node was create via init file (-fi) */ 331a9f12690SJung-uk Kim 332a9f12690SJung-uk Kim #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ 333a9f12690SJung-uk Kim #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ 334a9f12690SJung-uk Kim #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ 335a9f12690SJung-uk Kim #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ 336a9f12690SJung-uk Kim 337a9f12690SJung-uk Kim 3383f5e024cSJung-uk Kim /* Internal ACPI table management - master table list */ 339a9f12690SJung-uk Kim 3403f5e024cSJung-uk Kim typedef struct acpi_table_list 341a9f12690SJung-uk Kim { 3423f5e024cSJung-uk Kim ACPI_TABLE_DESC *Tables; /* Table descriptor array */ 3433f5e024cSJung-uk Kim UINT32 CurrentTableCount; /* Tables currently in the array */ 3443f5e024cSJung-uk Kim UINT32 MaxTableCount; /* Max tables array will hold */ 345a9f12690SJung-uk Kim UINT8 Flags; 346a9f12690SJung-uk Kim 3473f5e024cSJung-uk Kim } ACPI_TABLE_LIST; 348a9f12690SJung-uk Kim 349a9f12690SJung-uk Kim /* Flags for above */ 350a9f12690SJung-uk Kim 351a9f12690SJung-uk Kim #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */ 352a9f12690SJung-uk Kim #define ACPI_ROOT_ORIGIN_ALLOCATED (1) 353a9f12690SJung-uk Kim #define ACPI_ROOT_ALLOW_RESIZE (2) 354a9f12690SJung-uk Kim 355a9f12690SJung-uk Kim 356f8146b88SJung-uk Kim /* List to manage incoming ACPI tables */ 357f8146b88SJung-uk Kim 358f8146b88SJung-uk Kim typedef struct acpi_new_table_desc 359f8146b88SJung-uk Kim { 360f8146b88SJung-uk Kim ACPI_TABLE_HEADER *Table; 361f8146b88SJung-uk Kim struct acpi_new_table_desc *Next; 362f8146b88SJung-uk Kim 363f8146b88SJung-uk Kim } ACPI_NEW_TABLE_DESC; 364f8146b88SJung-uk Kim 365f8146b88SJung-uk Kim 36670e6ab8fSJung-uk Kim /* Predefined table indexes */ 367a9f12690SJung-uk Kim 36870e6ab8fSJung-uk Kim #define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF) 369a9f12690SJung-uk Kim 370a9f12690SJung-uk Kim 371a9f12690SJung-uk Kim typedef struct acpi_find_context 372a9f12690SJung-uk Kim { 373a9f12690SJung-uk Kim char *SearchFor; 374a9f12690SJung-uk Kim ACPI_HANDLE *List; 375a9f12690SJung-uk Kim UINT32 *Count; 376a9f12690SJung-uk Kim 377a9f12690SJung-uk Kim } ACPI_FIND_CONTEXT; 378a9f12690SJung-uk Kim 379a9f12690SJung-uk Kim 380a9f12690SJung-uk Kim typedef struct acpi_ns_search_data 381a9f12690SJung-uk Kim { 382a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 383a9f12690SJung-uk Kim 384a9f12690SJung-uk Kim } ACPI_NS_SEARCH_DATA; 385a9f12690SJung-uk Kim 386a9f12690SJung-uk Kim 387a9f12690SJung-uk Kim /* Object types used during package copies */ 388a9f12690SJung-uk Kim 389a9f12690SJung-uk Kim #define ACPI_COPY_TYPE_SIMPLE 0 390a9f12690SJung-uk Kim #define ACPI_COPY_TYPE_PACKAGE 1 391a9f12690SJung-uk Kim 392a9f12690SJung-uk Kim 393a9f12690SJung-uk Kim /* Info structure used to convert external<->internal namestrings */ 394a9f12690SJung-uk Kim 395a9f12690SJung-uk Kim typedef struct acpi_namestring_info 396a9f12690SJung-uk Kim { 397a9f12690SJung-uk Kim const char *ExternalName; 398a9f12690SJung-uk Kim const char *NextExternalChar; 399a9f12690SJung-uk Kim char *InternalName; 400a9f12690SJung-uk Kim UINT32 Length; 401a9f12690SJung-uk Kim UINT32 NumSegments; 402a9f12690SJung-uk Kim UINT32 NumCarats; 403a9f12690SJung-uk Kim BOOLEAN FullyQualified; 404a9f12690SJung-uk Kim 405a9f12690SJung-uk Kim } ACPI_NAMESTRING_INFO; 406a9f12690SJung-uk Kim 407a9f12690SJung-uk Kim 408a9f12690SJung-uk Kim /* Field creation info */ 409a9f12690SJung-uk Kim 410a9f12690SJung-uk Kim typedef struct acpi_create_field_info 411a9f12690SJung-uk Kim { 412a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *RegionNode; 413a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *FieldNode; 414a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *RegisterNode; 415a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *DataRegisterNode; 4163f0275a0SJung-uk Kim ACPI_NAMESPACE_NODE *ConnectionNode; 4173f0275a0SJung-uk Kim UINT8 *ResourceBuffer; 418a9f12690SJung-uk Kim UINT32 BankValue; 419a9f12690SJung-uk Kim UINT32 FieldBitPosition; 420a9f12690SJung-uk Kim UINT32 FieldBitLength; 4213f0275a0SJung-uk Kim UINT16 ResourceLength; 422313a0c13SJung-uk Kim UINT16 PinNumberIndex; 423a9f12690SJung-uk Kim UINT8 FieldFlags; 424a9f12690SJung-uk Kim UINT8 Attribute; 425a9f12690SJung-uk Kim UINT8 FieldType; 4263f0275a0SJung-uk Kim UINT8 AccessLength; 427a9f12690SJung-uk Kim 428a9f12690SJung-uk Kim } ACPI_CREATE_FIELD_INFO; 429a9f12690SJung-uk Kim 430a9f12690SJung-uk Kim 431a9f12690SJung-uk Kim typedef 432a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( 433a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 434a9f12690SJung-uk Kim 435a9f12690SJung-uk Kim 436a9f12690SJung-uk Kim /* 437a9f12690SJung-uk Kim * Bitmapped ACPI types. Used internally only 438a9f12690SJung-uk Kim */ 439a9f12690SJung-uk Kim #define ACPI_BTYPE_ANY 0x00000000 440a9f12690SJung-uk Kim #define ACPI_BTYPE_INTEGER 0x00000001 441a9f12690SJung-uk Kim #define ACPI_BTYPE_STRING 0x00000002 442a9f12690SJung-uk Kim #define ACPI_BTYPE_BUFFER 0x00000004 443a9f12690SJung-uk Kim #define ACPI_BTYPE_PACKAGE 0x00000008 444a9f12690SJung-uk Kim #define ACPI_BTYPE_FIELD_UNIT 0x00000010 445a9f12690SJung-uk Kim #define ACPI_BTYPE_DEVICE 0x00000020 446a9f12690SJung-uk Kim #define ACPI_BTYPE_EVENT 0x00000040 447a9f12690SJung-uk Kim #define ACPI_BTYPE_METHOD 0x00000080 448a9f12690SJung-uk Kim #define ACPI_BTYPE_MUTEX 0x00000100 449a9f12690SJung-uk Kim #define ACPI_BTYPE_REGION 0x00000200 450a9f12690SJung-uk Kim #define ACPI_BTYPE_POWER 0x00000400 451a9f12690SJung-uk Kim #define ACPI_BTYPE_PROCESSOR 0x00000800 452a9f12690SJung-uk Kim #define ACPI_BTYPE_THERMAL 0x00001000 453a9f12690SJung-uk Kim #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 454a9f12690SJung-uk Kim #define ACPI_BTYPE_DDB_HANDLE 0x00004000 455a9f12690SJung-uk Kim #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 456f8146b88SJung-uk Kim #define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */ 457a9f12690SJung-uk Kim #define ACPI_BTYPE_RESOURCE 0x00020000 458f8146b88SJung-uk Kim #define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */ 459a9f12690SJung-uk Kim 460a9f12690SJung-uk Kim #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) 461a9f12690SJung-uk Kim 462a9f12690SJung-uk Kim #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 463f8146b88SJung-uk Kim 464f8146b88SJung-uk Kim /* Used by Copy, DeRefOf, Store, Printf, Fprintf */ 465f8146b88SJung-uk Kim 466f8146b88SJung-uk Kim #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE) 467a9f12690SJung-uk Kim #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 468a9f12690SJung-uk Kim #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 469a9f12690SJung-uk Kim #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 470a9f12690SJung-uk Kim 4719c7c683cSJung-uk Kim #pragma pack(1) 472a9f12690SJung-uk Kim 473a9f12690SJung-uk Kim /* 474a9f12690SJung-uk Kim * Information structure for ACPI predefined names. 475a9f12690SJung-uk Kim * Each entry in the table contains the following items: 476a9f12690SJung-uk Kim * 477a9f12690SJung-uk Kim * Name - The ACPI reserved name 478a9f12690SJung-uk Kim * ParamCount - Number of arguments to the method 479a9f12690SJung-uk Kim * ExpectedReturnBtypes - Allowed type(s) for the return value 480a9f12690SJung-uk Kim */ 481a9f12690SJung-uk Kim typedef struct acpi_name_info 482a9f12690SJung-uk Kim { 483278f0de6SJung-uk Kim char Name[ACPI_NAMESEG_SIZE]; 4849c7c683cSJung-uk Kim UINT16 ArgumentList; 485a9f12690SJung-uk Kim UINT8 ExpectedBtypes; 486a9f12690SJung-uk Kim 487a9f12690SJung-uk Kim } ACPI_NAME_INFO; 488a9f12690SJung-uk Kim 489a9f12690SJung-uk Kim /* 490a9f12690SJung-uk Kim * Secondary information structures for ACPI predefined objects that return 491a9f12690SJung-uk Kim * package objects. This structure appears as the next entry in the table 492a9f12690SJung-uk Kim * after the NAME_INFO structure above. 493a9f12690SJung-uk Kim * 494a9f12690SJung-uk Kim * The reason for this is to minimize the size of the predefined name table. 495a9f12690SJung-uk Kim */ 496a9f12690SJung-uk Kim 497a9f12690SJung-uk Kim /* 498a9f12690SJung-uk Kim * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 4993f0275a0SJung-uk Kim * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 5003f0275a0SJung-uk Kim * ACPI_PTYPE2_FIX_VAR 501a9f12690SJung-uk Kim */ 502a9f12690SJung-uk Kim typedef struct acpi_package_info 503a9f12690SJung-uk Kim { 504a9f12690SJung-uk Kim UINT8 Type; 505a9f12690SJung-uk Kim UINT8 ObjectType1; 506a9f12690SJung-uk Kim UINT8 Count1; 507a9f12690SJung-uk Kim UINT8 ObjectType2; 508a9f12690SJung-uk Kim UINT8 Count2; 5099c7c683cSJung-uk Kim UINT16 Reserved; 510a9f12690SJung-uk Kim 511a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO; 512a9f12690SJung-uk Kim 513a9f12690SJung-uk Kim /* Used for ACPI_PTYPE2_FIXED */ 514a9f12690SJung-uk Kim 515a9f12690SJung-uk Kim typedef struct acpi_package_info2 516a9f12690SJung-uk Kim { 517a9f12690SJung-uk Kim UINT8 Type; 518a9f12690SJung-uk Kim UINT8 Count; 519a9f12690SJung-uk Kim UINT8 ObjectType[4]; 5209c7c683cSJung-uk Kim UINT8 Reserved; 521a9f12690SJung-uk Kim 522a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO2; 523a9f12690SJung-uk Kim 524a9f12690SJung-uk Kim /* Used for ACPI_PTYPE1_OPTION */ 525a9f12690SJung-uk Kim 526a9f12690SJung-uk Kim typedef struct acpi_package_info3 527a9f12690SJung-uk Kim { 528a9f12690SJung-uk Kim UINT8 Type; 529a9f12690SJung-uk Kim UINT8 Count; 530a9f12690SJung-uk Kim UINT8 ObjectType[2]; 531a9f12690SJung-uk Kim UINT8 TailObjectType; 5329c7c683cSJung-uk Kim UINT16 Reserved; 533a9f12690SJung-uk Kim 534a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO3; 535a9f12690SJung-uk Kim 536a371a5fdSJung-uk Kim typedef struct acpi_package_info4 537a371a5fdSJung-uk Kim { 538a371a5fdSJung-uk Kim UINT8 Type; 539a371a5fdSJung-uk Kim UINT8 ObjectType1; 540a371a5fdSJung-uk Kim UINT8 Count1; 541a371a5fdSJung-uk Kim UINT8 SubObjectTypes; 542a371a5fdSJung-uk Kim UINT8 PkgCount; 543a371a5fdSJung-uk Kim UINT16 Reserved; 544a371a5fdSJung-uk Kim 545a371a5fdSJung-uk Kim } ACPI_PACKAGE_INFO4; 546a371a5fdSJung-uk Kim 547a9f12690SJung-uk Kim typedef union acpi_predefined_info 548a9f12690SJung-uk Kim { 549a9f12690SJung-uk Kim ACPI_NAME_INFO Info; 550a9f12690SJung-uk Kim ACPI_PACKAGE_INFO RetInfo; 551a9f12690SJung-uk Kim ACPI_PACKAGE_INFO2 RetInfo2; 552a9f12690SJung-uk Kim ACPI_PACKAGE_INFO3 RetInfo3; 553a371a5fdSJung-uk Kim ACPI_PACKAGE_INFO4 RetInfo4; 554a9f12690SJung-uk Kim 555a9f12690SJung-uk Kim } ACPI_PREDEFINED_INFO; 556a9f12690SJung-uk Kim 5579c7c683cSJung-uk Kim /* Reset to default packing */ 5589c7c683cSJung-uk Kim 5599c7c683cSJung-uk Kim #pragma pack() 5609c7c683cSJung-uk Kim 561d6dd1baeSJung-uk Kim 5629c48c75eSJung-uk Kim /* Return object auto-repair info */ 5639c48c75eSJung-uk Kim 5649c48c75eSJung-uk Kim typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) ( 565f8146b88SJung-uk Kim struct acpi_namespace_node *Scope, 5669c48c75eSJung-uk Kim union acpi_operand_object *OriginalObject, 5679c48c75eSJung-uk Kim union acpi_operand_object **ConvertedObject); 5689c48c75eSJung-uk Kim 5699c48c75eSJung-uk Kim typedef struct acpi_simple_repair_info 5709c48c75eSJung-uk Kim { 571278f0de6SJung-uk Kim char Name[ACPI_NAMESEG_SIZE]; 5729c48c75eSJung-uk Kim UINT32 UnexpectedBtypes; 5739c48c75eSJung-uk Kim UINT32 PackageIndex; 5749c48c75eSJung-uk Kim ACPI_OBJECT_CONVERTER ObjectConverter; 5759c48c75eSJung-uk Kim 5769c48c75eSJung-uk Kim } ACPI_SIMPLE_REPAIR_INFO; 5779c48c75eSJung-uk Kim 5789c48c75eSJung-uk Kim 579a9f12690SJung-uk Kim /* 580a9f12690SJung-uk Kim * Bitmapped return value types 581a9f12690SJung-uk Kim * Note: the actual data types must be contiguous, a loop in nspredef.c 582a9f12690SJung-uk Kim * depends on this. 583a9f12690SJung-uk Kim */ 584a9f12690SJung-uk Kim #define ACPI_RTYPE_ANY 0x00 585a9f12690SJung-uk Kim #define ACPI_RTYPE_NONE 0x01 586a9f12690SJung-uk Kim #define ACPI_RTYPE_INTEGER 0x02 587a9f12690SJung-uk Kim #define ACPI_RTYPE_STRING 0x04 588a9f12690SJung-uk Kim #define ACPI_RTYPE_BUFFER 0x08 589a9f12690SJung-uk Kim #define ACPI_RTYPE_PACKAGE 0x10 590a9f12690SJung-uk Kim #define ACPI_RTYPE_REFERENCE 0x20 591a9f12690SJung-uk Kim #define ACPI_RTYPE_ALL 0x3F 592a9f12690SJung-uk Kim 593a9f12690SJung-uk Kim #define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 594a9f12690SJung-uk Kim 595a9f12690SJung-uk Kim 59670e6ab8fSJung-uk Kim /* Info for running the _REG methods */ 59770e6ab8fSJung-uk Kim 59870e6ab8fSJung-uk Kim typedef struct acpi_reg_walk_info 59970e6ab8fSJung-uk Kim { 600f8146b88SJung-uk Kim UINT32 Function; 60170e6ab8fSJung-uk Kim UINT32 RegRunCount; 6026f1f1a63SJung-uk Kim ACPI_ADR_SPACE_TYPE SpaceId; 60370e6ab8fSJung-uk Kim 60470e6ab8fSJung-uk Kim } ACPI_REG_WALK_INFO; 60570e6ab8fSJung-uk Kim 60670e6ab8fSJung-uk Kim 607a9f12690SJung-uk Kim /***************************************************************************** 608a9f12690SJung-uk Kim * 609a9f12690SJung-uk Kim * Event typedefs and structs 610a9f12690SJung-uk Kim * 611a9f12690SJung-uk Kim ****************************************************************************/ 612a9f12690SJung-uk Kim 61379c6d946SJung-uk Kim /* Dispatch info for each host-installed SCI handler */ 61479c6d946SJung-uk Kim 61579c6d946SJung-uk Kim typedef struct acpi_sci_handler_info 61679c6d946SJung-uk Kim { 61779c6d946SJung-uk Kim struct acpi_sci_handler_info *Next; 61879c6d946SJung-uk Kim ACPI_SCI_HANDLER Address; /* Address of handler */ 61979c6d946SJung-uk Kim void *Context; /* Context to be passed to handler */ 62079c6d946SJung-uk Kim 62179c6d946SJung-uk Kim } ACPI_SCI_HANDLER_INFO; 62279c6d946SJung-uk Kim 623a9f12690SJung-uk Kim /* Dispatch info for each GPE -- either a method or handler, cannot be both */ 624a9f12690SJung-uk Kim 6255a77b11bSJung-uk Kim typedef struct acpi_gpe_handler_info 626a9f12690SJung-uk Kim { 6275a77b11bSJung-uk Kim ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 628a9f12690SJung-uk Kim void *Context; /* Context to be passed to handler */ 629a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 6305a77b11bSJung-uk Kim UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 6315a77b11bSJung-uk Kim BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 632a9f12690SJung-uk Kim 6335a77b11bSJung-uk Kim } ACPI_GPE_HANDLER_INFO; 634a9f12690SJung-uk Kim 635f38b0f21SJung-uk Kim /* Notify info for implicit notify, multiple device objects */ 636f38b0f21SJung-uk Kim 637f38b0f21SJung-uk Kim typedef struct acpi_gpe_notify_info 638f38b0f21SJung-uk Kim { 639f38b0f21SJung-uk Kim ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */ 640f38b0f21SJung-uk Kim struct acpi_gpe_notify_info *Next; 641f38b0f21SJung-uk Kim 642f38b0f21SJung-uk Kim } ACPI_GPE_NOTIFY_INFO; 643f38b0f21SJung-uk Kim 6445a77b11bSJung-uk Kim /* 6455a77b11bSJung-uk Kim * GPE dispatch info. At any time, the GPE can have at most one type 6465a77b11bSJung-uk Kim * of dispatch - Method, Handler, or Implicit Notify. 6475a77b11bSJung-uk Kim */ 648a9f12690SJung-uk Kim typedef union acpi_gpe_dispatch_info 649a9f12690SJung-uk Kim { 650a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 651f38b0f21SJung-uk Kim ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */ 652f38b0f21SJung-uk Kim ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */ 653a9f12690SJung-uk Kim 654a9f12690SJung-uk Kim } ACPI_GPE_DISPATCH_INFO; 655a9f12690SJung-uk Kim 656a9f12690SJung-uk Kim /* 657a9f12690SJung-uk Kim * Information about a GPE, one per each GPE in an array. 658a9f12690SJung-uk Kim * NOTE: Important to keep this struct as small as possible. 659a9f12690SJung-uk Kim */ 660a9f12690SJung-uk Kim typedef struct acpi_gpe_event_info 661a9f12690SJung-uk Kim { 662f38b0f21SJung-uk Kim union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */ 663a9f12690SJung-uk Kim struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 664a9f12690SJung-uk Kim UINT8 Flags; /* Misc info about this GPE */ 665a9f12690SJung-uk Kim UINT8 GpeNumber; /* This GPE */ 6668c8be05fSJung-uk Kim UINT8 RuntimeCount; /* References to a run GPE */ 667493deb39SJung-uk Kim BOOLEAN DisableForDispatch; /* Masked during dispatching */ 668a9f12690SJung-uk Kim 669a9f12690SJung-uk Kim } ACPI_GPE_EVENT_INFO; 670a9f12690SJung-uk Kim 671a9f12690SJung-uk Kim /* Information about a GPE register pair, one per each status/enable pair in an array */ 672a9f12690SJung-uk Kim 673a9f12690SJung-uk Kim typedef struct acpi_gpe_register_info 674a9f12690SJung-uk Kim { 675a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 676a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 677313a0c13SJung-uk Kim UINT16 BaseGpeNumber; /* Base GPE number for this register */ 678a9f12690SJung-uk Kim UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 679a9f12690SJung-uk Kim UINT8 EnableForRun; /* GPEs to keep enabled when running */ 680493deb39SJung-uk Kim UINT8 MaskForRun; /* GPEs to keep masked when running */ 6811c0e1b6dSJung-uk Kim UINT8 EnableMask; /* Current mask of enabled GPEs */ 682a9f12690SJung-uk Kim 683a9f12690SJung-uk Kim } ACPI_GPE_REGISTER_INFO; 684a9f12690SJung-uk Kim 685a9f12690SJung-uk Kim /* 686a9f12690SJung-uk Kim * Information about a GPE register block, one per each installed block -- 687a9f12690SJung-uk Kim * GPE0, GPE1, and one per each installed GPE Block Device. 688a9f12690SJung-uk Kim */ 689a9f12690SJung-uk Kim typedef struct acpi_gpe_block_info 690a9f12690SJung-uk Kim { 691a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 692a9f12690SJung-uk Kim struct acpi_gpe_block_info *Previous; 693a9f12690SJung-uk Kim struct acpi_gpe_block_info *Next; 694a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 695a9f12690SJung-uk Kim ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 696a9f12690SJung-uk Kim ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 697313a0c13SJung-uk Kim UINT64 Address; /* Base address of the block */ 698a9f12690SJung-uk Kim UINT32 RegisterCount; /* Number of register pairs in block */ 6998c8be05fSJung-uk Kim UINT16 GpeCount; /* Number of individual GPEs in block */ 700313a0c13SJung-uk Kim UINT16 BlockBaseNumber;/* Base GPE number for this block */ 701313a0c13SJung-uk Kim UINT8 SpaceId; 7025a77b11bSJung-uk Kim BOOLEAN Initialized; /* TRUE if this block is initialized */ 703a9f12690SJung-uk Kim 704a9f12690SJung-uk Kim } ACPI_GPE_BLOCK_INFO; 705a9f12690SJung-uk Kim 706a9f12690SJung-uk Kim /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 707a9f12690SJung-uk Kim 708a9f12690SJung-uk Kim typedef struct acpi_gpe_xrupt_info 709a9f12690SJung-uk Kim { 710a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *Previous; 711a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *Next; 712a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 713a9f12690SJung-uk Kim UINT32 InterruptNumber; /* System interrupt number */ 714a9f12690SJung-uk Kim 715a9f12690SJung-uk Kim } ACPI_GPE_XRUPT_INFO; 716a9f12690SJung-uk Kim 717a9f12690SJung-uk Kim typedef struct acpi_gpe_walk_info 718a9f12690SJung-uk Kim { 719a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *GpeDevice; 720a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlock; 7213f5e024cSJung-uk Kim UINT16 Count; 7223f5e024cSJung-uk Kim ACPI_OWNER_ID OwnerId; 7233f5e024cSJung-uk Kim BOOLEAN ExecuteByOwnerId; 724a9f12690SJung-uk Kim 725a9f12690SJung-uk Kim } ACPI_GPE_WALK_INFO; 726a9f12690SJung-uk Kim 727a9f12690SJung-uk Kim typedef struct acpi_gpe_device_info 728a9f12690SJung-uk Kim { 729a9f12690SJung-uk Kim UINT32 Index; 730a9f12690SJung-uk Kim UINT32 NextBlockBaseIndex; 731a9f12690SJung-uk Kim ACPI_STATUS Status; 732a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *GpeDevice; 733a9f12690SJung-uk Kim 734a9f12690SJung-uk Kim } ACPI_GPE_DEVICE_INFO; 735a9f12690SJung-uk Kim 736a9f12690SJung-uk Kim typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 737a9f12690SJung-uk Kim ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 738a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlock, 739a9f12690SJung-uk Kim void *Context); 740a9f12690SJung-uk Kim 741a9f12690SJung-uk Kim 742a9f12690SJung-uk Kim /* Information about each particular fixed event */ 743a9f12690SJung-uk Kim 744a9f12690SJung-uk Kim typedef struct acpi_fixed_event_handler 745a9f12690SJung-uk Kim { 746a9f12690SJung-uk Kim ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 747a9f12690SJung-uk Kim void *Context; /* Context to be passed to handler */ 748a9f12690SJung-uk Kim 749a9f12690SJung-uk Kim } ACPI_FIXED_EVENT_HANDLER; 750a9f12690SJung-uk Kim 751a9f12690SJung-uk Kim typedef struct acpi_fixed_event_info 752a9f12690SJung-uk Kim { 753a9f12690SJung-uk Kim UINT8 StatusRegisterId; 754a9f12690SJung-uk Kim UINT8 EnableRegisterId; 755a9f12690SJung-uk Kim UINT16 StatusBitMask; 756a9f12690SJung-uk Kim UINT16 EnableBitMask; 757a9f12690SJung-uk Kim 758a9f12690SJung-uk Kim } ACPI_FIXED_EVENT_INFO; 759a9f12690SJung-uk Kim 760a9f12690SJung-uk Kim /* Information used during field processing */ 761a9f12690SJung-uk Kim 762a9f12690SJung-uk Kim typedef struct acpi_field_info 763a9f12690SJung-uk Kim { 764a9f12690SJung-uk Kim UINT8 SkipField; 765a9f12690SJung-uk Kim UINT8 FieldFlag; 766a9f12690SJung-uk Kim UINT32 PkgLength; 767a9f12690SJung-uk Kim 768a9f12690SJung-uk Kim } ACPI_FIELD_INFO; 769a9f12690SJung-uk Kim 770a9f12690SJung-uk Kim 771a9f12690SJung-uk Kim /***************************************************************************** 772a9f12690SJung-uk Kim * 773a9f12690SJung-uk Kim * Generic "state" object for stacks 774a9f12690SJung-uk Kim * 775a9f12690SJung-uk Kim ****************************************************************************/ 776a9f12690SJung-uk Kim 777a9f12690SJung-uk Kim #define ACPI_CONTROL_NORMAL 0xC0 778a9f12690SJung-uk Kim #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 779a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 780a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 781a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 782a9f12690SJung-uk Kim 783a9f12690SJung-uk Kim 784a9f12690SJung-uk Kim #define ACPI_STATE_COMMON \ 785a9f12690SJung-uk Kim void *Next; \ 786a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */\ 787a9f12690SJung-uk Kim UINT8 Flags; \ 788a9f12690SJung-uk Kim UINT16 Value; \ 789a9f12690SJung-uk Kim UINT16 State; 790a9f12690SJung-uk Kim 791a9f12690SJung-uk Kim /* There are 2 bytes available here until the next natural alignment boundary */ 792a9f12690SJung-uk Kim 793a9f12690SJung-uk Kim typedef struct acpi_common_state 794a9f12690SJung-uk Kim { 795a9f12690SJung-uk Kim ACPI_STATE_COMMON 796a9f12690SJung-uk Kim } ACPI_COMMON_STATE; 797a9f12690SJung-uk Kim 798a9f12690SJung-uk Kim 799a9f12690SJung-uk Kim /* 800a9f12690SJung-uk Kim * Update state - used to traverse complex objects such as packages 801a9f12690SJung-uk Kim */ 802a9f12690SJung-uk Kim typedef struct acpi_update_state 803a9f12690SJung-uk Kim { 804a9f12690SJung-uk Kim ACPI_STATE_COMMON 805a9f12690SJung-uk Kim union acpi_operand_object *Object; 806a9f12690SJung-uk Kim 807a9f12690SJung-uk Kim } ACPI_UPDATE_STATE; 808a9f12690SJung-uk Kim 809a9f12690SJung-uk Kim 810a9f12690SJung-uk Kim /* 811a9f12690SJung-uk Kim * Pkg state - used to traverse nested package structures 812a9f12690SJung-uk Kim */ 813a9f12690SJung-uk Kim typedef struct acpi_pkg_state 814a9f12690SJung-uk Kim { 815a9f12690SJung-uk Kim ACPI_STATE_COMMON 8165f9b24faSJung-uk Kim UINT32 Index; 817a9f12690SJung-uk Kim union acpi_operand_object *SourceObject; 818a9f12690SJung-uk Kim union acpi_operand_object *DestObject; 819a9f12690SJung-uk Kim struct acpi_walk_state *WalkState; 820a9f12690SJung-uk Kim void *ThisTargetObj; 821a9f12690SJung-uk Kim UINT32 NumPackages; 822a9f12690SJung-uk Kim 823a9f12690SJung-uk Kim } ACPI_PKG_STATE; 824a9f12690SJung-uk Kim 825a9f12690SJung-uk Kim 826a9f12690SJung-uk Kim /* 827a9f12690SJung-uk Kim * Control state - one per if/else and while constructs. 828a9f12690SJung-uk Kim * Allows nesting of these constructs 829a9f12690SJung-uk Kim */ 830a9f12690SJung-uk Kim typedef struct acpi_control_state 831a9f12690SJung-uk Kim { 832a9f12690SJung-uk Kim ACPI_STATE_COMMON 833a9f12690SJung-uk Kim UINT16 Opcode; 834a9f12690SJung-uk Kim union acpi_parse_object *PredicateOp; 835a9f12690SJung-uk Kim UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 836a9f12690SJung-uk Kim UINT8 *PackageEnd; /* End of if/while block */ 83767d9aa44SJung-uk Kim UINT64 LoopTimeout; /* While() loop timeout */ 838a9f12690SJung-uk Kim 839a9f12690SJung-uk Kim } ACPI_CONTROL_STATE; 840a9f12690SJung-uk Kim 841a9f12690SJung-uk Kim 842a9f12690SJung-uk Kim /* 843a9f12690SJung-uk Kim * Scope state - current scope during namespace lookups 844a9f12690SJung-uk Kim */ 845a9f12690SJung-uk Kim typedef struct acpi_scope_state 846a9f12690SJung-uk Kim { 847a9f12690SJung-uk Kim ACPI_STATE_COMMON 848a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 849a9f12690SJung-uk Kim 850a9f12690SJung-uk Kim } ACPI_SCOPE_STATE; 851a9f12690SJung-uk Kim 852a9f12690SJung-uk Kim 853a9f12690SJung-uk Kim typedef struct acpi_pscope_state 854a9f12690SJung-uk Kim { 855a9f12690SJung-uk Kim ACPI_STATE_COMMON 856a9f12690SJung-uk Kim UINT32 ArgCount; /* Number of fixed arguments */ 857a9f12690SJung-uk Kim union acpi_parse_object *Op; /* Current op being parsed */ 858a9f12690SJung-uk Kim UINT8 *ArgEnd; /* Current argument end */ 859a9f12690SJung-uk Kim UINT8 *PkgEnd; /* Current package end */ 860a9f12690SJung-uk Kim UINT32 ArgList; /* Next argument to parse */ 861a9f12690SJung-uk Kim 862a9f12690SJung-uk Kim } ACPI_PSCOPE_STATE; 863a9f12690SJung-uk Kim 864a9f12690SJung-uk Kim 865a9f12690SJung-uk Kim /* 866a9f12690SJung-uk Kim * Thread state - one per thread across multiple walk states. Multiple walk 867a9f12690SJung-uk Kim * states are created when there are nested control methods executing. 868a9f12690SJung-uk Kim */ 869a9f12690SJung-uk Kim typedef struct acpi_thread_state 870a9f12690SJung-uk Kim { 871a9f12690SJung-uk Kim ACPI_STATE_COMMON 872a9f12690SJung-uk Kim UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 873a9f12690SJung-uk Kim struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 874a9f12690SJung-uk Kim union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 875a9f12690SJung-uk Kim ACPI_THREAD_ID ThreadId; /* Running thread ID */ 876a9f12690SJung-uk Kim 877a9f12690SJung-uk Kim } ACPI_THREAD_STATE; 878a9f12690SJung-uk Kim 879a9f12690SJung-uk Kim 880a9f12690SJung-uk Kim /* 881a9f12690SJung-uk Kim * Result values - used to accumulate the results of nested 882a9f12690SJung-uk Kim * AML arguments 883a9f12690SJung-uk Kim */ 884a9f12690SJung-uk Kim typedef struct acpi_result_values 885a9f12690SJung-uk Kim { 886a9f12690SJung-uk Kim ACPI_STATE_COMMON 887a9f12690SJung-uk Kim union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 888a9f12690SJung-uk Kim 889a9f12690SJung-uk Kim } ACPI_RESULT_VALUES; 890a9f12690SJung-uk Kim 891a9f12690SJung-uk Kim 892a9f12690SJung-uk Kim typedef 893a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 894a9f12690SJung-uk Kim struct acpi_walk_state *WalkState, 895a9f12690SJung-uk Kim union acpi_parse_object **OutOp); 896a9f12690SJung-uk Kim 897a9f12690SJung-uk Kim typedef 898a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 899a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 900a9f12690SJung-uk Kim 901a9f12690SJung-uk Kim 902eef1b955SJung-uk Kim /* Global handlers for AML Notifies */ 903eef1b955SJung-uk Kim 904eef1b955SJung-uk Kim typedef struct acpi_global_notify_handler 905eef1b955SJung-uk Kim { 906eef1b955SJung-uk Kim ACPI_NOTIFY_HANDLER Handler; 907eef1b955SJung-uk Kim void *Context; 908eef1b955SJung-uk Kim 909eef1b955SJung-uk Kim } ACPI_GLOBAL_NOTIFY_HANDLER; 910eef1b955SJung-uk Kim 911a9f12690SJung-uk Kim /* 912a9f12690SJung-uk Kim * Notify info - used to pass info to the deferred notify 913a9f12690SJung-uk Kim * handler/dispatcher. 914a9f12690SJung-uk Kim */ 915a9f12690SJung-uk Kim typedef struct acpi_notify_info 916a9f12690SJung-uk Kim { 917a9f12690SJung-uk Kim ACPI_STATE_COMMON 918eef1b955SJung-uk Kim UINT8 HandlerListId; 919a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 920eef1b955SJung-uk Kim union acpi_operand_object *HandlerListHead; 921eef1b955SJung-uk Kim ACPI_GLOBAL_NOTIFY_HANDLER *Global; 922a9f12690SJung-uk Kim 923a9f12690SJung-uk Kim } ACPI_NOTIFY_INFO; 924a9f12690SJung-uk Kim 925a9f12690SJung-uk Kim 926a9f12690SJung-uk Kim /* Generic state is union of structs above */ 927a9f12690SJung-uk Kim 928a9f12690SJung-uk Kim typedef union acpi_generic_state 929a9f12690SJung-uk Kim { 930a9f12690SJung-uk Kim ACPI_COMMON_STATE Common; 931a9f12690SJung-uk Kim ACPI_CONTROL_STATE Control; 932a9f12690SJung-uk Kim ACPI_UPDATE_STATE Update; 933a9f12690SJung-uk Kim ACPI_SCOPE_STATE Scope; 934a9f12690SJung-uk Kim ACPI_PSCOPE_STATE ParseScope; 935a9f12690SJung-uk Kim ACPI_PKG_STATE Pkg; 936a9f12690SJung-uk Kim ACPI_THREAD_STATE Thread; 937a9f12690SJung-uk Kim ACPI_RESULT_VALUES Results; 938a9f12690SJung-uk Kim ACPI_NOTIFY_INFO Notify; 939a9f12690SJung-uk Kim 940a9f12690SJung-uk Kim } ACPI_GENERIC_STATE; 941a9f12690SJung-uk Kim 942a9f12690SJung-uk Kim 943a9f12690SJung-uk Kim /***************************************************************************** 944a9f12690SJung-uk Kim * 945a9f12690SJung-uk Kim * Interpreter typedefs and structs 946a9f12690SJung-uk Kim * 947a9f12690SJung-uk Kim ****************************************************************************/ 948a9f12690SJung-uk Kim 949a9f12690SJung-uk Kim typedef 950a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_EXECUTE_OP) ( 951a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 952a9f12690SJung-uk Kim 953ec3fc72fSJung-uk Kim /* Address Range info block */ 954ec3fc72fSJung-uk Kim 955ec3fc72fSJung-uk Kim typedef struct acpi_address_range 956ec3fc72fSJung-uk Kim { 957ec3fc72fSJung-uk Kim struct acpi_address_range *Next; 958ec3fc72fSJung-uk Kim ACPI_NAMESPACE_NODE *RegionNode; 959ec3fc72fSJung-uk Kim ACPI_PHYSICAL_ADDRESS StartAddress; 960ec3fc72fSJung-uk Kim ACPI_PHYSICAL_ADDRESS EndAddress; 961ec3fc72fSJung-uk Kim 962ec3fc72fSJung-uk Kim } ACPI_ADDRESS_RANGE; 963ec3fc72fSJung-uk Kim 964a9f12690SJung-uk Kim 965a9f12690SJung-uk Kim /***************************************************************************** 966a9f12690SJung-uk Kim * 967a9f12690SJung-uk Kim * Parser typedefs and structs 968a9f12690SJung-uk Kim * 969a9f12690SJung-uk Kim ****************************************************************************/ 970a9f12690SJung-uk Kim 971a9f12690SJung-uk Kim /* 972a9f12690SJung-uk Kim * AML opcode, name, and argument layout 973a9f12690SJung-uk Kim */ 974a9f12690SJung-uk Kim typedef struct acpi_opcode_info 975a9f12690SJung-uk Kim { 976a9f12690SJung-uk Kim #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 977a9f12690SJung-uk Kim char *Name; /* Opcode name (disassembler/debug only) */ 978a9f12690SJung-uk Kim #endif 979a9f12690SJung-uk Kim UINT32 ParseArgs; /* Grammar/Parse time arguments */ 980a9f12690SJung-uk Kim UINT32 RuntimeArgs; /* Interpret time arguments */ 981a9f12690SJung-uk Kim UINT16 Flags; /* Misc flags */ 982a9f12690SJung-uk Kim UINT8 ObjectType; /* Corresponding internal object type */ 983a9f12690SJung-uk Kim UINT8 Class; /* Opcode class */ 984a9f12690SJung-uk Kim UINT8 Type; /* Opcode type */ 985a9f12690SJung-uk Kim 986a9f12690SJung-uk Kim } ACPI_OPCODE_INFO; 987a9f12690SJung-uk Kim 9883f0275a0SJung-uk Kim /* Structure for Resource Tag information */ 9893f0275a0SJung-uk Kim 9903f0275a0SJung-uk Kim typedef struct acpi_tag_info 9913f0275a0SJung-uk Kim { 9923f0275a0SJung-uk Kim UINT32 BitOffset; 9933f0275a0SJung-uk Kim UINT32 BitLength; 9943f0275a0SJung-uk Kim 9953f0275a0SJung-uk Kim } ACPI_TAG_INFO; 9963f0275a0SJung-uk Kim 9973f0275a0SJung-uk Kim /* Value associated with the parse object */ 9983f0275a0SJung-uk Kim 999a9f12690SJung-uk Kim typedef union acpi_parse_value 1000a9f12690SJung-uk Kim { 10019a179dd8SJung-uk Kim UINT64 Integer; /* Integer constant (Up to 64 bits) */ 1002a9f12690SJung-uk Kim UINT32 Size; /* bytelist or field size */ 1003a9f12690SJung-uk Kim char *String; /* NULL terminated string */ 1004a9f12690SJung-uk Kim UINT8 *Buffer; /* buffer or string */ 1005a9f12690SJung-uk Kim char *Name; /* NULL terminated string */ 1006a9f12690SJung-uk Kim union acpi_parse_object *Arg; /* arguments and contained ops */ 10073f0275a0SJung-uk Kim ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 1008a9f12690SJung-uk Kim 1009a9f12690SJung-uk Kim } ACPI_PARSE_VALUE; 1010a9f12690SJung-uk Kim 1011a9f12690SJung-uk Kim 1012fe0f0bbbSJung-uk Kim #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 1013a9f12690SJung-uk Kim #define ACPI_DISASM_ONLY_MEMBERS(a) a; 1014a9f12690SJung-uk Kim #else 1015a9f12690SJung-uk Kim #define ACPI_DISASM_ONLY_MEMBERS(a) 1016a9f12690SJung-uk Kim #endif 1017a9f12690SJung-uk Kim 10180d84335fSJung-uk Kim #if defined(ACPI_ASL_COMPILER) 10190d84335fSJung-uk Kim #define ACPI_CONVERTER_ONLY_MEMBERS(a) a; 10200d84335fSJung-uk Kim #else 10210d84335fSJung-uk Kim #define ACPI_CONVERTER_ONLY_MEMBERS(a) 10220d84335fSJung-uk Kim #endif 10230d84335fSJung-uk Kim 1024a9f12690SJung-uk Kim #define ACPI_PARSE_COMMON \ 1025a9f12690SJung-uk Kim union acpi_parse_object *Parent; /* Parent op */\ 1026a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */\ 1027a9f12690SJung-uk Kim UINT8 Flags; /* Type of Op */\ 1028a9f12690SJung-uk Kim UINT16 AmlOpcode; /* AML opcode */\ 1029fe0f0bbbSJung-uk Kim UINT8 *Aml; /* Address of declaration in AML */\ 1030a9f12690SJung-uk Kim union acpi_parse_object *Next; /* Next op */\ 1031a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 1032a9f12690SJung-uk Kim ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 1033a9f12690SJung-uk Kim UINT8 ArgListLength; /* Number of elements in the arg list */\ 1034a9f12690SJung-uk Kim ACPI_DISASM_ONLY_MEMBERS (\ 1035493deb39SJung-uk Kim UINT16 DisasmFlags; /* Used during AML disassembly */\ 1036a9f12690SJung-uk Kim UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 10371c0e1b6dSJung-uk Kim char *OperatorSymbol; /* Used for C-style operator name strings */\ 10380d84335fSJung-uk Kim char AmlOpName[16]) /* Op name (debug only) */\ 10390d84335fSJung-uk Kim ACPI_CONVERTER_ONLY_MEMBERS (\ 10400d84335fSJung-uk Kim char *InlineComment; /* Inline comment */\ 10410d84335fSJung-uk Kim char *EndNodeComment; /* End of node comment */\ 10420d84335fSJung-uk Kim char *NameComment; /* Comment associated with the first parameter of the name node */\ 10430d84335fSJung-uk Kim char *CloseBraceComment; /* Comments that come after } on the same as } */\ 10440d84335fSJung-uk Kim ACPI_COMMENT_NODE *CommentList; /* comments that appears before this node */\ 10450d84335fSJung-uk Kim ACPI_COMMENT_NODE *EndBlkComment; /* comments that at the end of a block but before ) or } */\ 10460d84335fSJung-uk Kim char *CvFilename; /* Filename associated with this node. Used for ASL/ASL+ converter */\ 10470d84335fSJung-uk Kim char *CvParentFilename) /* Parent filename associated with this node. Used for ASL/ASL+ converter */ 10480d84335fSJung-uk Kim 10490d84335fSJung-uk Kim 10500d84335fSJung-uk Kim /* categories of comments */ 10510d84335fSJung-uk Kim 10520d84335fSJung-uk Kim typedef enum 10530d84335fSJung-uk Kim { 10540d84335fSJung-uk Kim STANDARD_COMMENT = 1, 10550d84335fSJung-uk Kim INLINE_COMMENT, 10560d84335fSJung-uk Kim ENDNODE_COMMENT, 10570d84335fSJung-uk Kim OPENBRACE_COMMENT, 10580d84335fSJung-uk Kim CLOSE_BRACE_COMMENT, 10590d84335fSJung-uk Kim STD_DEFBLK_COMMENT, 10600d84335fSJung-uk Kim END_DEFBLK_COMMENT, 10610d84335fSJung-uk Kim FILENAME_COMMENT, 10620d84335fSJung-uk Kim PARENTFILENAME_COMMENT, 10630d84335fSJung-uk Kim ENDBLK_COMMENT, 10640d84335fSJung-uk Kim INCLUDE_COMMENT 10650d84335fSJung-uk Kim 10660d84335fSJung-uk Kim } ASL_COMMENT_TYPES; 1067a9f12690SJung-uk Kim 1068a9f12690SJung-uk Kim 106928482948SJung-uk Kim /* Internal opcodes for DisasmOpcode field above */ 10701df130f1SJung-uk Kim 10711df130f1SJung-uk Kim #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */ 10721df130f1SJung-uk Kim #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */ 10731df130f1SJung-uk Kim #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ 10741df130f1SJung-uk Kim #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ 10751df130f1SJung-uk Kim #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ 1076313a0c13SJung-uk Kim #define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */ 1077313a0c13SJung-uk Kim #define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */ 1078313a0c13SJung-uk Kim #define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */ 1079313a0c13SJung-uk Kim #define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */ 1080313a0c13SJung-uk Kim #define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */ 1081313a0c13SJung-uk Kim #define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */ 108228482948SJung-uk Kim #define ACPI_DASM_IGNORE_SINGLE 0x0B /* Ignore the opcode but not it's children */ 10830d84335fSJung-uk Kim #define ACPI_DASM_SWITCH 0x0C /* While is a Switch */ 10840d84335fSJung-uk Kim #define ACPI_DASM_SWITCH_PREDICATE 0x0D /* Object is a predicate for a Switch or Case block */ 10850d84335fSJung-uk Kim #define ACPI_DASM_CASE 0x0E /* If/Else is a Case in a Switch/Case block */ 10860d84335fSJung-uk Kim #define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */ 10870d84335fSJung-uk Kim 10880d84335fSJung-uk Kim 10890d84335fSJung-uk Kim /* 10900d84335fSJung-uk Kim * List struct used in the -ca option 10910d84335fSJung-uk Kim */ 10920d84335fSJung-uk Kim typedef struct acpi_comment_node 10930d84335fSJung-uk Kim { 10940d84335fSJung-uk Kim char *Comment; 10950d84335fSJung-uk Kim struct acpi_comment_node *Next; 10960d84335fSJung-uk Kim 10970d84335fSJung-uk Kim } ACPI_COMMENT_NODE; 10980d84335fSJung-uk Kim 10990d84335fSJung-uk Kim 11000d84335fSJung-uk Kim typedef struct acpi_comment_addr_node 11010d84335fSJung-uk Kim { 11020d84335fSJung-uk Kim UINT8 *Addr; 11030d84335fSJung-uk Kim struct acpi_comment_addr_node *Next; 11040d84335fSJung-uk Kim } ACPI_COMMENT_ADDR_NODE; 11050d84335fSJung-uk Kim 11060d84335fSJung-uk Kim /* 11070d84335fSJung-uk Kim * File node - used for "Include" operator file stack and 1108cd6518c7SJung-uk Kim * dependency tree for the -ca option 11090d84335fSJung-uk Kim */ 11100d84335fSJung-uk Kim typedef struct acpi_file_node 11110d84335fSJung-uk Kim { 11120d84335fSJung-uk Kim void *File; 11130d84335fSJung-uk Kim char *Filename; 11140d84335fSJung-uk Kim char *FileStart; /* Points to AML and indicates when the AML for this particular file starts. */ 11150d84335fSJung-uk Kim char *FileEnd; /* Points to AML and indicates when the AML for this particular file ends. */ 11160d84335fSJung-uk Kim struct acpi_file_node *Next; 11170d84335fSJung-uk Kim struct acpi_file_node *Parent; 11180d84335fSJung-uk Kim BOOLEAN IncludeWritten; 11190d84335fSJung-uk Kim ACPI_COMMENT_NODE *IncludeComment; 11200d84335fSJung-uk Kim 11210d84335fSJung-uk Kim } ACPI_FILE_NODE; 11220d84335fSJung-uk Kim 1123a9f12690SJung-uk Kim 1124a9f12690SJung-uk Kim /* 1125a9f12690SJung-uk Kim * Generic operation (for example: If, While, Store) 1126a9f12690SJung-uk Kim */ 1127a9f12690SJung-uk Kim typedef struct acpi_parse_obj_common 1128a9f12690SJung-uk Kim { 1129a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1130a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_COMMON; 1131a9f12690SJung-uk Kim 1132a9f12690SJung-uk Kim 1133a9f12690SJung-uk Kim /* 1134a9f12690SJung-uk Kim * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 1135a9f12690SJung-uk Kim * and bytelists. 1136a9f12690SJung-uk Kim */ 1137a9f12690SJung-uk Kim typedef struct acpi_parse_obj_named 1138a9f12690SJung-uk Kim { 1139a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1140af051161SJung-uk Kim char *Path; 1141a9f12690SJung-uk Kim UINT8 *Data; /* AML body or bytelist data */ 1142a9f12690SJung-uk Kim UINT32 Length; /* AML length */ 1143a9f12690SJung-uk Kim UINT32 Name; /* 4-byte name or zero if no name */ 1144a9f12690SJung-uk Kim 1145a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_NAMED; 1146a9f12690SJung-uk Kim 1147a9f12690SJung-uk Kim 1148a9f12690SJung-uk Kim /* This version is used by the iASL compiler only */ 1149a9f12690SJung-uk Kim 1150a9f12690SJung-uk Kim #define ACPI_MAX_PARSEOP_NAME 20 1151a9f12690SJung-uk Kim 1152a9f12690SJung-uk Kim typedef struct acpi_parse_obj_asl 1153a9f12690SJung-uk Kim { 1154a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1155a9f12690SJung-uk Kim union acpi_parse_object *Child; 1156a9f12690SJung-uk Kim union acpi_parse_object *ParentMethod; 1157a9f12690SJung-uk Kim char *Filename; 11580d84335fSJung-uk Kim BOOLEAN FileChanged; 11590d84335fSJung-uk Kim char *ParentFilename; 1160a9f12690SJung-uk Kim char *ExternalName; 1161a9f12690SJung-uk Kim char *Namepath; 1162a9f12690SJung-uk Kim char NameSeg[4]; 1163a9f12690SJung-uk Kim UINT32 ExtraValue; 1164a9f12690SJung-uk Kim UINT32 Column; 1165a9f12690SJung-uk Kim UINT32 LineNumber; 1166a9f12690SJung-uk Kim UINT32 LogicalLineNumber; 1167a9f12690SJung-uk Kim UINT32 LogicalByteOffset; 1168a9f12690SJung-uk Kim UINT32 EndLine; 1169a9f12690SJung-uk Kim UINT32 EndLogicalLine; 1170a9f12690SJung-uk Kim UINT32 AcpiBtype; 1171a9f12690SJung-uk Kim UINT32 AmlLength; 1172a9f12690SJung-uk Kim UINT32 AmlSubtreeLength; 1173a9f12690SJung-uk Kim UINT32 FinalAmlLength; 1174a9f12690SJung-uk Kim UINT32 FinalAmlOffset; 1175a9f12690SJung-uk Kim UINT32 CompileFlags; 1176a9f12690SJung-uk Kim UINT16 ParseOpcode; 1177a9f12690SJung-uk Kim UINT8 AmlOpcodeLength; 1178a9f12690SJung-uk Kim UINT8 AmlPkgLenBytes; 1179a9f12690SJung-uk Kim UINT8 Extra; 1180a9f12690SJung-uk Kim char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 1181a9f12690SJung-uk Kim 1182a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_ASL; 1183a9f12690SJung-uk Kim 1184a9f12690SJung-uk Kim typedef union acpi_parse_object 1185a9f12690SJung-uk Kim { 1186a9f12690SJung-uk Kim ACPI_PARSE_OBJ_COMMON Common; 1187a9f12690SJung-uk Kim ACPI_PARSE_OBJ_NAMED Named; 1188a9f12690SJung-uk Kim ACPI_PARSE_OBJ_ASL Asl; 1189a9f12690SJung-uk Kim 1190a9f12690SJung-uk Kim } ACPI_PARSE_OBJECT; 1191a9f12690SJung-uk Kim 11920d84335fSJung-uk Kim typedef struct asl_comment_state 11930d84335fSJung-uk Kim { 11940d84335fSJung-uk Kim UINT8 CommentType; 11950d84335fSJung-uk Kim UINT32 SpacesBefore; 11965f9b24faSJung-uk Kim ACPI_PARSE_OBJECT *LatestParseOp; 11970d84335fSJung-uk Kim ACPI_PARSE_OBJECT *ParsingParenBraceNode; 11980d84335fSJung-uk Kim BOOLEAN CaptureComments; 11995f9b24faSJung-uk Kim 12000d84335fSJung-uk Kim } ASL_COMMENT_STATE; 12010d84335fSJung-uk Kim 1202a9f12690SJung-uk Kim 1203a9f12690SJung-uk Kim /* 1204a9f12690SJung-uk Kim * Parse state - one state per parser invocation and each control 1205a9f12690SJung-uk Kim * method. 1206a9f12690SJung-uk Kim */ 1207a9f12690SJung-uk Kim typedef struct acpi_parse_state 1208a9f12690SJung-uk Kim { 1209a9f12690SJung-uk Kim UINT8 *AmlStart; /* First AML byte */ 1210a9f12690SJung-uk Kim UINT8 *Aml; /* Next AML byte */ 1211a9f12690SJung-uk Kim UINT8 *AmlEnd; /* (last + 1) AML byte */ 1212a9f12690SJung-uk Kim UINT8 *PkgStart; /* Current package begin */ 1213a9f12690SJung-uk Kim UINT8 *PkgEnd; /* Current package end */ 1214a9f12690SJung-uk Kim union acpi_parse_object *StartOp; /* Root of parse tree */ 1215a9f12690SJung-uk Kim struct acpi_namespace_node *StartNode; 1216a9f12690SJung-uk Kim union acpi_generic_state *Scope; /* Current scope */ 1217a9f12690SJung-uk Kim union acpi_parse_object *StartScope; 1218a9f12690SJung-uk Kim UINT32 AmlSize; 1219a9f12690SJung-uk Kim 1220a9f12690SJung-uk Kim } ACPI_PARSE_STATE; 1221a9f12690SJung-uk Kim 1222a9f12690SJung-uk Kim 1223a9f12690SJung-uk Kim /* Parse object flags */ 1224a9f12690SJung-uk Kim 1225a9f12690SJung-uk Kim #define ACPI_PARSEOP_GENERIC 0x01 1226f8146b88SJung-uk Kim #define ACPI_PARSEOP_NAMED_OBJECT 0x02 1227a9f12690SJung-uk Kim #define ACPI_PARSEOP_DEFERRED 0x04 1228a9f12690SJung-uk Kim #define ACPI_PARSEOP_BYTELIST 0x08 1229a9f12690SJung-uk Kim #define ACPI_PARSEOP_IN_STACK 0x10 1230a9f12690SJung-uk Kim #define ACPI_PARSEOP_TARGET 0x20 1231a9f12690SJung-uk Kim #define ACPI_PARSEOP_IN_CACHE 0x80 1232a9f12690SJung-uk Kim 1233a9f12690SJung-uk Kim /* Parse object DisasmFlags */ 1234a9f12690SJung-uk Kim 1235493deb39SJung-uk Kim #define ACPI_PARSEOP_IGNORE 0x0001 1236493deb39SJung-uk Kim #define ACPI_PARSEOP_PARAMETER_LIST 0x0002 1237493deb39SJung-uk Kim #define ACPI_PARSEOP_EMPTY_TERMLIST 0x0004 1238493deb39SJung-uk Kim #define ACPI_PARSEOP_PREDEFINED_CHECKED 0x0008 1239493deb39SJung-uk Kim #define ACPI_PARSEOP_CLOSING_PAREN 0x0010 1240493deb39SJung-uk Kim #define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x0020 1241493deb39SJung-uk Kim #define ACPI_PARSEOP_ASSIGNMENT 0x0040 1242493deb39SJung-uk Kim #define ACPI_PARSEOP_ELSEIF 0x0080 1243493deb39SJung-uk Kim #define ACPI_PARSEOP_LEGACY_ASL_ONLY 0x0100 1244a9f12690SJung-uk Kim 1245a9f12690SJung-uk Kim 1246a9f12690SJung-uk Kim /***************************************************************************** 1247a9f12690SJung-uk Kim * 1248a9f12690SJung-uk Kim * Hardware (ACPI registers) and PNP 1249a9f12690SJung-uk Kim * 1250a9f12690SJung-uk Kim ****************************************************************************/ 1251a9f12690SJung-uk Kim 1252a9f12690SJung-uk Kim typedef struct acpi_bit_register_info 1253a9f12690SJung-uk Kim { 1254a9f12690SJung-uk Kim UINT8 ParentRegister; 1255a9f12690SJung-uk Kim UINT8 BitPosition; 1256a9f12690SJung-uk Kim UINT16 AccessBitMask; 1257a9f12690SJung-uk Kim 1258a9f12690SJung-uk Kim } ACPI_BIT_REGISTER_INFO; 1259a9f12690SJung-uk Kim 1260a9f12690SJung-uk Kim 1261a9f12690SJung-uk Kim /* 1262a9f12690SJung-uk Kim * Some ACPI registers have bits that must be ignored -- meaning that they 1263a9f12690SJung-uk Kim * must be preserved. 1264a9f12690SJung-uk Kim */ 1265a9f12690SJung-uk Kim #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 1266a9f12690SJung-uk Kim 1267a9f12690SJung-uk Kim /* Write-only bits must be zeroed by software */ 1268a9f12690SJung-uk Kim 1269a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 1270a9f12690SJung-uk Kim 1271a9f12690SJung-uk Kim /* For control registers, both ignored and reserved bits must be preserved */ 1272a9f12690SJung-uk Kim 1273a9f12690SJung-uk Kim /* 1274a9f12690SJung-uk Kim * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 1275a9f12690SJung-uk Kim * ACPI specification to be a "preserved" bit - "OSPM always preserves this 1276a9f12690SJung-uk Kim * bit position", section 4.7.3.2.1. However, on some machines the OS must 1277a9f12690SJung-uk Kim * write a one to this bit after resume for the machine to work properly. 1278a9f12690SJung-uk Kim * To enable this, we no longer attempt to preserve this bit. No machines 1279a9f12690SJung-uk Kim * are known to fail if the bit is not preserved. (May 2009) 1280a9f12690SJung-uk Kim */ 1281a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 1282a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 1283a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_PRESERVED_BITS \ 1284a9f12690SJung-uk Kim (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 1285a9f12690SJung-uk Kim 1286a9f12690SJung-uk Kim #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 1287a9f12690SJung-uk Kim 1288a9f12690SJung-uk Kim /* 1289a9f12690SJung-uk Kim * Register IDs 1290a9f12690SJung-uk Kim * These are the full ACPI registers 1291a9f12690SJung-uk Kim */ 1292a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_STATUS 0x01 1293a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_ENABLE 0x02 1294a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_CONTROL 0x03 1295a9f12690SJung-uk Kim #define ACPI_REGISTER_PM2_CONTROL 0x04 1296a9f12690SJung-uk Kim #define ACPI_REGISTER_PM_TIMER 0x05 1297a9f12690SJung-uk Kim #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 1298a9f12690SJung-uk Kim #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 1299a9f12690SJung-uk Kim 1300a9f12690SJung-uk Kim 1301a9f12690SJung-uk Kim /* Masks used to access the BitRegisters */ 1302a9f12690SJung-uk Kim 1303a9f12690SJung-uk Kim #define ACPI_BITMASK_TIMER_STATUS 0x0001 1304a9f12690SJung-uk Kim #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 1305a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 1306a9f12690SJung-uk Kim #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 1307a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 1308a9f12690SJung-uk Kim #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 1309a9f12690SJung-uk Kim #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 1310a9f12690SJung-uk Kim #define ACPI_BITMASK_WAKE_STATUS 0x8000 1311a9f12690SJung-uk Kim 1312a9f12690SJung-uk Kim #define ACPI_BITMASK_ALL_FIXED_STATUS (\ 1313a9f12690SJung-uk Kim ACPI_BITMASK_TIMER_STATUS | \ 1314a9f12690SJung-uk Kim ACPI_BITMASK_BUS_MASTER_STATUS | \ 1315a9f12690SJung-uk Kim ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 1316a9f12690SJung-uk Kim ACPI_BITMASK_POWER_BUTTON_STATUS | \ 1317a9f12690SJung-uk Kim ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 1318a9f12690SJung-uk Kim ACPI_BITMASK_RT_CLOCK_STATUS | \ 13193c1812acSJung-uk Kim ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 1320a9f12690SJung-uk Kim ACPI_BITMASK_WAKE_STATUS) 1321a9f12690SJung-uk Kim 1322a9f12690SJung-uk Kim #define ACPI_BITMASK_TIMER_ENABLE 0x0001 1323a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 1324a9f12690SJung-uk Kim #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 1325a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 1326a9f12690SJung-uk Kim #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 1327a9f12690SJung-uk Kim #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 1328a9f12690SJung-uk Kim 1329a9f12690SJung-uk Kim #define ACPI_BITMASK_SCI_ENABLE 0x0001 1330a9f12690SJung-uk Kim #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 1331a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 1332a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_TYPE 0x1C00 1333a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_ENABLE 0x2000 1334a9f12690SJung-uk Kim 1335a9f12690SJung-uk Kim #define ACPI_BITMASK_ARB_DISABLE 0x0001 1336a9f12690SJung-uk Kim 1337a9f12690SJung-uk Kim 1338a9f12690SJung-uk Kim /* Raw bit position of each BitRegister */ 1339a9f12690SJung-uk Kim 1340a9f12690SJung-uk Kim #define ACPI_BITPOSITION_TIMER_STATUS 0x00 1341a9f12690SJung-uk Kim #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 1342a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 1343a9f12690SJung-uk Kim #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 1344a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 1345a9f12690SJung-uk Kim #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 1346a9f12690SJung-uk Kim #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 1347a9f12690SJung-uk Kim #define ACPI_BITPOSITION_WAKE_STATUS 0x0F 1348a9f12690SJung-uk Kim 1349a9f12690SJung-uk Kim #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 1350a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 1351a9f12690SJung-uk Kim #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 1352a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 1353a9f12690SJung-uk Kim #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 1354a9f12690SJung-uk Kim #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 1355a9f12690SJung-uk Kim 1356a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SCI_ENABLE 0x00 1357a9f12690SJung-uk Kim #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 1358a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 1359a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 1360a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 1361a9f12690SJung-uk Kim 1362a9f12690SJung-uk Kim #define ACPI_BITPOSITION_ARB_DISABLE 0x00 1363a9f12690SJung-uk Kim 1364a9f12690SJung-uk Kim 1365a9f12690SJung-uk Kim /* Structs and definitions for _OSI support and I/O port validation */ 1366a9f12690SJung-uk Kim 1367a9f12690SJung-uk Kim #define ACPI_ALWAYS_ILLEGAL 0x00 1368a9f12690SJung-uk Kim 1369a9f12690SJung-uk Kim typedef struct acpi_interface_info 1370a9f12690SJung-uk Kim { 1371a9f12690SJung-uk Kim char *Name; 1372709fac06SJung-uk Kim struct acpi_interface_info *Next; 1373709fac06SJung-uk Kim UINT8 Flags; 1374a9f12690SJung-uk Kim UINT8 Value; 1375a9f12690SJung-uk Kim 1376a9f12690SJung-uk Kim } ACPI_INTERFACE_INFO; 1377a9f12690SJung-uk Kim 1378709fac06SJung-uk Kim #define ACPI_OSI_INVALID 0x01 1379709fac06SJung-uk Kim #define ACPI_OSI_DYNAMIC 0x02 1380bf6fac21SJung-uk Kim #define ACPI_OSI_FEATURE 0x04 1381bf6fac21SJung-uk Kim #define ACPI_OSI_DEFAULT_INVALID 0x08 1382bf6fac21SJung-uk Kim #define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID) 1383709fac06SJung-uk Kim 1384a9f12690SJung-uk Kim typedef struct acpi_port_info 1385a9f12690SJung-uk Kim { 1386a9f12690SJung-uk Kim char *Name; 1387a9f12690SJung-uk Kim UINT16 Start; 1388a9f12690SJung-uk Kim UINT16 End; 1389a9f12690SJung-uk Kim UINT8 OsiDependency; 1390a9f12690SJung-uk Kim 1391a9f12690SJung-uk Kim } ACPI_PORT_INFO; 1392a9f12690SJung-uk Kim 1393a9f12690SJung-uk Kim 1394a9f12690SJung-uk Kim /***************************************************************************** 1395a9f12690SJung-uk Kim * 1396a9f12690SJung-uk Kim * Resource descriptors 1397a9f12690SJung-uk Kim * 1398a9f12690SJung-uk Kim ****************************************************************************/ 1399a9f12690SJung-uk Kim 1400a9f12690SJung-uk Kim /* ResourceType values */ 1401a9f12690SJung-uk Kim 1402a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 1403a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_IO_RANGE 1 1404a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 1405a9f12690SJung-uk Kim 1406a9f12690SJung-uk Kim /* Resource descriptor types and masks */ 1407a9f12690SJung-uk Kim 1408a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE 0x80 1409a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL 0x00 1410a9f12690SJung-uk Kim 1411a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 1412a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 1413a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 1414a9f12690SJung-uk Kim 1415a9f12690SJung-uk Kim 1416a9f12690SJung-uk Kim /* 1417a9f12690SJung-uk Kim * Small resource descriptor "names" as defined by the ACPI specification. 1418a9f12690SJung-uk Kim * Note: Bits 2:0 are used for the descriptor length 1419a9f12690SJung-uk Kim */ 1420a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_IRQ 0x20 1421a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_DMA 0x28 1422a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 1423a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 1424a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_IO 0x40 1425a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 14263f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 1427a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 1428a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 1429a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 1430a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 1431a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_END_TAG 0x78 1432a9f12690SJung-uk Kim 1433a9f12690SJung-uk Kim /* 1434a9f12690SJung-uk Kim * Large resource descriptor "names" as defined by the ACPI specification. 1435a9f12690SJung-uk Kim * Note: includes the Large Descriptor bit in bit[7] 1436a9f12690SJung-uk Kim */ 1437a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_MEMORY24 0x81 1438a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 1439a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 1440a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 1441a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_MEMORY32 0x85 1442a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 1443a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS32 0x87 1444a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS16 0x88 1445a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 1446a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1447a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 14483f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_GPIO 0x8C 1449af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D 14503f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1451af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F 1452af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP 0x90 1453af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91 1454af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92 1455af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE_MAX 0x92 1456a9f12690SJung-uk Kim 1457a9f12690SJung-uk Kim 1458a9f12690SJung-uk Kim /***************************************************************************** 1459a9f12690SJung-uk Kim * 1460a9f12690SJung-uk Kim * Miscellaneous 1461a9f12690SJung-uk Kim * 1462a9f12690SJung-uk Kim ****************************************************************************/ 1463a9f12690SJung-uk Kim 1464a9f12690SJung-uk Kim #define ACPI_ASCII_ZERO 0x30 1465a9f12690SJung-uk Kim 1466a9f12690SJung-uk Kim 1467a9f12690SJung-uk Kim /***************************************************************************** 1468a9f12690SJung-uk Kim * 1469f556842eSJung-uk Kim * Disassembler 1470f556842eSJung-uk Kim * 1471f556842eSJung-uk Kim ****************************************************************************/ 1472f556842eSJung-uk Kim 1473f556842eSJung-uk Kim typedef struct acpi_external_list 1474f556842eSJung-uk Kim { 1475f556842eSJung-uk Kim char *Path; 1476f556842eSJung-uk Kim char *InternalPath; 1477f556842eSJung-uk Kim struct acpi_external_list *Next; 1478f556842eSJung-uk Kim UINT32 Value; 1479f556842eSJung-uk Kim UINT16 Length; 1480313a0c13SJung-uk Kim UINT16 Flags; 1481f556842eSJung-uk Kim UINT8 Type; 1482f556842eSJung-uk Kim 1483f556842eSJung-uk Kim } ACPI_EXTERNAL_LIST; 1484f556842eSJung-uk Kim 1485f556842eSJung-uk Kim /* Values for Flags field above */ 1486f556842eSJung-uk Kim 1487313a0c13SJung-uk Kim #define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */ 1488313a0c13SJung-uk Kim #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */ 1489313a0c13SJung-uk Kim #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1490313a0c13SJung-uk Kim #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ 1491f8146b88SJung-uk Kim #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ 1492af051161SJung-uk Kim #define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */ 1493f556842eSJung-uk Kim 1494f556842eSJung-uk Kim 1495709fac06SJung-uk Kim typedef struct acpi_external_file 1496709fac06SJung-uk Kim { 1497709fac06SJung-uk Kim char *Path; 1498709fac06SJung-uk Kim struct acpi_external_file *Next; 1499709fac06SJung-uk Kim 1500709fac06SJung-uk Kim } ACPI_EXTERNAL_FILE; 1501709fac06SJung-uk Kim 1502709fac06SJung-uk Kim 1503af051161SJung-uk Kim typedef struct acpi_parse_object_list 1504af051161SJung-uk Kim { 1505af051161SJung-uk Kim ACPI_PARSE_OBJECT *Op; 1506af051161SJung-uk Kim struct acpi_parse_object_list *Next; 1507af051161SJung-uk Kim 1508af051161SJung-uk Kim } ACPI_PARSE_OBJECT_LIST; 1509af051161SJung-uk Kim 1510f556842eSJung-uk Kim /***************************************************************************** 1511f556842eSJung-uk Kim * 1512a9f12690SJung-uk Kim * Debugger 1513a9f12690SJung-uk Kim * 1514a9f12690SJung-uk Kim ****************************************************************************/ 1515a9f12690SJung-uk Kim 1516a9f12690SJung-uk Kim typedef struct acpi_db_method_info 1517a9f12690SJung-uk Kim { 15181df130f1SJung-uk Kim ACPI_HANDLE Method; 1519a9f12690SJung-uk Kim ACPI_HANDLE MainThreadGate; 1520a9f12690SJung-uk Kim ACPI_HANDLE ThreadCompleteGate; 1521a9f12690SJung-uk Kim ACPI_HANDLE InfoGate; 152242fecd12SJung-uk Kim ACPI_THREAD_ID *Threads; 1523a9f12690SJung-uk Kim UINT32 NumThreads; 1524a9f12690SJung-uk Kim UINT32 NumCreated; 1525a9f12690SJung-uk Kim UINT32 NumCompleted; 1526a9f12690SJung-uk Kim 1527a9f12690SJung-uk Kim char *Name; 1528a9f12690SJung-uk Kim UINT32 Flags; 1529a9f12690SJung-uk Kim UINT32 NumLoops; 1530313a0c13SJung-uk Kim char Pathname[ACPI_DB_LINE_BUFFER_SIZE]; 1531a9f12690SJung-uk Kim char **Args; 153242e58c03SJung-uk Kim ACPI_OBJECT_TYPE *Types; 1533a9f12690SJung-uk Kim 1534a9f12690SJung-uk Kim /* 1535b7b7e711SJung-uk Kim * Arguments to be passed to method for the commands Threads and 1536b7b7e711SJung-uk Kim * Background. Note, ACPI specifies a maximum of 7 arguments (0 - 6). 1537b7b7e711SJung-uk Kim * 1538b7b7e711SJung-uk Kim * For the Threads command, the Number of threads, ID of current 1539b7b7e711SJung-uk Kim * thread and Index of current thread inside all them created. 1540a9f12690SJung-uk Kim */ 1541a9f12690SJung-uk Kim char InitArgs; 1542fe0f0bbbSJung-uk Kim #ifdef ACPI_DEBUGGER 1543b7b7e711SJung-uk Kim ACPI_OBJECT_TYPE ArgTypes[ACPI_METHOD_NUM_ARGS]; 1544fe0f0bbbSJung-uk Kim #endif 1545b7b7e711SJung-uk Kim char *Arguments[ACPI_METHOD_NUM_ARGS]; 1546a9f12690SJung-uk Kim char NumThreadsStr[11]; 1547a9f12690SJung-uk Kim char IdOfThreadStr[11]; 1548a9f12690SJung-uk Kim char IndexOfThreadStr[11]; 1549a9f12690SJung-uk Kim 1550a9f12690SJung-uk Kim } ACPI_DB_METHOD_INFO; 1551a9f12690SJung-uk Kim 1552a9f12690SJung-uk Kim typedef struct acpi_integrity_info 1553a9f12690SJung-uk Kim { 1554a9f12690SJung-uk Kim UINT32 Nodes; 1555a9f12690SJung-uk Kim UINT32 Objects; 1556a9f12690SJung-uk Kim 1557a9f12690SJung-uk Kim } ACPI_INTEGRITY_INFO; 1558a9f12690SJung-uk Kim 1559a9f12690SJung-uk Kim 1560313a0c13SJung-uk Kim #define ACPI_DB_DISABLE_OUTPUT 0x00 1561a9f12690SJung-uk Kim #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1562a9f12690SJung-uk Kim #define ACPI_DB_CONSOLE_OUTPUT 0x02 1563a9f12690SJung-uk Kim #define ACPI_DB_DUPLICATE_OUTPUT 0x03 1564a9f12690SJung-uk Kim 1565a9f12690SJung-uk Kim 156670e6ab8fSJung-uk Kim typedef struct acpi_object_info 156770e6ab8fSJung-uk Kim { 156870e6ab8fSJung-uk Kim UINT32 Types[ACPI_TOTAL_TYPES]; 156970e6ab8fSJung-uk Kim 157070e6ab8fSJung-uk Kim } ACPI_OBJECT_INFO; 157170e6ab8fSJung-uk Kim 157270e6ab8fSJung-uk Kim 1573a9f12690SJung-uk Kim /***************************************************************************** 1574a9f12690SJung-uk Kim * 1575a9f12690SJung-uk Kim * Debug 1576a9f12690SJung-uk Kim * 1577a9f12690SJung-uk Kim ****************************************************************************/ 1578a9f12690SJung-uk Kim 1579a9f12690SJung-uk Kim /* Entry for a memory allocation (debug only) */ 1580a9f12690SJung-uk Kim 1581a9f12690SJung-uk Kim #define ACPI_MEM_MALLOC 0 1582a9f12690SJung-uk Kim #define ACPI_MEM_CALLOC 1 1583a9f12690SJung-uk Kim #define ACPI_MAX_MODULE_NAME 16 1584a9f12690SJung-uk Kim 1585a9f12690SJung-uk Kim #define ACPI_COMMON_DEBUG_MEM_HEADER \ 1586a9f12690SJung-uk Kim struct acpi_debug_mem_block *Previous; \ 1587a9f12690SJung-uk Kim struct acpi_debug_mem_block *Next; \ 1588a9f12690SJung-uk Kim UINT32 Size; \ 1589a9f12690SJung-uk Kim UINT32 Component; \ 1590a9f12690SJung-uk Kim UINT32 Line; \ 1591a9f12690SJung-uk Kim char Module[ACPI_MAX_MODULE_NAME]; \ 1592a9f12690SJung-uk Kim UINT8 AllocType; 1593a9f12690SJung-uk Kim 1594a9f12690SJung-uk Kim typedef struct acpi_debug_mem_header 1595a9f12690SJung-uk Kim { 1596a9f12690SJung-uk Kim ACPI_COMMON_DEBUG_MEM_HEADER 1597a9f12690SJung-uk Kim 1598a9f12690SJung-uk Kim } ACPI_DEBUG_MEM_HEADER; 1599a9f12690SJung-uk Kim 1600a9f12690SJung-uk Kim typedef struct acpi_debug_mem_block 1601a9f12690SJung-uk Kim { 1602a9f12690SJung-uk Kim ACPI_COMMON_DEBUG_MEM_HEADER 1603a9f12690SJung-uk Kim UINT64 UserSpace; 1604a9f12690SJung-uk Kim 1605a9f12690SJung-uk Kim } ACPI_DEBUG_MEM_BLOCK; 1606a9f12690SJung-uk Kim 1607a9f12690SJung-uk Kim 1608a9f12690SJung-uk Kim #define ACPI_MEM_LIST_GLOBAL 0 1609a9f12690SJung-uk Kim #define ACPI_MEM_LIST_NSNODE 1 1610a9f12690SJung-uk Kim #define ACPI_MEM_LIST_MAX 1 1611a9f12690SJung-uk Kim #define ACPI_NUM_MEM_LISTS 2 1612a9f12690SJung-uk Kim 1613a9f12690SJung-uk Kim 1614f38b0f21SJung-uk Kim /***************************************************************************** 1615f38b0f21SJung-uk Kim * 1616f38b0f21SJung-uk Kim * Info/help support 1617f38b0f21SJung-uk Kim * 1618f38b0f21SJung-uk Kim ****************************************************************************/ 1619f38b0f21SJung-uk Kim 1620f38b0f21SJung-uk Kim typedef struct ah_predefined_name 1621f38b0f21SJung-uk Kim { 1622f38b0f21SJung-uk Kim char *Name; 1623f38b0f21SJung-uk Kim char *Description; 1624f38b0f21SJung-uk Kim #ifndef ACPI_ASL_COMPILER 1625f38b0f21SJung-uk Kim char *Action; 1626f38b0f21SJung-uk Kim #endif 1627f38b0f21SJung-uk Kim 1628f38b0f21SJung-uk Kim } AH_PREDEFINED_NAME; 1629f38b0f21SJung-uk Kim 1630313a0c13SJung-uk Kim typedef struct ah_device_id 1631313a0c13SJung-uk Kim { 1632313a0c13SJung-uk Kim char *Name; 1633313a0c13SJung-uk Kim char *Description; 1634313a0c13SJung-uk Kim 1635313a0c13SJung-uk Kim } AH_DEVICE_ID; 1636313a0c13SJung-uk Kim 1637313a0c13SJung-uk Kim typedef struct ah_uuid 1638313a0c13SJung-uk Kim { 1639313a0c13SJung-uk Kim char *Description; 1640313a0c13SJung-uk Kim char *String; 1641313a0c13SJung-uk Kim 1642313a0c13SJung-uk Kim } AH_UUID; 1643313a0c13SJung-uk Kim 1644a371a5fdSJung-uk Kim typedef struct ah_table 1645a371a5fdSJung-uk Kim { 1646a371a5fdSJung-uk Kim char *Signature; 1647a371a5fdSJung-uk Kim char *Description; 1648a371a5fdSJung-uk Kim 1649a371a5fdSJung-uk Kim } AH_TABLE; 1650a371a5fdSJung-uk Kim 1651a9f12690SJung-uk Kim #endif /* __ACLOCAL_H__ */ 1652