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 * 110d84335fSJung-uk Kim * Some or all of this work - Copyright (c) 1999 - 2017, 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: 287a9f12690SJung-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 */ 298a9f12690SJung-uk Kim UINT8 Flags; /* Miscellaneous flags */ 299a9f12690SJung-uk Kim ACPI_OWNER_ID OwnerId; /* Node creator */ 300a9f12690SJung-uk Kim ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */ 301a88e22b7SJung-uk Kim struct acpi_namespace_node *Parent; /* Parent node */ 302a9f12690SJung-uk Kim struct acpi_namespace_node *Child; /* First child */ 303a88e22b7SJung-uk Kim struct acpi_namespace_node *Peer; /* First peer */ 304a9f12690SJung-uk Kim 305a9f12690SJung-uk Kim /* 306a9f12690SJung-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; 315fe0f0bbbSJung-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) */ 330a9f12690SJung-uk Kim 331a9f12690SJung-uk Kim #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */ 332a9f12690SJung-uk Kim #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */ 333a9f12690SJung-uk Kim #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */ 334a9f12690SJung-uk Kim #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */ 335a9f12690SJung-uk Kim 336a9f12690SJung-uk Kim 3373f5e024cSJung-uk Kim /* Internal ACPI table management - master table list */ 338a9f12690SJung-uk Kim 3393f5e024cSJung-uk Kim typedef struct acpi_table_list 340a9f12690SJung-uk Kim { 3413f5e024cSJung-uk Kim ACPI_TABLE_DESC *Tables; /* Table descriptor array */ 3423f5e024cSJung-uk Kim UINT32 CurrentTableCount; /* Tables currently in the array */ 3433f5e024cSJung-uk Kim UINT32 MaxTableCount; /* Max tables array will hold */ 344a9f12690SJung-uk Kim UINT8 Flags; 345a9f12690SJung-uk Kim 3463f5e024cSJung-uk Kim } ACPI_TABLE_LIST; 347a9f12690SJung-uk Kim 348a9f12690SJung-uk Kim /* Flags for above */ 349a9f12690SJung-uk Kim 350a9f12690SJung-uk Kim #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */ 351a9f12690SJung-uk Kim #define ACPI_ROOT_ORIGIN_ALLOCATED (1) 352a9f12690SJung-uk Kim #define ACPI_ROOT_ALLOW_RESIZE (2) 353a9f12690SJung-uk Kim 354a9f12690SJung-uk Kim 355f8146b88SJung-uk Kim /* List to manage incoming ACPI tables */ 356f8146b88SJung-uk Kim 357f8146b88SJung-uk Kim typedef struct acpi_new_table_desc 358f8146b88SJung-uk Kim { 359f8146b88SJung-uk Kim ACPI_TABLE_HEADER *Table; 360f8146b88SJung-uk Kim struct acpi_new_table_desc *Next; 361f8146b88SJung-uk Kim 362f8146b88SJung-uk Kim } ACPI_NEW_TABLE_DESC; 363f8146b88SJung-uk Kim 364f8146b88SJung-uk Kim 36570e6ab8fSJung-uk Kim /* Predefined table indexes */ 366a9f12690SJung-uk Kim 36770e6ab8fSJung-uk Kim #define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF) 368a9f12690SJung-uk Kim 369a9f12690SJung-uk Kim 370a9f12690SJung-uk Kim typedef struct acpi_find_context 371a9f12690SJung-uk Kim { 372a9f12690SJung-uk Kim char *SearchFor; 373a9f12690SJung-uk Kim ACPI_HANDLE *List; 374a9f12690SJung-uk Kim UINT32 *Count; 375a9f12690SJung-uk Kim 376a9f12690SJung-uk Kim } ACPI_FIND_CONTEXT; 377a9f12690SJung-uk Kim 378a9f12690SJung-uk Kim 379a9f12690SJung-uk Kim typedef struct acpi_ns_search_data 380a9f12690SJung-uk Kim { 381a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 382a9f12690SJung-uk Kim 383a9f12690SJung-uk Kim } ACPI_NS_SEARCH_DATA; 384a9f12690SJung-uk Kim 385a9f12690SJung-uk Kim 386a9f12690SJung-uk Kim /* Object types used during package copies */ 387a9f12690SJung-uk Kim 388a9f12690SJung-uk Kim #define ACPI_COPY_TYPE_SIMPLE 0 389a9f12690SJung-uk Kim #define ACPI_COPY_TYPE_PACKAGE 1 390a9f12690SJung-uk Kim 391a9f12690SJung-uk Kim 392a9f12690SJung-uk Kim /* Info structure used to convert external<->internal namestrings */ 393a9f12690SJung-uk Kim 394a9f12690SJung-uk Kim typedef struct acpi_namestring_info 395a9f12690SJung-uk Kim { 396a9f12690SJung-uk Kim const char *ExternalName; 397a9f12690SJung-uk Kim const char *NextExternalChar; 398a9f12690SJung-uk Kim char *InternalName; 399a9f12690SJung-uk Kim UINT32 Length; 400a9f12690SJung-uk Kim UINT32 NumSegments; 401a9f12690SJung-uk Kim UINT32 NumCarats; 402a9f12690SJung-uk Kim BOOLEAN FullyQualified; 403a9f12690SJung-uk Kim 404a9f12690SJung-uk Kim } ACPI_NAMESTRING_INFO; 405a9f12690SJung-uk Kim 406a9f12690SJung-uk Kim 407a9f12690SJung-uk Kim /* Field creation info */ 408a9f12690SJung-uk Kim 409a9f12690SJung-uk Kim typedef struct acpi_create_field_info 410a9f12690SJung-uk Kim { 411a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *RegionNode; 412a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *FieldNode; 413a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *RegisterNode; 414a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *DataRegisterNode; 4153f0275a0SJung-uk Kim ACPI_NAMESPACE_NODE *ConnectionNode; 4163f0275a0SJung-uk Kim UINT8 *ResourceBuffer; 417a9f12690SJung-uk Kim UINT32 BankValue; 418a9f12690SJung-uk Kim UINT32 FieldBitPosition; 419a9f12690SJung-uk Kim UINT32 FieldBitLength; 4203f0275a0SJung-uk Kim UINT16 ResourceLength; 421313a0c13SJung-uk Kim UINT16 PinNumberIndex; 422a9f12690SJung-uk Kim UINT8 FieldFlags; 423a9f12690SJung-uk Kim UINT8 Attribute; 424a9f12690SJung-uk Kim UINT8 FieldType; 4253f0275a0SJung-uk Kim UINT8 AccessLength; 426a9f12690SJung-uk Kim 427a9f12690SJung-uk Kim } ACPI_CREATE_FIELD_INFO; 428a9f12690SJung-uk Kim 429a9f12690SJung-uk Kim 430a9f12690SJung-uk Kim typedef 431a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( 432a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 433a9f12690SJung-uk Kim 434a9f12690SJung-uk Kim 435a9f12690SJung-uk Kim /* 436a9f12690SJung-uk Kim * Bitmapped ACPI types. Used internally only 437a9f12690SJung-uk Kim */ 438a9f12690SJung-uk Kim #define ACPI_BTYPE_ANY 0x00000000 439a9f12690SJung-uk Kim #define ACPI_BTYPE_INTEGER 0x00000001 440a9f12690SJung-uk Kim #define ACPI_BTYPE_STRING 0x00000002 441a9f12690SJung-uk Kim #define ACPI_BTYPE_BUFFER 0x00000004 442a9f12690SJung-uk Kim #define ACPI_BTYPE_PACKAGE 0x00000008 443a9f12690SJung-uk Kim #define ACPI_BTYPE_FIELD_UNIT 0x00000010 444a9f12690SJung-uk Kim #define ACPI_BTYPE_DEVICE 0x00000020 445a9f12690SJung-uk Kim #define ACPI_BTYPE_EVENT 0x00000040 446a9f12690SJung-uk Kim #define ACPI_BTYPE_METHOD 0x00000080 447a9f12690SJung-uk Kim #define ACPI_BTYPE_MUTEX 0x00000100 448a9f12690SJung-uk Kim #define ACPI_BTYPE_REGION 0x00000200 449a9f12690SJung-uk Kim #define ACPI_BTYPE_POWER 0x00000400 450a9f12690SJung-uk Kim #define ACPI_BTYPE_PROCESSOR 0x00000800 451a9f12690SJung-uk Kim #define ACPI_BTYPE_THERMAL 0x00001000 452a9f12690SJung-uk Kim #define ACPI_BTYPE_BUFFER_FIELD 0x00002000 453a9f12690SJung-uk Kim #define ACPI_BTYPE_DDB_HANDLE 0x00004000 454a9f12690SJung-uk Kim #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000 455f8146b88SJung-uk Kim #define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */ 456a9f12690SJung-uk Kim #define ACPI_BTYPE_RESOURCE 0x00020000 457f8146b88SJung-uk Kim #define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */ 458a9f12690SJung-uk Kim 459a9f12690SJung-uk Kim #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER) 460a9f12690SJung-uk Kim 461a9f12690SJung-uk Kim #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE) 462f8146b88SJung-uk Kim 463f8146b88SJung-uk Kim /* Used by Copy, DeRefOf, Store, Printf, Fprintf */ 464f8146b88SJung-uk Kim 465f8146b88SJung-uk Kim #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE) 466a9f12690SJung-uk Kim #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR) 467a9f12690SJung-uk Kim #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ 468a9f12690SJung-uk Kim #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF 469a9f12690SJung-uk Kim 4709c7c683cSJung-uk Kim #pragma pack(1) 471a9f12690SJung-uk Kim 472a9f12690SJung-uk Kim /* 473a9f12690SJung-uk Kim * Information structure for ACPI predefined names. 474a9f12690SJung-uk Kim * Each entry in the table contains the following items: 475a9f12690SJung-uk Kim * 476a9f12690SJung-uk Kim * Name - The ACPI reserved name 477a9f12690SJung-uk Kim * ParamCount - Number of arguments to the method 478a9f12690SJung-uk Kim * ExpectedReturnBtypes - Allowed type(s) for the return value 479a9f12690SJung-uk Kim */ 480a9f12690SJung-uk Kim typedef struct acpi_name_info 481a9f12690SJung-uk Kim { 482a9f12690SJung-uk Kim char Name[ACPI_NAME_SIZE]; 4839c7c683cSJung-uk Kim UINT16 ArgumentList; 484a9f12690SJung-uk Kim UINT8 ExpectedBtypes; 485a9f12690SJung-uk Kim 486a9f12690SJung-uk Kim } ACPI_NAME_INFO; 487a9f12690SJung-uk Kim 488a9f12690SJung-uk Kim /* 489a9f12690SJung-uk Kim * Secondary information structures for ACPI predefined objects that return 490a9f12690SJung-uk Kim * package objects. This structure appears as the next entry in the table 491a9f12690SJung-uk Kim * after the NAME_INFO structure above. 492a9f12690SJung-uk Kim * 493a9f12690SJung-uk Kim * The reason for this is to minimize the size of the predefined name table. 494a9f12690SJung-uk Kim */ 495a9f12690SJung-uk Kim 496a9f12690SJung-uk Kim /* 497a9f12690SJung-uk Kim * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, 4983f0275a0SJung-uk Kim * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, 4993f0275a0SJung-uk Kim * ACPI_PTYPE2_FIX_VAR 500a9f12690SJung-uk Kim */ 501a9f12690SJung-uk Kim typedef struct acpi_package_info 502a9f12690SJung-uk Kim { 503a9f12690SJung-uk Kim UINT8 Type; 504a9f12690SJung-uk Kim UINT8 ObjectType1; 505a9f12690SJung-uk Kim UINT8 Count1; 506a9f12690SJung-uk Kim UINT8 ObjectType2; 507a9f12690SJung-uk Kim UINT8 Count2; 5089c7c683cSJung-uk Kim UINT16 Reserved; 509a9f12690SJung-uk Kim 510a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO; 511a9f12690SJung-uk Kim 512a9f12690SJung-uk Kim /* Used for ACPI_PTYPE2_FIXED */ 513a9f12690SJung-uk Kim 514a9f12690SJung-uk Kim typedef struct acpi_package_info2 515a9f12690SJung-uk Kim { 516a9f12690SJung-uk Kim UINT8 Type; 517a9f12690SJung-uk Kim UINT8 Count; 518a9f12690SJung-uk Kim UINT8 ObjectType[4]; 5199c7c683cSJung-uk Kim UINT8 Reserved; 520a9f12690SJung-uk Kim 521a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO2; 522a9f12690SJung-uk Kim 523a9f12690SJung-uk Kim /* Used for ACPI_PTYPE1_OPTION */ 524a9f12690SJung-uk Kim 525a9f12690SJung-uk Kim typedef struct acpi_package_info3 526a9f12690SJung-uk Kim { 527a9f12690SJung-uk Kim UINT8 Type; 528a9f12690SJung-uk Kim UINT8 Count; 529a9f12690SJung-uk Kim UINT8 ObjectType[2]; 530a9f12690SJung-uk Kim UINT8 TailObjectType; 5319c7c683cSJung-uk Kim UINT16 Reserved; 532a9f12690SJung-uk Kim 533a9f12690SJung-uk Kim } ACPI_PACKAGE_INFO3; 534a9f12690SJung-uk Kim 535a371a5fdSJung-uk Kim typedef struct acpi_package_info4 536a371a5fdSJung-uk Kim { 537a371a5fdSJung-uk Kim UINT8 Type; 538a371a5fdSJung-uk Kim UINT8 ObjectType1; 539a371a5fdSJung-uk Kim UINT8 Count1; 540a371a5fdSJung-uk Kim UINT8 SubObjectTypes; 541a371a5fdSJung-uk Kim UINT8 PkgCount; 542a371a5fdSJung-uk Kim UINT16 Reserved; 543a371a5fdSJung-uk Kim 544a371a5fdSJung-uk Kim } ACPI_PACKAGE_INFO4; 545a371a5fdSJung-uk Kim 546a9f12690SJung-uk Kim typedef union acpi_predefined_info 547a9f12690SJung-uk Kim { 548a9f12690SJung-uk Kim ACPI_NAME_INFO Info; 549a9f12690SJung-uk Kim ACPI_PACKAGE_INFO RetInfo; 550a9f12690SJung-uk Kim ACPI_PACKAGE_INFO2 RetInfo2; 551a9f12690SJung-uk Kim ACPI_PACKAGE_INFO3 RetInfo3; 552a371a5fdSJung-uk Kim ACPI_PACKAGE_INFO4 RetInfo4; 553a9f12690SJung-uk Kim 554a9f12690SJung-uk Kim } ACPI_PREDEFINED_INFO; 555a9f12690SJung-uk Kim 5569c7c683cSJung-uk Kim /* Reset to default packing */ 5579c7c683cSJung-uk Kim 5589c7c683cSJung-uk Kim #pragma pack() 5599c7c683cSJung-uk Kim 560d6dd1baeSJung-uk Kim 5619c48c75eSJung-uk Kim /* Return object auto-repair info */ 5629c48c75eSJung-uk Kim 5639c48c75eSJung-uk Kim typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) ( 564f8146b88SJung-uk Kim struct acpi_namespace_node *Scope, 5659c48c75eSJung-uk Kim union acpi_operand_object *OriginalObject, 5669c48c75eSJung-uk Kim union acpi_operand_object **ConvertedObject); 5679c48c75eSJung-uk Kim 5689c48c75eSJung-uk Kim typedef struct acpi_simple_repair_info 5699c48c75eSJung-uk Kim { 5709c48c75eSJung-uk Kim char Name[ACPI_NAME_SIZE]; 5719c48c75eSJung-uk Kim UINT32 UnexpectedBtypes; 5729c48c75eSJung-uk Kim UINT32 PackageIndex; 5739c48c75eSJung-uk Kim ACPI_OBJECT_CONVERTER ObjectConverter; 5749c48c75eSJung-uk Kim 5759c48c75eSJung-uk Kim } ACPI_SIMPLE_REPAIR_INFO; 5769c48c75eSJung-uk Kim 5779c48c75eSJung-uk Kim 578a9f12690SJung-uk Kim /* 579a9f12690SJung-uk Kim * Bitmapped return value types 580a9f12690SJung-uk Kim * Note: the actual data types must be contiguous, a loop in nspredef.c 581a9f12690SJung-uk Kim * depends on this. 582a9f12690SJung-uk Kim */ 583a9f12690SJung-uk Kim #define ACPI_RTYPE_ANY 0x00 584a9f12690SJung-uk Kim #define ACPI_RTYPE_NONE 0x01 585a9f12690SJung-uk Kim #define ACPI_RTYPE_INTEGER 0x02 586a9f12690SJung-uk Kim #define ACPI_RTYPE_STRING 0x04 587a9f12690SJung-uk Kim #define ACPI_RTYPE_BUFFER 0x08 588a9f12690SJung-uk Kim #define ACPI_RTYPE_PACKAGE 0x10 589a9f12690SJung-uk Kim #define ACPI_RTYPE_REFERENCE 0x20 590a9f12690SJung-uk Kim #define ACPI_RTYPE_ALL 0x3F 591a9f12690SJung-uk Kim 592a9f12690SJung-uk Kim #define ACPI_NUM_RTYPES 5 /* Number of actual object types */ 593a9f12690SJung-uk Kim 594a9f12690SJung-uk Kim 59570e6ab8fSJung-uk Kim /* Info for running the _REG methods */ 59670e6ab8fSJung-uk Kim 59770e6ab8fSJung-uk Kim typedef struct acpi_reg_walk_info 59870e6ab8fSJung-uk Kim { 59970e6ab8fSJung-uk Kim ACPI_ADR_SPACE_TYPE SpaceId; 600f8146b88SJung-uk Kim UINT32 Function; 60170e6ab8fSJung-uk Kim UINT32 RegRunCount; 60270e6ab8fSJung-uk Kim 60370e6ab8fSJung-uk Kim } ACPI_REG_WALK_INFO; 60470e6ab8fSJung-uk Kim 60570e6ab8fSJung-uk Kim 606a9f12690SJung-uk Kim /***************************************************************************** 607a9f12690SJung-uk Kim * 608a9f12690SJung-uk Kim * Event typedefs and structs 609a9f12690SJung-uk Kim * 610a9f12690SJung-uk Kim ****************************************************************************/ 611a9f12690SJung-uk Kim 61279c6d946SJung-uk Kim /* Dispatch info for each host-installed SCI handler */ 61379c6d946SJung-uk Kim 61479c6d946SJung-uk Kim typedef struct acpi_sci_handler_info 61579c6d946SJung-uk Kim { 61679c6d946SJung-uk Kim struct acpi_sci_handler_info *Next; 61779c6d946SJung-uk Kim ACPI_SCI_HANDLER Address; /* Address of handler */ 61879c6d946SJung-uk Kim void *Context; /* Context to be passed to handler */ 61979c6d946SJung-uk Kim 62079c6d946SJung-uk Kim } ACPI_SCI_HANDLER_INFO; 62179c6d946SJung-uk Kim 622a9f12690SJung-uk Kim /* Dispatch info for each GPE -- either a method or handler, cannot be both */ 623a9f12690SJung-uk Kim 6245a77b11bSJung-uk Kim typedef struct acpi_gpe_handler_info 625a9f12690SJung-uk Kim { 6265a77b11bSJung-uk Kim ACPI_GPE_HANDLER Address; /* Address of handler, if any */ 627a9f12690SJung-uk Kim void *Context; /* Context to be passed to handler */ 628a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */ 6295a77b11bSJung-uk Kim UINT8 OriginalFlags; /* Original (pre-handler) GPE info */ 6305a77b11bSJung-uk Kim BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */ 631a9f12690SJung-uk Kim 6325a77b11bSJung-uk Kim } ACPI_GPE_HANDLER_INFO; 633a9f12690SJung-uk Kim 634f38b0f21SJung-uk Kim /* Notify info for implicit notify, multiple device objects */ 635f38b0f21SJung-uk Kim 636f38b0f21SJung-uk Kim typedef struct acpi_gpe_notify_info 637f38b0f21SJung-uk Kim { 638f38b0f21SJung-uk Kim ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */ 639f38b0f21SJung-uk Kim struct acpi_gpe_notify_info *Next; 640f38b0f21SJung-uk Kim 641f38b0f21SJung-uk Kim } ACPI_GPE_NOTIFY_INFO; 642f38b0f21SJung-uk Kim 6435a77b11bSJung-uk Kim /* 6445a77b11bSJung-uk Kim * GPE dispatch info. At any time, the GPE can have at most one type 6455a77b11bSJung-uk Kim * of dispatch - Method, Handler, or Implicit Notify. 6465a77b11bSJung-uk Kim */ 647a9f12690SJung-uk Kim typedef union acpi_gpe_dispatch_info 648a9f12690SJung-uk Kim { 649a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ 650f38b0f21SJung-uk Kim ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */ 651f38b0f21SJung-uk Kim ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */ 652a9f12690SJung-uk Kim 653a9f12690SJung-uk Kim } ACPI_GPE_DISPATCH_INFO; 654a9f12690SJung-uk Kim 655a9f12690SJung-uk Kim /* 656a9f12690SJung-uk Kim * Information about a GPE, one per each GPE in an array. 657a9f12690SJung-uk Kim * NOTE: Important to keep this struct as small as possible. 658a9f12690SJung-uk Kim */ 659a9f12690SJung-uk Kim typedef struct acpi_gpe_event_info 660a9f12690SJung-uk Kim { 661f38b0f21SJung-uk Kim union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */ 662a9f12690SJung-uk Kim struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ 663a9f12690SJung-uk Kim UINT8 Flags; /* Misc info about this GPE */ 664a9f12690SJung-uk Kim UINT8 GpeNumber; /* This GPE */ 6658c8be05fSJung-uk Kim UINT8 RuntimeCount; /* References to a run GPE */ 666493deb39SJung-uk Kim BOOLEAN DisableForDispatch; /* Masked during dispatching */ 667a9f12690SJung-uk Kim 668a9f12690SJung-uk Kim } ACPI_GPE_EVENT_INFO; 669a9f12690SJung-uk Kim 670a9f12690SJung-uk Kim /* Information about a GPE register pair, one per each status/enable pair in an array */ 671a9f12690SJung-uk Kim 672a9f12690SJung-uk Kim typedef struct acpi_gpe_register_info 673a9f12690SJung-uk Kim { 674a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */ 675a9f12690SJung-uk Kim ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */ 676313a0c13SJung-uk Kim UINT16 BaseGpeNumber; /* Base GPE number for this register */ 677a9f12690SJung-uk Kim UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */ 678a9f12690SJung-uk Kim UINT8 EnableForRun; /* GPEs to keep enabled when running */ 679493deb39SJung-uk Kim UINT8 MaskForRun; /* GPEs to keep masked when running */ 6801c0e1b6dSJung-uk Kim UINT8 EnableMask; /* Current mask of enabled GPEs */ 681a9f12690SJung-uk Kim 682a9f12690SJung-uk Kim } ACPI_GPE_REGISTER_INFO; 683a9f12690SJung-uk Kim 684a9f12690SJung-uk Kim /* 685a9f12690SJung-uk Kim * Information about a GPE register block, one per each installed block -- 686a9f12690SJung-uk Kim * GPE0, GPE1, and one per each installed GPE Block Device. 687a9f12690SJung-uk Kim */ 688a9f12690SJung-uk Kim typedef struct acpi_gpe_block_info 689a9f12690SJung-uk Kim { 690a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 691a9f12690SJung-uk Kim struct acpi_gpe_block_info *Previous; 692a9f12690SJung-uk Kim struct acpi_gpe_block_info *Next; 693a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */ 694a9f12690SJung-uk Kim ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */ 695a9f12690SJung-uk Kim ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */ 696313a0c13SJung-uk Kim UINT64 Address; /* Base address of the block */ 697a9f12690SJung-uk Kim UINT32 RegisterCount; /* Number of register pairs in block */ 6988c8be05fSJung-uk Kim UINT16 GpeCount; /* Number of individual GPEs in block */ 699313a0c13SJung-uk Kim UINT16 BlockBaseNumber;/* Base GPE number for this block */ 700313a0c13SJung-uk Kim UINT8 SpaceId; 7015a77b11bSJung-uk Kim BOOLEAN Initialized; /* TRUE if this block is initialized */ 702a9f12690SJung-uk Kim 703a9f12690SJung-uk Kim } ACPI_GPE_BLOCK_INFO; 704a9f12690SJung-uk Kim 705a9f12690SJung-uk Kim /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */ 706a9f12690SJung-uk Kim 707a9f12690SJung-uk Kim typedef struct acpi_gpe_xrupt_info 708a9f12690SJung-uk Kim { 709a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *Previous; 710a9f12690SJung-uk Kim struct acpi_gpe_xrupt_info *Next; 711a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */ 712a9f12690SJung-uk Kim UINT32 InterruptNumber; /* System interrupt number */ 713a9f12690SJung-uk Kim 714a9f12690SJung-uk Kim } ACPI_GPE_XRUPT_INFO; 715a9f12690SJung-uk Kim 716a9f12690SJung-uk Kim typedef struct acpi_gpe_walk_info 717a9f12690SJung-uk Kim { 718a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *GpeDevice; 719a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlock; 7203f5e024cSJung-uk Kim UINT16 Count; 7213f5e024cSJung-uk Kim ACPI_OWNER_ID OwnerId; 7223f5e024cSJung-uk Kim BOOLEAN ExecuteByOwnerId; 723a9f12690SJung-uk Kim 724a9f12690SJung-uk Kim } ACPI_GPE_WALK_INFO; 725a9f12690SJung-uk Kim 726a9f12690SJung-uk Kim typedef struct acpi_gpe_device_info 727a9f12690SJung-uk Kim { 728a9f12690SJung-uk Kim UINT32 Index; 729a9f12690SJung-uk Kim UINT32 NextBlockBaseIndex; 730a9f12690SJung-uk Kim ACPI_STATUS Status; 731a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *GpeDevice; 732a9f12690SJung-uk Kim 733a9f12690SJung-uk Kim } ACPI_GPE_DEVICE_INFO; 734a9f12690SJung-uk Kim 735a9f12690SJung-uk Kim typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) ( 736a9f12690SJung-uk Kim ACPI_GPE_XRUPT_INFO *GpeXruptInfo, 737a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlock, 738a9f12690SJung-uk Kim void *Context); 739a9f12690SJung-uk Kim 740a9f12690SJung-uk Kim 741a9f12690SJung-uk Kim /* Information about each particular fixed event */ 742a9f12690SJung-uk Kim 743a9f12690SJung-uk Kim typedef struct acpi_fixed_event_handler 744a9f12690SJung-uk Kim { 745a9f12690SJung-uk Kim ACPI_EVENT_HANDLER Handler; /* Address of handler. */ 746a9f12690SJung-uk Kim void *Context; /* Context to be passed to handler */ 747a9f12690SJung-uk Kim 748a9f12690SJung-uk Kim } ACPI_FIXED_EVENT_HANDLER; 749a9f12690SJung-uk Kim 750a9f12690SJung-uk Kim typedef struct acpi_fixed_event_info 751a9f12690SJung-uk Kim { 752a9f12690SJung-uk Kim UINT8 StatusRegisterId; 753a9f12690SJung-uk Kim UINT8 EnableRegisterId; 754a9f12690SJung-uk Kim UINT16 StatusBitMask; 755a9f12690SJung-uk Kim UINT16 EnableBitMask; 756a9f12690SJung-uk Kim 757a9f12690SJung-uk Kim } ACPI_FIXED_EVENT_INFO; 758a9f12690SJung-uk Kim 759a9f12690SJung-uk Kim /* Information used during field processing */ 760a9f12690SJung-uk Kim 761a9f12690SJung-uk Kim typedef struct acpi_field_info 762a9f12690SJung-uk Kim { 763a9f12690SJung-uk Kim UINT8 SkipField; 764a9f12690SJung-uk Kim UINT8 FieldFlag; 765a9f12690SJung-uk Kim UINT32 PkgLength; 766a9f12690SJung-uk Kim 767a9f12690SJung-uk Kim } ACPI_FIELD_INFO; 768a9f12690SJung-uk Kim 769a9f12690SJung-uk Kim 770a9f12690SJung-uk Kim /***************************************************************************** 771a9f12690SJung-uk Kim * 772a9f12690SJung-uk Kim * Generic "state" object for stacks 773a9f12690SJung-uk Kim * 774a9f12690SJung-uk Kim ****************************************************************************/ 775a9f12690SJung-uk Kim 776a9f12690SJung-uk Kim #define ACPI_CONTROL_NORMAL 0xC0 777a9f12690SJung-uk Kim #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1 778a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2 779a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_FALSE 0xC3 780a9f12690SJung-uk Kim #define ACPI_CONTROL_PREDICATE_TRUE 0xC4 781a9f12690SJung-uk Kim 782a9f12690SJung-uk Kim 783a9f12690SJung-uk Kim #define ACPI_STATE_COMMON \ 784a9f12690SJung-uk Kim void *Next; \ 785a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */\ 786a9f12690SJung-uk Kim UINT8 Flags; \ 787a9f12690SJung-uk Kim UINT16 Value; \ 788a9f12690SJung-uk Kim UINT16 State; 789a9f12690SJung-uk Kim 790a9f12690SJung-uk Kim /* There are 2 bytes available here until the next natural alignment boundary */ 791a9f12690SJung-uk Kim 792a9f12690SJung-uk Kim typedef struct acpi_common_state 793a9f12690SJung-uk Kim { 794a9f12690SJung-uk Kim ACPI_STATE_COMMON 795a9f12690SJung-uk Kim } ACPI_COMMON_STATE; 796a9f12690SJung-uk Kim 797a9f12690SJung-uk Kim 798a9f12690SJung-uk Kim /* 799a9f12690SJung-uk Kim * Update state - used to traverse complex objects such as packages 800a9f12690SJung-uk Kim */ 801a9f12690SJung-uk Kim typedef struct acpi_update_state 802a9f12690SJung-uk Kim { 803a9f12690SJung-uk Kim ACPI_STATE_COMMON 804a9f12690SJung-uk Kim union acpi_operand_object *Object; 805a9f12690SJung-uk Kim 806a9f12690SJung-uk Kim } ACPI_UPDATE_STATE; 807a9f12690SJung-uk Kim 808a9f12690SJung-uk Kim 809a9f12690SJung-uk Kim /* 810a9f12690SJung-uk Kim * Pkg state - used to traverse nested package structures 811a9f12690SJung-uk Kim */ 812a9f12690SJung-uk Kim typedef struct acpi_pkg_state 813a9f12690SJung-uk Kim { 814a9f12690SJung-uk Kim ACPI_STATE_COMMON 815a9f12690SJung-uk Kim UINT16 Index; 816a9f12690SJung-uk Kim union acpi_operand_object *SourceObject; 817a9f12690SJung-uk Kim union acpi_operand_object *DestObject; 818a9f12690SJung-uk Kim struct acpi_walk_state *WalkState; 819a9f12690SJung-uk Kim void *ThisTargetObj; 820a9f12690SJung-uk Kim UINT32 NumPackages; 821a9f12690SJung-uk Kim 822a9f12690SJung-uk Kim } ACPI_PKG_STATE; 823a9f12690SJung-uk Kim 824a9f12690SJung-uk Kim 825a9f12690SJung-uk Kim /* 826a9f12690SJung-uk Kim * Control state - one per if/else and while constructs. 827a9f12690SJung-uk Kim * Allows nesting of these constructs 828a9f12690SJung-uk Kim */ 829a9f12690SJung-uk Kim typedef struct acpi_control_state 830a9f12690SJung-uk Kim { 831a9f12690SJung-uk Kim ACPI_STATE_COMMON 832a9f12690SJung-uk Kim UINT16 Opcode; 833a9f12690SJung-uk Kim union acpi_parse_object *PredicateOp; 834a9f12690SJung-uk Kim UINT8 *AmlPredicateStart; /* Start of if/while predicate */ 835a9f12690SJung-uk Kim UINT8 *PackageEnd; /* End of if/while block */ 836a9f12690SJung-uk Kim UINT32 LoopCount; /* While() loop counter */ 837a9f12690SJung-uk Kim 838a9f12690SJung-uk Kim } ACPI_CONTROL_STATE; 839a9f12690SJung-uk Kim 840a9f12690SJung-uk Kim 841a9f12690SJung-uk Kim /* 842a9f12690SJung-uk Kim * Scope state - current scope during namespace lookups 843a9f12690SJung-uk Kim */ 844a9f12690SJung-uk Kim typedef struct acpi_scope_state 845a9f12690SJung-uk Kim { 846a9f12690SJung-uk Kim ACPI_STATE_COMMON 847a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 848a9f12690SJung-uk Kim 849a9f12690SJung-uk Kim } ACPI_SCOPE_STATE; 850a9f12690SJung-uk Kim 851a9f12690SJung-uk Kim 852a9f12690SJung-uk Kim typedef struct acpi_pscope_state 853a9f12690SJung-uk Kim { 854a9f12690SJung-uk Kim ACPI_STATE_COMMON 855a9f12690SJung-uk Kim UINT32 ArgCount; /* Number of fixed arguments */ 856a9f12690SJung-uk Kim union acpi_parse_object *Op; /* Current op being parsed */ 857a9f12690SJung-uk Kim UINT8 *ArgEnd; /* Current argument end */ 858a9f12690SJung-uk Kim UINT8 *PkgEnd; /* Current package end */ 859a9f12690SJung-uk Kim UINT32 ArgList; /* Next argument to parse */ 860a9f12690SJung-uk Kim 861a9f12690SJung-uk Kim } ACPI_PSCOPE_STATE; 862a9f12690SJung-uk Kim 863a9f12690SJung-uk Kim 864a9f12690SJung-uk Kim /* 865a9f12690SJung-uk Kim * Thread state - one per thread across multiple walk states. Multiple walk 866a9f12690SJung-uk Kim * states are created when there are nested control methods executing. 867a9f12690SJung-uk Kim */ 868a9f12690SJung-uk Kim typedef struct acpi_thread_state 869a9f12690SJung-uk Kim { 870a9f12690SJung-uk Kim ACPI_STATE_COMMON 871a9f12690SJung-uk Kim UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */ 872a9f12690SJung-uk Kim struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */ 873a9f12690SJung-uk Kim union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */ 874a9f12690SJung-uk Kim ACPI_THREAD_ID ThreadId; /* Running thread ID */ 875a9f12690SJung-uk Kim 876a9f12690SJung-uk Kim } ACPI_THREAD_STATE; 877a9f12690SJung-uk Kim 878a9f12690SJung-uk Kim 879a9f12690SJung-uk Kim /* 880a9f12690SJung-uk Kim * Result values - used to accumulate the results of nested 881a9f12690SJung-uk Kim * AML arguments 882a9f12690SJung-uk Kim */ 883a9f12690SJung-uk Kim typedef struct acpi_result_values 884a9f12690SJung-uk Kim { 885a9f12690SJung-uk Kim ACPI_STATE_COMMON 886a9f12690SJung-uk Kim union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM]; 887a9f12690SJung-uk Kim 888a9f12690SJung-uk Kim } ACPI_RESULT_VALUES; 889a9f12690SJung-uk Kim 890a9f12690SJung-uk Kim 891a9f12690SJung-uk Kim typedef 892a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) ( 893a9f12690SJung-uk Kim struct acpi_walk_state *WalkState, 894a9f12690SJung-uk Kim union acpi_parse_object **OutOp); 895a9f12690SJung-uk Kim 896a9f12690SJung-uk Kim typedef 897a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( 898a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 899a9f12690SJung-uk Kim 900a9f12690SJung-uk Kim 901eef1b955SJung-uk Kim /* Global handlers for AML Notifies */ 902eef1b955SJung-uk Kim 903eef1b955SJung-uk Kim typedef struct acpi_global_notify_handler 904eef1b955SJung-uk Kim { 905eef1b955SJung-uk Kim ACPI_NOTIFY_HANDLER Handler; 906eef1b955SJung-uk Kim void *Context; 907eef1b955SJung-uk Kim 908eef1b955SJung-uk Kim } ACPI_GLOBAL_NOTIFY_HANDLER; 909eef1b955SJung-uk Kim 910a9f12690SJung-uk Kim /* 911a9f12690SJung-uk Kim * Notify info - used to pass info to the deferred notify 912a9f12690SJung-uk Kim * handler/dispatcher. 913a9f12690SJung-uk Kim */ 914a9f12690SJung-uk Kim typedef struct acpi_notify_info 915a9f12690SJung-uk Kim { 916a9f12690SJung-uk Kim ACPI_STATE_COMMON 917eef1b955SJung-uk Kim UINT8 HandlerListId; 918a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; 919eef1b955SJung-uk Kim union acpi_operand_object *HandlerListHead; 920eef1b955SJung-uk Kim ACPI_GLOBAL_NOTIFY_HANDLER *Global; 921a9f12690SJung-uk Kim 922a9f12690SJung-uk Kim } ACPI_NOTIFY_INFO; 923a9f12690SJung-uk Kim 924a9f12690SJung-uk Kim 925a9f12690SJung-uk Kim /* Generic state is union of structs above */ 926a9f12690SJung-uk Kim 927a9f12690SJung-uk Kim typedef union acpi_generic_state 928a9f12690SJung-uk Kim { 929a9f12690SJung-uk Kim ACPI_COMMON_STATE Common; 930a9f12690SJung-uk Kim ACPI_CONTROL_STATE Control; 931a9f12690SJung-uk Kim ACPI_UPDATE_STATE Update; 932a9f12690SJung-uk Kim ACPI_SCOPE_STATE Scope; 933a9f12690SJung-uk Kim ACPI_PSCOPE_STATE ParseScope; 934a9f12690SJung-uk Kim ACPI_PKG_STATE Pkg; 935a9f12690SJung-uk Kim ACPI_THREAD_STATE Thread; 936a9f12690SJung-uk Kim ACPI_RESULT_VALUES Results; 937a9f12690SJung-uk Kim ACPI_NOTIFY_INFO Notify; 938a9f12690SJung-uk Kim 939a9f12690SJung-uk Kim } ACPI_GENERIC_STATE; 940a9f12690SJung-uk Kim 941a9f12690SJung-uk Kim 942a9f12690SJung-uk Kim /***************************************************************************** 943a9f12690SJung-uk Kim * 944a9f12690SJung-uk Kim * Interpreter typedefs and structs 945a9f12690SJung-uk Kim * 946a9f12690SJung-uk Kim ****************************************************************************/ 947a9f12690SJung-uk Kim 948a9f12690SJung-uk Kim typedef 949a9f12690SJung-uk Kim ACPI_STATUS (*ACPI_EXECUTE_OP) ( 950a9f12690SJung-uk Kim struct acpi_walk_state *WalkState); 951a9f12690SJung-uk Kim 952ec3fc72fSJung-uk Kim /* Address Range info block */ 953ec3fc72fSJung-uk Kim 954ec3fc72fSJung-uk Kim typedef struct acpi_address_range 955ec3fc72fSJung-uk Kim { 956ec3fc72fSJung-uk Kim struct acpi_address_range *Next; 957ec3fc72fSJung-uk Kim ACPI_NAMESPACE_NODE *RegionNode; 958ec3fc72fSJung-uk Kim ACPI_PHYSICAL_ADDRESS StartAddress; 959ec3fc72fSJung-uk Kim ACPI_PHYSICAL_ADDRESS EndAddress; 960ec3fc72fSJung-uk Kim 961ec3fc72fSJung-uk Kim } ACPI_ADDRESS_RANGE; 962ec3fc72fSJung-uk Kim 963a9f12690SJung-uk Kim 964a9f12690SJung-uk Kim /***************************************************************************** 965a9f12690SJung-uk Kim * 966a9f12690SJung-uk Kim * Parser typedefs and structs 967a9f12690SJung-uk Kim * 968a9f12690SJung-uk Kim ****************************************************************************/ 969a9f12690SJung-uk Kim 970a9f12690SJung-uk Kim /* 971a9f12690SJung-uk Kim * AML opcode, name, and argument layout 972a9f12690SJung-uk Kim */ 973a9f12690SJung-uk Kim typedef struct acpi_opcode_info 974a9f12690SJung-uk Kim { 975a9f12690SJung-uk Kim #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 976a9f12690SJung-uk Kim char *Name; /* Opcode name (disassembler/debug only) */ 977a9f12690SJung-uk Kim #endif 978a9f12690SJung-uk Kim UINT32 ParseArgs; /* Grammar/Parse time arguments */ 979a9f12690SJung-uk Kim UINT32 RuntimeArgs; /* Interpret time arguments */ 980a9f12690SJung-uk Kim UINT16 Flags; /* Misc flags */ 981a9f12690SJung-uk Kim UINT8 ObjectType; /* Corresponding internal object type */ 982a9f12690SJung-uk Kim UINT8 Class; /* Opcode class */ 983a9f12690SJung-uk Kim UINT8 Type; /* Opcode type */ 984a9f12690SJung-uk Kim 985a9f12690SJung-uk Kim } ACPI_OPCODE_INFO; 986a9f12690SJung-uk Kim 9873f0275a0SJung-uk Kim /* Structure for Resource Tag information */ 9883f0275a0SJung-uk Kim 9893f0275a0SJung-uk Kim typedef struct acpi_tag_info 9903f0275a0SJung-uk Kim { 9913f0275a0SJung-uk Kim UINT32 BitOffset; 9923f0275a0SJung-uk Kim UINT32 BitLength; 9933f0275a0SJung-uk Kim 9943f0275a0SJung-uk Kim } ACPI_TAG_INFO; 9953f0275a0SJung-uk Kim 9963f0275a0SJung-uk Kim /* Value associated with the parse object */ 9973f0275a0SJung-uk Kim 998a9f12690SJung-uk Kim typedef union acpi_parse_value 999a9f12690SJung-uk Kim { 10009a179dd8SJung-uk Kim UINT64 Integer; /* Integer constant (Up to 64 bits) */ 1001a9f12690SJung-uk Kim UINT32 Size; /* bytelist or field size */ 1002a9f12690SJung-uk Kim char *String; /* NULL terminated string */ 1003a9f12690SJung-uk Kim UINT8 *Buffer; /* buffer or string */ 1004a9f12690SJung-uk Kim char *Name; /* NULL terminated string */ 1005a9f12690SJung-uk Kim union acpi_parse_object *Arg; /* arguments and contained ops */ 10063f0275a0SJung-uk Kim ACPI_TAG_INFO Tag; /* Resource descriptor tag info */ 1007a9f12690SJung-uk Kim 1008a9f12690SJung-uk Kim } ACPI_PARSE_VALUE; 1009a9f12690SJung-uk Kim 1010a9f12690SJung-uk Kim 1011fe0f0bbbSJung-uk Kim #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT) 1012a9f12690SJung-uk Kim #define ACPI_DISASM_ONLY_MEMBERS(a) a; 1013a9f12690SJung-uk Kim #else 1014a9f12690SJung-uk Kim #define ACPI_DISASM_ONLY_MEMBERS(a) 1015a9f12690SJung-uk Kim #endif 1016a9f12690SJung-uk Kim 10170d84335fSJung-uk Kim #if defined(ACPI_ASL_COMPILER) 10180d84335fSJung-uk Kim #define ACPI_CONVERTER_ONLY_MEMBERS(a) a; 10190d84335fSJung-uk Kim #else 10200d84335fSJung-uk Kim #define ACPI_CONVERTER_ONLY_MEMBERS(a) 10210d84335fSJung-uk Kim #endif 10220d84335fSJung-uk Kim 1023a9f12690SJung-uk Kim #define ACPI_PARSE_COMMON \ 1024a9f12690SJung-uk Kim union acpi_parse_object *Parent; /* Parent op */\ 1025a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */\ 1026a9f12690SJung-uk Kim UINT8 Flags; /* Type of Op */\ 1027a9f12690SJung-uk Kim UINT16 AmlOpcode; /* AML opcode */\ 1028fe0f0bbbSJung-uk Kim UINT8 *Aml; /* Address of declaration in AML */\ 1029a9f12690SJung-uk Kim union acpi_parse_object *Next; /* Next op */\ 1030a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\ 1031a9f12690SJung-uk Kim ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\ 1032a9f12690SJung-uk Kim UINT8 ArgListLength; /* Number of elements in the arg list */\ 1033a9f12690SJung-uk Kim ACPI_DISASM_ONLY_MEMBERS (\ 1034493deb39SJung-uk Kim UINT16 DisasmFlags; /* Used during AML disassembly */\ 1035a9f12690SJung-uk Kim UINT8 DisasmOpcode; /* Subtype used for disassembly */\ 10361c0e1b6dSJung-uk Kim char *OperatorSymbol; /* Used for C-style operator name strings */\ 10370d84335fSJung-uk Kim char AmlOpName[16]) /* Op name (debug only) */\ 10380d84335fSJung-uk Kim ACPI_CONVERTER_ONLY_MEMBERS (\ 10390d84335fSJung-uk Kim char *InlineComment; /* Inline comment */\ 10400d84335fSJung-uk Kim char *EndNodeComment; /* End of node comment */\ 10410d84335fSJung-uk Kim char *NameComment; /* Comment associated with the first parameter of the name node */\ 10420d84335fSJung-uk Kim char *CloseBraceComment; /* Comments that come after } on the same as } */\ 10430d84335fSJung-uk Kim ACPI_COMMENT_NODE *CommentList; /* comments that appears before this node */\ 10440d84335fSJung-uk Kim ACPI_COMMENT_NODE *EndBlkComment; /* comments that at the end of a block but before ) or } */\ 10450d84335fSJung-uk Kim char *CvFilename; /* Filename associated with this node. Used for ASL/ASL+ converter */\ 10460d84335fSJung-uk Kim char *CvParentFilename) /* Parent filename associated with this node. Used for ASL/ASL+ converter */ 10470d84335fSJung-uk Kim 10480d84335fSJung-uk Kim 10490d84335fSJung-uk Kim /* categories of comments */ 10500d84335fSJung-uk Kim 10510d84335fSJung-uk Kim typedef enum 10520d84335fSJung-uk Kim { 10530d84335fSJung-uk Kim STANDARD_COMMENT = 1, 10540d84335fSJung-uk Kim INLINE_COMMENT, 10550d84335fSJung-uk Kim ENDNODE_COMMENT, 10560d84335fSJung-uk Kim OPENBRACE_COMMENT, 10570d84335fSJung-uk Kim CLOSE_BRACE_COMMENT, 10580d84335fSJung-uk Kim STD_DEFBLK_COMMENT, 10590d84335fSJung-uk Kim END_DEFBLK_COMMENT, 10600d84335fSJung-uk Kim FILENAME_COMMENT, 10610d84335fSJung-uk Kim PARENTFILENAME_COMMENT, 10620d84335fSJung-uk Kim ENDBLK_COMMENT, 10630d84335fSJung-uk Kim INCLUDE_COMMENT 10640d84335fSJung-uk Kim 10650d84335fSJung-uk Kim } ASL_COMMENT_TYPES; 1066a9f12690SJung-uk Kim 1067a9f12690SJung-uk Kim 106828482948SJung-uk Kim /* Internal opcodes for DisasmOpcode field above */ 10691df130f1SJung-uk Kim 10701df130f1SJung-uk Kim #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */ 10711df130f1SJung-uk Kim #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */ 10721df130f1SJung-uk Kim #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ 10731df130f1SJung-uk Kim #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ 10741df130f1SJung-uk Kim #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ 1075313a0c13SJung-uk Kim #define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */ 1076313a0c13SJung-uk Kim #define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */ 1077313a0c13SJung-uk Kim #define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */ 1078313a0c13SJung-uk Kim #define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */ 1079313a0c13SJung-uk Kim #define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */ 1080313a0c13SJung-uk Kim #define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */ 108128482948SJung-uk Kim #define ACPI_DASM_IGNORE_SINGLE 0x0B /* Ignore the opcode but not it's children */ 10820d84335fSJung-uk Kim #define ACPI_DASM_SWITCH 0x0C /* While is a Switch */ 10830d84335fSJung-uk Kim #define ACPI_DASM_SWITCH_PREDICATE 0x0D /* Object is a predicate for a Switch or Case block */ 10840d84335fSJung-uk Kim #define ACPI_DASM_CASE 0x0E /* If/Else is a Case in a Switch/Case block */ 10850d84335fSJung-uk Kim #define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */ 10860d84335fSJung-uk Kim 10870d84335fSJung-uk Kim 10880d84335fSJung-uk Kim /* 10890d84335fSJung-uk Kim * List struct used in the -ca option 10900d84335fSJung-uk Kim */ 10910d84335fSJung-uk Kim typedef struct acpi_comment_node 10920d84335fSJung-uk Kim { 10930d84335fSJung-uk Kim char *Comment; 10940d84335fSJung-uk Kim struct acpi_comment_node *Next; 10950d84335fSJung-uk Kim 10960d84335fSJung-uk Kim } ACPI_COMMENT_NODE; 10970d84335fSJung-uk Kim 10980d84335fSJung-uk Kim 10990d84335fSJung-uk Kim typedef struct acpi_comment_addr_node 11000d84335fSJung-uk Kim { 11010d84335fSJung-uk Kim UINT8 *Addr; 11020d84335fSJung-uk Kim struct acpi_comment_addr_node *Next; 11030d84335fSJung-uk Kim } ACPI_COMMENT_ADDR_NODE; 11040d84335fSJung-uk Kim 11050d84335fSJung-uk Kim /* 11060d84335fSJung-uk Kim * File node - used for "Include" operator file stack and 11070d84335fSJung-uk Kim * depdendency tree for the -ca option 11080d84335fSJung-uk Kim */ 11090d84335fSJung-uk Kim typedef struct acpi_file_node 11100d84335fSJung-uk Kim { 11110d84335fSJung-uk Kim void *File; 11120d84335fSJung-uk Kim char *Filename; 11130d84335fSJung-uk Kim char *FileStart; /* Points to AML and indicates when the AML for this particular file starts. */ 11140d84335fSJung-uk Kim char *FileEnd; /* Points to AML and indicates when the AML for this particular file ends. */ 11150d84335fSJung-uk Kim struct acpi_file_node *Next; 11160d84335fSJung-uk Kim struct acpi_file_node *Parent; 11170d84335fSJung-uk Kim BOOLEAN IncludeWritten; 11180d84335fSJung-uk Kim ACPI_COMMENT_NODE *IncludeComment; 11190d84335fSJung-uk Kim 11200d84335fSJung-uk Kim } ACPI_FILE_NODE; 11210d84335fSJung-uk Kim 1122a9f12690SJung-uk Kim 1123a9f12690SJung-uk Kim /* 1124a9f12690SJung-uk Kim * Generic operation (for example: If, While, Store) 1125a9f12690SJung-uk Kim */ 1126a9f12690SJung-uk Kim typedef struct acpi_parse_obj_common 1127a9f12690SJung-uk Kim { 1128a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1129a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_COMMON; 1130a9f12690SJung-uk Kim 1131a9f12690SJung-uk Kim 1132a9f12690SJung-uk Kim /* 1133a9f12690SJung-uk Kim * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions), 1134a9f12690SJung-uk Kim * and bytelists. 1135a9f12690SJung-uk Kim */ 1136a9f12690SJung-uk Kim typedef struct acpi_parse_obj_named 1137a9f12690SJung-uk Kim { 1138a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1139*af051161SJung-uk Kim char *Path; 1140a9f12690SJung-uk Kim UINT8 *Data; /* AML body or bytelist data */ 1141a9f12690SJung-uk Kim UINT32 Length; /* AML length */ 1142a9f12690SJung-uk Kim UINT32 Name; /* 4-byte name or zero if no name */ 1143a9f12690SJung-uk Kim 1144a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_NAMED; 1145a9f12690SJung-uk Kim 1146a9f12690SJung-uk Kim 1147a9f12690SJung-uk Kim /* This version is used by the iASL compiler only */ 1148a9f12690SJung-uk Kim 1149a9f12690SJung-uk Kim #define ACPI_MAX_PARSEOP_NAME 20 1150a9f12690SJung-uk Kim 1151a9f12690SJung-uk Kim typedef struct acpi_parse_obj_asl 1152a9f12690SJung-uk Kim { 1153a9f12690SJung-uk Kim ACPI_PARSE_COMMON 1154a9f12690SJung-uk Kim union acpi_parse_object *Child; 1155a9f12690SJung-uk Kim union acpi_parse_object *ParentMethod; 1156a9f12690SJung-uk Kim char *Filename; 11570d84335fSJung-uk Kim BOOLEAN FileChanged; 11580d84335fSJung-uk Kim char *ParentFilename; 1159a9f12690SJung-uk Kim char *ExternalName; 1160a9f12690SJung-uk Kim char *Namepath; 1161a9f12690SJung-uk Kim char NameSeg[4]; 1162a9f12690SJung-uk Kim UINT32 ExtraValue; 1163a9f12690SJung-uk Kim UINT32 Column; 1164a9f12690SJung-uk Kim UINT32 LineNumber; 1165a9f12690SJung-uk Kim UINT32 LogicalLineNumber; 1166a9f12690SJung-uk Kim UINT32 LogicalByteOffset; 1167a9f12690SJung-uk Kim UINT32 EndLine; 1168a9f12690SJung-uk Kim UINT32 EndLogicalLine; 1169a9f12690SJung-uk Kim UINT32 AcpiBtype; 1170a9f12690SJung-uk Kim UINT32 AmlLength; 1171a9f12690SJung-uk Kim UINT32 AmlSubtreeLength; 1172a9f12690SJung-uk Kim UINT32 FinalAmlLength; 1173a9f12690SJung-uk Kim UINT32 FinalAmlOffset; 1174a9f12690SJung-uk Kim UINT32 CompileFlags; 1175a9f12690SJung-uk Kim UINT16 ParseOpcode; 1176a9f12690SJung-uk Kim UINT8 AmlOpcodeLength; 1177a9f12690SJung-uk Kim UINT8 AmlPkgLenBytes; 1178a9f12690SJung-uk Kim UINT8 Extra; 1179a9f12690SJung-uk Kim char ParseOpName[ACPI_MAX_PARSEOP_NAME]; 1180a9f12690SJung-uk Kim 1181a9f12690SJung-uk Kim } ACPI_PARSE_OBJ_ASL; 1182a9f12690SJung-uk Kim 1183a9f12690SJung-uk Kim typedef union acpi_parse_object 1184a9f12690SJung-uk Kim { 1185a9f12690SJung-uk Kim ACPI_PARSE_OBJ_COMMON Common; 1186a9f12690SJung-uk Kim ACPI_PARSE_OBJ_NAMED Named; 1187a9f12690SJung-uk Kim ACPI_PARSE_OBJ_ASL Asl; 1188a9f12690SJung-uk Kim 1189a9f12690SJung-uk Kim } ACPI_PARSE_OBJECT; 1190a9f12690SJung-uk Kim 11910d84335fSJung-uk Kim typedef struct asl_comment_state 11920d84335fSJung-uk Kim { 11930d84335fSJung-uk Kim UINT8 CommentType; 11940d84335fSJung-uk Kim UINT32 SpacesBefore; 11950d84335fSJung-uk Kim ACPI_PARSE_OBJECT *Latest_Parse_Node; 11960d84335fSJung-uk Kim ACPI_PARSE_OBJECT *ParsingParenBraceNode; 11970d84335fSJung-uk Kim BOOLEAN CaptureComments; 11980d84335fSJung-uk Kim } ASL_COMMENT_STATE; 11990d84335fSJung-uk Kim 1200a9f12690SJung-uk Kim 1201a9f12690SJung-uk Kim /* 1202a9f12690SJung-uk Kim * Parse state - one state per parser invocation and each control 1203a9f12690SJung-uk Kim * method. 1204a9f12690SJung-uk Kim */ 1205a9f12690SJung-uk Kim typedef struct acpi_parse_state 1206a9f12690SJung-uk Kim { 1207a9f12690SJung-uk Kim UINT8 *AmlStart; /* First AML byte */ 1208a9f12690SJung-uk Kim UINT8 *Aml; /* Next AML byte */ 1209a9f12690SJung-uk Kim UINT8 *AmlEnd; /* (last + 1) AML byte */ 1210a9f12690SJung-uk Kim UINT8 *PkgStart; /* Current package begin */ 1211a9f12690SJung-uk Kim UINT8 *PkgEnd; /* Current package end */ 1212a9f12690SJung-uk Kim union acpi_parse_object *StartOp; /* Root of parse tree */ 1213a9f12690SJung-uk Kim struct acpi_namespace_node *StartNode; 1214a9f12690SJung-uk Kim union acpi_generic_state *Scope; /* Current scope */ 1215a9f12690SJung-uk Kim union acpi_parse_object *StartScope; 1216a9f12690SJung-uk Kim UINT32 AmlSize; 1217a9f12690SJung-uk Kim 1218a9f12690SJung-uk Kim } ACPI_PARSE_STATE; 1219a9f12690SJung-uk Kim 1220a9f12690SJung-uk Kim 1221a9f12690SJung-uk Kim /* Parse object flags */ 1222a9f12690SJung-uk Kim 1223a9f12690SJung-uk Kim #define ACPI_PARSEOP_GENERIC 0x01 1224f8146b88SJung-uk Kim #define ACPI_PARSEOP_NAMED_OBJECT 0x02 1225a9f12690SJung-uk Kim #define ACPI_PARSEOP_DEFERRED 0x04 1226a9f12690SJung-uk Kim #define ACPI_PARSEOP_BYTELIST 0x08 1227a9f12690SJung-uk Kim #define ACPI_PARSEOP_IN_STACK 0x10 1228a9f12690SJung-uk Kim #define ACPI_PARSEOP_TARGET 0x20 1229a9f12690SJung-uk Kim #define ACPI_PARSEOP_IN_CACHE 0x80 1230a9f12690SJung-uk Kim 1231a9f12690SJung-uk Kim /* Parse object DisasmFlags */ 1232a9f12690SJung-uk Kim 1233493deb39SJung-uk Kim #define ACPI_PARSEOP_IGNORE 0x0001 1234493deb39SJung-uk Kim #define ACPI_PARSEOP_PARAMETER_LIST 0x0002 1235493deb39SJung-uk Kim #define ACPI_PARSEOP_EMPTY_TERMLIST 0x0004 1236493deb39SJung-uk Kim #define ACPI_PARSEOP_PREDEFINED_CHECKED 0x0008 1237493deb39SJung-uk Kim #define ACPI_PARSEOP_CLOSING_PAREN 0x0010 1238493deb39SJung-uk Kim #define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x0020 1239493deb39SJung-uk Kim #define ACPI_PARSEOP_ASSIGNMENT 0x0040 1240493deb39SJung-uk Kim #define ACPI_PARSEOP_ELSEIF 0x0080 1241493deb39SJung-uk Kim #define ACPI_PARSEOP_LEGACY_ASL_ONLY 0x0100 1242a9f12690SJung-uk Kim 1243a9f12690SJung-uk Kim 1244a9f12690SJung-uk Kim /***************************************************************************** 1245a9f12690SJung-uk Kim * 1246a9f12690SJung-uk Kim * Hardware (ACPI registers) and PNP 1247a9f12690SJung-uk Kim * 1248a9f12690SJung-uk Kim ****************************************************************************/ 1249a9f12690SJung-uk Kim 1250a9f12690SJung-uk Kim typedef struct acpi_bit_register_info 1251a9f12690SJung-uk Kim { 1252a9f12690SJung-uk Kim UINT8 ParentRegister; 1253a9f12690SJung-uk Kim UINT8 BitPosition; 1254a9f12690SJung-uk Kim UINT16 AccessBitMask; 1255a9f12690SJung-uk Kim 1256a9f12690SJung-uk Kim } ACPI_BIT_REGISTER_INFO; 1257a9f12690SJung-uk Kim 1258a9f12690SJung-uk Kim 1259a9f12690SJung-uk Kim /* 1260a9f12690SJung-uk Kim * Some ACPI registers have bits that must be ignored -- meaning that they 1261a9f12690SJung-uk Kim * must be preserved. 1262a9f12690SJung-uk Kim */ 1263a9f12690SJung-uk Kim #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */ 1264a9f12690SJung-uk Kim 1265a9f12690SJung-uk Kim /* Write-only bits must be zeroed by software */ 1266a9f12690SJung-uk Kim 1267a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */ 1268a9f12690SJung-uk Kim 1269a9f12690SJung-uk Kim /* For control registers, both ignored and reserved bits must be preserved */ 1270a9f12690SJung-uk Kim 1271a9f12690SJung-uk Kim /* 1272a9f12690SJung-uk Kim * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the 1273a9f12690SJung-uk Kim * ACPI specification to be a "preserved" bit - "OSPM always preserves this 1274a9f12690SJung-uk Kim * bit position", section 4.7.3.2.1. However, on some machines the OS must 1275a9f12690SJung-uk Kim * write a one to this bit after resume for the machine to work properly. 1276a9f12690SJung-uk Kim * To enable this, we no longer attempt to preserve this bit. No machines 1277a9f12690SJung-uk Kim * are known to fail if the bit is not preserved. (May 2009) 1278a9f12690SJung-uk Kim */ 1279a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */ 1280a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */ 1281a9f12690SJung-uk Kim #define ACPI_PM1_CONTROL_PRESERVED_BITS \ 1282a9f12690SJung-uk Kim (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS) 1283a9f12690SJung-uk Kim 1284a9f12690SJung-uk Kim #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */ 1285a9f12690SJung-uk Kim 1286a9f12690SJung-uk Kim /* 1287a9f12690SJung-uk Kim * Register IDs 1288a9f12690SJung-uk Kim * These are the full ACPI registers 1289a9f12690SJung-uk Kim */ 1290a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_STATUS 0x01 1291a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_ENABLE 0x02 1292a9f12690SJung-uk Kim #define ACPI_REGISTER_PM1_CONTROL 0x03 1293a9f12690SJung-uk Kim #define ACPI_REGISTER_PM2_CONTROL 0x04 1294a9f12690SJung-uk Kim #define ACPI_REGISTER_PM_TIMER 0x05 1295a9f12690SJung-uk Kim #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06 1296a9f12690SJung-uk Kim #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07 1297a9f12690SJung-uk Kim 1298a9f12690SJung-uk Kim 1299a9f12690SJung-uk Kim /* Masks used to access the BitRegisters */ 1300a9f12690SJung-uk Kim 1301a9f12690SJung-uk Kim #define ACPI_BITMASK_TIMER_STATUS 0x0001 1302a9f12690SJung-uk Kim #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010 1303a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020 1304a9f12690SJung-uk Kim #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100 1305a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200 1306a9f12690SJung-uk Kim #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400 1307a9f12690SJung-uk Kim #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */ 1308a9f12690SJung-uk Kim #define ACPI_BITMASK_WAKE_STATUS 0x8000 1309a9f12690SJung-uk Kim 1310a9f12690SJung-uk Kim #define ACPI_BITMASK_ALL_FIXED_STATUS (\ 1311a9f12690SJung-uk Kim ACPI_BITMASK_TIMER_STATUS | \ 1312a9f12690SJung-uk Kim ACPI_BITMASK_BUS_MASTER_STATUS | \ 1313a9f12690SJung-uk Kim ACPI_BITMASK_GLOBAL_LOCK_STATUS | \ 1314a9f12690SJung-uk Kim ACPI_BITMASK_POWER_BUTTON_STATUS | \ 1315a9f12690SJung-uk Kim ACPI_BITMASK_SLEEP_BUTTON_STATUS | \ 1316a9f12690SJung-uk Kim ACPI_BITMASK_RT_CLOCK_STATUS | \ 13173c1812acSJung-uk Kim ACPI_BITMASK_PCIEXP_WAKE_STATUS | \ 1318a9f12690SJung-uk Kim ACPI_BITMASK_WAKE_STATUS) 1319a9f12690SJung-uk Kim 1320a9f12690SJung-uk Kim #define ACPI_BITMASK_TIMER_ENABLE 0x0001 1321a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020 1322a9f12690SJung-uk Kim #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100 1323a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200 1324a9f12690SJung-uk Kim #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400 1325a9f12690SJung-uk Kim #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */ 1326a9f12690SJung-uk Kim 1327a9f12690SJung-uk Kim #define ACPI_BITMASK_SCI_ENABLE 0x0001 1328a9f12690SJung-uk Kim #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002 1329a9f12690SJung-uk Kim #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004 1330a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_TYPE 0x1C00 1331a9f12690SJung-uk Kim #define ACPI_BITMASK_SLEEP_ENABLE 0x2000 1332a9f12690SJung-uk Kim 1333a9f12690SJung-uk Kim #define ACPI_BITMASK_ARB_DISABLE 0x0001 1334a9f12690SJung-uk Kim 1335a9f12690SJung-uk Kim 1336a9f12690SJung-uk Kim /* Raw bit position of each BitRegister */ 1337a9f12690SJung-uk Kim 1338a9f12690SJung-uk Kim #define ACPI_BITPOSITION_TIMER_STATUS 0x00 1339a9f12690SJung-uk Kim #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04 1340a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05 1341a9f12690SJung-uk Kim #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08 1342a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09 1343a9f12690SJung-uk Kim #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A 1344a9f12690SJung-uk Kim #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */ 1345a9f12690SJung-uk Kim #define ACPI_BITPOSITION_WAKE_STATUS 0x0F 1346a9f12690SJung-uk Kim 1347a9f12690SJung-uk Kim #define ACPI_BITPOSITION_TIMER_ENABLE 0x00 1348a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05 1349a9f12690SJung-uk Kim #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08 1350a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09 1351a9f12690SJung-uk Kim #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A 1352a9f12690SJung-uk Kim #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */ 1353a9f12690SJung-uk Kim 1354a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SCI_ENABLE 0x00 1355a9f12690SJung-uk Kim #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01 1356a9f12690SJung-uk Kim #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02 1357a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A 1358a9f12690SJung-uk Kim #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D 1359a9f12690SJung-uk Kim 1360a9f12690SJung-uk Kim #define ACPI_BITPOSITION_ARB_DISABLE 0x00 1361a9f12690SJung-uk Kim 1362a9f12690SJung-uk Kim 1363a9f12690SJung-uk Kim /* Structs and definitions for _OSI support and I/O port validation */ 1364a9f12690SJung-uk Kim 1365a9f12690SJung-uk Kim #define ACPI_ALWAYS_ILLEGAL 0x00 1366a9f12690SJung-uk Kim 1367a9f12690SJung-uk Kim typedef struct acpi_interface_info 1368a9f12690SJung-uk Kim { 1369a9f12690SJung-uk Kim char *Name; 1370709fac06SJung-uk Kim struct acpi_interface_info *Next; 1371709fac06SJung-uk Kim UINT8 Flags; 1372a9f12690SJung-uk Kim UINT8 Value; 1373a9f12690SJung-uk Kim 1374a9f12690SJung-uk Kim } ACPI_INTERFACE_INFO; 1375a9f12690SJung-uk Kim 1376709fac06SJung-uk Kim #define ACPI_OSI_INVALID 0x01 1377709fac06SJung-uk Kim #define ACPI_OSI_DYNAMIC 0x02 1378bf6fac21SJung-uk Kim #define ACPI_OSI_FEATURE 0x04 1379bf6fac21SJung-uk Kim #define ACPI_OSI_DEFAULT_INVALID 0x08 1380bf6fac21SJung-uk Kim #define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID) 1381709fac06SJung-uk Kim 1382a9f12690SJung-uk Kim typedef struct acpi_port_info 1383a9f12690SJung-uk Kim { 1384a9f12690SJung-uk Kim char *Name; 1385a9f12690SJung-uk Kim UINT16 Start; 1386a9f12690SJung-uk Kim UINT16 End; 1387a9f12690SJung-uk Kim UINT8 OsiDependency; 1388a9f12690SJung-uk Kim 1389a9f12690SJung-uk Kim } ACPI_PORT_INFO; 1390a9f12690SJung-uk Kim 1391a9f12690SJung-uk Kim 1392a9f12690SJung-uk Kim /***************************************************************************** 1393a9f12690SJung-uk Kim * 1394a9f12690SJung-uk Kim * Resource descriptors 1395a9f12690SJung-uk Kim * 1396a9f12690SJung-uk Kim ****************************************************************************/ 1397a9f12690SJung-uk Kim 1398a9f12690SJung-uk Kim /* ResourceType values */ 1399a9f12690SJung-uk Kim 1400a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0 1401a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_IO_RANGE 1 1402a9f12690SJung-uk Kim #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2 1403a9f12690SJung-uk Kim 1404a9f12690SJung-uk Kim /* Resource descriptor types and masks */ 1405a9f12690SJung-uk Kim 1406a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE 0x80 1407a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL 0x00 1408a9f12690SJung-uk Kim 1409a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */ 1410a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */ 1411a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */ 1412a9f12690SJung-uk Kim 1413a9f12690SJung-uk Kim 1414a9f12690SJung-uk Kim /* 1415a9f12690SJung-uk Kim * Small resource descriptor "names" as defined by the ACPI specification. 1416a9f12690SJung-uk Kim * Note: Bits 2:0 are used for the descriptor length 1417a9f12690SJung-uk Kim */ 1418a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_IRQ 0x20 1419a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_DMA 0x28 1420a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30 1421a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 1422a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_IO 0x40 1423a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 14243f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 1425a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 1426a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 1427a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 1428a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70 1429a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_END_TAG 0x78 1430a9f12690SJung-uk Kim 1431a9f12690SJung-uk Kim /* 1432a9f12690SJung-uk Kim * Large resource descriptor "names" as defined by the ACPI specification. 1433a9f12690SJung-uk Kim * Note: includes the Large Descriptor bit in bit[7] 1434a9f12690SJung-uk Kim */ 1435a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_MEMORY24 0x81 1436a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82 1437a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83 1438a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84 1439a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_MEMORY32 0x85 1440a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86 1441a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS32 0x87 1442a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS16 0x88 1443a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 1444a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A 1445a9f12690SJung-uk Kim #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B 14463f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_GPIO 0x8C 1447*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D 14483f0275a0SJung-uk Kim #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E 1449*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F 1450*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP 0x90 1451*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91 1452*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92 1453*af051161SJung-uk Kim #define ACPI_RESOURCE_NAME_LARGE_MAX 0x92 1454a9f12690SJung-uk Kim 1455a9f12690SJung-uk Kim 1456a9f12690SJung-uk Kim /***************************************************************************** 1457a9f12690SJung-uk Kim * 1458a9f12690SJung-uk Kim * Miscellaneous 1459a9f12690SJung-uk Kim * 1460a9f12690SJung-uk Kim ****************************************************************************/ 1461a9f12690SJung-uk Kim 1462a9f12690SJung-uk Kim #define ACPI_ASCII_ZERO 0x30 1463a9f12690SJung-uk Kim 1464a9f12690SJung-uk Kim 1465a9f12690SJung-uk Kim /***************************************************************************** 1466a9f12690SJung-uk Kim * 1467f556842eSJung-uk Kim * Disassembler 1468f556842eSJung-uk Kim * 1469f556842eSJung-uk Kim ****************************************************************************/ 1470f556842eSJung-uk Kim 1471f556842eSJung-uk Kim typedef struct acpi_external_list 1472f556842eSJung-uk Kim { 1473f556842eSJung-uk Kim char *Path; 1474f556842eSJung-uk Kim char *InternalPath; 1475f556842eSJung-uk Kim struct acpi_external_list *Next; 1476f556842eSJung-uk Kim UINT32 Value; 1477f556842eSJung-uk Kim UINT16 Length; 1478313a0c13SJung-uk Kim UINT16 Flags; 1479f556842eSJung-uk Kim UINT8 Type; 1480f556842eSJung-uk Kim 1481f556842eSJung-uk Kim } ACPI_EXTERNAL_LIST; 1482f556842eSJung-uk Kim 1483f556842eSJung-uk Kim /* Values for Flags field above */ 1484f556842eSJung-uk Kim 1485313a0c13SJung-uk Kim #define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */ 1486313a0c13SJung-uk Kim #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */ 1487313a0c13SJung-uk Kim #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ 1488313a0c13SJung-uk Kim #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ 1489f8146b88SJung-uk Kim #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */ 1490*af051161SJung-uk Kim #define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */ 1491f556842eSJung-uk Kim 1492f556842eSJung-uk Kim 1493709fac06SJung-uk Kim typedef struct acpi_external_file 1494709fac06SJung-uk Kim { 1495709fac06SJung-uk Kim char *Path; 1496709fac06SJung-uk Kim struct acpi_external_file *Next; 1497709fac06SJung-uk Kim 1498709fac06SJung-uk Kim } ACPI_EXTERNAL_FILE; 1499709fac06SJung-uk Kim 1500709fac06SJung-uk Kim 1501*af051161SJung-uk Kim typedef struct acpi_parse_object_list 1502*af051161SJung-uk Kim { 1503*af051161SJung-uk Kim ACPI_PARSE_OBJECT *Op; 1504*af051161SJung-uk Kim struct acpi_parse_object_list *Next; 1505*af051161SJung-uk Kim 1506*af051161SJung-uk Kim } ACPI_PARSE_OBJECT_LIST; 1507*af051161SJung-uk Kim 1508f556842eSJung-uk Kim /***************************************************************************** 1509f556842eSJung-uk Kim * 1510a9f12690SJung-uk Kim * Debugger 1511a9f12690SJung-uk Kim * 1512a9f12690SJung-uk Kim ****************************************************************************/ 1513a9f12690SJung-uk Kim 1514a9f12690SJung-uk Kim typedef struct acpi_db_method_info 1515a9f12690SJung-uk Kim { 15161df130f1SJung-uk Kim ACPI_HANDLE Method; 1517a9f12690SJung-uk Kim ACPI_HANDLE MainThreadGate; 1518a9f12690SJung-uk Kim ACPI_HANDLE ThreadCompleteGate; 1519a9f12690SJung-uk Kim ACPI_HANDLE InfoGate; 152042fecd12SJung-uk Kim ACPI_THREAD_ID *Threads; 1521a9f12690SJung-uk Kim UINT32 NumThreads; 1522a9f12690SJung-uk Kim UINT32 NumCreated; 1523a9f12690SJung-uk Kim UINT32 NumCompleted; 1524a9f12690SJung-uk Kim 1525a9f12690SJung-uk Kim char *Name; 1526a9f12690SJung-uk Kim UINT32 Flags; 1527a9f12690SJung-uk Kim UINT32 NumLoops; 1528313a0c13SJung-uk Kim char Pathname[ACPI_DB_LINE_BUFFER_SIZE]; 1529a9f12690SJung-uk Kim char **Args; 153042e58c03SJung-uk Kim ACPI_OBJECT_TYPE *Types; 1531a9f12690SJung-uk Kim 1532a9f12690SJung-uk Kim /* 1533a9f12690SJung-uk Kim * Arguments to be passed to method for the command 1534a9f12690SJung-uk Kim * Threads - 1535a9f12690SJung-uk Kim * the Number of threads, ID of current thread and 1536a9f12690SJung-uk Kim * Index of current thread inside all them created. 1537a9f12690SJung-uk Kim */ 1538a9f12690SJung-uk Kim char InitArgs; 1539fe0f0bbbSJung-uk Kim #ifdef ACPI_DEBUGGER 154042e58c03SJung-uk Kim ACPI_OBJECT_TYPE ArgTypes[4]; 1541fe0f0bbbSJung-uk Kim #endif 1542a9f12690SJung-uk Kim char *Arguments[4]; 1543a9f12690SJung-uk Kim char NumThreadsStr[11]; 1544a9f12690SJung-uk Kim char IdOfThreadStr[11]; 1545a9f12690SJung-uk Kim char IndexOfThreadStr[11]; 1546a9f12690SJung-uk Kim 1547a9f12690SJung-uk Kim } ACPI_DB_METHOD_INFO; 1548a9f12690SJung-uk Kim 1549a9f12690SJung-uk Kim typedef struct acpi_integrity_info 1550a9f12690SJung-uk Kim { 1551a9f12690SJung-uk Kim UINT32 Nodes; 1552a9f12690SJung-uk Kim UINT32 Objects; 1553a9f12690SJung-uk Kim 1554a9f12690SJung-uk Kim } ACPI_INTEGRITY_INFO; 1555a9f12690SJung-uk Kim 1556a9f12690SJung-uk Kim 1557313a0c13SJung-uk Kim #define ACPI_DB_DISABLE_OUTPUT 0x00 1558a9f12690SJung-uk Kim #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 1559a9f12690SJung-uk Kim #define ACPI_DB_CONSOLE_OUTPUT 0x02 1560a9f12690SJung-uk Kim #define ACPI_DB_DUPLICATE_OUTPUT 0x03 1561a9f12690SJung-uk Kim 1562a9f12690SJung-uk Kim 156370e6ab8fSJung-uk Kim typedef struct acpi_object_info 156470e6ab8fSJung-uk Kim { 156570e6ab8fSJung-uk Kim UINT32 Types[ACPI_TOTAL_TYPES]; 156670e6ab8fSJung-uk Kim 156770e6ab8fSJung-uk Kim } ACPI_OBJECT_INFO; 156870e6ab8fSJung-uk Kim 156970e6ab8fSJung-uk Kim 1570a9f12690SJung-uk Kim /***************************************************************************** 1571a9f12690SJung-uk Kim * 1572a9f12690SJung-uk Kim * Debug 1573a9f12690SJung-uk Kim * 1574a9f12690SJung-uk Kim ****************************************************************************/ 1575a9f12690SJung-uk Kim 1576a9f12690SJung-uk Kim /* Entry for a memory allocation (debug only) */ 1577a9f12690SJung-uk Kim 1578a9f12690SJung-uk Kim #define ACPI_MEM_MALLOC 0 1579a9f12690SJung-uk Kim #define ACPI_MEM_CALLOC 1 1580a9f12690SJung-uk Kim #define ACPI_MAX_MODULE_NAME 16 1581a9f12690SJung-uk Kim 1582a9f12690SJung-uk Kim #define ACPI_COMMON_DEBUG_MEM_HEADER \ 1583a9f12690SJung-uk Kim struct acpi_debug_mem_block *Previous; \ 1584a9f12690SJung-uk Kim struct acpi_debug_mem_block *Next; \ 1585a9f12690SJung-uk Kim UINT32 Size; \ 1586a9f12690SJung-uk Kim UINT32 Component; \ 1587a9f12690SJung-uk Kim UINT32 Line; \ 1588a9f12690SJung-uk Kim char Module[ACPI_MAX_MODULE_NAME]; \ 1589a9f12690SJung-uk Kim UINT8 AllocType; 1590a9f12690SJung-uk Kim 1591a9f12690SJung-uk Kim typedef struct acpi_debug_mem_header 1592a9f12690SJung-uk Kim { 1593a9f12690SJung-uk Kim ACPI_COMMON_DEBUG_MEM_HEADER 1594a9f12690SJung-uk Kim 1595a9f12690SJung-uk Kim } ACPI_DEBUG_MEM_HEADER; 1596a9f12690SJung-uk Kim 1597a9f12690SJung-uk Kim typedef struct acpi_debug_mem_block 1598a9f12690SJung-uk Kim { 1599a9f12690SJung-uk Kim ACPI_COMMON_DEBUG_MEM_HEADER 1600a9f12690SJung-uk Kim UINT64 UserSpace; 1601a9f12690SJung-uk Kim 1602a9f12690SJung-uk Kim } ACPI_DEBUG_MEM_BLOCK; 1603a9f12690SJung-uk Kim 1604a9f12690SJung-uk Kim 1605a9f12690SJung-uk Kim #define ACPI_MEM_LIST_GLOBAL 0 1606a9f12690SJung-uk Kim #define ACPI_MEM_LIST_NSNODE 1 1607a9f12690SJung-uk Kim #define ACPI_MEM_LIST_MAX 1 1608a9f12690SJung-uk Kim #define ACPI_NUM_MEM_LISTS 2 1609a9f12690SJung-uk Kim 1610a9f12690SJung-uk Kim 1611f38b0f21SJung-uk Kim /***************************************************************************** 1612f38b0f21SJung-uk Kim * 1613f38b0f21SJung-uk Kim * Info/help support 1614f38b0f21SJung-uk Kim * 1615f38b0f21SJung-uk Kim ****************************************************************************/ 1616f38b0f21SJung-uk Kim 1617f38b0f21SJung-uk Kim typedef struct ah_predefined_name 1618f38b0f21SJung-uk Kim { 1619f38b0f21SJung-uk Kim char *Name; 1620f38b0f21SJung-uk Kim char *Description; 1621f38b0f21SJung-uk Kim #ifndef ACPI_ASL_COMPILER 1622f38b0f21SJung-uk Kim char *Action; 1623f38b0f21SJung-uk Kim #endif 1624f38b0f21SJung-uk Kim 1625f38b0f21SJung-uk Kim } AH_PREDEFINED_NAME; 1626f38b0f21SJung-uk Kim 1627313a0c13SJung-uk Kim typedef struct ah_device_id 1628313a0c13SJung-uk Kim { 1629313a0c13SJung-uk Kim char *Name; 1630313a0c13SJung-uk Kim char *Description; 1631313a0c13SJung-uk Kim 1632313a0c13SJung-uk Kim } AH_DEVICE_ID; 1633313a0c13SJung-uk Kim 1634313a0c13SJung-uk Kim typedef struct ah_uuid 1635313a0c13SJung-uk Kim { 1636313a0c13SJung-uk Kim char *Description; 1637313a0c13SJung-uk Kim char *String; 1638313a0c13SJung-uk Kim 1639313a0c13SJung-uk Kim } AH_UUID; 1640313a0c13SJung-uk Kim 1641a371a5fdSJung-uk Kim typedef struct ah_table 1642a371a5fdSJung-uk Kim { 1643a371a5fdSJung-uk Kim char *Signature; 1644a371a5fdSJung-uk Kim char *Description; 1645a371a5fdSJung-uk Kim 1646a371a5fdSJung-uk Kim } AH_TABLE; 1647a371a5fdSJung-uk Kim 1648a9f12690SJung-uk Kim #endif /* __ACLOCAL_H__ */ 1649