1a9f12690SJung-uk Kim /****************************************************************************** 2a9f12690SJung-uk Kim * 3a9f12690SJung-uk Kim * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) 4a9f12690SJung-uk Kim * 5a9f12690SJung-uk Kim *****************************************************************************/ 6a9f12690SJung-uk Kim 7d244b227SJung-uk Kim /* 8*f8146b88SJung-uk Kim * Copyright (C) 2000 - 2016, Intel Corp. 9a9f12690SJung-uk Kim * All rights reserved. 10a9f12690SJung-uk Kim * 11d244b227SJung-uk Kim * Redistribution and use in source and binary forms, with or without 12d244b227SJung-uk Kim * modification, are permitted provided that the following conditions 13d244b227SJung-uk Kim * are met: 14d244b227SJung-uk Kim * 1. Redistributions of source code must retain the above copyright 15d244b227SJung-uk Kim * notice, this list of conditions, and the following disclaimer, 16d244b227SJung-uk Kim * without modification. 17d244b227SJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18d244b227SJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 19d244b227SJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 20d244b227SJung-uk Kim * including a substantially similar Disclaimer requirement for further 21d244b227SJung-uk Kim * binary redistribution. 22d244b227SJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 23d244b227SJung-uk Kim * of any contributors may be used to endorse or promote products derived 24d244b227SJung-uk Kim * from this software without specific prior written permission. 25a9f12690SJung-uk Kim * 26d244b227SJung-uk Kim * Alternatively, this software may be distributed under the terms of the 27d244b227SJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 28d244b227SJung-uk Kim * Software Foundation. 29a9f12690SJung-uk Kim * 30d244b227SJung-uk Kim * NO WARRANTY 31d244b227SJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32d244b227SJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33d244b227SJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34d244b227SJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35d244b227SJung-uk Kim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36d244b227SJung-uk Kim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37d244b227SJung-uk Kim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38d244b227SJung-uk Kim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39d244b227SJung-uk Kim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40d244b227SJung-uk Kim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41d244b227SJung-uk Kim * POSSIBILITY OF SUCH DAMAGES. 42d244b227SJung-uk Kim */ 43a9f12690SJung-uk Kim 44a9f12690SJung-uk Kim #ifndef _ACOBJECT_H 45a9f12690SJung-uk Kim #define _ACOBJECT_H 46a9f12690SJung-uk Kim 47a9f12690SJung-uk Kim /* acpisrc:StructDefs -- for acpisrc conversion */ 48a9f12690SJung-uk Kim 49a9f12690SJung-uk Kim 50a9f12690SJung-uk Kim /* 51a9f12690SJung-uk Kim * The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher 52a9f12690SJung-uk Kim * to the interpreter, and to keep track of the various handlers such as 53a9f12690SJung-uk Kim * address space handlers and notify handlers. The object is a constant 54a9f12690SJung-uk Kim * size in order to allow it to be cached and reused. 55a9f12690SJung-uk Kim * 56a9f12690SJung-uk Kim * Note: The object is optimized to be aligned and will not work if it is 57a9f12690SJung-uk Kim * byte-packed. 58a9f12690SJung-uk Kim */ 59a9f12690SJung-uk Kim #if ACPI_MACHINE_WIDTH == 64 60a9f12690SJung-uk Kim #pragma pack(8) 61a9f12690SJung-uk Kim #else 62a9f12690SJung-uk Kim #pragma pack(4) 63a9f12690SJung-uk Kim #endif 64a9f12690SJung-uk Kim 65a9f12690SJung-uk Kim /******************************************************************************* 66a9f12690SJung-uk Kim * 67a9f12690SJung-uk Kim * Common Descriptors 68a9f12690SJung-uk Kim * 69a9f12690SJung-uk Kim ******************************************************************************/ 70a9f12690SJung-uk Kim 71a9f12690SJung-uk Kim /* 72a9f12690SJung-uk Kim * Common area for all objects. 73a9f12690SJung-uk Kim * 74a9f12690SJung-uk Kim * DescriptorType is used to differentiate between internal descriptors, and 75a9f12690SJung-uk Kim * must be in the same place across all descriptors 76a9f12690SJung-uk Kim * 77a9f12690SJung-uk Kim * Note: The DescriptorType and Type fields must appear in the identical 78a9f12690SJung-uk Kim * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 79a9f12690SJung-uk Kim * structures. 80a9f12690SJung-uk Kim */ 81a9f12690SJung-uk Kim #define ACPI_OBJECT_COMMON_HEADER \ 82a9f12690SJung-uk Kim union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\ 83a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */\ 84a9f12690SJung-uk Kim UINT8 Type; /* ACPI_OBJECT_TYPE */\ 85a9f12690SJung-uk Kim UINT16 ReferenceCount; /* For object deletion management */\ 86a9f12690SJung-uk Kim UINT8 Flags; 87a9f12690SJung-uk Kim /* 88a9f12690SJung-uk Kim * Note: There are 3 bytes available here before the 89a9f12690SJung-uk Kim * next natural alignment boundary (for both 32/64 cases) 90a9f12690SJung-uk Kim */ 91a9f12690SJung-uk Kim 92a9f12690SJung-uk Kim /* Values for Flag byte above */ 93a9f12690SJung-uk Kim 94a88e22b7SJung-uk Kim #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */ 95a88e22b7SJung-uk Kim #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */ 96a7a3b383SJung-uk Kim #define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */ 97*f8146b88SJung-uk Kim #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized */ 98*f8146b88SJung-uk Kim #define AOPOBJ_REG_CONNECTED 0x10 /* _REG was run */ 99*f8146b88SJung-uk Kim #define AOPOBJ_SETUP_COMPLETE 0x20 /* Region setup is complete */ 100*f8146b88SJung-uk Kim #define AOPOBJ_INVALID 0x40 /* Host OS won't allow a Region address */ 101a9f12690SJung-uk Kim 102a9f12690SJung-uk Kim 103a9f12690SJung-uk Kim /****************************************************************************** 104a9f12690SJung-uk Kim * 105a9f12690SJung-uk Kim * Basic data types 106a9f12690SJung-uk Kim * 107a9f12690SJung-uk Kim *****************************************************************************/ 108a9f12690SJung-uk Kim 109a9f12690SJung-uk Kim typedef struct acpi_object_common 110a9f12690SJung-uk Kim { 111a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 112a9f12690SJung-uk Kim 113a9f12690SJung-uk Kim } ACPI_OBJECT_COMMON; 114a9f12690SJung-uk Kim 115a9f12690SJung-uk Kim 116a9f12690SJung-uk Kim typedef struct acpi_object_integer 117a9f12690SJung-uk Kim { 118a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 119a9f12690SJung-uk Kim UINT8 Fill[3]; /* Prevent warning on some compilers */ 1209a179dd8SJung-uk Kim UINT64 Value; 121a9f12690SJung-uk Kim 122a9f12690SJung-uk Kim } ACPI_OBJECT_INTEGER; 123a9f12690SJung-uk Kim 124a9f12690SJung-uk Kim 125a9f12690SJung-uk Kim /* 126e8241eabSJung-uk Kim * Note: The String and Buffer object must be identical through the 127e8241eabSJung-uk Kim * pointer and length elements. There is code that depends on this. 128a9f12690SJung-uk Kim * 129a9f12690SJung-uk Kim * Fields common to both Strings and Buffers 130a9f12690SJung-uk Kim */ 131a9f12690SJung-uk Kim #define ACPI_COMMON_BUFFER_INFO(_Type) \ 132a9f12690SJung-uk Kim _Type *Pointer; \ 133a9f12690SJung-uk Kim UINT32 Length; 134a9f12690SJung-uk Kim 135a9f12690SJung-uk Kim 136a9f12690SJung-uk Kim typedef struct acpi_object_string /* Null terminated, ASCII characters only */ 137a9f12690SJung-uk Kim { 138a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 139a9f12690SJung-uk Kim ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */ 140a9f12690SJung-uk Kim 141a9f12690SJung-uk Kim } ACPI_OBJECT_STRING; 142a9f12690SJung-uk Kim 143a9f12690SJung-uk Kim 144a9f12690SJung-uk Kim typedef struct acpi_object_buffer 145a9f12690SJung-uk Kim { 146a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 147a9f12690SJung-uk Kim ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */ 148a9f12690SJung-uk Kim UINT32 AmlLength; 149a9f12690SJung-uk Kim UINT8 *AmlStart; 150a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 151a9f12690SJung-uk Kim 152a9f12690SJung-uk Kim } ACPI_OBJECT_BUFFER; 153a9f12690SJung-uk Kim 154a9f12690SJung-uk Kim 155a9f12690SJung-uk Kim typedef struct acpi_object_package 156a9f12690SJung-uk Kim { 157a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 158a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 159a9f12690SJung-uk Kim union acpi_operand_object **Elements; /* Array of pointers to AcpiObjects */ 160a9f12690SJung-uk Kim UINT8 *AmlStart; 161a9f12690SJung-uk Kim UINT32 AmlLength; 162a9f12690SJung-uk Kim UINT32 Count; /* # of elements in package */ 163a9f12690SJung-uk Kim 164a9f12690SJung-uk Kim } ACPI_OBJECT_PACKAGE; 165a9f12690SJung-uk Kim 166a9f12690SJung-uk Kim 167a9f12690SJung-uk Kim /****************************************************************************** 168a9f12690SJung-uk Kim * 169a9f12690SJung-uk Kim * Complex data types 170a9f12690SJung-uk Kim * 171a9f12690SJung-uk Kim *****************************************************************************/ 172a9f12690SJung-uk Kim 173a9f12690SJung-uk Kim typedef struct acpi_object_event 174a9f12690SJung-uk Kim { 175a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 176a9f12690SJung-uk Kim ACPI_SEMAPHORE OsSemaphore; /* Actual OS synchronization object */ 177a9f12690SJung-uk Kim 178a9f12690SJung-uk Kim } ACPI_OBJECT_EVENT; 179a9f12690SJung-uk Kim 180a9f12690SJung-uk Kim 181a9f12690SJung-uk Kim typedef struct acpi_object_mutex 182a9f12690SJung-uk Kim { 183a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 184a9f12690SJung-uk Kim UINT8 SyncLevel; /* 0-15, specified in Mutex() call */ 185a9f12690SJung-uk Kim UINT16 AcquisitionDepth; /* Allow multiple Acquires, same thread */ 186a9f12690SJung-uk Kim ACPI_MUTEX OsMutex; /* Actual OS synchronization object */ 187a9f12690SJung-uk Kim ACPI_THREAD_ID ThreadId; /* Current owner of the mutex */ 188a9f12690SJung-uk Kim struct acpi_thread_state *OwnerThread; /* Current owner of the mutex */ 189a9f12690SJung-uk Kim union acpi_operand_object *Prev; /* Link for list of acquired mutexes */ 190a9f12690SJung-uk Kim union acpi_operand_object *Next; /* Link for list of acquired mutexes */ 191a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 192a9f12690SJung-uk Kim UINT8 OriginalSyncLevel; /* Owner's original sync level (0-15) */ 193a9f12690SJung-uk Kim 194a9f12690SJung-uk Kim } ACPI_OBJECT_MUTEX; 195a9f12690SJung-uk Kim 196a9f12690SJung-uk Kim 197a9f12690SJung-uk Kim typedef struct acpi_object_region 198a9f12690SJung-uk Kim { 199a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 200a9f12690SJung-uk Kim UINT8 SpaceId; 201a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 202a9f12690SJung-uk Kim union acpi_operand_object *Handler; /* Handler for region access */ 203a9f12690SJung-uk Kim union acpi_operand_object *Next; 204a9f12690SJung-uk Kim ACPI_PHYSICAL_ADDRESS Address; 205a9f12690SJung-uk Kim UINT32 Length; 206a9f12690SJung-uk Kim 207a9f12690SJung-uk Kim } ACPI_OBJECT_REGION; 208a9f12690SJung-uk Kim 209a9f12690SJung-uk Kim 210a9f12690SJung-uk Kim typedef struct acpi_object_method 211a9f12690SJung-uk Kim { 212a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 213d244b227SJung-uk Kim UINT8 InfoFlags; 214a9f12690SJung-uk Kim UINT8 ParamCount; 215a9f12690SJung-uk Kim UINT8 SyncLevel; 216a9f12690SJung-uk Kim union acpi_operand_object *Mutex; 217fe0f0bbbSJung-uk Kim union acpi_operand_object *Node; 218a9f12690SJung-uk Kim UINT8 *AmlStart; 219572c8255SJung-uk Kim union 220572c8255SJung-uk Kim { 221a9f12690SJung-uk Kim ACPI_INTERNAL_METHOD Implementation; 222572c8255SJung-uk Kim union acpi_operand_object *Handler; 223d244b227SJung-uk Kim } Dispatch; 224572c8255SJung-uk Kim 225a9f12690SJung-uk Kim UINT32 AmlLength; 226a9f12690SJung-uk Kim UINT8 ThreadCount; 227a9f12690SJung-uk Kim ACPI_OWNER_ID OwnerId; 228a9f12690SJung-uk Kim 229a9f12690SJung-uk Kim } ACPI_OBJECT_METHOD; 230a9f12690SJung-uk Kim 231d244b227SJung-uk Kim /* Flags for InfoFlags field above */ 232d244b227SJung-uk Kim 233d244b227SJung-uk Kim #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */ 234d244b227SJung-uk Kim #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ 235d244b227SJung-uk Kim #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ 236d244b227SJung-uk Kim #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ 237313a0c13SJung-uk Kim #define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */ 238313a0c13SJung-uk Kim #define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */ 239d244b227SJung-uk Kim 240a9f12690SJung-uk Kim 241a9f12690SJung-uk Kim /****************************************************************************** 242a9f12690SJung-uk Kim * 243a9f12690SJung-uk Kim * Objects that can be notified. All share a common NotifyInfo area. 244a9f12690SJung-uk Kim * 245a9f12690SJung-uk Kim *****************************************************************************/ 246a9f12690SJung-uk Kim 247a9f12690SJung-uk Kim /* 248a9f12690SJung-uk Kim * Common fields for objects that support ASL notifications 249a9f12690SJung-uk Kim */ 250a9f12690SJung-uk Kim #define ACPI_COMMON_NOTIFY_INFO \ 251eef1b955SJung-uk Kim union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\ 252a9f12690SJung-uk Kim union acpi_operand_object *Handler; /* Handler for Address space */ 253a9f12690SJung-uk Kim 254a9f12690SJung-uk Kim 255a9f12690SJung-uk Kim typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 256a9f12690SJung-uk Kim { 257a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 258a9f12690SJung-uk Kim ACPI_COMMON_NOTIFY_INFO 259a9f12690SJung-uk Kim 260a9f12690SJung-uk Kim } ACPI_OBJECT_NOTIFY_COMMON; 261a9f12690SJung-uk Kim 262a9f12690SJung-uk Kim 263a9f12690SJung-uk Kim typedef struct acpi_object_device 264a9f12690SJung-uk Kim { 265a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 266a9f12690SJung-uk Kim ACPI_COMMON_NOTIFY_INFO 267a9f12690SJung-uk Kim ACPI_GPE_BLOCK_INFO *GpeBlock; 268a9f12690SJung-uk Kim 269a9f12690SJung-uk Kim } ACPI_OBJECT_DEVICE; 270a9f12690SJung-uk Kim 271a9f12690SJung-uk Kim 272a9f12690SJung-uk Kim typedef struct acpi_object_power_resource 273a9f12690SJung-uk Kim { 274a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 275a9f12690SJung-uk Kim ACPI_COMMON_NOTIFY_INFO 276a9f12690SJung-uk Kim UINT32 SystemLevel; 277a9f12690SJung-uk Kim UINT32 ResourceOrder; 278a9f12690SJung-uk Kim 279a9f12690SJung-uk Kim } ACPI_OBJECT_POWER_RESOURCE; 280a9f12690SJung-uk Kim 281a9f12690SJung-uk Kim 282a9f12690SJung-uk Kim typedef struct acpi_object_processor 283a9f12690SJung-uk Kim { 284a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 285a9f12690SJung-uk Kim 286a9f12690SJung-uk Kim /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */ 287a9f12690SJung-uk Kim 288a9f12690SJung-uk Kim UINT8 ProcId; 289a9f12690SJung-uk Kim UINT8 Length; 290a9f12690SJung-uk Kim ACPI_COMMON_NOTIFY_INFO 291a9f12690SJung-uk Kim ACPI_IO_ADDRESS Address; 292a9f12690SJung-uk Kim 293a9f12690SJung-uk Kim } ACPI_OBJECT_PROCESSOR; 294a9f12690SJung-uk Kim 295a9f12690SJung-uk Kim 296a9f12690SJung-uk Kim typedef struct acpi_object_thermal_zone 297a9f12690SJung-uk Kim { 298a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 299a9f12690SJung-uk Kim ACPI_COMMON_NOTIFY_INFO 300a9f12690SJung-uk Kim 301a9f12690SJung-uk Kim } ACPI_OBJECT_THERMAL_ZONE; 302a9f12690SJung-uk Kim 303a9f12690SJung-uk Kim 304a9f12690SJung-uk Kim /****************************************************************************** 305a9f12690SJung-uk Kim * 306a9f12690SJung-uk Kim * Fields. All share a common header/info field. 307a9f12690SJung-uk Kim * 308a9f12690SJung-uk Kim *****************************************************************************/ 309a9f12690SJung-uk Kim 310a9f12690SJung-uk Kim /* 311a9f12690SJung-uk Kim * Common bitfield for the field objects 312a9f12690SJung-uk Kim * "Field Datum" -- a datum from the actual field object 313a9f12690SJung-uk Kim * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field 314a9f12690SJung-uk Kim */ 315a9f12690SJung-uk Kim #define ACPI_COMMON_FIELD_INFO \ 316a9f12690SJung-uk Kim UINT8 FieldFlags; /* Access, update, and lock bits */\ 317a9f12690SJung-uk Kim UINT8 Attribute; /* From AccessAs keyword */\ 318a9f12690SJung-uk Kim UINT8 AccessByteWidth; /* Read/Write size in bytes */\ 319a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\ 320a9f12690SJung-uk Kim UINT32 BitLength; /* Length of field in bits */\ 321a9f12690SJung-uk Kim UINT32 BaseByteOffset; /* Byte offset within containing object */\ 322a9f12690SJung-uk Kim UINT32 Value; /* Value to store into the Bank or Index register */\ 323a9f12690SJung-uk Kim UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ 3243f0275a0SJung-uk Kim UINT8 AccessLength; /* For serial regions/fields */ 325a9f12690SJung-uk Kim 326a9f12690SJung-uk Kim 327a9f12690SJung-uk Kim typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 328a9f12690SJung-uk Kim { 329a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 330a9f12690SJung-uk Kim ACPI_COMMON_FIELD_INFO 331a9f12690SJung-uk Kim union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */ 332a9f12690SJung-uk Kim 333a9f12690SJung-uk Kim } ACPI_OBJECT_FIELD_COMMON; 334a9f12690SJung-uk Kim 335a9f12690SJung-uk Kim 336a9f12690SJung-uk Kim typedef struct acpi_object_region_field 337a9f12690SJung-uk Kim { 338a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 339a9f12690SJung-uk Kim ACPI_COMMON_FIELD_INFO 3403f0275a0SJung-uk Kim UINT16 ResourceLength; 341a9f12690SJung-uk Kim union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 3423f0275a0SJung-uk Kim UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */ 343313a0c13SJung-uk Kim UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */ 344a9f12690SJung-uk Kim 345a9f12690SJung-uk Kim } ACPI_OBJECT_REGION_FIELD; 346a9f12690SJung-uk Kim 347a9f12690SJung-uk Kim 348a9f12690SJung-uk Kim typedef struct acpi_object_bank_field 349a9f12690SJung-uk Kim { 350a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 351a9f12690SJung-uk Kim ACPI_COMMON_FIELD_INFO 352a9f12690SJung-uk Kim union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 353a9f12690SJung-uk Kim union acpi_operand_object *BankObj; /* BankSelect Register object */ 354a9f12690SJung-uk Kim 355a9f12690SJung-uk Kim } ACPI_OBJECT_BANK_FIELD; 356a9f12690SJung-uk Kim 357a9f12690SJung-uk Kim 358a9f12690SJung-uk Kim typedef struct acpi_object_index_field 359a9f12690SJung-uk Kim { 360a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 361a9f12690SJung-uk Kim ACPI_COMMON_FIELD_INFO 362a9f12690SJung-uk Kim 363a9f12690SJung-uk Kim /* 364a9f12690SJung-uk Kim * No "RegionObj" pointer needed since the Index and Data registers 365a9f12690SJung-uk Kim * are each field definitions unto themselves. 366a9f12690SJung-uk Kim */ 367a9f12690SJung-uk Kim union acpi_operand_object *IndexObj; /* Index register */ 368a9f12690SJung-uk Kim union acpi_operand_object *DataObj; /* Data register */ 369a9f12690SJung-uk Kim 370a9f12690SJung-uk Kim } ACPI_OBJECT_INDEX_FIELD; 371a9f12690SJung-uk Kim 372a9f12690SJung-uk Kim 373a9f12690SJung-uk Kim /* The BufferField is different in that it is part of a Buffer, not an OpRegion */ 374a9f12690SJung-uk Kim 375a9f12690SJung-uk Kim typedef struct acpi_object_buffer_field 376a9f12690SJung-uk Kim { 377a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 378a9f12690SJung-uk Kim ACPI_COMMON_FIELD_INFO 379a9f12690SJung-uk Kim union acpi_operand_object *BufferObj; /* Containing Buffer object */ 380a9f12690SJung-uk Kim 381a9f12690SJung-uk Kim } ACPI_OBJECT_BUFFER_FIELD; 382a9f12690SJung-uk Kim 383a9f12690SJung-uk Kim 384a9f12690SJung-uk Kim /****************************************************************************** 385a9f12690SJung-uk Kim * 386a9f12690SJung-uk Kim * Objects for handlers 387a9f12690SJung-uk Kim * 388a9f12690SJung-uk Kim *****************************************************************************/ 389a9f12690SJung-uk Kim 390a9f12690SJung-uk Kim typedef struct acpi_object_notify_handler 391a9f12690SJung-uk Kim { 392a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 393a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Parent device */ 394eef1b955SJung-uk Kim UINT32 HandlerType; /* Type: Device/System/Both */ 395a7a3b383SJung-uk Kim ACPI_NOTIFY_HANDLER Handler; /* Handler address */ 396a9f12690SJung-uk Kim void *Context; 397eef1b955SJung-uk Kim union acpi_operand_object *Next[2]; /* Device and System handler lists */ 398a9f12690SJung-uk Kim 399a9f12690SJung-uk Kim } ACPI_OBJECT_NOTIFY_HANDLER; 400a9f12690SJung-uk Kim 401a9f12690SJung-uk Kim 402a9f12690SJung-uk Kim typedef struct acpi_object_addr_handler 403a9f12690SJung-uk Kim { 404a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 405a9f12690SJung-uk Kim UINT8 SpaceId; 406a9f12690SJung-uk Kim UINT8 HandlerFlags; 407a9f12690SJung-uk Kim ACPI_ADR_SPACE_HANDLER Handler; 408a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* Parent device */ 409a9f12690SJung-uk Kim void *Context; 410a9f12690SJung-uk Kim ACPI_ADR_SPACE_SETUP Setup; 411a7a3b383SJung-uk Kim union acpi_operand_object *RegionList; /* Regions using this handler */ 412a9f12690SJung-uk Kim union acpi_operand_object *Next; 413a9f12690SJung-uk Kim 414a9f12690SJung-uk Kim } ACPI_OBJECT_ADDR_HANDLER; 415a9f12690SJung-uk Kim 416a9f12690SJung-uk Kim /* Flags for address handler (HandlerFlags) */ 417a9f12690SJung-uk Kim 418a9f12690SJung-uk Kim #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 419a9f12690SJung-uk Kim 420a9f12690SJung-uk Kim 421a9f12690SJung-uk Kim /****************************************************************************** 422a9f12690SJung-uk Kim * 423a9f12690SJung-uk Kim * Special internal objects 424a9f12690SJung-uk Kim * 425a9f12690SJung-uk Kim *****************************************************************************/ 426a9f12690SJung-uk Kim 427a9f12690SJung-uk Kim /* 428a9f12690SJung-uk Kim * The Reference object is used for these opcodes: 429a9f12690SJung-uk Kim * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp 430a9f12690SJung-uk Kim * The Reference.Class differentiates these types. 431a9f12690SJung-uk Kim */ 432a9f12690SJung-uk Kim typedef struct acpi_object_reference 433a9f12690SJung-uk Kim { 434a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 435a9f12690SJung-uk Kim UINT8 Class; /* Reference Class */ 436a9f12690SJung-uk Kim UINT8 TargetType; /* Used for Index Op */ 437a9f12690SJung-uk Kim UINT8 Reserved; 438a9f12690SJung-uk Kim void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ 439a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ 440a9f12690SJung-uk Kim union acpi_operand_object **Where; /* Target of Index */ 4415ef50723SJung-uk Kim UINT8 *IndexPointer; /* Used for Buffers and Strings */ 442a9f12690SJung-uk Kim UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ 443a9f12690SJung-uk Kim 444a9f12690SJung-uk Kim } ACPI_OBJECT_REFERENCE; 445a9f12690SJung-uk Kim 446a9f12690SJung-uk Kim /* Values for Reference.Class above */ 447a9f12690SJung-uk Kim 448a9f12690SJung-uk Kim typedef enum 449a9f12690SJung-uk Kim { 450a9f12690SJung-uk Kim ACPI_REFCLASS_LOCAL = 0, /* Method local */ 451a9f12690SJung-uk Kim ACPI_REFCLASS_ARG = 1, /* Method argument */ 452a9f12690SJung-uk Kim ACPI_REFCLASS_REFOF = 2, /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */ 453a9f12690SJung-uk Kim ACPI_REFCLASS_INDEX = 3, /* Result of Index() */ 454a9f12690SJung-uk Kim ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */ 455a9f12690SJung-uk Kim ACPI_REFCLASS_NAME = 5, /* Reference to a named object */ 456a9f12690SJung-uk Kim ACPI_REFCLASS_DEBUG = 6, /* Debug object */ 457a9f12690SJung-uk Kim 458a9f12690SJung-uk Kim ACPI_REFCLASS_MAX = 6 459a9f12690SJung-uk Kim 460a9f12690SJung-uk Kim } ACPI_REFERENCE_CLASSES; 461a9f12690SJung-uk Kim 462a9f12690SJung-uk Kim 463a9f12690SJung-uk Kim /* 464a9f12690SJung-uk Kim * Extra object is used as additional storage for types that 465a9f12690SJung-uk Kim * have AML code in their declarations (TermArgs) that must be 466a9f12690SJung-uk Kim * evaluated at run time. 467a9f12690SJung-uk Kim * 468a9f12690SJung-uk Kim * Currently: Region and FieldUnit types 469a9f12690SJung-uk Kim */ 470a9f12690SJung-uk Kim typedef struct acpi_object_extra 471a9f12690SJung-uk Kim { 472a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 473a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */ 4743f0275a0SJung-uk Kim ACPI_NAMESPACE_NODE *ScopeNode; 475a9f12690SJung-uk Kim void *RegionContext; /* Region-specific data */ 476a9f12690SJung-uk Kim UINT8 *AmlStart; 477a9f12690SJung-uk Kim UINT32 AmlLength; 478a9f12690SJung-uk Kim 479a9f12690SJung-uk Kim } ACPI_OBJECT_EXTRA; 480a9f12690SJung-uk Kim 481a9f12690SJung-uk Kim 482a9f12690SJung-uk Kim /* Additional data that can be attached to namespace nodes */ 483a9f12690SJung-uk Kim 484a9f12690SJung-uk Kim typedef struct acpi_object_data 485a9f12690SJung-uk Kim { 486a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 487a9f12690SJung-uk Kim ACPI_OBJECT_HANDLER Handler; 488a9f12690SJung-uk Kim void *Pointer; 489a9f12690SJung-uk Kim 490a9f12690SJung-uk Kim } ACPI_OBJECT_DATA; 491a9f12690SJung-uk Kim 492a9f12690SJung-uk Kim 493a9f12690SJung-uk Kim /* Structure used when objects are cached for reuse */ 494a9f12690SJung-uk Kim 495a9f12690SJung-uk Kim typedef struct acpi_object_cache_list 496a9f12690SJung-uk Kim { 497a9f12690SJung-uk Kim ACPI_OBJECT_COMMON_HEADER 498a9f12690SJung-uk Kim union acpi_operand_object *Next; /* Link for object cache and internal lists*/ 499a9f12690SJung-uk Kim 500a9f12690SJung-uk Kim } ACPI_OBJECT_CACHE_LIST; 501a9f12690SJung-uk Kim 502a9f12690SJung-uk Kim 503a9f12690SJung-uk Kim /****************************************************************************** 504a9f12690SJung-uk Kim * 505a9f12690SJung-uk Kim * ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above 506a9f12690SJung-uk Kim * 507a9f12690SJung-uk Kim *****************************************************************************/ 508a9f12690SJung-uk Kim 509a9f12690SJung-uk Kim typedef union acpi_operand_object 510a9f12690SJung-uk Kim { 511a9f12690SJung-uk Kim ACPI_OBJECT_COMMON Common; 512a9f12690SJung-uk Kim ACPI_OBJECT_INTEGER Integer; 513a9f12690SJung-uk Kim ACPI_OBJECT_STRING String; 514a9f12690SJung-uk Kim ACPI_OBJECT_BUFFER Buffer; 515a9f12690SJung-uk Kim ACPI_OBJECT_PACKAGE Package; 516a9f12690SJung-uk Kim ACPI_OBJECT_EVENT Event; 517a9f12690SJung-uk Kim ACPI_OBJECT_METHOD Method; 518a9f12690SJung-uk Kim ACPI_OBJECT_MUTEX Mutex; 519a9f12690SJung-uk Kim ACPI_OBJECT_REGION Region; 520a9f12690SJung-uk Kim ACPI_OBJECT_NOTIFY_COMMON CommonNotify; 521a9f12690SJung-uk Kim ACPI_OBJECT_DEVICE Device; 522a9f12690SJung-uk Kim ACPI_OBJECT_POWER_RESOURCE PowerResource; 523a9f12690SJung-uk Kim ACPI_OBJECT_PROCESSOR Processor; 524a9f12690SJung-uk Kim ACPI_OBJECT_THERMAL_ZONE ThermalZone; 525a9f12690SJung-uk Kim ACPI_OBJECT_FIELD_COMMON CommonField; 526a9f12690SJung-uk Kim ACPI_OBJECT_REGION_FIELD Field; 527a9f12690SJung-uk Kim ACPI_OBJECT_BUFFER_FIELD BufferField; 528a9f12690SJung-uk Kim ACPI_OBJECT_BANK_FIELD BankField; 529a9f12690SJung-uk Kim ACPI_OBJECT_INDEX_FIELD IndexField; 530a9f12690SJung-uk Kim ACPI_OBJECT_NOTIFY_HANDLER Notify; 531a9f12690SJung-uk Kim ACPI_OBJECT_ADDR_HANDLER AddressSpace; 532a9f12690SJung-uk Kim ACPI_OBJECT_REFERENCE Reference; 533a9f12690SJung-uk Kim ACPI_OBJECT_EXTRA Extra; 534a9f12690SJung-uk Kim ACPI_OBJECT_DATA Data; 535a9f12690SJung-uk Kim ACPI_OBJECT_CACHE_LIST Cache; 536a9f12690SJung-uk Kim 537a9f12690SJung-uk Kim /* 538a9f12690SJung-uk Kim * Add namespace node to union in order to simplify code that accepts both 539a9f12690SJung-uk Kim * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share 540a9f12690SJung-uk Kim * a common DescriptorType field in order to differentiate them. 541a9f12690SJung-uk Kim */ 542a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE Node; 543a9f12690SJung-uk Kim 544a9f12690SJung-uk Kim } ACPI_OPERAND_OBJECT; 545a9f12690SJung-uk Kim 546a9f12690SJung-uk Kim 547a9f12690SJung-uk Kim /****************************************************************************** 548a9f12690SJung-uk Kim * 549a9f12690SJung-uk Kim * ACPI_DESCRIPTOR - objects that share a common descriptor identifier 550a9f12690SJung-uk Kim * 551a9f12690SJung-uk Kim *****************************************************************************/ 552a9f12690SJung-uk Kim 553a9f12690SJung-uk Kim /* Object descriptor types */ 554a9f12690SJung-uk Kim 555a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 556a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE 0x02 557a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 558a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 559a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_CONTROL 0x05 560a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06 561a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_PSCOPE 0x07 562a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_WSCOPE 0x08 563a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_RESULT 0x09 564a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A 565a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_STATE_THREAD 0x0B 566a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_WALK 0x0C 567a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_PARSER 0x0D 568a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_OPERAND 0x0E 569a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_NAMED 0x0F 570a9f12690SJung-uk Kim #define ACPI_DESC_TYPE_MAX 0x0F 571a9f12690SJung-uk Kim 572a9f12690SJung-uk Kim 573a9f12690SJung-uk Kim typedef struct acpi_common_descriptor 574a9f12690SJung-uk Kim { 575a9f12690SJung-uk Kim void *CommonPointer; 576a9f12690SJung-uk Kim UINT8 DescriptorType; /* To differentiate various internal objs */ 577a9f12690SJung-uk Kim 578a9f12690SJung-uk Kim } ACPI_COMMON_DESCRIPTOR; 579a9f12690SJung-uk Kim 580a9f12690SJung-uk Kim typedef union acpi_descriptor 581a9f12690SJung-uk Kim { 582a9f12690SJung-uk Kim ACPI_COMMON_DESCRIPTOR Common; 583a9f12690SJung-uk Kim ACPI_OPERAND_OBJECT Object; 584a9f12690SJung-uk Kim ACPI_NAMESPACE_NODE Node; 585a9f12690SJung-uk Kim ACPI_PARSE_OBJECT Op; 586a9f12690SJung-uk Kim 587a9f12690SJung-uk Kim } ACPI_DESCRIPTOR; 588a9f12690SJung-uk Kim 589a9f12690SJung-uk Kim #pragma pack() 590a9f12690SJung-uk Kim 591a9f12690SJung-uk Kim #endif /* _ACOBJECT_H */ 592