aclocal.h 37 KB

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