17c478bd9Sstevel@tonic-gate /****************************************************************************** 27c478bd9Sstevel@tonic-gate * 37c478bd9Sstevel@tonic-gate * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) 47c478bd9Sstevel@tonic-gate * 57c478bd9Sstevel@tonic-gate *****************************************************************************/ 67c478bd9Sstevel@tonic-gate 726f3cdf0SGordon Ross /* 8*385cc6b4SJerry Jelinek * Copyright (C) 2000 - 2016, Intel Corp. 97c478bd9Sstevel@tonic-gate * All rights reserved. 107c478bd9Sstevel@tonic-gate * 1126f3cdf0SGordon Ross * Redistribution and use in source and binary forms, with or without 1226f3cdf0SGordon Ross * modification, are permitted provided that the following conditions 1326f3cdf0SGordon Ross * are met: 1426f3cdf0SGordon Ross * 1. Redistributions of source code must retain the above copyright 1526f3cdf0SGordon Ross * notice, this list of conditions, and the following disclaimer, 1626f3cdf0SGordon Ross * without modification. 1726f3cdf0SGordon Ross * 2. Redistributions in binary form must reproduce at minimum a disclaimer 1826f3cdf0SGordon Ross * substantially similar to the "NO WARRANTY" disclaimer below 1926f3cdf0SGordon Ross * ("Disclaimer") and any redistribution must be conditioned upon 2026f3cdf0SGordon Ross * including a substantially similar Disclaimer requirement for further 2126f3cdf0SGordon Ross * binary redistribution. 2226f3cdf0SGordon Ross * 3. Neither the names of the above-listed copyright holders nor the names 2326f3cdf0SGordon Ross * of any contributors may be used to endorse or promote products derived 2426f3cdf0SGordon Ross * from this software without specific prior written permission. 257c478bd9Sstevel@tonic-gate * 2626f3cdf0SGordon Ross * Alternatively, this software may be distributed under the terms of the 2726f3cdf0SGordon Ross * GNU General Public License ("GPL") version 2 as published by the Free 2826f3cdf0SGordon Ross * Software Foundation. 297c478bd9Sstevel@tonic-gate * 3026f3cdf0SGordon Ross * NO WARRANTY 3126f3cdf0SGordon Ross * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 3226f3cdf0SGordon Ross * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3326f3cdf0SGordon Ross * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 3426f3cdf0SGordon Ross * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3526f3cdf0SGordon Ross * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 3626f3cdf0SGordon Ross * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3726f3cdf0SGordon Ross * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3826f3cdf0SGordon Ross * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 3926f3cdf0SGordon Ross * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 4026f3cdf0SGordon Ross * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 4126f3cdf0SGordon Ross * POSSIBILITY OF SUCH DAMAGES. 4226f3cdf0SGordon Ross */ 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate #ifndef _ACOBJECT_H 457c478bd9Sstevel@tonic-gate #define _ACOBJECT_H 467c478bd9Sstevel@tonic-gate 4727f7c583Smyers /* acpisrc:StructDefs -- for acpisrc conversion */ 4827f7c583Smyers 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate /* 517c478bd9Sstevel@tonic-gate * The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher 527c478bd9Sstevel@tonic-gate * to the interpreter, and to keep track of the various handlers such as 537c478bd9Sstevel@tonic-gate * address space handlers and notify handlers. The object is a constant 547c478bd9Sstevel@tonic-gate * size in order to allow it to be cached and reused. 55db2bae30SDana Myers * 56db2bae30SDana Myers * Note: The object is optimized to be aligned and will not work if it is 57db2bae30SDana Myers * byte-packed. 587c478bd9Sstevel@tonic-gate */ 59db2bae30SDana Myers #if ACPI_MACHINE_WIDTH == 64 60db2bae30SDana Myers #pragma pack(8) 61db2bae30SDana Myers #else 62db2bae30SDana Myers #pragma pack(4) 63db2bae30SDana Myers #endif 647c478bd9Sstevel@tonic-gate 657c478bd9Sstevel@tonic-gate /******************************************************************************* 667c478bd9Sstevel@tonic-gate * 677c478bd9Sstevel@tonic-gate * Common Descriptors 687c478bd9Sstevel@tonic-gate * 697c478bd9Sstevel@tonic-gate ******************************************************************************/ 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate /* 727c478bd9Sstevel@tonic-gate * Common area for all objects. 737c478bd9Sstevel@tonic-gate * 7427f7c583Smyers * DescriptorType is used to differentiate between internal descriptors, and 7527f7c583Smyers * must be in the same place across all descriptors 7627f7c583Smyers * 7727f7c583Smyers * Note: The DescriptorType and Type fields must appear in the identical 7827f7c583Smyers * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT 7927f7c583Smyers * structures. 807c478bd9Sstevel@tonic-gate */ 8127f7c583Smyers #define ACPI_OBJECT_COMMON_HEADER \ 8227f7c583Smyers union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\ 8327f7c583Smyers UINT8 DescriptorType; /* To differentiate various internal objs */\ 847c478bd9Sstevel@tonic-gate UINT8 Type; /* ACPI_OBJECT_TYPE */\ 857c478bd9Sstevel@tonic-gate UINT16 ReferenceCount; /* For object deletion management */\ 8630082d0cSmyers UINT8 Flags; 8727f7c583Smyers /* 8827f7c583Smyers * Note: There are 3 bytes available here before the 8927f7c583Smyers * next natural alignment boundary (for both 32/64 cases) 9027f7c583Smyers */ 917c478bd9Sstevel@tonic-gate 9227f7c583Smyers /* Values for Flag byte above */ 937c478bd9Sstevel@tonic-gate 9426f3cdf0SGordon Ross #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */ 9526f3cdf0SGordon Ross #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */ 96*385cc6b4SJerry Jelinek #define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */ 97*385cc6b4SJerry Jelinek #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized */ 98*385cc6b4SJerry Jelinek #define AOPOBJ_REG_CONNECTED 0x10 /* _REG was run */ 99*385cc6b4SJerry Jelinek #define AOPOBJ_SETUP_COMPLETE 0x20 /* Region setup is complete */ 100*385cc6b4SJerry Jelinek #define AOPOBJ_INVALID 0x40 /* Host OS won't allow a Region address */ 1017c478bd9Sstevel@tonic-gate 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate /****************************************************************************** 1047c478bd9Sstevel@tonic-gate * 1057c478bd9Sstevel@tonic-gate * Basic data types 1067c478bd9Sstevel@tonic-gate * 1077c478bd9Sstevel@tonic-gate *****************************************************************************/ 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate typedef struct acpi_object_common 1107c478bd9Sstevel@tonic-gate { 1117c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 1127c478bd9Sstevel@tonic-gate 1137c478bd9Sstevel@tonic-gate } ACPI_OBJECT_COMMON; 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate typedef struct acpi_object_integer 1177c478bd9Sstevel@tonic-gate { 1187c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 119db2bae30SDana Myers UINT8 Fill[3]; /* Prevent warning on some compilers */ 12026f3cdf0SGordon Ross UINT64 Value; 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate } ACPI_OBJECT_INTEGER; 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate /* 126*385cc6b4SJerry Jelinek * Note: The String and Buffer object must be identical through the 127*385cc6b4SJerry Jelinek * pointer and length elements. There is code that depends on this. 12827f7c583Smyers * 12927f7c583Smyers * Fields common to both Strings and Buffers 1307c478bd9Sstevel@tonic-gate */ 13127f7c583Smyers #define ACPI_COMMON_BUFFER_INFO(_Type) \ 13227f7c583Smyers _Type *Pointer; \ 13327f7c583Smyers UINT32 Length; 13427f7c583Smyers 13527f7c583Smyers 1367c478bd9Sstevel@tonic-gate typedef struct acpi_object_string /* Null terminated, ASCII characters only */ 1377c478bd9Sstevel@tonic-gate { 1387c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 13927f7c583Smyers ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */ 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate } ACPI_OBJECT_STRING; 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gate typedef struct acpi_object_buffer 1457c478bd9Sstevel@tonic-gate { 1467c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 14727f7c583Smyers ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */ 1487c478bd9Sstevel@tonic-gate UINT32 AmlLength; 14927f7c583Smyers UINT8 *AmlStart; 15027f7c583Smyers ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BUFFER; 1537c478bd9Sstevel@tonic-gate 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate typedef struct acpi_object_package 1567c478bd9Sstevel@tonic-gate { 1577c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 1587c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */ 1597c478bd9Sstevel@tonic-gate union acpi_operand_object **Elements; /* Array of pointers to AcpiObjects */ 16027f7c583Smyers UINT8 *AmlStart; 16127f7c583Smyers UINT32 AmlLength; 16227f7c583Smyers UINT32 Count; /* # of elements in package */ 1637c478bd9Sstevel@tonic-gate 1647c478bd9Sstevel@tonic-gate } ACPI_OBJECT_PACKAGE; 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gate /****************************************************************************** 1687c478bd9Sstevel@tonic-gate * 1697c478bd9Sstevel@tonic-gate * Complex data types 1707c478bd9Sstevel@tonic-gate * 1717c478bd9Sstevel@tonic-gate *****************************************************************************/ 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate typedef struct acpi_object_event 1747c478bd9Sstevel@tonic-gate { 1757c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 17627f7c583Smyers ACPI_SEMAPHORE OsSemaphore; /* Actual OS synchronization object */ 1777c478bd9Sstevel@tonic-gate 1787c478bd9Sstevel@tonic-gate } ACPI_OBJECT_EVENT; 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate 1817c478bd9Sstevel@tonic-gate typedef struct acpi_object_mutex 1827c478bd9Sstevel@tonic-gate { 1837c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 1847c478bd9Sstevel@tonic-gate UINT8 SyncLevel; /* 0-15, specified in Mutex() call */ 1857c478bd9Sstevel@tonic-gate UINT16 AcquisitionDepth; /* Allow multiple Acquires, same thread */ 18627f7c583Smyers ACPI_MUTEX OsMutex; /* Actual OS synchronization object */ 187db2bae30SDana Myers ACPI_THREAD_ID ThreadId; /* Current owner of the mutex */ 188db2bae30SDana Myers struct acpi_thread_state *OwnerThread; /* Current owner of the mutex */ 1897c478bd9Sstevel@tonic-gate union acpi_operand_object *Prev; /* Link for list of acquired mutexes */ 1907c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; /* Link for list of acquired mutexes */ 1917c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 1927c478bd9Sstevel@tonic-gate UINT8 OriginalSyncLevel; /* Owner's original sync level (0-15) */ 1937c478bd9Sstevel@tonic-gate 1947c478bd9Sstevel@tonic-gate } ACPI_OBJECT_MUTEX; 1957c478bd9Sstevel@tonic-gate 1967c478bd9Sstevel@tonic-gate 1977c478bd9Sstevel@tonic-gate typedef struct acpi_object_region 1987c478bd9Sstevel@tonic-gate { 1997c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2007c478bd9Sstevel@tonic-gate UINT8 SpaceId; 2017c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */ 20227f7c583Smyers union acpi_operand_object *Handler; /* Handler for region access */ 2037c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; 2047c478bd9Sstevel@tonic-gate ACPI_PHYSICAL_ADDRESS Address; 20527f7c583Smyers UINT32 Length; 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REGION; 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate 21027f7c583Smyers typedef struct acpi_object_method 21127f7c583Smyers { 21227f7c583Smyers ACPI_OBJECT_COMMON_HEADER 21326f3cdf0SGordon Ross UINT8 InfoFlags; 21427f7c583Smyers UINT8 ParamCount; 21527f7c583Smyers UINT8 SyncLevel; 21627f7c583Smyers union acpi_operand_object *Mutex; 217*385cc6b4SJerry Jelinek union acpi_operand_object *Node; 21827f7c583Smyers UINT8 *AmlStart; 21926f3cdf0SGordon Ross union 22026f3cdf0SGordon Ross { 22127f7c583Smyers ACPI_INTERNAL_METHOD Implementation; 22226f3cdf0SGordon Ross union acpi_operand_object *Handler; 22326f3cdf0SGordon Ross } Dispatch; 22426f3cdf0SGordon Ross 22527f7c583Smyers UINT32 AmlLength; 22627f7c583Smyers UINT8 ThreadCount; 22727f7c583Smyers ACPI_OWNER_ID OwnerId; 22827f7c583Smyers 22927f7c583Smyers } ACPI_OBJECT_METHOD; 23027f7c583Smyers 23126f3cdf0SGordon Ross /* Flags for InfoFlags field above */ 23226f3cdf0SGordon Ross 23326f3cdf0SGordon Ross #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */ 23426f3cdf0SGordon Ross #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ 23526f3cdf0SGordon Ross #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ 23626f3cdf0SGordon Ross #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ 237*385cc6b4SJerry Jelinek #define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */ 238*385cc6b4SJerry Jelinek #define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */ 23926f3cdf0SGordon Ross 24027f7c583Smyers 2417c478bd9Sstevel@tonic-gate /****************************************************************************** 2427c478bd9Sstevel@tonic-gate * 2437c478bd9Sstevel@tonic-gate * Objects that can be notified. All share a common NotifyInfo area. 2447c478bd9Sstevel@tonic-gate * 2457c478bd9Sstevel@tonic-gate *****************************************************************************/ 2467c478bd9Sstevel@tonic-gate 24727f7c583Smyers /* 24827f7c583Smyers * Common fields for objects that support ASL notifications 24927f7c583Smyers */ 25027f7c583Smyers #define ACPI_COMMON_NOTIFY_INFO \ 251*385cc6b4SJerry Jelinek union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\ 25227f7c583Smyers union acpi_operand_object *Handler; /* Handler for Address space */ 25327f7c583Smyers 25427f7c583Smyers 2557c478bd9Sstevel@tonic-gate typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */ 2567c478bd9Sstevel@tonic-gate { 2577c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2587c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 2597c478bd9Sstevel@tonic-gate 2607c478bd9Sstevel@tonic-gate } ACPI_OBJECT_NOTIFY_COMMON; 2617c478bd9Sstevel@tonic-gate 2627c478bd9Sstevel@tonic-gate 2637c478bd9Sstevel@tonic-gate typedef struct acpi_object_device 2647c478bd9Sstevel@tonic-gate { 2657c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2667c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 2677c478bd9Sstevel@tonic-gate ACPI_GPE_BLOCK_INFO *GpeBlock; 2687c478bd9Sstevel@tonic-gate 2697c478bd9Sstevel@tonic-gate } ACPI_OBJECT_DEVICE; 2707c478bd9Sstevel@tonic-gate 2717c478bd9Sstevel@tonic-gate 2727c478bd9Sstevel@tonic-gate typedef struct acpi_object_power_resource 2737c478bd9Sstevel@tonic-gate { 2747c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2757c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 2767c478bd9Sstevel@tonic-gate UINT32 SystemLevel; 2777c478bd9Sstevel@tonic-gate UINT32 ResourceOrder; 2787c478bd9Sstevel@tonic-gate 2797c478bd9Sstevel@tonic-gate } ACPI_OBJECT_POWER_RESOURCE; 2807c478bd9Sstevel@tonic-gate 2817c478bd9Sstevel@tonic-gate 2827c478bd9Sstevel@tonic-gate typedef struct acpi_object_processor 2837c478bd9Sstevel@tonic-gate { 2847c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 285db2bae30SDana Myers 286db2bae30SDana Myers /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */ 287db2bae30SDana Myers 28827f7c583Smyers UINT8 ProcId; 28927f7c583Smyers UINT8 Length; 2907c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 2917c478bd9Sstevel@tonic-gate ACPI_IO_ADDRESS Address; 2927c478bd9Sstevel@tonic-gate 2937c478bd9Sstevel@tonic-gate } ACPI_OBJECT_PROCESSOR; 2947c478bd9Sstevel@tonic-gate 2957c478bd9Sstevel@tonic-gate 2967c478bd9Sstevel@tonic-gate typedef struct acpi_object_thermal_zone 2977c478bd9Sstevel@tonic-gate { 2987c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 2997c478bd9Sstevel@tonic-gate ACPI_COMMON_NOTIFY_INFO 3007c478bd9Sstevel@tonic-gate 3017c478bd9Sstevel@tonic-gate } ACPI_OBJECT_THERMAL_ZONE; 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate 3047c478bd9Sstevel@tonic-gate /****************************************************************************** 3057c478bd9Sstevel@tonic-gate * 3067c478bd9Sstevel@tonic-gate * Fields. All share a common header/info field. 3077c478bd9Sstevel@tonic-gate * 3087c478bd9Sstevel@tonic-gate *****************************************************************************/ 3097c478bd9Sstevel@tonic-gate 31027f7c583Smyers /* 31127f7c583Smyers * Common bitfield for the field objects 31227f7c583Smyers * "Field Datum" -- a datum from the actual field object 31327f7c583Smyers * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field 31427f7c583Smyers */ 31527f7c583Smyers #define ACPI_COMMON_FIELD_INFO \ 31627f7c583Smyers UINT8 FieldFlags; /* Access, update, and lock bits */\ 31727f7c583Smyers UINT8 Attribute; /* From AccessAs keyword */\ 31827f7c583Smyers UINT8 AccessByteWidth; /* Read/Write size in bytes */\ 31927f7c583Smyers ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\ 32027f7c583Smyers UINT32 BitLength; /* Length of field in bits */\ 32127f7c583Smyers UINT32 BaseByteOffset; /* Byte offset within containing object */\ 32227f7c583Smyers UINT32 Value; /* Value to store into the Bank or Index register */\ 32327f7c583Smyers UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ 324*385cc6b4SJerry Jelinek UINT8 AccessLength; /* For serial regions/fields */ 32527f7c583Smyers 32627f7c583Smyers 3277c478bd9Sstevel@tonic-gate typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ 3287c478bd9Sstevel@tonic-gate { 3297c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3307c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 33127f7c583Smyers union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */ 33227f7c583Smyers 3337c478bd9Sstevel@tonic-gate } ACPI_OBJECT_FIELD_COMMON; 3347c478bd9Sstevel@tonic-gate 3357c478bd9Sstevel@tonic-gate 3367c478bd9Sstevel@tonic-gate typedef struct acpi_object_region_field 3377c478bd9Sstevel@tonic-gate { 3387c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3397c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 340*385cc6b4SJerry Jelinek UINT16 ResourceLength; 3417c478bd9Sstevel@tonic-gate union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 342*385cc6b4SJerry Jelinek UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */ 343*385cc6b4SJerry Jelinek UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */ 3447c478bd9Sstevel@tonic-gate 3457c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REGION_FIELD; 3467c478bd9Sstevel@tonic-gate 3477c478bd9Sstevel@tonic-gate 3487c478bd9Sstevel@tonic-gate typedef struct acpi_object_bank_field 3497c478bd9Sstevel@tonic-gate { 3507c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3517c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 3527c478bd9Sstevel@tonic-gate union acpi_operand_object *RegionObj; /* Containing OpRegion object */ 3537c478bd9Sstevel@tonic-gate union acpi_operand_object *BankObj; /* BankSelect Register object */ 3547c478bd9Sstevel@tonic-gate 3557c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BANK_FIELD; 3567c478bd9Sstevel@tonic-gate 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate typedef struct acpi_object_index_field 3597c478bd9Sstevel@tonic-gate { 3607c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3617c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 3627c478bd9Sstevel@tonic-gate 3637c478bd9Sstevel@tonic-gate /* 3647c478bd9Sstevel@tonic-gate * No "RegionObj" pointer needed since the Index and Data registers 3657c478bd9Sstevel@tonic-gate * are each field definitions unto themselves. 3667c478bd9Sstevel@tonic-gate */ 3677c478bd9Sstevel@tonic-gate union acpi_operand_object *IndexObj; /* Index register */ 3687c478bd9Sstevel@tonic-gate union acpi_operand_object *DataObj; /* Data register */ 3697c478bd9Sstevel@tonic-gate 3707c478bd9Sstevel@tonic-gate } ACPI_OBJECT_INDEX_FIELD; 3717c478bd9Sstevel@tonic-gate 3727c478bd9Sstevel@tonic-gate 3737c478bd9Sstevel@tonic-gate /* The BufferField is different in that it is part of a Buffer, not an OpRegion */ 3747c478bd9Sstevel@tonic-gate 3757c478bd9Sstevel@tonic-gate typedef struct acpi_object_buffer_field 3767c478bd9Sstevel@tonic-gate { 3777c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3787c478bd9Sstevel@tonic-gate ACPI_COMMON_FIELD_INFO 3797c478bd9Sstevel@tonic-gate union acpi_operand_object *BufferObj; /* Containing Buffer object */ 3807c478bd9Sstevel@tonic-gate 3817c478bd9Sstevel@tonic-gate } ACPI_OBJECT_BUFFER_FIELD; 3827c478bd9Sstevel@tonic-gate 3837c478bd9Sstevel@tonic-gate 3847c478bd9Sstevel@tonic-gate /****************************************************************************** 3857c478bd9Sstevel@tonic-gate * 3867c478bd9Sstevel@tonic-gate * Objects for handlers 3877c478bd9Sstevel@tonic-gate * 3887c478bd9Sstevel@tonic-gate *****************************************************************************/ 3897c478bd9Sstevel@tonic-gate 3907c478bd9Sstevel@tonic-gate typedef struct acpi_object_notify_handler 3917c478bd9Sstevel@tonic-gate { 3927c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 3937c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Parent device */ 394*385cc6b4SJerry Jelinek UINT32 HandlerType; /* Type: Device/System/Both */ 395*385cc6b4SJerry Jelinek ACPI_NOTIFY_HANDLER Handler; /* Handler address */ 3967c478bd9Sstevel@tonic-gate void *Context; 397*385cc6b4SJerry Jelinek union acpi_operand_object *Next[2]; /* Device and System handler lists */ 3987c478bd9Sstevel@tonic-gate 3997c478bd9Sstevel@tonic-gate } ACPI_OBJECT_NOTIFY_HANDLER; 4007c478bd9Sstevel@tonic-gate 4017c478bd9Sstevel@tonic-gate 4027c478bd9Sstevel@tonic-gate typedef struct acpi_object_addr_handler 4037c478bd9Sstevel@tonic-gate { 4047c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4057c478bd9Sstevel@tonic-gate UINT8 SpaceId; 40627f7c583Smyers UINT8 HandlerFlags; 4077c478bd9Sstevel@tonic-gate ACPI_ADR_SPACE_HANDLER Handler; 4087c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Node; /* Parent device */ 4097c478bd9Sstevel@tonic-gate void *Context; 4107c478bd9Sstevel@tonic-gate ACPI_ADR_SPACE_SETUP Setup; 411*385cc6b4SJerry Jelinek union acpi_operand_object *RegionList; /* Regions using this handler */ 4127c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; 4137c478bd9Sstevel@tonic-gate 4147c478bd9Sstevel@tonic-gate } ACPI_OBJECT_ADDR_HANDLER; 4157c478bd9Sstevel@tonic-gate 41627f7c583Smyers /* Flags for address handler (HandlerFlags) */ 41727f7c583Smyers 41827f7c583Smyers #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01 41927f7c583Smyers 4207c478bd9Sstevel@tonic-gate 4217c478bd9Sstevel@tonic-gate /****************************************************************************** 4227c478bd9Sstevel@tonic-gate * 4237c478bd9Sstevel@tonic-gate * Special internal objects 4247c478bd9Sstevel@tonic-gate * 4257c478bd9Sstevel@tonic-gate *****************************************************************************/ 4267c478bd9Sstevel@tonic-gate 4277c478bd9Sstevel@tonic-gate /* 428db2bae30SDana Myers * The Reference object is used for these opcodes: 429db2bae30SDana Myers * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp 430db2bae30SDana Myers * The Reference.Class differentiates these types. 4317c478bd9Sstevel@tonic-gate */ 4327c478bd9Sstevel@tonic-gate typedef struct acpi_object_reference 4337c478bd9Sstevel@tonic-gate { 4347c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 435db2bae30SDana Myers UINT8 Class; /* Reference Class */ 4367c478bd9Sstevel@tonic-gate UINT8 TargetType; /* Used for Index Op */ 437db2bae30SDana Myers UINT8 Reserved; 4387c478bd9Sstevel@tonic-gate void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */ 439db2bae30SDana Myers ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */ 440db2bae30SDana Myers union acpi_operand_object **Where; /* Target of Index */ 441*385cc6b4SJerry Jelinek UINT8 *IndexPointer; /* Used for Buffers and Strings */ 442db2bae30SDana Myers UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */ 4437c478bd9Sstevel@tonic-gate 4447c478bd9Sstevel@tonic-gate } ACPI_OBJECT_REFERENCE; 4457c478bd9Sstevel@tonic-gate 446db2bae30SDana Myers /* Values for Reference.Class above */ 447db2bae30SDana Myers 448db2bae30SDana Myers typedef enum 449db2bae30SDana Myers { 450db2bae30SDana Myers ACPI_REFCLASS_LOCAL = 0, /* Method local */ 451db2bae30SDana Myers ACPI_REFCLASS_ARG = 1, /* Method argument */ 452db2bae30SDana Myers ACPI_REFCLASS_REFOF = 2, /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */ 453db2bae30SDana Myers ACPI_REFCLASS_INDEX = 3, /* Result of Index() */ 454db2bae30SDana Myers ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */ 455db2bae30SDana Myers ACPI_REFCLASS_NAME = 5, /* Reference to a named object */ 456db2bae30SDana Myers ACPI_REFCLASS_DEBUG = 6, /* Debug object */ 457db2bae30SDana Myers 458db2bae30SDana Myers ACPI_REFCLASS_MAX = 6 459db2bae30SDana Myers 460db2bae30SDana Myers } ACPI_REFERENCE_CLASSES; 461db2bae30SDana Myers 4627c478bd9Sstevel@tonic-gate 4637c478bd9Sstevel@tonic-gate /* 4647c478bd9Sstevel@tonic-gate * Extra object is used as additional storage for types that 4657c478bd9Sstevel@tonic-gate * have AML code in their declarations (TermArgs) that must be 4667c478bd9Sstevel@tonic-gate * evaluated at run time. 4677c478bd9Sstevel@tonic-gate * 4687c478bd9Sstevel@tonic-gate * Currently: Region and FieldUnit types 4697c478bd9Sstevel@tonic-gate */ 4707c478bd9Sstevel@tonic-gate typedef struct acpi_object_extra 4717c478bd9Sstevel@tonic-gate { 4727c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4737c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */ 474*385cc6b4SJerry Jelinek ACPI_NAMESPACE_NODE *ScopeNode; 4757c478bd9Sstevel@tonic-gate void *RegionContext; /* Region-specific data */ 47627f7c583Smyers UINT8 *AmlStart; 47727f7c583Smyers UINT32 AmlLength; 4787c478bd9Sstevel@tonic-gate 4797c478bd9Sstevel@tonic-gate } ACPI_OBJECT_EXTRA; 4807c478bd9Sstevel@tonic-gate 4817c478bd9Sstevel@tonic-gate 4827c478bd9Sstevel@tonic-gate /* Additional data that can be attached to namespace nodes */ 4837c478bd9Sstevel@tonic-gate 4847c478bd9Sstevel@tonic-gate typedef struct acpi_object_data 4857c478bd9Sstevel@tonic-gate { 4867c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4877c478bd9Sstevel@tonic-gate ACPI_OBJECT_HANDLER Handler; 4887c478bd9Sstevel@tonic-gate void *Pointer; 4897c478bd9Sstevel@tonic-gate 4907c478bd9Sstevel@tonic-gate } ACPI_OBJECT_DATA; 4917c478bd9Sstevel@tonic-gate 4927c478bd9Sstevel@tonic-gate 4937c478bd9Sstevel@tonic-gate /* Structure used when objects are cached for reuse */ 4947c478bd9Sstevel@tonic-gate 4957c478bd9Sstevel@tonic-gate typedef struct acpi_object_cache_list 4967c478bd9Sstevel@tonic-gate { 4977c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON_HEADER 4987c478bd9Sstevel@tonic-gate union acpi_operand_object *Next; /* Link for object cache and internal lists*/ 4997c478bd9Sstevel@tonic-gate 5007c478bd9Sstevel@tonic-gate } ACPI_OBJECT_CACHE_LIST; 5017c478bd9Sstevel@tonic-gate 5027c478bd9Sstevel@tonic-gate 5037c478bd9Sstevel@tonic-gate /****************************************************************************** 5047c478bd9Sstevel@tonic-gate * 5057c478bd9Sstevel@tonic-gate * ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above 5067c478bd9Sstevel@tonic-gate * 5077c478bd9Sstevel@tonic-gate *****************************************************************************/ 5087c478bd9Sstevel@tonic-gate 5097c478bd9Sstevel@tonic-gate typedef union acpi_operand_object 5107c478bd9Sstevel@tonic-gate { 5117c478bd9Sstevel@tonic-gate ACPI_OBJECT_COMMON Common; 5127c478bd9Sstevel@tonic-gate ACPI_OBJECT_INTEGER Integer; 5137c478bd9Sstevel@tonic-gate ACPI_OBJECT_STRING String; 5147c478bd9Sstevel@tonic-gate ACPI_OBJECT_BUFFER Buffer; 5157c478bd9Sstevel@tonic-gate ACPI_OBJECT_PACKAGE Package; 5167c478bd9Sstevel@tonic-gate ACPI_OBJECT_EVENT Event; 5177c478bd9Sstevel@tonic-gate ACPI_OBJECT_METHOD Method; 5187c478bd9Sstevel@tonic-gate ACPI_OBJECT_MUTEX Mutex; 5197c478bd9Sstevel@tonic-gate ACPI_OBJECT_REGION Region; 5207c478bd9Sstevel@tonic-gate ACPI_OBJECT_NOTIFY_COMMON CommonNotify; 5217c478bd9Sstevel@tonic-gate ACPI_OBJECT_DEVICE Device; 5227c478bd9Sstevel@tonic-gate ACPI_OBJECT_POWER_RESOURCE PowerResource; 5237c478bd9Sstevel@tonic-gate ACPI_OBJECT_PROCESSOR Processor; 5247c478bd9Sstevel@tonic-gate ACPI_OBJECT_THERMAL_ZONE ThermalZone; 5257c478bd9Sstevel@tonic-gate ACPI_OBJECT_FIELD_COMMON CommonField; 5267c478bd9Sstevel@tonic-gate ACPI_OBJECT_REGION_FIELD Field; 5277c478bd9Sstevel@tonic-gate ACPI_OBJECT_BUFFER_FIELD BufferField; 5287c478bd9Sstevel@tonic-gate ACPI_OBJECT_BANK_FIELD BankField; 5297c478bd9Sstevel@tonic-gate ACPI_OBJECT_INDEX_FIELD IndexField; 5307c478bd9Sstevel@tonic-gate ACPI_OBJECT_NOTIFY_HANDLER Notify; 5317c478bd9Sstevel@tonic-gate ACPI_OBJECT_ADDR_HANDLER AddressSpace; 5327c478bd9Sstevel@tonic-gate ACPI_OBJECT_REFERENCE Reference; 5337c478bd9Sstevel@tonic-gate ACPI_OBJECT_EXTRA Extra; 5347c478bd9Sstevel@tonic-gate ACPI_OBJECT_DATA Data; 5357c478bd9Sstevel@tonic-gate ACPI_OBJECT_CACHE_LIST Cache; 5367c478bd9Sstevel@tonic-gate 537db2bae30SDana Myers /* 538db2bae30SDana Myers * Add namespace node to union in order to simplify code that accepts both 539db2bae30SDana Myers * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share 540db2bae30SDana Myers * a common DescriptorType field in order to differentiate them. 541db2bae30SDana Myers */ 542db2bae30SDana Myers ACPI_NAMESPACE_NODE Node; 543db2bae30SDana Myers 5447c478bd9Sstevel@tonic-gate } ACPI_OPERAND_OBJECT; 5457c478bd9Sstevel@tonic-gate 5467c478bd9Sstevel@tonic-gate 5477c478bd9Sstevel@tonic-gate /****************************************************************************** 5487c478bd9Sstevel@tonic-gate * 5497c478bd9Sstevel@tonic-gate * ACPI_DESCRIPTOR - objects that share a common descriptor identifier 5507c478bd9Sstevel@tonic-gate * 5517c478bd9Sstevel@tonic-gate *****************************************************************************/ 5527c478bd9Sstevel@tonic-gate 5537c478bd9Sstevel@tonic-gate /* Object descriptor types */ 5547c478bd9Sstevel@tonic-gate 5557c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */ 5567c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE 0x02 5577c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_UPDATE 0x03 5587c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04 5597c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_CONTROL 0x05 5607c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06 5617c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_PSCOPE 0x07 5627c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_WSCOPE 0x08 5637c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_RESULT 0x09 5647c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A 5657c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_STATE_THREAD 0x0B 5667c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_WALK 0x0C 5677c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_PARSER 0x0D 5687c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_OPERAND 0x0E 5697c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_NAMED 0x0F 5707c478bd9Sstevel@tonic-gate #define ACPI_DESC_TYPE_MAX 0x0F 5717c478bd9Sstevel@tonic-gate 5727c478bd9Sstevel@tonic-gate 57327f7c583Smyers typedef struct acpi_common_descriptor 57427f7c583Smyers { 57527f7c583Smyers void *CommonPointer; 57627f7c583Smyers UINT8 DescriptorType; /* To differentiate various internal objs */ 57727f7c583Smyers 57827f7c583Smyers } ACPI_COMMON_DESCRIPTOR; 57927f7c583Smyers 5807c478bd9Sstevel@tonic-gate typedef union acpi_descriptor 5817c478bd9Sstevel@tonic-gate { 58227f7c583Smyers ACPI_COMMON_DESCRIPTOR Common; 5837c478bd9Sstevel@tonic-gate ACPI_OPERAND_OBJECT Object; 5847c478bd9Sstevel@tonic-gate ACPI_NAMESPACE_NODE Node; 5857c478bd9Sstevel@tonic-gate ACPI_PARSE_OBJECT Op; 5867c478bd9Sstevel@tonic-gate 5877c478bd9Sstevel@tonic-gate } ACPI_DESCRIPTOR; 5887c478bd9Sstevel@tonic-gate 589db2bae30SDana Myers #pragma pack() 5907c478bd9Sstevel@tonic-gate 5917c478bd9Sstevel@tonic-gate #endif /* _ACOBJECT_H */ 592