aclocal.h 37 KB

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