acobject.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  1. /******************************************************************************
  2. *
  3. * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
  4. *
  5. *****************************************************************************/
  6. /******************************************************************************
  7. *
  8. * 1. Copyright Notice
  9. *
  10. * Some or all of this work - Copyright (c) 1999 - 2016, Intel Corp.
  11. * All rights reserved.
  12. *
  13. * 2. License
  14. *
  15. * 2.1. This is your license from Intel Corp. under its intellectual property
  16. * rights. You may have additional license terms from the party that provided
  17. * you this software, covering your right to use that party's intellectual
  18. * property rights.
  19. *
  20. * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
  21. * copy of the source code appearing in this file ("Covered Code") an
  22. * irrevocable, perpetual, worldwide license under Intel's copyrights in the
  23. * base code distributed originally by Intel ("Original Intel Code") to copy,
  24. * make derivatives, distribute, use and display any portion of the Covered
  25. * Code in any form, with the right to sublicense such rights; and
  26. *
  27. * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
  28. * license (with the right to sublicense), under only those claims of Intel
  29. * patents that are infringed by the Original Intel Code, to make, use, sell,
  30. * offer to sell, and import the Covered Code and derivative works thereof
  31. * solely to the minimum extent necessary to exercise the above copyright
  32. * license, and in no event shall the patent license extend to any additions
  33. * to or modifications of the Original Intel Code. No other license or right
  34. * is granted directly or by implication, estoppel or otherwise;
  35. *
  36. * The above copyright and patent license is granted only if the following
  37. * conditions are met:
  38. *
  39. * 3. Conditions
  40. *
  41. * 3.1. Redistribution of Source with Rights to Further Distribute Source.
  42. * Redistribution of source code of any substantial portion of the Covered
  43. * Code or modification with rights to further distribute source must include
  44. * the above Copyright Notice, the above License, this list of Conditions,
  45. * and the following Disclaimer and Export Compliance provision. In addition,
  46. * Licensee must cause all Covered Code to which Licensee contributes to
  47. * contain a file documenting the changes Licensee made to create that Covered
  48. * Code and the date of any change. Licensee must include in that file the
  49. * documentation of any changes made by any predecessor Licensee. Licensee
  50. * must include a prominent statement that the modification is derived,
  51. * directly or indirectly, from Original Intel Code.
  52. *
  53. * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
  54. * Redistribution of source code of any substantial portion of the Covered
  55. * Code or modification without rights to further distribute source must
  56. * include the following Disclaimer and Export Compliance provision in the
  57. * documentation and/or other materials provided with distribution. In
  58. * addition, Licensee may not authorize further sublicense of source of any
  59. * portion of the Covered Code, and must include terms to the effect that the
  60. * license from Licensee to its licensee is limited to the intellectual
  61. * property embodied in the software Licensee provides to its licensee, and
  62. * not to intellectual property embodied in modifications its licensee may
  63. * make.
  64. *
  65. * 3.3. Redistribution of Executable. Redistribution in executable form of any
  66. * substantial portion of the Covered Code or modification must reproduce the
  67. * above Copyright Notice, and the following Disclaimer and Export Compliance
  68. * provision in the documentation and/or other materials provided with the
  69. * distribution.
  70. *
  71. * 3.4. Intel retains all right, title, and interest in and to the Original
  72. * Intel Code.
  73. *
  74. * 3.5. Neither the name Intel nor any other trademark owned or controlled by
  75. * Intel shall be used in advertising or otherwise to promote the sale, use or
  76. * other dealings in products derived from or relating to the Covered Code
  77. * without prior written authorization from Intel.
  78. *
  79. * 4. Disclaimer and Export Compliance
  80. *
  81. * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
  82. * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
  83. * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
  84. * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
  85. * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
  86. * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
  87. * PARTICULAR PURPOSE.
  88. *
  89. * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
  90. * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
  91. * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
  92. * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
  93. * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
  94. * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
  95. * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
  96. * LIMITED REMEDY.
  97. *
  98. * 4.3. Licensee shall not export, either directly or indirectly, any of this
  99. * software or system incorporating such software without first obtaining any
  100. * required license or other approval from the U. S. Department of Commerce or
  101. * any other agency or department of the United States Government. In the
  102. * event Licensee exports any such software from the United States or
  103. * re-exports any such software from a foreign destination, Licensee shall
  104. * ensure that the distribution and export/re-export of the software is in
  105. * compliance with all laws, regulations, orders, or other restrictions of the
  106. * U.S. Export Administration Regulations. Licensee agrees that neither it nor
  107. * any of its subsidiaries will export/re-export any technical data, process,
  108. * software, or service, directly or indirectly, to any country for which the
  109. * United States government or any agency thereof requires an export license,
  110. * other governmental approval, or letter of assurance, without first obtaining
  111. * such license, approval or letter.
  112. *
  113. *****************************************************************************/
  114. #ifndef _ACOBJECT_H
  115. #define _ACOBJECT_H
  116. /* acpisrc:StructDefs -- for acpisrc conversion */
  117. /*
  118. * The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher
  119. * to the interpreter, and to keep track of the various handlers such as
  120. * address space handlers and notify handlers. The object is a constant
  121. * size in order to allow it to be cached and reused.
  122. *
  123. * Note: The object is optimized to be aligned and will not work if it is
  124. * byte-packed.
  125. */
  126. #if ACPI_MACHINE_WIDTH == 64
  127. #pragma pack(8)
  128. #else
  129. #pragma pack(4)
  130. #endif
  131. /*******************************************************************************
  132. *
  133. * Common Descriptors
  134. *
  135. ******************************************************************************/
  136. /*
  137. * Common area for all objects.
  138. *
  139. * DescriptorType is used to differentiate between internal descriptors, and
  140. * must be in the same place across all descriptors
  141. *
  142. * Note: The DescriptorType and Type fields must appear in the identical
  143. * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
  144. * structures.
  145. */
  146. #define ACPI_OBJECT_COMMON_HEADER \
  147. union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\
  148. UINT8 DescriptorType; /* To differentiate various internal objs */\
  149. UINT8 Type; /* ACPI_OBJECT_TYPE */\
  150. UINT16 ReferenceCount; /* For object deletion management */\
  151. UINT8 Flags;
  152. /*
  153. * Note: There are 3 bytes available here before the
  154. * next natural alignment boundary (for both 32/64 cases)
  155. */
  156. /* Values for Flag byte above */
  157. #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
  158. #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
  159. #define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */
  160. #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized */
  161. #define AOPOBJ_REG_CONNECTED 0x10 /* _REG was run */
  162. #define AOPOBJ_SETUP_COMPLETE 0x20 /* Region setup is complete */
  163. #define AOPOBJ_INVALID 0x40 /* Host OS won't allow a Region address */
  164. /******************************************************************************
  165. *
  166. * Basic data types
  167. *
  168. *****************************************************************************/
  169. typedef struct acpi_object_common
  170. {
  171. ACPI_OBJECT_COMMON_HEADER
  172. } ACPI_OBJECT_COMMON;
  173. typedef struct acpi_object_integer
  174. {
  175. ACPI_OBJECT_COMMON_HEADER
  176. UINT8 Fill[3]; /* Prevent warning on some compilers */
  177. UINT64 Value;
  178. } ACPI_OBJECT_INTEGER;
  179. /*
  180. * Note: The String and Buffer object must be identical through the
  181. * pointer and length elements. There is code that depends on this.
  182. *
  183. * Fields common to both Strings and Buffers
  184. */
  185. #define ACPI_COMMON_BUFFER_INFO(_Type) \
  186. _Type *Pointer; \
  187. UINT32 Length;
  188. typedef struct acpi_object_string /* Null terminated, ASCII characters only */
  189. {
  190. ACPI_OBJECT_COMMON_HEADER
  191. ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */
  192. } ACPI_OBJECT_STRING;
  193. typedef struct acpi_object_buffer
  194. {
  195. ACPI_OBJECT_COMMON_HEADER
  196. ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */
  197. UINT32 AmlLength;
  198. UINT8 *AmlStart;
  199. ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */
  200. } ACPI_OBJECT_BUFFER;
  201. typedef struct acpi_object_package
  202. {
  203. ACPI_OBJECT_COMMON_HEADER
  204. ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */
  205. union acpi_operand_object **Elements; /* Array of pointers to AcpiObjects */
  206. UINT8 *AmlStart;
  207. UINT32 AmlLength;
  208. UINT32 Count; /* # of elements in package */
  209. } ACPI_OBJECT_PACKAGE;
  210. /******************************************************************************
  211. *
  212. * Complex data types
  213. *
  214. *****************************************************************************/
  215. typedef struct acpi_object_event
  216. {
  217. ACPI_OBJECT_COMMON_HEADER
  218. ACPI_SEMAPHORE OsSemaphore; /* Actual OS synchronization object */
  219. } ACPI_OBJECT_EVENT;
  220. typedef struct acpi_object_mutex
  221. {
  222. ACPI_OBJECT_COMMON_HEADER
  223. UINT8 SyncLevel; /* 0-15, specified in Mutex() call */
  224. UINT16 AcquisitionDepth; /* Allow multiple Acquires, same thread */
  225. ACPI_MUTEX OsMutex; /* Actual OS synchronization object */
  226. ACPI_THREAD_ID ThreadId; /* Current owner of the mutex */
  227. struct acpi_thread_state *OwnerThread; /* Current owner of the mutex */
  228. union acpi_operand_object *Prev; /* Link for list of acquired mutexes */
  229. union acpi_operand_object *Next; /* Link for list of acquired mutexes */
  230. ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */
  231. UINT8 OriginalSyncLevel; /* Owner's original sync level (0-15) */
  232. } ACPI_OBJECT_MUTEX;
  233. typedef struct acpi_object_region
  234. {
  235. ACPI_OBJECT_COMMON_HEADER
  236. UINT8 SpaceId;
  237. ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */
  238. union acpi_operand_object *Handler; /* Handler for region access */
  239. union acpi_operand_object *Next;
  240. ACPI_PHYSICAL_ADDRESS Address;
  241. UINT32 Length;
  242. } ACPI_OBJECT_REGION;
  243. typedef struct acpi_object_method
  244. {
  245. ACPI_OBJECT_COMMON_HEADER
  246. UINT8 InfoFlags;
  247. UINT8 ParamCount;
  248. UINT8 SyncLevel;
  249. union acpi_operand_object *Mutex;
  250. union acpi_operand_object *Node;
  251. UINT8 *AmlStart;
  252. union
  253. {
  254. ACPI_INTERNAL_METHOD Implementation;
  255. union acpi_operand_object *Handler;
  256. } Dispatch;
  257. UINT32 AmlLength;
  258. UINT8 ThreadCount;
  259. ACPI_OWNER_ID OwnerId;
  260. } ACPI_OBJECT_METHOD;
  261. /* Flags for InfoFlags field above */
  262. #define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
  263. #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
  264. #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
  265. #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
  266. #define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
  267. #define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
  268. /******************************************************************************
  269. *
  270. * Objects that can be notified. All share a common NotifyInfo area.
  271. *
  272. *****************************************************************************/
  273. /*
  274. * Common fields for objects that support ASL notifications
  275. */
  276. #define ACPI_COMMON_NOTIFY_INFO \
  277. union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
  278. union acpi_operand_object *Handler; /* Handler for Address space */
  279. typedef struct acpi_object_notify_common /* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
  280. {
  281. ACPI_OBJECT_COMMON_HEADER
  282. ACPI_COMMON_NOTIFY_INFO
  283. } ACPI_OBJECT_NOTIFY_COMMON;
  284. typedef struct acpi_object_device
  285. {
  286. ACPI_OBJECT_COMMON_HEADER
  287. ACPI_COMMON_NOTIFY_INFO
  288. ACPI_GPE_BLOCK_INFO *GpeBlock;
  289. } ACPI_OBJECT_DEVICE;
  290. typedef struct acpi_object_power_resource
  291. {
  292. ACPI_OBJECT_COMMON_HEADER
  293. ACPI_COMMON_NOTIFY_INFO
  294. UINT32 SystemLevel;
  295. UINT32 ResourceOrder;
  296. } ACPI_OBJECT_POWER_RESOURCE;
  297. typedef struct acpi_object_processor
  298. {
  299. ACPI_OBJECT_COMMON_HEADER
  300. /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
  301. UINT8 ProcId;
  302. UINT8 Length;
  303. ACPI_COMMON_NOTIFY_INFO
  304. ACPI_IO_ADDRESS Address;
  305. } ACPI_OBJECT_PROCESSOR;
  306. typedef struct acpi_object_thermal_zone
  307. {
  308. ACPI_OBJECT_COMMON_HEADER
  309. ACPI_COMMON_NOTIFY_INFO
  310. } ACPI_OBJECT_THERMAL_ZONE;
  311. /******************************************************************************
  312. *
  313. * Fields. All share a common header/info field.
  314. *
  315. *****************************************************************************/
  316. /*
  317. * Common bitfield for the field objects
  318. * "Field Datum" -- a datum from the actual field object
  319. * "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
  320. */
  321. #define ACPI_COMMON_FIELD_INFO \
  322. UINT8 FieldFlags; /* Access, update, and lock bits */\
  323. UINT8 Attribute; /* From AccessAs keyword */\
  324. UINT8 AccessByteWidth; /* Read/Write size in bytes */\
  325. ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\
  326. UINT32 BitLength; /* Length of field in bits */\
  327. UINT32 BaseByteOffset; /* Byte offset within containing object */\
  328. UINT32 Value; /* Value to store into the Bank or Index register */\
  329. UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
  330. UINT8 AccessLength; /* For serial regions/fields */
  331. typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
  332. {
  333. ACPI_OBJECT_COMMON_HEADER
  334. ACPI_COMMON_FIELD_INFO
  335. union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */
  336. } ACPI_OBJECT_FIELD_COMMON;
  337. typedef struct acpi_object_region_field
  338. {
  339. ACPI_OBJECT_COMMON_HEADER
  340. ACPI_COMMON_FIELD_INFO
  341. UINT16 ResourceLength;
  342. union acpi_operand_object *RegionObj; /* Containing OpRegion object */
  343. UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
  344. UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
  345. } ACPI_OBJECT_REGION_FIELD;
  346. typedef struct acpi_object_bank_field
  347. {
  348. ACPI_OBJECT_COMMON_HEADER
  349. ACPI_COMMON_FIELD_INFO
  350. union acpi_operand_object *RegionObj; /* Containing OpRegion object */
  351. union acpi_operand_object *BankObj; /* BankSelect Register object */
  352. } ACPI_OBJECT_BANK_FIELD;
  353. typedef struct acpi_object_index_field
  354. {
  355. ACPI_OBJECT_COMMON_HEADER
  356. ACPI_COMMON_FIELD_INFO
  357. /*
  358. * No "RegionObj" pointer needed since the Index and Data registers
  359. * are each field definitions unto themselves.
  360. */
  361. union acpi_operand_object *IndexObj; /* Index register */
  362. union acpi_operand_object *DataObj; /* Data register */
  363. } ACPI_OBJECT_INDEX_FIELD;
  364. /* The BufferField is different in that it is part of a Buffer, not an OpRegion */
  365. typedef struct acpi_object_buffer_field
  366. {
  367. ACPI_OBJECT_COMMON_HEADER
  368. ACPI_COMMON_FIELD_INFO
  369. union acpi_operand_object *BufferObj; /* Containing Buffer object */
  370. } ACPI_OBJECT_BUFFER_FIELD;
  371. /******************************************************************************
  372. *
  373. * Objects for handlers
  374. *
  375. *****************************************************************************/
  376. typedef struct acpi_object_notify_handler
  377. {
  378. ACPI_OBJECT_COMMON_HEADER
  379. ACPI_NAMESPACE_NODE *Node; /* Parent device */
  380. UINT32 HandlerType; /* Type: Device/System/Both */
  381. ACPI_NOTIFY_HANDLER Handler; /* Handler address */
  382. void *Context;
  383. union acpi_operand_object *Next[2]; /* Device and System handler lists */
  384. } ACPI_OBJECT_NOTIFY_HANDLER;
  385. typedef struct acpi_object_addr_handler
  386. {
  387. ACPI_OBJECT_COMMON_HEADER
  388. UINT8 SpaceId;
  389. UINT8 HandlerFlags;
  390. ACPI_ADR_SPACE_HANDLER Handler;
  391. ACPI_NAMESPACE_NODE *Node; /* Parent device */
  392. void *Context;
  393. ACPI_ADR_SPACE_SETUP Setup;
  394. union acpi_operand_object *RegionList; /* Regions using this handler */
  395. union acpi_operand_object *Next;
  396. } ACPI_OBJECT_ADDR_HANDLER;
  397. /* Flags for address handler (HandlerFlags) */
  398. #define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
  399. /******************************************************************************
  400. *
  401. * Special internal objects
  402. *
  403. *****************************************************************************/
  404. /*
  405. * The Reference object is used for these opcodes:
  406. * Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp
  407. * The Reference.Class differentiates these types.
  408. */
  409. typedef struct acpi_object_reference
  410. {
  411. ACPI_OBJECT_COMMON_HEADER
  412. UINT8 Class; /* Reference Class */
  413. UINT8 TargetType; /* Used for Index Op */
  414. UINT8 Reserved;
  415. void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
  416. ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */
  417. union acpi_operand_object **Where; /* Target of Index */
  418. UINT8 *IndexPointer; /* Used for Buffers and Strings */
  419. UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */
  420. } ACPI_OBJECT_REFERENCE;
  421. /* Values for Reference.Class above */
  422. typedef enum
  423. {
  424. ACPI_REFCLASS_LOCAL = 0, /* Method local */
  425. ACPI_REFCLASS_ARG = 1, /* Method argument */
  426. ACPI_REFCLASS_REFOF = 2, /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */
  427. ACPI_REFCLASS_INDEX = 3, /* Result of Index() */
  428. ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */
  429. ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
  430. ACPI_REFCLASS_DEBUG = 6, /* Debug object */
  431. ACPI_REFCLASS_MAX = 6
  432. } ACPI_REFERENCE_CLASSES;
  433. /*
  434. * Extra object is used as additional storage for types that
  435. * have AML code in their declarations (TermArgs) that must be
  436. * evaluated at run time.
  437. *
  438. * Currently: Region and FieldUnit types
  439. */
  440. typedef struct acpi_object_extra
  441. {
  442. ACPI_OBJECT_COMMON_HEADER
  443. ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
  444. ACPI_NAMESPACE_NODE *ScopeNode;
  445. void *RegionContext; /* Region-specific data */
  446. UINT8 *AmlStart;
  447. UINT32 AmlLength;
  448. } ACPI_OBJECT_EXTRA;
  449. /* Additional data that can be attached to namespace nodes */
  450. typedef struct acpi_object_data
  451. {
  452. ACPI_OBJECT_COMMON_HEADER
  453. ACPI_OBJECT_HANDLER Handler;
  454. void *Pointer;
  455. } ACPI_OBJECT_DATA;
  456. /* Structure used when objects are cached for reuse */
  457. typedef struct acpi_object_cache_list
  458. {
  459. ACPI_OBJECT_COMMON_HEADER
  460. union acpi_operand_object *Next; /* Link for object cache and internal lists*/
  461. } ACPI_OBJECT_CACHE_LIST;
  462. /******************************************************************************
  463. *
  464. * ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above
  465. *
  466. *****************************************************************************/
  467. typedef union acpi_operand_object
  468. {
  469. ACPI_OBJECT_COMMON Common;
  470. ACPI_OBJECT_INTEGER Integer;
  471. ACPI_OBJECT_STRING String;
  472. ACPI_OBJECT_BUFFER Buffer;
  473. ACPI_OBJECT_PACKAGE Package;
  474. ACPI_OBJECT_EVENT Event;
  475. ACPI_OBJECT_METHOD Method;
  476. ACPI_OBJECT_MUTEX Mutex;
  477. ACPI_OBJECT_REGION Region;
  478. ACPI_OBJECT_NOTIFY_COMMON CommonNotify;
  479. ACPI_OBJECT_DEVICE Device;
  480. ACPI_OBJECT_POWER_RESOURCE PowerResource;
  481. ACPI_OBJECT_PROCESSOR Processor;
  482. ACPI_OBJECT_THERMAL_ZONE ThermalZone;
  483. ACPI_OBJECT_FIELD_COMMON CommonField;
  484. ACPI_OBJECT_REGION_FIELD Field;
  485. ACPI_OBJECT_BUFFER_FIELD BufferField;
  486. ACPI_OBJECT_BANK_FIELD BankField;
  487. ACPI_OBJECT_INDEX_FIELD IndexField;
  488. ACPI_OBJECT_NOTIFY_HANDLER Notify;
  489. ACPI_OBJECT_ADDR_HANDLER AddressSpace;
  490. ACPI_OBJECT_REFERENCE Reference;
  491. ACPI_OBJECT_EXTRA Extra;
  492. ACPI_OBJECT_DATA Data;
  493. ACPI_OBJECT_CACHE_LIST Cache;
  494. /*
  495. * Add namespace node to union in order to simplify code that accepts both
  496. * ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share
  497. * a common DescriptorType field in order to differentiate them.
  498. */
  499. ACPI_NAMESPACE_NODE Node;
  500. } ACPI_OPERAND_OBJECT;
  501. /******************************************************************************
  502. *
  503. * ACPI_DESCRIPTOR - objects that share a common descriptor identifier
  504. *
  505. *****************************************************************************/
  506. /* Object descriptor types */
  507. #define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */
  508. #define ACPI_DESC_TYPE_STATE 0x02
  509. #define ACPI_DESC_TYPE_STATE_UPDATE 0x03
  510. #define ACPI_DESC_TYPE_STATE_PACKAGE 0x04
  511. #define ACPI_DESC_TYPE_STATE_CONTROL 0x05
  512. #define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06
  513. #define ACPI_DESC_TYPE_STATE_PSCOPE 0x07
  514. #define ACPI_DESC_TYPE_STATE_WSCOPE 0x08
  515. #define ACPI_DESC_TYPE_STATE_RESULT 0x09
  516. #define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A
  517. #define ACPI_DESC_TYPE_STATE_THREAD 0x0B
  518. #define ACPI_DESC_TYPE_WALK 0x0C
  519. #define ACPI_DESC_TYPE_PARSER 0x0D
  520. #define ACPI_DESC_TYPE_OPERAND 0x0E
  521. #define ACPI_DESC_TYPE_NAMED 0x0F
  522. #define ACPI_DESC_TYPE_MAX 0x0F
  523. typedef struct acpi_common_descriptor
  524. {
  525. void *CommonPointer;
  526. UINT8 DescriptorType; /* To differentiate various internal objs */
  527. } ACPI_COMMON_DESCRIPTOR;
  528. typedef union acpi_descriptor
  529. {
  530. ACPI_COMMON_DESCRIPTOR Common;
  531. ACPI_OPERAND_OBJECT Object;
  532. ACPI_NAMESPACE_NODE Node;
  533. ACPI_PARSE_OBJECT Op;
  534. } ACPI_DESCRIPTOR;
  535. #pragma pack()
  536. #endif /* _ACOBJECT_H */