aclocal.h 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157
  1. /******************************************************************************
  2. *
  3. * Name: aclocal.h - Internal data types used across the ACPI subsystem
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2014, 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. #pragma pack(1)
  246. /*
  247. * Information structure for ACPI predefined names.
  248. * Each entry in the table contains the following items:
  249. *
  250. * name - The ACPI reserved name
  251. * param_count - Number of arguments to the method
  252. * expected_return_btypes - Allowed type(s) for the return value
  253. */
  254. struct acpi_name_info {
  255. char name[ACPI_NAME_SIZE];
  256. u16 argument_list;
  257. u8 expected_btypes;
  258. };
  259. /*
  260. * Secondary information structures for ACPI predefined objects that return
  261. * package objects. This structure appears as the next entry in the table
  262. * after the NAME_INFO structure above.
  263. *
  264. * The reason for this is to minimize the size of the predefined name table.
  265. */
  266. /*
  267. * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
  268. * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
  269. * ACPI_PTYPE2_FIX_VAR
  270. */
  271. struct acpi_package_info {
  272. u8 type;
  273. u8 object_type1;
  274. u8 count1;
  275. u8 object_type2;
  276. u8 count2;
  277. u16 reserved;
  278. };
  279. /* Used for ACPI_PTYPE2_FIXED */
  280. struct acpi_package_info2 {
  281. u8 type;
  282. u8 count;
  283. u8 object_type[4];
  284. u8 reserved;
  285. };
  286. /* Used for ACPI_PTYPE1_OPTION */
  287. struct acpi_package_info3 {
  288. u8 type;
  289. u8 count;
  290. u8 object_type[2];
  291. u8 tail_object_type;
  292. u16 reserved;
  293. };
  294. union acpi_predefined_info {
  295. struct acpi_name_info info;
  296. struct acpi_package_info ret_info;
  297. struct acpi_package_info2 ret_info2;
  298. struct acpi_package_info3 ret_info3;
  299. };
  300. /* Reset to default packing */
  301. #pragma pack()
  302. /* Return object auto-repair info */
  303. typedef acpi_status(*acpi_object_converter) (union acpi_operand_object
  304. *original_object,
  305. union acpi_operand_object
  306. **converted_object);
  307. struct acpi_simple_repair_info {
  308. char name[ACPI_NAME_SIZE];
  309. u32 unexpected_btypes;
  310. u32 package_index;
  311. acpi_object_converter object_converter;
  312. };
  313. /*
  314. * Bitmapped return value types
  315. * Note: the actual data types must be contiguous, a loop in nspredef.c
  316. * depends on this.
  317. */
  318. #define ACPI_RTYPE_ANY 0x00
  319. #define ACPI_RTYPE_NONE 0x01
  320. #define ACPI_RTYPE_INTEGER 0x02
  321. #define ACPI_RTYPE_STRING 0x04
  322. #define ACPI_RTYPE_BUFFER 0x08
  323. #define ACPI_RTYPE_PACKAGE 0x10
  324. #define ACPI_RTYPE_REFERENCE 0x20
  325. #define ACPI_RTYPE_ALL 0x3F
  326. #define ACPI_NUM_RTYPES 5 /* Number of actual object types */
  327. /*****************************************************************************
  328. *
  329. * Event typedefs and structs
  330. *
  331. ****************************************************************************/
  332. /* Dispatch info for each host-installed SCI handler */
  333. struct acpi_sci_handler_info {
  334. struct acpi_sci_handler_info *next;
  335. acpi_sci_handler address; /* Address of handler */
  336. void *context; /* Context to be passed to handler */
  337. };
  338. /* Dispatch info for each GPE -- either a method or handler, cannot be both */
  339. struct acpi_gpe_handler_info {
  340. acpi_gpe_handler address; /* Address of handler, if any */
  341. void *context; /* Context to be passed to handler */
  342. struct acpi_namespace_node *method_node; /* Method node for this GPE level (saved) */
  343. u8 original_flags; /* Original (pre-handler) GPE info */
  344. u8 originally_enabled; /* True if GPE was originally enabled */
  345. };
  346. /* Notify info for implicit notify, multiple device objects */
  347. struct acpi_gpe_notify_info {
  348. struct acpi_namespace_node *device_node; /* Device to be notified */
  349. struct acpi_gpe_notify_info *next;
  350. };
  351. /*
  352. * GPE dispatch info. At any time, the GPE can have at most one type
  353. * of dispatch - Method, Handler, or Implicit Notify.
  354. */
  355. union acpi_gpe_dispatch_info {
  356. struct acpi_namespace_node *method_node; /* Method node for this GPE level */
  357. struct acpi_gpe_handler_info *handler; /* Installed GPE handler */
  358. struct acpi_gpe_notify_info *notify_list; /* List of _PRW devices for implicit notifies */
  359. };
  360. /*
  361. * Information about a GPE, one per each GPE in an array.
  362. * NOTE: Important to keep this struct as small as possible.
  363. */
  364. struct acpi_gpe_event_info {
  365. union acpi_gpe_dispatch_info dispatch; /* Either Method, Handler, or notify_list */
  366. struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
  367. u8 flags; /* Misc info about this GPE */
  368. u8 gpe_number; /* This GPE */
  369. u8 runtime_count; /* References to a run GPE */
  370. };
  371. /* Information about a GPE register pair, one per each status/enable pair in an array */
  372. struct acpi_gpe_register_info {
  373. struct acpi_generic_address status_address; /* Address of status reg */
  374. struct acpi_generic_address enable_address; /* Address of enable reg */
  375. u16 base_gpe_number; /* Base GPE number for this register */
  376. u8 enable_for_wake; /* GPEs to keep enabled when sleeping */
  377. u8 enable_for_run; /* GPEs to keep enabled when running */
  378. };
  379. /*
  380. * Information about a GPE register block, one per each installed block --
  381. * GPE0, GPE1, and one per each installed GPE Block Device.
  382. */
  383. struct acpi_gpe_block_info {
  384. struct acpi_namespace_node *node;
  385. struct acpi_gpe_block_info *previous;
  386. struct acpi_gpe_block_info *next;
  387. struct acpi_gpe_xrupt_info *xrupt_block; /* Backpointer to interrupt block */
  388. struct acpi_gpe_register_info *register_info; /* One per GPE register pair */
  389. struct acpi_gpe_event_info *event_info; /* One for each GPE */
  390. u64 address; /* Base address of the block */
  391. u32 register_count; /* Number of register pairs in block */
  392. u16 gpe_count; /* Number of individual GPEs in block */
  393. u16 block_base_number; /* Base GPE number for this block */
  394. u8 space_id;
  395. u8 initialized; /* TRUE if this block is initialized */
  396. };
  397. /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
  398. struct acpi_gpe_xrupt_info {
  399. struct acpi_gpe_xrupt_info *previous;
  400. struct acpi_gpe_xrupt_info *next;
  401. struct acpi_gpe_block_info *gpe_block_list_head; /* List of GPE blocks for this xrupt */
  402. u32 interrupt_number; /* System interrupt number */
  403. };
  404. struct acpi_gpe_walk_info {
  405. struct acpi_namespace_node *gpe_device;
  406. struct acpi_gpe_block_info *gpe_block;
  407. u16 count;
  408. acpi_owner_id owner_id;
  409. u8 execute_by_owner_id;
  410. };
  411. struct acpi_gpe_device_info {
  412. u32 index;
  413. u32 next_block_base_index;
  414. acpi_status status;
  415. struct acpi_namespace_node *gpe_device;
  416. };
  417. typedef acpi_status(*acpi_gpe_callback) (struct acpi_gpe_xrupt_info *
  418. gpe_xrupt_info,
  419. struct acpi_gpe_block_info *gpe_block,
  420. void *context);
  421. /* Information about each particular fixed event */
  422. struct acpi_fixed_event_handler {
  423. acpi_event_handler handler; /* Address of handler. */
  424. void *context; /* Context to be passed to handler */
  425. };
  426. struct acpi_fixed_event_info {
  427. u8 status_register_id;
  428. u8 enable_register_id;
  429. u16 status_bit_mask;
  430. u16 enable_bit_mask;
  431. };
  432. /* Information used during field processing */
  433. struct acpi_field_info {
  434. u8 skip_field;
  435. u8 field_flag;
  436. u32 pkg_length;
  437. };
  438. /*****************************************************************************
  439. *
  440. * Generic "state" object for stacks
  441. *
  442. ****************************************************************************/
  443. #define ACPI_CONTROL_NORMAL 0xC0
  444. #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
  445. #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
  446. #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
  447. #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
  448. #define ACPI_STATE_COMMON \
  449. void *next; \
  450. u8 descriptor_type; /* To differentiate various internal objs */\
  451. u8 flags; \
  452. u16 value; \
  453. u16 state;
  454. /* There are 2 bytes available here until the next natural alignment boundary */
  455. struct acpi_common_state {
  456. ACPI_STATE_COMMON};
  457. /*
  458. * Update state - used to traverse complex objects such as packages
  459. */
  460. struct acpi_update_state {
  461. ACPI_STATE_COMMON union acpi_operand_object *object;
  462. };
  463. /*
  464. * Pkg state - used to traverse nested package structures
  465. */
  466. struct acpi_pkg_state {
  467. ACPI_STATE_COMMON u16 index;
  468. union acpi_operand_object *source_object;
  469. union acpi_operand_object *dest_object;
  470. struct acpi_walk_state *walk_state;
  471. void *this_target_obj;
  472. u32 num_packages;
  473. };
  474. /*
  475. * Control state - one per if/else and while constructs.
  476. * Allows nesting of these constructs
  477. */
  478. struct acpi_control_state {
  479. ACPI_STATE_COMMON u16 opcode;
  480. union acpi_parse_object *predicate_op;
  481. u8 *aml_predicate_start; /* Start of if/while predicate */
  482. u8 *package_end; /* End of if/while block */
  483. u32 loop_count; /* While() loop counter */
  484. };
  485. /*
  486. * Scope state - current scope during namespace lookups
  487. */
  488. struct acpi_scope_state {
  489. ACPI_STATE_COMMON struct acpi_namespace_node *node;
  490. };
  491. struct acpi_pscope_state {
  492. ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
  493. union acpi_parse_object *op; /* Current op being parsed */
  494. u8 *arg_end; /* Current argument end */
  495. u8 *pkg_end; /* Current package end */
  496. u32 arg_list; /* Next argument to parse */
  497. };
  498. /*
  499. * Thread state - one per thread across multiple walk states. Multiple walk
  500. * states are created when there are nested control methods executing.
  501. */
  502. struct acpi_thread_state {
  503. ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
  504. struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
  505. union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
  506. acpi_thread_id thread_id; /* Running thread ID */
  507. };
  508. /*
  509. * Result values - used to accumulate the results of nested
  510. * AML arguments
  511. */
  512. struct acpi_result_values {
  513. ACPI_STATE_COMMON
  514. union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
  515. };
  516. typedef
  517. acpi_status(*acpi_parse_downwards) (struct acpi_walk_state * walk_state,
  518. union acpi_parse_object ** out_op);
  519. typedef acpi_status(*acpi_parse_upwards) (struct acpi_walk_state * walk_state);
  520. /* Global handlers for AML Notifies */
  521. struct acpi_global_notify_handler {
  522. acpi_notify_handler handler;
  523. void *context;
  524. };
  525. /*
  526. * Notify info - used to pass info to the deferred notify
  527. * handler/dispatcher.
  528. */
  529. struct acpi_notify_info {
  530. ACPI_STATE_COMMON u8 handler_list_id;
  531. struct acpi_namespace_node *node;
  532. union acpi_operand_object *handler_list_head;
  533. struct acpi_global_notify_handler *global;
  534. };
  535. /* Generic state is union of structs above */
  536. union acpi_generic_state {
  537. struct acpi_common_state common;
  538. struct acpi_control_state control;
  539. struct acpi_update_state update;
  540. struct acpi_scope_state scope;
  541. struct acpi_pscope_state parse_scope;
  542. struct acpi_pkg_state pkg;
  543. struct acpi_thread_state thread;
  544. struct acpi_result_values results;
  545. struct acpi_notify_info notify;
  546. };
  547. /*****************************************************************************
  548. *
  549. * Interpreter typedefs and structs
  550. *
  551. ****************************************************************************/
  552. typedef acpi_status(*acpi_execute_op) (struct acpi_walk_state * walk_state);
  553. /* Address Range info block */
  554. struct acpi_address_range {
  555. struct acpi_address_range *next;
  556. struct acpi_namespace_node *region_node;
  557. acpi_physical_address start_address;
  558. acpi_physical_address end_address;
  559. };
  560. /*****************************************************************************
  561. *
  562. * Parser typedefs and structs
  563. *
  564. ****************************************************************************/
  565. /*
  566. * AML opcode, name, and argument layout
  567. */
  568. struct acpi_opcode_info {
  569. #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
  570. char *name; /* Opcode name (disassembler/debug only) */
  571. #endif
  572. u32 parse_args; /* Grammar/Parse time arguments */
  573. u32 runtime_args; /* Interpret time arguments */
  574. u16 flags; /* Misc flags */
  575. u8 object_type; /* Corresponding internal object type */
  576. u8 class; /* Opcode class */
  577. u8 type; /* Opcode type */
  578. };
  579. /* Value associated with the parse object */
  580. union acpi_parse_value {
  581. u64 integer; /* Integer constant (Up to 64 bits) */
  582. u32 size; /* bytelist or field size */
  583. char *string; /* NULL terminated string */
  584. u8 *buffer; /* buffer or string */
  585. char *name; /* NULL terminated string */
  586. union acpi_parse_object *arg; /* arguments and contained ops */
  587. };
  588. #ifdef ACPI_DISASSEMBLER
  589. #define ACPI_DISASM_ONLY_MEMBERS(a) a;
  590. #else
  591. #define ACPI_DISASM_ONLY_MEMBERS(a)
  592. #endif
  593. #define ACPI_PARSE_COMMON \
  594. union acpi_parse_object *parent; /* Parent op */\
  595. u8 descriptor_type; /* To differentiate various internal objs */\
  596. u8 flags; /* Type of Op */\
  597. u16 aml_opcode; /* AML opcode */\
  598. u32 aml_offset; /* Offset of declaration in AML */\
  599. union acpi_parse_object *next; /* Next op */\
  600. struct acpi_namespace_node *node; /* For use by interpreter */\
  601. union acpi_parse_value value; /* Value or args associated with the opcode */\
  602. u8 arg_list_length; /* Number of elements in the arg list */\
  603. ACPI_DISASM_ONLY_MEMBERS (\
  604. u8 disasm_flags; /* Used during AML disassembly */\
  605. u8 disasm_opcode; /* Subtype used for disassembly */\
  606. char aml_op_name[16]) /* Op name (debug only) */
  607. /* Flags for disasm_flags field above */
  608. #define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
  609. #define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
  610. #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
  611. #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
  612. #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
  613. #define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
  614. #define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
  615. #define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a Lnot_equal (etc.) pair of opcodes */
  616. #define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a Lnot_equal (etc.) pair of opcodes */
  617. #define ACPI_DASM_HID_STRING 0x09 /* String is a _HID or _CID */
  618. #define ACPI_DASM_IGNORE 0x0A /* Not used at this time */
  619. /*
  620. * Generic operation (for example: If, While, Store)
  621. */
  622. struct acpi_parse_obj_common {
  623. ACPI_PARSE_COMMON};
  624. /*
  625. * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
  626. * and bytelists.
  627. */
  628. struct acpi_parse_obj_named {
  629. ACPI_PARSE_COMMON u8 *path;
  630. u8 *data; /* AML body or bytelist data */
  631. u32 length; /* AML length */
  632. u32 name; /* 4-byte name or zero if no name */
  633. };
  634. /* This version is used by the iASL compiler only */
  635. #define ACPI_MAX_PARSEOP_NAME 20
  636. struct acpi_parse_obj_asl {
  637. ACPI_PARSE_COMMON union acpi_parse_object *child;
  638. union acpi_parse_object *parent_method;
  639. char *filename;
  640. char *external_name;
  641. char *namepath;
  642. char name_seg[4];
  643. u32 extra_value;
  644. u32 column;
  645. u32 line_number;
  646. u32 logical_line_number;
  647. u32 logical_byte_offset;
  648. u32 end_line;
  649. u32 end_logical_line;
  650. u32 acpi_btype;
  651. u32 aml_length;
  652. u32 aml_subtree_length;
  653. u32 final_aml_length;
  654. u32 final_aml_offset;
  655. u32 compile_flags;
  656. u16 parse_opcode;
  657. u8 aml_opcode_length;
  658. u8 aml_pkg_len_bytes;
  659. u8 extra;
  660. char parse_op_name[ACPI_MAX_PARSEOP_NAME];
  661. };
  662. union acpi_parse_object {
  663. struct acpi_parse_obj_common common;
  664. struct acpi_parse_obj_named named;
  665. struct acpi_parse_obj_asl asl;
  666. };
  667. /*
  668. * Parse state - one state per parser invocation and each control
  669. * method.
  670. */
  671. struct acpi_parse_state {
  672. u8 *aml_start; /* First AML byte */
  673. u8 *aml; /* Next AML byte */
  674. u8 *aml_end; /* (last + 1) AML byte */
  675. u8 *pkg_start; /* Current package begin */
  676. u8 *pkg_end; /* Current package end */
  677. union acpi_parse_object *start_op; /* Root of parse tree */
  678. struct acpi_namespace_node *start_node;
  679. union acpi_generic_state *scope; /* Current scope */
  680. union acpi_parse_object *start_scope;
  681. u32 aml_size;
  682. };
  683. /* Parse object flags */
  684. #define ACPI_PARSEOP_GENERIC 0x01
  685. #define ACPI_PARSEOP_NAMED 0x02
  686. #define ACPI_PARSEOP_DEFERRED 0x04
  687. #define ACPI_PARSEOP_BYTELIST 0x08
  688. #define ACPI_PARSEOP_IN_STACK 0x10
  689. #define ACPI_PARSEOP_TARGET 0x20
  690. #define ACPI_PARSEOP_IN_CACHE 0x80
  691. /* Parse object disasm_flags */
  692. #define ACPI_PARSEOP_IGNORE 0x01
  693. #define ACPI_PARSEOP_PARAMLIST 0x02
  694. #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
  695. #define ACPI_PARSEOP_PREDEF_CHECKED 0x08
  696. #define ACPI_PARSEOP_SPECIAL 0x10
  697. /*****************************************************************************
  698. *
  699. * Hardware (ACPI registers) and PNP
  700. *
  701. ****************************************************************************/
  702. struct acpi_bit_register_info {
  703. u8 parent_register;
  704. u8 bit_position;
  705. u16 access_bit_mask;
  706. };
  707. /*
  708. * Some ACPI registers have bits that must be ignored -- meaning that they
  709. * must be preserved.
  710. */
  711. #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
  712. /* Write-only bits must be zeroed by software */
  713. #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */
  714. /* For control registers, both ignored and reserved bits must be preserved */
  715. /*
  716. * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
  717. * ACPI specification to be a "preserved" bit - "OSPM always preserves this
  718. * bit position", section 4.7.3.2.1. However, on some machines the OS must
  719. * write a one to this bit after resume for the machine to work properly.
  720. * To enable this, we no longer attempt to preserve this bit. No machines
  721. * are known to fail if the bit is not preserved. (May 2009)
  722. */
  723. #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */
  724. #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
  725. #define ACPI_PM1_CONTROL_PRESERVED_BITS \
  726. (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
  727. #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
  728. /*
  729. * Register IDs
  730. * These are the full ACPI registers
  731. */
  732. #define ACPI_REGISTER_PM1_STATUS 0x01
  733. #define ACPI_REGISTER_PM1_ENABLE 0x02
  734. #define ACPI_REGISTER_PM1_CONTROL 0x03
  735. #define ACPI_REGISTER_PM2_CONTROL 0x04
  736. #define ACPI_REGISTER_PM_TIMER 0x05
  737. #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06
  738. #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07
  739. /* Masks used to access the bit_registers */
  740. #define ACPI_BITMASK_TIMER_STATUS 0x0001
  741. #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
  742. #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
  743. #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
  744. #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
  745. #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
  746. #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
  747. #define ACPI_BITMASK_WAKE_STATUS 0x8000
  748. #define ACPI_BITMASK_ALL_FIXED_STATUS (\
  749. ACPI_BITMASK_TIMER_STATUS | \
  750. ACPI_BITMASK_BUS_MASTER_STATUS | \
  751. ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
  752. ACPI_BITMASK_POWER_BUTTON_STATUS | \
  753. ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
  754. ACPI_BITMASK_RT_CLOCK_STATUS | \
  755. ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
  756. ACPI_BITMASK_WAKE_STATUS)
  757. #define ACPI_BITMASK_TIMER_ENABLE 0x0001
  758. #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
  759. #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
  760. #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
  761. #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
  762. #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
  763. #define ACPI_BITMASK_SCI_ENABLE 0x0001
  764. #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
  765. #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
  766. #define ACPI_BITMASK_SLEEP_TYPE 0x1C00
  767. #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
  768. #define ACPI_BITMASK_ARB_DISABLE 0x0001
  769. /* Raw bit position of each bit_register */
  770. #define ACPI_BITPOSITION_TIMER_STATUS 0x00
  771. #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
  772. #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
  773. #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
  774. #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
  775. #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
  776. #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
  777. #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
  778. #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
  779. #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
  780. #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
  781. #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
  782. #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
  783. #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
  784. #define ACPI_BITPOSITION_SCI_ENABLE 0x00
  785. #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
  786. #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
  787. #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A
  788. #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
  789. #define ACPI_BITPOSITION_ARB_DISABLE 0x00
  790. /* Structs and definitions for _OSI support and I/O port validation */
  791. #define ACPI_ALWAYS_ILLEGAL 0x00
  792. struct acpi_interface_info {
  793. char *name;
  794. struct acpi_interface_info *next;
  795. u8 flags;
  796. u8 value;
  797. };
  798. #define ACPI_OSI_INVALID 0x01
  799. #define ACPI_OSI_DYNAMIC 0x02
  800. #define ACPI_OSI_FEATURE 0x04
  801. #define ACPI_OSI_DEFAULT_INVALID 0x08
  802. #define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
  803. struct acpi_port_info {
  804. char *name;
  805. u16 start;
  806. u16 end;
  807. u8 osi_dependency;
  808. };
  809. /*****************************************************************************
  810. *
  811. * Resource descriptors
  812. *
  813. ****************************************************************************/
  814. /* resource_type values */
  815. #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
  816. #define ACPI_ADDRESS_TYPE_IO_RANGE 1
  817. #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
  818. /* Resource descriptor types and masks */
  819. #define ACPI_RESOURCE_NAME_LARGE 0x80
  820. #define ACPI_RESOURCE_NAME_SMALL 0x00
  821. #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
  822. #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
  823. #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
  824. /*
  825. * Small resource descriptor "names" as defined by the ACPI specification.
  826. * Note: Bits 2:0 are used for the descriptor length
  827. */
  828. #define ACPI_RESOURCE_NAME_IRQ 0x20
  829. #define ACPI_RESOURCE_NAME_DMA 0x28
  830. #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
  831. #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
  832. #define ACPI_RESOURCE_NAME_IO 0x40
  833. #define ACPI_RESOURCE_NAME_FIXED_IO 0x48
  834. #define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
  835. #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
  836. #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
  837. #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
  838. #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
  839. #define ACPI_RESOURCE_NAME_END_TAG 0x78
  840. /*
  841. * Large resource descriptor "names" as defined by the ACPI specification.
  842. * Note: includes the Large Descriptor bit in bit[7]
  843. */
  844. #define ACPI_RESOURCE_NAME_MEMORY24 0x81
  845. #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
  846. #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
  847. #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
  848. #define ACPI_RESOURCE_NAME_MEMORY32 0x85
  849. #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
  850. #define ACPI_RESOURCE_NAME_ADDRESS32 0x87
  851. #define ACPI_RESOURCE_NAME_ADDRESS16 0x88
  852. #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
  853. #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
  854. #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
  855. #define ACPI_RESOURCE_NAME_GPIO 0x8C
  856. #define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
  857. #define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
  858. /*****************************************************************************
  859. *
  860. * Miscellaneous
  861. *
  862. ****************************************************************************/
  863. #define ACPI_ASCII_ZERO 0x30
  864. /*****************************************************************************
  865. *
  866. * Disassembler
  867. *
  868. ****************************************************************************/
  869. struct acpi_external_list {
  870. char *path;
  871. char *internal_path;
  872. struct acpi_external_list *next;
  873. u32 value;
  874. u16 length;
  875. u16 flags;
  876. u8 type;
  877. };
  878. /* Values for Flags field above */
  879. #define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
  880. #define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
  881. #define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
  882. #define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
  883. struct acpi_external_file {
  884. char *path;
  885. struct acpi_external_file *next;
  886. };
  887. /*****************************************************************************
  888. *
  889. * Debugger
  890. *
  891. ****************************************************************************/
  892. struct acpi_db_method_info {
  893. acpi_handle method;
  894. acpi_handle main_thread_gate;
  895. acpi_handle thread_complete_gate;
  896. acpi_handle info_gate;
  897. acpi_thread_id *threads;
  898. u32 num_threads;
  899. u32 num_created;
  900. u32 num_completed;
  901. char *name;
  902. u32 flags;
  903. u32 num_loops;
  904. char pathname[ACPI_DB_LINE_BUFFER_SIZE];
  905. char **args;
  906. acpi_object_type *types;
  907. /*
  908. * Arguments to be passed to method for the command
  909. * Threads -
  910. * the Number of threads, ID of current thread and
  911. * Index of current thread inside all them created.
  912. */
  913. char init_args;
  914. char *arguments[4];
  915. char num_threads_str[11];
  916. char id_of_thread_str[11];
  917. char index_of_thread_str[11];
  918. };
  919. struct acpi_integrity_info {
  920. u32 nodes;
  921. u32 objects;
  922. };
  923. #define ACPI_DB_DISABLE_OUTPUT 0x00
  924. #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
  925. #define ACPI_DB_CONSOLE_OUTPUT 0x02
  926. #define ACPI_DB_DUPLICATE_OUTPUT 0x03
  927. /*****************************************************************************
  928. *
  929. * Debug
  930. *
  931. ****************************************************************************/
  932. /* Entry for a memory allocation (debug only) */
  933. #define ACPI_MEM_MALLOC 0
  934. #define ACPI_MEM_CALLOC 1
  935. #define ACPI_MAX_MODULE_NAME 16
  936. #define ACPI_COMMON_DEBUG_MEM_HEADER \
  937. struct acpi_debug_mem_block *previous; \
  938. struct acpi_debug_mem_block *next; \
  939. u32 size; \
  940. u32 component; \
  941. u32 line; \
  942. char module[ACPI_MAX_MODULE_NAME]; \
  943. u8 alloc_type;
  944. struct acpi_debug_mem_header {
  945. ACPI_COMMON_DEBUG_MEM_HEADER};
  946. struct acpi_debug_mem_block {
  947. ACPI_COMMON_DEBUG_MEM_HEADER u64 user_space;
  948. };
  949. #define ACPI_MEM_LIST_GLOBAL 0
  950. #define ACPI_MEM_LIST_NSNODE 1
  951. #define ACPI_MEM_LIST_MAX 1
  952. #define ACPI_NUM_MEM_LISTS 2
  953. /*****************************************************************************
  954. *
  955. * Info/help support
  956. *
  957. ****************************************************************************/
  958. struct ah_predefined_name {
  959. char *name;
  960. char *description;
  961. #ifndef ACPI_ASL_COMPILER
  962. char *action;
  963. #endif
  964. };
  965. struct ah_device_id {
  966. char *name;
  967. char *description;
  968. };
  969. #endif /* __ACLOCAL_H__ */