aclocal.h 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227
  1. /******************************************************************************
  2. *
  3. * Name: aclocal.h - Internal data types used across the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2016, Intel Corp.
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACLOCAL_H__
  43. #define __ACLOCAL_H__
  44. /* acpisrc:struct_defs -- for acpisrc conversion */
  45. #define ACPI_SERIALIZED 0xFF
  46. typedef u32 acpi_mutex_handle;
  47. #define ACPI_GLOBAL_LOCK (acpi_semaphore) (-1)
  48. /* Total number of aml opcodes defined */
  49. #define AML_NUM_OPCODES 0x82
  50. /* Forward declarations */
  51. struct acpi_walk_state;
  52. struct acpi_obj_mutex;
  53. union acpi_parse_object;
  54. /*****************************************************************************
  55. *
  56. * Mutex typedefs and structs
  57. *
  58. ****************************************************************************/
  59. /*
  60. * Predefined handles for the mutex objects used within the subsystem
  61. * All mutex objects are automatically created by acpi_ut_mutex_initialize.
  62. *
  63. * The acquire/release ordering protocol is implied via this list. Mutexes
  64. * with a lower value must be acquired before mutexes with a higher value.
  65. *
  66. * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names
  67. * table below also!
  68. */
  69. #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
  70. #define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
  71. #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
  72. #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
  73. #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
  74. #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
  75. #define ACPI_MAX_MUTEX 5
  76. #define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1)
  77. /* Lock structure for reader/writer interfaces */
  78. struct acpi_rw_lock {
  79. acpi_mutex writer_mutex;
  80. acpi_mutex reader_mutex;
  81. u32 num_readers;
  82. };
  83. /*
  84. * Predefined handles for spinlocks used within the subsystem.
  85. * These spinlocks are created by acpi_ut_mutex_initialize
  86. */
  87. #define ACPI_LOCK_GPES 0
  88. #define ACPI_LOCK_HARDWARE 1
  89. #define ACPI_MAX_LOCK 1
  90. #define ACPI_NUM_LOCK (ACPI_MAX_LOCK+1)
  91. /* This Thread ID means that the mutex is not in use (unlocked) */
  92. #define ACPI_MUTEX_NOT_ACQUIRED ((acpi_thread_id) 0)
  93. /* This Thread ID means an invalid thread ID */
  94. #ifdef ACPI_OS_INVALID_THREAD_ID
  95. #define ACPI_INVALID_THREAD_ID ACPI_OS_INVALID_THREAD_ID
  96. #else
  97. #define ACPI_INVALID_THREAD_ID ((acpi_thread_id) 0xFFFFFFFF)
  98. #endif
  99. /* Table for the global mutexes */
  100. struct acpi_mutex_info {
  101. acpi_mutex mutex;
  102. u32 use_count;
  103. acpi_thread_id thread_id;
  104. };
  105. /* Lock flag parameter for various interfaces */
  106. #define ACPI_MTX_DO_NOT_LOCK 0
  107. #define ACPI_MTX_LOCK 1
  108. /* Field access granularities */
  109. #define ACPI_FIELD_BYTE_GRANULARITY 1
  110. #define ACPI_FIELD_WORD_GRANULARITY 2
  111. #define ACPI_FIELD_DWORD_GRANULARITY 4
  112. #define ACPI_FIELD_QWORD_GRANULARITY 8
  113. #define ACPI_ENTRY_NOT_FOUND NULL
  114. /*****************************************************************************
  115. *
  116. * Namespace typedefs and structs
  117. *
  118. ****************************************************************************/
  119. /* Operational modes of the AML interpreter/scanner */
  120. typedef enum {
  121. ACPI_IMODE_LOAD_PASS1 = 0x01,
  122. ACPI_IMODE_LOAD_PASS2 = 0x02,
  123. ACPI_IMODE_EXECUTE = 0x03
  124. } acpi_interpreter_mode;
  125. /*
  126. * The Namespace Node describes a named object that appears in the AML.
  127. * descriptor_type is used to differentiate between internal descriptors.
  128. *
  129. * The node is optimized for both 32-bit and 64-bit platforms:
  130. * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
  131. *
  132. * Note: The descriptor_type and Type fields must appear in the identical
  133. * position in both the struct acpi_namespace_node and union acpi_operand_object
  134. * structures.
  135. */
  136. struct acpi_namespace_node {
  137. union acpi_operand_object *object; /* Interpreter object */
  138. u8 descriptor_type; /* Differentiate object descriptor types */
  139. u8 type; /* ACPI Type associated with this name */
  140. u8 flags; /* Miscellaneous flags */
  141. acpi_owner_id owner_id; /* Node creator */
  142. union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
  143. struct acpi_namespace_node *parent; /* Parent node */
  144. struct acpi_namespace_node *child; /* First child */
  145. struct acpi_namespace_node *peer; /* First peer */
  146. /*
  147. * The following fields are used by the ASL compiler and disassembler only
  148. */
  149. #ifdef ACPI_LARGE_NAMESPACE_NODE
  150. union acpi_parse_object *op;
  151. void *method_locals;
  152. void *method_args;
  153. u32 value;
  154. u32 length;
  155. u8 arg_count;
  156. #endif
  157. };
  158. /* Namespace Node flags */
  159. #define ANOBJ_RESERVED 0x01 /* Available for use */
  160. #define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
  161. #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
  162. #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
  163. #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
  164. #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
  165. #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (install_method) */
  166. #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
  167. #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
  168. #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
  169. #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
  170. /* Internal ACPI table management - master table list */
  171. struct acpi_table_list {
  172. struct acpi_table_desc *tables; /* Table descriptor array */
  173. u32 current_table_count; /* Tables currently in the array */
  174. u32 max_table_count; /* Max tables array will hold */
  175. u8 flags;
  176. };
  177. /* Flags for above */
  178. #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
  179. #define ACPI_ROOT_ORIGIN_ALLOCATED (1)
  180. #define ACPI_ROOT_ALLOW_RESIZE (2)
  181. /* List to manage incoming ACPI tables */
  182. struct acpi_new_table_desc {
  183. struct acpi_table_header *table;
  184. struct acpi_new_table_desc *next;
  185. };
  186. /* Predefined table indexes */
  187. #define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
  188. struct acpi_find_context {
  189. char *search_for;
  190. acpi_handle *list;
  191. u32 *count;
  192. };
  193. struct acpi_ns_search_data {
  194. struct acpi_namespace_node *node;
  195. };
  196. /* Object types used during package copies */
  197. #define ACPI_COPY_TYPE_SIMPLE 0
  198. #define ACPI_COPY_TYPE_PACKAGE 1
  199. /* Info structure used to convert external<->internal namestrings */
  200. struct acpi_namestring_info {
  201. const char *external_name;
  202. const char *next_external_char;
  203. char *internal_name;
  204. u32 length;
  205. u32 num_segments;
  206. u32 num_carats;
  207. u8 fully_qualified;
  208. };
  209. /* Field creation info */
  210. struct acpi_create_field_info {
  211. struct acpi_namespace_node *region_node;
  212. struct acpi_namespace_node *field_node;
  213. struct acpi_namespace_node *register_node;
  214. struct acpi_namespace_node *data_register_node;
  215. struct acpi_namespace_node *connection_node;
  216. u8 *resource_buffer;
  217. u32 bank_value;
  218. u32 field_bit_position;
  219. u32 field_bit_length;
  220. u16 resource_length;
  221. u16 pin_number_index;
  222. u8 field_flags;
  223. u8 attribute;
  224. u8 field_type;
  225. u8 access_length;
  226. };
  227. typedef
  228. acpi_status (*acpi_internal_method) (struct acpi_walk_state * walk_state);
  229. /*
  230. * Bitmapped ACPI types. Used internally only
  231. */
  232. #define ACPI_BTYPE_ANY 0x00000000
  233. #define ACPI_BTYPE_INTEGER 0x00000001
  234. #define ACPI_BTYPE_STRING 0x00000002
  235. #define ACPI_BTYPE_BUFFER 0x00000004
  236. #define ACPI_BTYPE_PACKAGE 0x00000008
  237. #define ACPI_BTYPE_FIELD_UNIT 0x00000010
  238. #define ACPI_BTYPE_DEVICE 0x00000020
  239. #define ACPI_BTYPE_EVENT 0x00000040
  240. #define ACPI_BTYPE_METHOD 0x00000080
  241. #define ACPI_BTYPE_MUTEX 0x00000100
  242. #define ACPI_BTYPE_REGION 0x00000200
  243. #define ACPI_BTYPE_POWER 0x00000400
  244. #define ACPI_BTYPE_PROCESSOR 0x00000800
  245. #define ACPI_BTYPE_THERMAL 0x00001000
  246. #define ACPI_BTYPE_BUFFER_FIELD 0x00002000
  247. #define ACPI_BTYPE_DDB_HANDLE 0x00004000
  248. #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
  249. #define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), ref_of(), etc (type6_opcodes) */
  250. #define ACPI_BTYPE_RESOURCE 0x00020000
  251. #define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */
  252. #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
  253. #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
  254. /* Used by Copy, de_ref_of, Store, Printf, Fprintf */
  255. #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
  256. #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
  257. #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
  258. #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
  259. #pragma pack(1)
  260. /*
  261. * Information structure for ACPI predefined names.
  262. * Each entry in the table contains the following items:
  263. *
  264. * name - The ACPI reserved name
  265. * param_count - Number of arguments to the method
  266. * expected_return_btypes - Allowed type(s) for the return value
  267. */
  268. struct acpi_name_info {
  269. char name[ACPI_NAME_SIZE];
  270. u16 argument_list;
  271. u8 expected_btypes;
  272. };
  273. /*
  274. * Secondary information structures for ACPI predefined objects that return
  275. * package objects. This structure appears as the next entry in the table
  276. * after the NAME_INFO structure above.
  277. *
  278. * The reason for this is to minimize the size of the predefined name table.
  279. */
  280. /*
  281. * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
  282. * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
  283. * ACPI_PTYPE2_FIX_VAR
  284. */
  285. struct acpi_package_info {
  286. u8 type;
  287. u8 object_type1;
  288. u8 count1;
  289. u8 object_type2;
  290. u8 count2;
  291. u16 reserved;
  292. };
  293. /* Used for ACPI_PTYPE2_FIXED */
  294. struct acpi_package_info2 {
  295. u8 type;
  296. u8 count;
  297. u8 object_type[4];
  298. u8 reserved;
  299. };
  300. /* Used for ACPI_PTYPE1_OPTION */
  301. struct acpi_package_info3 {
  302. u8 type;
  303. u8 count;
  304. u8 object_type[2];
  305. u8 tail_object_type;
  306. u16 reserved;
  307. };
  308. struct acpi_package_info4 {
  309. u8 type;
  310. u8 object_type1;
  311. u8 count1;
  312. u8 sub_object_types;
  313. u8 pkg_count;
  314. u16 reserved;
  315. };
  316. union acpi_predefined_info {
  317. struct acpi_name_info info;
  318. struct acpi_package_info ret_info;
  319. struct acpi_package_info2 ret_info2;
  320. struct acpi_package_info3 ret_info3;
  321. struct acpi_package_info4 ret_info4;
  322. };
  323. /* Reset to default packing */
  324. #pragma pack()
  325. /* Return object auto-repair info */
  326. typedef acpi_status (*acpi_object_converter) (struct acpi_namespace_node *
  327. scope,
  328. union acpi_operand_object *
  329. original_object,
  330. union acpi_operand_object **
  331. converted_object);
  332. struct acpi_simple_repair_info {
  333. char name[ACPI_NAME_SIZE];
  334. u32 unexpected_btypes;
  335. u32 package_index;
  336. acpi_object_converter object_converter;
  337. };
  338. /*
  339. * Bitmapped return value types
  340. * Note: the actual data types must be contiguous, a loop in nspredef.c
  341. * depends on this.
  342. */
  343. #define ACPI_RTYPE_ANY 0x00
  344. #define ACPI_RTYPE_NONE 0x01
  345. #define ACPI_RTYPE_INTEGER 0x02
  346. #define ACPI_RTYPE_STRING 0x04
  347. #define ACPI_RTYPE_BUFFER 0x08
  348. #define ACPI_RTYPE_PACKAGE 0x10
  349. #define ACPI_RTYPE_REFERENCE 0x20
  350. #define ACPI_RTYPE_ALL 0x3F
  351. #define ACPI_NUM_RTYPES 5 /* Number of actual object types */
  352. /* Info for running the _REG methods */
  353. struct acpi_reg_walk_info {
  354. acpi_adr_space_type space_id;
  355. u32 function;
  356. u32 reg_run_count;
  357. };
  358. /*****************************************************************************
  359. *
  360. * Event typedefs and structs
  361. *
  362. ****************************************************************************/
  363. /* Dispatch info for each host-installed SCI handler */
  364. struct acpi_sci_handler_info {
  365. struct acpi_sci_handler_info *next;
  366. acpi_sci_handler address; /* Address of handler */
  367. void *context; /* Context to be passed to handler */
  368. };
  369. /* Dispatch info for each GPE -- either a method or handler, cannot be both */
  370. struct acpi_gpe_handler_info {
  371. acpi_gpe_handler address; /* Address of handler, if any */
  372. void *context; /* Context to be passed to handler */
  373. struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
  374. u8 original_flags; /* Original (pre-handler) GPE info */
  375. u8 originally_enabled; /* True if GPE was originally enabled */
  376. };
  377. /* Notify info for implicit notify, multiple device objects */
  378. struct acpi_gpe_notify_info {
  379. struct acpi_namespace_node *device_node; /* Device to be notified */
  380. struct acpi_gpe_notify_info *next;
  381. };
  382. /*
  383. * GPE dispatch info. At any time, the GPE can have at most one type
  384. * of dispatch - Method, Handler, or Implicit Notify.
  385. */
  386. union acpi_gpe_dispatch_info {
  387. struct acpi_namespace_node *method_node; /* Method node for this GPE level */
  388. struct acpi_gpe_handler_info *handler; /* Installed GPE handler */
  389. struct acpi_gpe_notify_info *notify_list; /* List of _PRW devices for implicit notifies */
  390. };
  391. /*
  392. * Information about a GPE, one per each GPE in an array.
  393. * NOTE: Important to keep this struct as small as possible.
  394. */
  395. struct acpi_gpe_event_info {
  396. union acpi_gpe_dispatch_info dispatch; /* Either Method, Handler, or notify_list */
  397. struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
  398. u8 flags; /* Misc info about this GPE */
  399. u8 gpe_number; /* This GPE */
  400. u8 runtime_count; /* References to a run GPE */
  401. u8 disable_for_dispatch; /* Masked during dispatching */
  402. };
  403. /* Information about a GPE register pair, one per each status/enable pair in an array */
  404. struct acpi_gpe_register_info {
  405. struct acpi_generic_address status_address; /* Address of status reg */
  406. struct acpi_generic_address enable_address; /* Address of enable reg */
  407. u16 base_gpe_number; /* Base GPE number for this register */
  408. u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
  409. u8 enable_for_run; /* GPEs to keep enabled when running */
  410. u8 mask_for_run; /* GPEs to keep masked when running */
  411. u8 enable_mask; /* Current mask of enabled GPEs */
  412. };
  413. /*
  414. * Information about a GPE register block, one per each installed block --
  415. * GPE0, GPE1, and one per each installed GPE Block Device.
  416. */
  417. struct acpi_gpe_block_info {
  418. struct acpi_namespace_node *node;
  419. struct acpi_gpe_block_info *previous;
  420. struct acpi_gpe_block_info *next;
  421. struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */
  422. struct acpi_gpe_register_info *register_info; /* One per GPE register pair */
  423. struct acpi_gpe_event_info *event_info; /* One for each GPE */
  424. u64 address; /* Base address of the block */
  425. u32 register_count; /* Number of register pairs in block */
  426. u16 gpe_count; /* Number of individual GPEs in block */
  427. u16 block_base_number; /* Base GPE number for this block */
  428. u8 space_id;
  429. u8 initialized; /* TRUE if this block is initialized */
  430. };
  431. /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
  432. struct acpi_gpe_xrupt_info {
  433. struct acpi_gpe_xrupt_info *previous;
  434. struct acpi_gpe_xrupt_info *next;
  435. struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */
  436. u32 interrupt_number; /* System interrupt number */
  437. };
  438. struct acpi_gpe_walk_info {
  439. struct acpi_namespace_node *gpe_device;
  440. struct acpi_gpe_block_info *gpe_block;
  441. u16 count;
  442. acpi_owner_id owner_id;
  443. u8 execute_by_owner_id;
  444. };
  445. struct acpi_gpe_device_info {
  446. u32 index;
  447. u32 next_block_base_index;
  448. acpi_status status;
  449. struct acpi_namespace_node *gpe_device;
  450. };
  451. typedef acpi_status (*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
  452. gpe_xrupt_info,
  453. struct acpi_gpe_block_info *
  454. gpe_block, void *context);
  455. /* Information about each particular fixed event */
  456. struct acpi_fixed_event_handler {
  457. acpi_event_handler handler; /* Address of handler. */
  458. void *context; /* Context to be passed to handler */
  459. };
  460. struct acpi_fixed_event_info {
  461. u8 status_register_id;
  462. u8 enable_register_id;
  463. u16 status_bit_mask;
  464. u16 enable_bit_mask;
  465. };
  466. /* Information used during field processing */
  467. struct acpi_field_info {
  468. u8 skip_field;
  469. u8 field_flag;
  470. u32 pkg_length;
  471. };
  472. /*****************************************************************************
  473. *
  474. * Generic "state" object for stacks
  475. *
  476. ****************************************************************************/
  477. #define ACPI_CONTROL_NORMAL 0xC0
  478. #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
  479. #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
  480. #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
  481. #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
  482. #define ACPI_STATE_COMMON \
  483. void *next; \
  484. u8 descriptor_type; /* To differentiate various internal objs */\
  485. u8 flags; \
  486. u16 value; \
  487. u16 state;
  488. /* There are 2 bytes available here until the next natural alignment boundary */
  489. struct acpi_common_state {
  490. ACPI_STATE_COMMON};
  491. /*
  492. * Update state - used to traverse complex objects such as packages
  493. */
  494. struct acpi_update_state {
  495. ACPI_STATE_COMMON union acpi_operand_object *object;
  496. };
  497. /*
  498. * Pkg state - used to traverse nested package structures
  499. */
  500. struct acpi_pkg_state {
  501. ACPI_STATE_COMMON u16 index;
  502. union acpi_operand_object *source_object;
  503. union acpi_operand_object *dest_object;
  504. struct acpi_walk_state *walk_state;
  505. void *this_target_obj;
  506. u32 num_packages;
  507. };
  508. /*
  509. * Control state - one per if/else and while constructs.
  510. * Allows nesting of these constructs
  511. */
  512. struct acpi_control_state {
  513. ACPI_STATE_COMMON u16 opcode;
  514. union acpi_parse_object *predicate_op;
  515. u8 *aml_predicate_start; /* Start of if/while predicate */
  516. u8 *package_end; /* End of if/while block */
  517. u32 loop_count; /* While() loop counter */
  518. };
  519. /*
  520. * Scope state - current scope during namespace lookups
  521. */
  522. struct acpi_scope_state {
  523. ACPI_STATE_COMMON struct acpi_namespace_node *node;
  524. };
  525. struct acpi_pscope_state {
  526. ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
  527. union acpi_parse_object *op; /* Current op being parsed */
  528. u8 *arg_end; /* Current argument end */
  529. u8 *pkg_end; /* Current package end */
  530. u32 arg_list; /* Next argument to parse */
  531. };
  532. /*
  533. * Thread state - one per thread across multiple walk states. Multiple walk
  534. * states are created when there are nested control methods executing.
  535. */
  536. struct acpi_thread_state {
  537. ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
  538. struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
  539. union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
  540. acpi_thread_id thread_id; /* Running thread ID */
  541. };
  542. /*
  543. * Result values - used to accumulate the results of nested
  544. * AML arguments
  545. */
  546. struct acpi_result_values {
  547. ACPI_STATE_COMMON
  548. union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
  549. };
  550. typedef
  551. acpi_status (*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
  552. union acpi_parse_object ** out_op);
  553. typedef
  554. acpi_status (*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
  555. /* Global handlers for AML Notifies */
  556. struct acpi_global_notify_handler {
  557. acpi_notify_handler handler;
  558. void *context;
  559. };
  560. /*
  561. * Notify info - used to pass info to the deferred notify
  562. * handler/dispatcher.
  563. */
  564. struct acpi_notify_info {
  565. ACPI_STATE_COMMON u8 handler_list_id;
  566. struct acpi_namespace_node *node;
  567. union acpi_operand_object *handler_list_head;
  568. struct acpi_global_notify_handler *global;
  569. };
  570. /* Generic state is union of structs above */
  571. union acpi_generic_state {
  572. struct acpi_common_state common;
  573. struct acpi_control_state control;
  574. struct acpi_update_state update;
  575. struct acpi_scope_state scope;
  576. struct acpi_pscope_state parse_scope;
  577. struct acpi_pkg_state pkg;
  578. struct acpi_thread_state thread;
  579. struct acpi_result_values results;
  580. struct acpi_notify_info notify;
  581. };
  582. /*****************************************************************************
  583. *
  584. * Interpreter typedefs and structs
  585. *
  586. ****************************************************************************/
  587. typedef
  588. acpi_status (*acpi_execute_op) (struct acpi_walk_state * walk_state);
  589. /* Address Range info block */
  590. struct acpi_address_range {
  591. struct acpi_address_range *next;
  592. struct acpi_namespace_node *region_node;
  593. acpi_physical_address start_address;
  594. acpi_physical_address end_address;
  595. };
  596. /*****************************************************************************
  597. *
  598. * Parser typedefs and structs
  599. *
  600. ****************************************************************************/
  601. /*
  602. * AML opcode, name, and argument layout
  603. */
  604. struct acpi_opcode_info {
  605. #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
  606. char *name; /* Opcode name (disassembler/debug only) */
  607. #endif
  608. u32 parse_args; /* Grammar/Parse time arguments */
  609. u32 runtime_args; /* Interpret time arguments */
  610. u16 flags; /* Misc flags */
  611. u8 object_type; /* Corresponding internal object type */
  612. u8 class; /* Opcode class */
  613. u8 type; /* Opcode type */
  614. };
  615. /* Value associated with the parse object */
  616. union acpi_parse_value {
  617. u64 integer; /* Integer constant (Up to 64 bits) */
  618. u32 size; /* bytelist or field size */
  619. char *string; /* NULL terminated string */
  620. u8 *buffer; /* buffer or string */
  621. char *name; /* NULL terminated string */
  622. union acpi_parse_object *arg; /* arguments and contained ops */
  623. };
  624. #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
  625. #define ACPI_DISASM_ONLY_MEMBERS(a) a;
  626. #else
  627. #define ACPI_DISASM_ONLY_MEMBERS(a)
  628. #endif
  629. #define ACPI_PARSE_COMMON \
  630. union acpi_parse_object *parent; /* Parent op */\
  631. u8 descriptor_type; /* To differentiate various internal objs */\
  632. u8 flags; /* Type of Op */\
  633. u16 aml_opcode; /* AML opcode */\
  634. u8 *aml; /* Address of declaration in AML */\
  635. union acpi_parse_object *next; /* Next op */\
  636. struct acpi_namespace_node *node; /* For use by interpreter */\
  637. union acpi_parse_value value; /* Value or args associated with the opcode */\
  638. u8 arg_list_length; /* Number of elements in the arg list */\
  639. ACPI_DISASM_ONLY_MEMBERS (\
  640. u8 disasm_flags; /* Used during AML disassembly */\
  641. u8 disasm_opcode; /* Subtype used for disassembly */\
  642. char *operator_symbol;/* Used for C-style operator name strings */\
  643. char aml_op_name[16]) /* Op name (debug only) */
  644. /* Flags for disasm_flags field above */
  645. #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
  646. #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
  647. #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
  648. #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
  649. #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
  650. #define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
  651. #define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
  652. #define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
  653. #define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a Lnot_equal (etc.) pair of opcodes */
  654. #define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a Lnot_equal (etc.) pair of opcodes */
  655. #define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
  656. #define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
  657. /*
  658. * Generic operation (for example: If, While, Store)
  659. */
  660. struct acpi_parse_obj_common {
  661. ACPI_PARSE_COMMON};
  662. /*
  663. * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
  664. * and bytelists.
  665. */
  666. struct acpi_parse_obj_named {
  667. ACPI_PARSE_COMMON u8 *path;
  668. u8 *data; /* AML body or bytelist data */
  669. u32 length; /* AML length */
  670. u32 name; /* 4-byte name or zero if no name */
  671. };
  672. /* This version is used by the iASL compiler only */
  673. #define ACPI_MAX_PARSEOP_NAME 20
  674. struct acpi_parse_obj_asl {
  675. ACPI_PARSE_COMMON union acpi_parse_object *child;
  676. union acpi_parse_object *parent_method;
  677. char *filename;
  678. char *external_name;
  679. char *namepath;
  680. char name_seg[4];
  681. u32 extra_value;
  682. u32 column;
  683. u32 line_number;
  684. u32 logical_line_number;
  685. u32 logical_byte_offset;
  686. u32 end_line;
  687. u32 end_logical_line;
  688. u32 acpi_btype;
  689. u32 aml_length;
  690. u32 aml_subtree_length;
  691. u32 final_aml_length;
  692. u32 final_aml_offset;
  693. u32 compile_flags;
  694. u16 parse_opcode;
  695. u8 aml_opcode_length;
  696. u8 aml_pkg_len_bytes;
  697. u8 extra;
  698. char parse_op_name[ACPI_MAX_PARSEOP_NAME];
  699. };
  700. union acpi_parse_object {
  701. struct acpi_parse_obj_common common;
  702. struct acpi_parse_obj_named named;
  703. struct acpi_parse_obj_asl asl;
  704. };
  705. /*
  706. * Parse state - one state per parser invocation and each control
  707. * method.
  708. */
  709. struct acpi_parse_state {
  710. u8 *aml_start; /* First AML byte */
  711. u8 *aml; /* Next AML byte */
  712. u8 *aml_end; /* (last + 1) AML byte */
  713. u8 *pkg_start; /* Current package begin */
  714. u8 *pkg_end; /* Current package end */
  715. union acpi_parse_object *start_op; /* Root of parse tree */
  716. struct acpi_namespace_node *start_node;
  717. union acpi_generic_state *scope; /* Current scope */
  718. union acpi_parse_object *start_scope;
  719. u32 aml_size;
  720. };
  721. /* Parse object flags */
  722. #define ACPI_PARSEOP_GENERIC 0x01
  723. #define ACPI_PARSEOP_NAMED_OBJECT 0x02
  724. #define ACPI_PARSEOP_DEFERRED 0x04
  725. #define ACPI_PARSEOP_BYTELIST 0x08
  726. #define ACPI_PARSEOP_IN_STACK 0x10
  727. #define ACPI_PARSEOP_TARGET 0x20
  728. #define ACPI_PARSEOP_IN_CACHE 0x80
  729. /* Parse object disasm_flags */
  730. #define ACPI_PARSEOP_IGNORE 0x01
  731. #define ACPI_PARSEOP_PARAMETER_LIST 0x02
  732. #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
  733. #define ACPI_PARSEOP_PREDEFINED_CHECKED 0x08
  734. #define ACPI_PARSEOP_CLOSING_PAREN 0x10
  735. #define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x20
  736. #define ACPI_PARSEOP_ASSIGNMENT 0x40
  737. #define ACPI_PARSEOP_ELSEIF 0x80
  738. /*****************************************************************************
  739. *
  740. * Hardware (ACPI registers) and PNP
  741. *
  742. ****************************************************************************/
  743. struct acpi_bit_register_info {
  744. u8 parent_register;
  745. u8 bit_position;
  746. u16 access_bit_mask;
  747. };
  748. /*
  749. * Some ACPI registers have bits that must be ignored -- meaning that they
  750. * must be preserved.
  751. */
  752. #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
  753. /* Write-only bits must be zeroed by software */
  754. #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */
  755. /* For control registers, both ignored and reserved bits must be preserved */
  756. /*
  757. * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
  758. * ACPI specification to be a "preserved" bit - "OSPM always preserves this
  759. * bit position", section 4.7.3.2.1. However, on some machines the OS must
  760. * write a one to this bit after resume for the machine to work properly.
  761. * To enable this, we no longer attempt to preserve this bit. No machines
  762. * are known to fail if the bit is not preserved. (May 2009)
  763. */
  764. #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */
  765. #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
  766. #define ACPI_PM1_CONTROL_PRESERVED_BITS \
  767. (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
  768. #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
  769. /*
  770. * Register IDs
  771. * These are the full ACPI registers
  772. */
  773. #define ACPI_REGISTER_PM1_STATUS 0x01
  774. #define ACPI_REGISTER_PM1_ENABLE 0x02
  775. #define ACPI_REGISTER_PM1_CONTROL 0x03
  776. #define ACPI_REGISTER_PM2_CONTROL 0x04
  777. #define ACPI_REGISTER_PM_TIMER 0x05
  778. #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06
  779. #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07
  780. /* Masks used to access the bit_registers */
  781. #define ACPI_BITMASK_TIMER_STATUS 0x0001
  782. #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
  783. #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
  784. #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
  785. #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
  786. #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
  787. #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
  788. #define ACPI_BITMASK_WAKE_STATUS 0x8000
  789. #define ACPI_BITMASK_ALL_FIXED_STATUS (\
  790. ACPI_BITMASK_TIMER_STATUS | \
  791. ACPI_BITMASK_BUS_MASTER_STATUS | \
  792. ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
  793. ACPI_BITMASK_POWER_BUTTON_STATUS | \
  794. ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
  795. ACPI_BITMASK_RT_CLOCK_STATUS | \
  796. ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
  797. ACPI_BITMASK_WAKE_STATUS)
  798. #define ACPI_BITMASK_TIMER_ENABLE 0x0001
  799. #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
  800. #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
  801. #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
  802. #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
  803. #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
  804. #define ACPI_BITMASK_SCI_ENABLE 0x0001
  805. #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
  806. #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
  807. #define ACPI_BITMASK_SLEEP_TYPE 0x1C00
  808. #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
  809. #define ACPI_BITMASK_ARB_DISABLE 0x0001
  810. /* Raw bit position of each bit_register */
  811. #define ACPI_BITPOSITION_TIMER_STATUS 0x00
  812. #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
  813. #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
  814. #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
  815. #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
  816. #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
  817. #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
  818. #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
  819. #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
  820. #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
  821. #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
  822. #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
  823. #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
  824. #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
  825. #define ACPI_BITPOSITION_SCI_ENABLE 0x00
  826. #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
  827. #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
  828. #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A
  829. #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
  830. #define ACPI_BITPOSITION_ARB_DISABLE 0x00
  831. /* Structs and definitions for _OSI support and I/O port validation */
  832. #define ACPI_ALWAYS_ILLEGAL 0x00
  833. struct acpi_interface_info {
  834. char *name;
  835. struct acpi_interface_info *next;
  836. u8 flags;
  837. u8 value;
  838. };
  839. #define ACPI_OSI_INVALID 0x01
  840. #define ACPI_OSI_DYNAMIC 0x02
  841. #define ACPI_OSI_FEATURE 0x04
  842. #define ACPI_OSI_DEFAULT_INVALID 0x08
  843. #define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
  844. struct acpi_port_info {
  845. char *name;
  846. u16 start;
  847. u16 end;
  848. u8 osi_dependency;
  849. };
  850. /*****************************************************************************
  851. *
  852. * Resource descriptors
  853. *
  854. ****************************************************************************/
  855. /* resource_type values */
  856. #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
  857. #define ACPI_ADDRESS_TYPE_IO_RANGE 1
  858. #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
  859. /* Resource descriptor types and masks */
  860. #define ACPI_RESOURCE_NAME_LARGE 0x80
  861. #define ACPI_RESOURCE_NAME_SMALL 0x00
  862. #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
  863. #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
  864. #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
  865. /*
  866. * Small resource descriptor "names" as defined by the ACPI specification.
  867. * Note: Bits 2:0 are used for the descriptor length
  868. */
  869. #define ACPI_RESOURCE_NAME_IRQ 0x20
  870. #define ACPI_RESOURCE_NAME_DMA 0x28
  871. #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
  872. #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
  873. #define ACPI_RESOURCE_NAME_IO 0x40
  874. #define ACPI_RESOURCE_NAME_FIXED_IO 0x48
  875. #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
  876. #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
  877. #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
  878. #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
  879. #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
  880. #define ACPI_RESOURCE_NAME_END_TAG 0x78
  881. /*
  882. * Large resource descriptor "names" as defined by the ACPI specification.
  883. * Note: includes the Large Descriptor bit in bit[7]
  884. */
  885. #define ACPI_RESOURCE_NAME_MEMORY24 0x81
  886. #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
  887. #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
  888. #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
  889. #define ACPI_RESOURCE_NAME_MEMORY32 0x85
  890. #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
  891. #define ACPI_RESOURCE_NAME_ADDRESS32 0x87
  892. #define ACPI_RESOURCE_NAME_ADDRESS16 0x88
  893. #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
  894. #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
  895. #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
  896. #define ACPI_RESOURCE_NAME_GPIO 0x8C
  897. #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
  898. #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
  899. /*****************************************************************************
  900. *
  901. * Miscellaneous
  902. *
  903. ****************************************************************************/
  904. #define ACPI_ASCII_ZERO 0x30
  905. /*****************************************************************************
  906. *
  907. * Disassembler
  908. *
  909. ****************************************************************************/
  910. struct acpi_external_list {
  911. char *path;
  912. char *internal_path;
  913. struct acpi_external_list *next;
  914. u32 value;
  915. u16 length;
  916. u16 flags;
  917. u8 type;
  918. };
  919. /* Values for Flags field above */
  920. #define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
  921. #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
  922. #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
  923. #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
  924. #define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */
  925. struct acpi_external_file {
  926. char *path;
  927. struct acpi_external_file *next;
  928. };
  929. /*****************************************************************************
  930. *
  931. * Debugger
  932. *
  933. ****************************************************************************/
  934. struct acpi_db_method_info {
  935. acpi_handle method;
  936. acpi_handle main_thread_gate;
  937. acpi_handle thread_complete_gate;
  938. acpi_handle info_gate;
  939. acpi_thread_id *threads;
  940. u32 num_threads;
  941. u32 num_created;
  942. u32 num_completed;
  943. char *name;
  944. u32 flags;
  945. u32 num_loops;
  946. char pathname[ACPI_DB_LINE_BUFFER_SIZE];
  947. char **args;
  948. acpi_object_type *types;
  949. /*
  950. * Arguments to be passed to method for the command
  951. * Threads -
  952. * the Number of threads, ID of current thread and
  953. * Index of current thread inside all them created.
  954. */
  955. char init_args;
  956. #ifdef ACPI_DEBUGGER
  957. acpi_object_type arg_types[4];
  958. #endif
  959. char *arguments[4];
  960. char num_threads_str[11];
  961. char id_of_thread_str[11];
  962. char index_of_thread_str[11];
  963. };
  964. struct acpi_integrity_info {
  965. u32 nodes;
  966. u32 objects;
  967. };
  968. #define ACPI_DB_DISABLE_OUTPUT 0x00
  969. #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
  970. #define ACPI_DB_CONSOLE_OUTPUT 0x02
  971. #define ACPI_DB_DUPLICATE_OUTPUT 0x03
  972. struct acpi_object_info {
  973. u32 types[ACPI_TOTAL_TYPES];
  974. };
  975. /*****************************************************************************
  976. *
  977. * Debug
  978. *
  979. ****************************************************************************/
  980. /* Entry for a memory allocation (debug only) */
  981. #define ACPI_MEM_MALLOC 0
  982. #define ACPI_MEM_CALLOC 1
  983. #define ACPI_MAX_MODULE_NAME 16
  984. #define ACPI_COMMON_DEBUG_MEM_HEADER \
  985. struct acpi_debug_mem_block *previous; \
  986. struct acpi_debug_mem_block *next; \
  987. u32 size; \
  988. u32 component; \
  989. u32 line; \
  990. char module[ACPI_MAX_MODULE_NAME]; \
  991. u8 alloc_type;
  992. struct acpi_debug_mem_header {
  993. ACPI_COMMON_DEBUG_MEM_HEADER};
  994. struct acpi_debug_mem_block {
  995. ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space;
  996. };
  997. #define ACPI_MEM_LIST_GLOBAL 0
  998. #define ACPI_MEM_LIST_NSNODE 1
  999. #define ACPI_MEM_LIST_MAX 1
  1000. #define ACPI_NUM_MEM_LISTS 2
  1001. /*****************************************************************************
  1002. *
  1003. * Info/help support
  1004. *
  1005. ****************************************************************************/
  1006. struct ah_predefined_name {
  1007. char *name;
  1008. char *description;
  1009. #ifndef ACPI_ASL_COMPILER
  1010. char *action;
  1011. #endif
  1012. };
  1013. struct ah_device_id {
  1014. char *name;
  1015. char *description;
  1016. };
  1017. struct ah_uuid {
  1018. char *description;
  1019. char *string;
  1020. };
  1021. struct ah_table {
  1022. char *signature;
  1023. char *description;
  1024. };
  1025. #endif /* __ACLOCAL_H__ */