Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20131218
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/intel/sys/acpi/aclocal.h
+++ new/usr/src/common/acpica/include/aclocal.h
1 1 /******************************************************************************
2 2 *
3 3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
4 4 *
5 5 *****************************************************************************/
6 6
7 7 /*
8 - * Copyright (C) 2000 - 2011, Intel Corp.
8 + * Copyright (C) 2000 - 2014, Intel Corp.
9 9 * All rights reserved.
10 10 *
11 11 * Redistribution and use in source and binary forms, with or without
12 12 * modification, are permitted provided that the following conditions
13 13 * are met:
14 14 * 1. Redistributions of source code must retain the above copyright
15 15 * notice, this list of conditions, and the following disclaimer,
16 16 * without modification.
17 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 18 * substantially similar to the "NO WARRANTY" disclaimer below
19 19 * ("Disclaimer") and any redistribution must be conditioned upon
20 20 * including a substantially similar Disclaimer requirement for further
21 21 * binary redistribution.
22 22 * 3. Neither the names of the above-listed copyright holders nor the names
23 23 * of any contributors may be used to endorse or promote products derived
24 24 * from this software without specific prior written permission.
25 25 *
26 26 * Alternatively, this software may be distributed under the terms of the
27 27 * GNU General Public License ("GPL") version 2 as published by the Free
28 28 * Software Foundation.
29 29 *
30 30 * NO WARRANTY
31 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 41 * POSSIBILITY OF SUCH DAMAGES.
42 42 */
43 43
44 44 #ifndef __ACLOCAL_H__
45 45 #define __ACLOCAL_H__
46 46
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
47 47
48 48 /* acpisrc:StructDefs -- for acpisrc conversion */
49 49
50 50 #define ACPI_SERIALIZED 0xFF
51 51
52 52 typedef UINT32 ACPI_MUTEX_HANDLE;
53 53 #define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1)
54 54
55 55 /* Total number of aml opcodes defined */
56 56
57 -#define AML_NUM_OPCODES 0x7F
57 +#define AML_NUM_OPCODES 0x81
58 58
59 59
60 60 /* Forward declarations */
61 61
62 62 struct acpi_walk_state;
63 63 struct acpi_obj_mutex;
64 64 union acpi_parse_object;
65 65
66 66
67 67 /*****************************************************************************
68 68 *
69 69 * Mutex typedefs and structs
70 70 *
71 71 ****************************************************************************/
72 72
73 73
74 74 /*
75 75 * Predefined handles for the mutex objects used within the subsystem
76 76 * All mutex objects are automatically created by AcpiUtMutexInitialize.
77 77 *
78 78 * The acquire/release ordering protocol is implied via this list. Mutexes
79 79 * with a lower value must be acquired before mutexes with a higher value.
80 80 *
81 81 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
82 82 * table below also!
83 83 */
84 84 #define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
85 85 #define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
86 86 #define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
87 87 #define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
88 88 #define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
89 89 #define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
90 90 #define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */
91 91 #define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */
92 92
93 93 #define ACPI_MAX_MUTEX 7
94 94 #define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
95 95
96 96
97 97 /* Lock structure for reader/writer interfaces */
98 98
99 99 typedef struct acpi_rw_lock
100 100 {
101 101 ACPI_MUTEX WriterMutex;
102 102 ACPI_MUTEX ReaderMutex;
103 103 UINT32 NumReaders;
104 104
105 105 } ACPI_RW_LOCK;
106 106
107 107
108 108 /*
109 109 * Predefined handles for spinlocks used within the subsystem.
110 110 * These spinlocks are created by AcpiUtMutexInitialize
111 111 */
112 112 #define ACPI_LOCK_GPES 0
113 113 #define ACPI_LOCK_HARDWARE 1
114 114
115 115 #define ACPI_MAX_LOCK 1
116 116 #define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
117 117
118 118
119 119 /* This Thread ID means that the mutex is not in use (unlocked) */
120 120
121 121 #define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1
122 122
123 123 /* Table for the global mutexes */
124 124
125 125 typedef struct acpi_mutex_info
126 126 {
127 127 ACPI_MUTEX Mutex;
128 128 UINT32 UseCount;
129 129 ACPI_THREAD_ID ThreadId;
130 130
131 131 } ACPI_MUTEX_INFO;
132 132
133 133
134 134 /* Lock flag parameter for various interfaces */
135 135
136 136 #define ACPI_MTX_DO_NOT_LOCK 0
137 137 #define ACPI_MTX_LOCK 1
138 138
139 139
140 140 /* Field access granularities */
141 141
142 142 #define ACPI_FIELD_BYTE_GRANULARITY 1
143 143 #define ACPI_FIELD_WORD_GRANULARITY 2
144 144 #define ACPI_FIELD_DWORD_GRANULARITY 4
145 145 #define ACPI_FIELD_QWORD_GRANULARITY 8
146 146
147 147
148 148 #define ACPI_ENTRY_NOT_FOUND NULL
149 149
150 150
151 151 /*****************************************************************************
152 152 *
153 153 * Namespace typedefs and structs
154 154 *
155 155 ****************************************************************************/
156 156
157 157 /* Operational modes of the AML interpreter/scanner */
158 158
159 159 typedef enum
160 160 {
161 161 ACPI_IMODE_LOAD_PASS1 = 0x01,
162 162 ACPI_IMODE_LOAD_PASS2 = 0x02,
163 163 ACPI_IMODE_EXECUTE = 0x03
164 164
165 165 } ACPI_INTERPRETER_MODE;
166 166
167 167
168 168 /*
169 169 * The Namespace Node describes a named object that appears in the AML.
170 170 * DescriptorType is used to differentiate between internal descriptors.
171 171 *
172 172 * The node is optimized for both 32-bit and 64-bit platforms:
173 173 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
174 174 *
175 175 * Note: The DescriptorType and Type fields must appear in the identical
176 176 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
177 177 * structures.
178 178 */
179 179 typedef struct acpi_namespace_node
180 180 {
181 181 union acpi_operand_object *Object; /* Interpreter object */
182 182 UINT8 DescriptorType; /* Differentiate object descriptor types */
183 183 UINT8 Type; /* ACPI Type associated with this name */
184 184 UINT8 Flags; /* Miscellaneous flags */
185 185 ACPI_OWNER_ID OwnerId; /* Node creator */
186 186 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
187 187 struct acpi_namespace_node *Parent; /* Parent node */
188 188 struct acpi_namespace_node *Child; /* First child */
189 189 struct acpi_namespace_node *Peer; /* First peer */
190 190
191 191 /*
192 192 * The following fields are used by the ASL compiler and disassembler only
193 193 */
194 194 #ifdef ACPI_LARGE_NAMESPACE_NODE
195 195 union acpi_parse_object *Op;
196 196 UINT32 Value;
197 197 UINT32 Length;
198 198 #endif
199 199
200 200 } ACPI_NAMESPACE_NODE;
201 201
202 202
203 203 /* Namespace Node flags */
204 204
205 205 #define ANOBJ_RESERVED 0x01 /* Available for use */
↓ open down ↓ |
138 lines elided |
↑ open up ↑ |
206 206 #define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
207 207 #define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
208 208 #define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
209 209 #define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
210 210 #define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
211 211 #define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
212 212
213 213 #define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
214 214 #define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
215 215 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
216 -#define ANOBJ_IS_BIT_OFFSET 0x40 /* iASL only: Reference is a bit offset */
217 216 #define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
218 217
219 218
220 219 /* Internal ACPI table management - master table list */
221 220
222 221 typedef struct acpi_table_list
223 222 {
224 223 ACPI_TABLE_DESC *Tables; /* Table descriptor array */
225 224 UINT32 CurrentTableCount; /* Tables currently in the array */
226 225 UINT32 MaxTableCount; /* Max tables array will hold */
227 226 UINT8 Flags;
228 227
229 228 } ACPI_TABLE_LIST;
230 229
231 230 /* Flags for above */
232 231
233 232 #define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
234 233 #define ACPI_ROOT_ORIGIN_ALLOCATED (1)
235 234 #define ACPI_ROOT_ALLOW_RESIZE (2)
236 235
237 236
238 237 /* Predefined (fixed) table indexes */
239 238
240 239 #define ACPI_TABLE_INDEX_DSDT (0)
241 240 #define ACPI_TABLE_INDEX_FACS (1)
242 241
243 242
244 243 typedef struct acpi_find_context
245 244 {
246 245 char *SearchFor;
247 246 ACPI_HANDLE *List;
248 247 UINT32 *Count;
249 248
250 249 } ACPI_FIND_CONTEXT;
251 250
252 251
253 252 typedef struct acpi_ns_search_data
254 253 {
255 254 ACPI_NAMESPACE_NODE *Node;
256 255
257 256 } ACPI_NS_SEARCH_DATA;
258 257
259 258
260 259 /* Object types used during package copies */
261 260
262 261 #define ACPI_COPY_TYPE_SIMPLE 0
263 262 #define ACPI_COPY_TYPE_PACKAGE 1
264 263
265 264
266 265 /* Info structure used to convert external<->internal namestrings */
267 266
268 267 typedef struct acpi_namestring_info
269 268 {
270 269 const char *ExternalName;
271 270 const char *NextExternalChar;
272 271 char *InternalName;
273 272 UINT32 Length;
274 273 UINT32 NumSegments;
275 274 UINT32 NumCarats;
276 275 BOOLEAN FullyQualified;
277 276
278 277 } ACPI_NAMESTRING_INFO;
↓ open down ↓ |
52 lines elided |
↑ open up ↑ |
279 278
280 279
281 280 /* Field creation info */
282 281
283 282 typedef struct acpi_create_field_info
284 283 {
285 284 ACPI_NAMESPACE_NODE *RegionNode;
286 285 ACPI_NAMESPACE_NODE *FieldNode;
287 286 ACPI_NAMESPACE_NODE *RegisterNode;
288 287 ACPI_NAMESPACE_NODE *DataRegisterNode;
288 + ACPI_NAMESPACE_NODE *ConnectionNode;
289 + UINT8 *ResourceBuffer;
289 290 UINT32 BankValue;
290 291 UINT32 FieldBitPosition;
291 292 UINT32 FieldBitLength;
293 + UINT16 ResourceLength;
292 294 UINT8 FieldFlags;
293 295 UINT8 Attribute;
294 296 UINT8 FieldType;
297 + UINT8 AccessLength;
295 298
296 299 } ACPI_CREATE_FIELD_INFO;
297 300
298 301
299 302 typedef
300 303 ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
301 304 struct acpi_walk_state *WalkState);
302 305
303 306
304 307 /*
305 - * Bitmapped ACPI types. Used internally only
308 + * Bitmapped ACPI types. Used internally only
306 309 */
307 310 #define ACPI_BTYPE_ANY 0x00000000
308 311 #define ACPI_BTYPE_INTEGER 0x00000001
309 312 #define ACPI_BTYPE_STRING 0x00000002
310 313 #define ACPI_BTYPE_BUFFER 0x00000004
311 314 #define ACPI_BTYPE_PACKAGE 0x00000008
312 315 #define ACPI_BTYPE_FIELD_UNIT 0x00000010
313 316 #define ACPI_BTYPE_DEVICE 0x00000020
314 317 #define ACPI_BTYPE_EVENT 0x00000040
315 318 #define ACPI_BTYPE_METHOD 0x00000080
316 319 #define ACPI_BTYPE_MUTEX 0x00000100
317 320 #define ACPI_BTYPE_REGION 0x00000200
318 321 #define ACPI_BTYPE_POWER 0x00000400
319 322 #define ACPI_BTYPE_PROCESSOR 0x00000800
320 323 #define ACPI_BTYPE_THERMAL 0x00001000
321 324 #define ACPI_BTYPE_BUFFER_FIELD 0x00002000
322 325 #define ACPI_BTYPE_DDB_HANDLE 0x00004000
323 326 #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
324 327 #define ACPI_BTYPE_REFERENCE 0x00010000
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
325 328 #define ACPI_BTYPE_RESOURCE 0x00020000
326 329
327 330 #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
328 331
329 332 #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
330 333 #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
331 334 #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
332 335 #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
333 336 #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
334 337
338 +#pragma pack(1)
335 339
336 340 /*
337 341 * Information structure for ACPI predefined names.
338 342 * Each entry in the table contains the following items:
339 343 *
340 344 * Name - The ACPI reserved name
341 345 * ParamCount - Number of arguments to the method
342 346 * ExpectedReturnBtypes - Allowed type(s) for the return value
343 347 */
344 348 typedef struct acpi_name_info
345 349 {
346 350 char Name[ACPI_NAME_SIZE];
347 - UINT8 ParamCount;
351 + UINT16 ArgumentList;
348 352 UINT8 ExpectedBtypes;
349 353
350 354 } ACPI_NAME_INFO;
351 355
352 356 /*
353 357 * Secondary information structures for ACPI predefined objects that return
354 358 * package objects. This structure appears as the next entry in the table
355 359 * after the NAME_INFO structure above.
356 360 *
357 361 * The reason for this is to minimize the size of the predefined name table.
358 362 */
359 363
360 364 /*
361 365 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
362 - * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
366 + * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
367 + * ACPI_PTYPE2_FIX_VAR
363 368 */
364 369 typedef struct acpi_package_info
365 370 {
366 371 UINT8 Type;
367 372 UINT8 ObjectType1;
368 373 UINT8 Count1;
369 374 UINT8 ObjectType2;
370 375 UINT8 Count2;
371 - UINT8 Reserved;
376 + UINT16 Reserved;
372 377
373 378 } ACPI_PACKAGE_INFO;
374 379
375 380 /* Used for ACPI_PTYPE2_FIXED */
376 381
377 382 typedef struct acpi_package_info2
378 383 {
379 384 UINT8 Type;
380 385 UINT8 Count;
381 386 UINT8 ObjectType[4];
387 + UINT8 Reserved;
382 388
383 389 } ACPI_PACKAGE_INFO2;
384 390
385 391 /* Used for ACPI_PTYPE1_OPTION */
386 392
387 393 typedef struct acpi_package_info3
388 394 {
389 395 UINT8 Type;
390 396 UINT8 Count;
391 397 UINT8 ObjectType[2];
392 398 UINT8 TailObjectType;
393 - UINT8 Reserved;
399 + UINT16 Reserved;
394 400
395 401 } ACPI_PACKAGE_INFO3;
396 402
397 403 typedef union acpi_predefined_info
398 404 {
399 405 ACPI_NAME_INFO Info;
400 406 ACPI_PACKAGE_INFO RetInfo;
401 407 ACPI_PACKAGE_INFO2 RetInfo2;
402 408 ACPI_PACKAGE_INFO3 RetInfo3;
403 409
404 410 } ACPI_PREDEFINED_INFO;
405 411
412 +/* Reset to default packing */
406 413
407 -/* Data block used during object validation */
414 +#pragma pack()
408 415
409 -typedef struct acpi_predefined_data
410 -{
411 - char *Pathname;
412 - const ACPI_PREDEFINED_INFO *Predefined;
413 - union acpi_operand_object *ParentPackage;
414 - UINT32 Flags;
415 - UINT8 NodeFlags;
416 416
417 -} ACPI_PREDEFINED_DATA;
417 +/* Return object auto-repair info */
418 418
419 -/* Defines for Flags field above */
419 +typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
420 + union acpi_operand_object *OriginalObject,
421 + union acpi_operand_object **ConvertedObject);
420 422
421 -#define ACPI_OBJECT_REPAIRED 1
423 +typedef struct acpi_simple_repair_info
424 +{
425 + char Name[ACPI_NAME_SIZE];
426 + UINT32 UnexpectedBtypes;
427 + UINT32 PackageIndex;
428 + ACPI_OBJECT_CONVERTER ObjectConverter;
422 429
430 +} ACPI_SIMPLE_REPAIR_INFO;
423 431
432 +
424 433 /*
425 434 * Bitmapped return value types
426 435 * Note: the actual data types must be contiguous, a loop in nspredef.c
427 436 * depends on this.
428 437 */
429 438 #define ACPI_RTYPE_ANY 0x00
430 439 #define ACPI_RTYPE_NONE 0x01
431 440 #define ACPI_RTYPE_INTEGER 0x02
432 441 #define ACPI_RTYPE_STRING 0x04
433 442 #define ACPI_RTYPE_BUFFER 0x08
434 443 #define ACPI_RTYPE_PACKAGE 0x10
435 444 #define ACPI_RTYPE_REFERENCE 0x20
436 445 #define ACPI_RTYPE_ALL 0x3F
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
437 446
438 447 #define ACPI_NUM_RTYPES 5 /* Number of actual object types */
439 448
440 449
441 450 /*****************************************************************************
442 451 *
443 452 * Event typedefs and structs
444 453 *
445 454 ****************************************************************************/
446 455
456 +/* Dispatch info for each host-installed SCI handler */
457 +
458 +typedef struct acpi_sci_handler_info
459 +{
460 + struct acpi_sci_handler_info *Next;
461 + ACPI_SCI_HANDLER Address; /* Address of handler */
462 + void *Context; /* Context to be passed to handler */
463 +
464 +} ACPI_SCI_HANDLER_INFO;
465 +
447 466 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
448 467
449 468 typedef struct acpi_gpe_handler_info
450 469 {
451 470 ACPI_GPE_HANDLER Address; /* Address of handler, if any */
452 471 void *Context; /* Context to be passed to handler */
453 472 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
454 473 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */
455 474 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */
456 475
457 476 } ACPI_GPE_HANDLER_INFO;
458 477
478 +/* Notify info for implicit notify, multiple device objects */
479 +
480 +typedef struct acpi_gpe_notify_info
481 +{
482 + ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */
483 + struct acpi_gpe_notify_info *Next;
484 +
485 +} ACPI_GPE_NOTIFY_INFO;
486 +
459 487 /*
460 488 * GPE dispatch info. At any time, the GPE can have at most one type
461 489 * of dispatch - Method, Handler, or Implicit Notify.
462 490 */
463 491 typedef union acpi_gpe_dispatch_info
464 492 {
465 493 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
466 - struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */
467 - ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */
494 + ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */
495 + ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */
468 496
469 497 } ACPI_GPE_DISPATCH_INFO;
470 498
471 499 /*
472 500 * Information about a GPE, one per each GPE in an array.
473 501 * NOTE: Important to keep this struct as small as possible.
474 502 */
475 503 typedef struct acpi_gpe_event_info
476 504 {
477 - union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */
505 + union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */
478 506 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */
479 507 UINT8 Flags; /* Misc info about this GPE */
480 508 UINT8 GpeNumber; /* This GPE */
481 509 UINT8 RuntimeCount; /* References to a run GPE */
482 510
483 511 } ACPI_GPE_EVENT_INFO;
484 512
485 513 /* Information about a GPE register pair, one per each status/enable pair in an array */
486 514
487 515 typedef struct acpi_gpe_register_info
488 516 {
489 517 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
490 518 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
491 519 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
492 520 UINT8 EnableForRun; /* GPEs to keep enabled when running */
493 521 UINT8 BaseGpeNumber; /* Base GPE number for this register */
494 522
495 523 } ACPI_GPE_REGISTER_INFO;
496 524
497 525 /*
498 526 * Information about a GPE register block, one per each installed block --
499 527 * GPE0, GPE1, and one per each installed GPE Block Device.
500 528 */
501 529 typedef struct acpi_gpe_block_info
502 530 {
503 531 ACPI_NAMESPACE_NODE *Node;
504 532 struct acpi_gpe_block_info *Previous;
505 533 struct acpi_gpe_block_info *Next;
506 534 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
507 535 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
508 536 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
509 537 ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
510 538 UINT32 RegisterCount; /* Number of register pairs in block */
511 539 UINT16 GpeCount; /* Number of individual GPEs in block */
512 540 UINT8 BlockBaseNumber;/* Base GPE number for this block */
513 541 BOOLEAN Initialized; /* TRUE if this block is initialized */
514 542
515 543 } ACPI_GPE_BLOCK_INFO;
516 544
517 545 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
518 546
519 547 typedef struct acpi_gpe_xrupt_info
520 548 {
521 549 struct acpi_gpe_xrupt_info *Previous;
522 550 struct acpi_gpe_xrupt_info *Next;
523 551 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */
524 552 UINT32 InterruptNumber; /* System interrupt number */
525 553
526 554 } ACPI_GPE_XRUPT_INFO;
527 555
528 556 typedef struct acpi_gpe_walk_info
529 557 {
530 558 ACPI_NAMESPACE_NODE *GpeDevice;
531 559 ACPI_GPE_BLOCK_INFO *GpeBlock;
532 560 UINT16 Count;
533 561 ACPI_OWNER_ID OwnerId;
534 562 BOOLEAN ExecuteByOwnerId;
535 563
536 564 } ACPI_GPE_WALK_INFO;
537 565
538 566 typedef struct acpi_gpe_device_info
539 567 {
540 568 UINT32 Index;
541 569 UINT32 NextBlockBaseIndex;
542 570 ACPI_STATUS Status;
543 571 ACPI_NAMESPACE_NODE *GpeDevice;
544 572
545 573 } ACPI_GPE_DEVICE_INFO;
546 574
547 575 typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
548 576 ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
549 577 ACPI_GPE_BLOCK_INFO *GpeBlock,
550 578 void *Context);
551 579
552 580
553 581 /* Information about each particular fixed event */
554 582
555 583 typedef struct acpi_fixed_event_handler
556 584 {
557 585 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
558 586 void *Context; /* Context to be passed to handler */
559 587
560 588 } ACPI_FIXED_EVENT_HANDLER;
561 589
562 590 typedef struct acpi_fixed_event_info
563 591 {
564 592 UINT8 StatusRegisterId;
565 593 UINT8 EnableRegisterId;
566 594 UINT16 StatusBitMask;
567 595 UINT16 EnableBitMask;
568 596
569 597 } ACPI_FIXED_EVENT_INFO;
570 598
571 599 /* Information used during field processing */
572 600
573 601 typedef struct acpi_field_info
574 602 {
575 603 UINT8 SkipField;
576 604 UINT8 FieldFlag;
577 605 UINT32 PkgLength;
578 606
579 607 } ACPI_FIELD_INFO;
580 608
581 609
582 610 /*****************************************************************************
583 611 *
584 612 * Generic "state" object for stacks
585 613 *
586 614 ****************************************************************************/
587 615
588 616 #define ACPI_CONTROL_NORMAL 0xC0
589 617 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
590 618 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
591 619 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
592 620 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
593 621
594 622
595 623 #define ACPI_STATE_COMMON \
596 624 void *Next; \
597 625 UINT8 DescriptorType; /* To differentiate various internal objs */\
598 626 UINT8 Flags; \
599 627 UINT16 Value; \
600 628 UINT16 State;
601 629
602 630 /* There are 2 bytes available here until the next natural alignment boundary */
603 631
604 632 typedef struct acpi_common_state
605 633 {
606 634 ACPI_STATE_COMMON
607 635 } ACPI_COMMON_STATE;
608 636
609 637
610 638 /*
611 639 * Update state - used to traverse complex objects such as packages
612 640 */
613 641 typedef struct acpi_update_state
614 642 {
615 643 ACPI_STATE_COMMON
616 644 union acpi_operand_object *Object;
617 645
618 646 } ACPI_UPDATE_STATE;
619 647
620 648
621 649 /*
622 650 * Pkg state - used to traverse nested package structures
623 651 */
624 652 typedef struct acpi_pkg_state
625 653 {
626 654 ACPI_STATE_COMMON
627 655 UINT16 Index;
628 656 union acpi_operand_object *SourceObject;
629 657 union acpi_operand_object *DestObject;
630 658 struct acpi_walk_state *WalkState;
631 659 void *ThisTargetObj;
632 660 UINT32 NumPackages;
633 661
634 662 } ACPI_PKG_STATE;
635 663
636 664
637 665 /*
638 666 * Control state - one per if/else and while constructs.
639 667 * Allows nesting of these constructs
640 668 */
641 669 typedef struct acpi_control_state
642 670 {
643 671 ACPI_STATE_COMMON
644 672 UINT16 Opcode;
645 673 union acpi_parse_object *PredicateOp;
646 674 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
647 675 UINT8 *PackageEnd; /* End of if/while block */
648 676 UINT32 LoopCount; /* While() loop counter */
649 677
650 678 } ACPI_CONTROL_STATE;
651 679
652 680
653 681 /*
654 682 * Scope state - current scope during namespace lookups
655 683 */
656 684 typedef struct acpi_scope_state
657 685 {
658 686 ACPI_STATE_COMMON
659 687 ACPI_NAMESPACE_NODE *Node;
660 688
661 689 } ACPI_SCOPE_STATE;
662 690
663 691
664 692 typedef struct acpi_pscope_state
665 693 {
666 694 ACPI_STATE_COMMON
↓ open down ↓ |
179 lines elided |
↑ open up ↑ |
667 695 UINT32 ArgCount; /* Number of fixed arguments */
668 696 union acpi_parse_object *Op; /* Current op being parsed */
669 697 UINT8 *ArgEnd; /* Current argument end */
670 698 UINT8 *PkgEnd; /* Current package end */
671 699 UINT32 ArgList; /* Next argument to parse */
672 700
673 701 } ACPI_PSCOPE_STATE;
674 702
675 703
676 704 /*
677 - * Thread state - one per thread across multiple walk states. Multiple walk
705 + * Thread state - one per thread across multiple walk states. Multiple walk
678 706 * states are created when there are nested control methods executing.
679 707 */
680 708 typedef struct acpi_thread_state
681 709 {
682 710 ACPI_STATE_COMMON
683 711 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
684 712 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
685 713 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */
686 714 ACPI_THREAD_ID ThreadId; /* Running thread ID */
687 715
688 716 } ACPI_THREAD_STATE;
689 717
690 718
691 719 /*
692 720 * Result values - used to accumulate the results of nested
693 721 * AML arguments
694 722 */
695 723 typedef struct acpi_result_values
696 724 {
697 725 ACPI_STATE_COMMON
698 726 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
699 727
700 728 } ACPI_RESULT_VALUES;
701 729
702 730
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
703 731 typedef
704 732 ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
705 733 struct acpi_walk_state *WalkState,
706 734 union acpi_parse_object **OutOp);
707 735
708 736 typedef
709 737 ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
710 738 struct acpi_walk_state *WalkState);
711 739
712 740
741 +/* Global handlers for AML Notifies */
742 +
743 +typedef struct acpi_global_notify_handler
744 +{
745 + ACPI_NOTIFY_HANDLER Handler;
746 + void *Context;
747 +
748 +} ACPI_GLOBAL_NOTIFY_HANDLER;
749 +
713 750 /*
714 751 * Notify info - used to pass info to the deferred notify
715 752 * handler/dispatcher.
716 753 */
717 754 typedef struct acpi_notify_info
718 755 {
719 756 ACPI_STATE_COMMON
757 + UINT8 HandlerListId;
720 758 ACPI_NAMESPACE_NODE *Node;
721 - union acpi_operand_object *HandlerObj;
759 + union acpi_operand_object *HandlerListHead;
760 + ACPI_GLOBAL_NOTIFY_HANDLER *Global;
722 761
723 762 } ACPI_NOTIFY_INFO;
724 763
725 764
726 765 /* Generic state is union of structs above */
727 766
728 767 typedef union acpi_generic_state
729 768 {
730 769 ACPI_COMMON_STATE Common;
731 770 ACPI_CONTROL_STATE Control;
732 771 ACPI_UPDATE_STATE Update;
733 772 ACPI_SCOPE_STATE Scope;
734 773 ACPI_PSCOPE_STATE ParseScope;
735 774 ACPI_PKG_STATE Pkg;
736 775 ACPI_THREAD_STATE Thread;
737 776 ACPI_RESULT_VALUES Results;
738 777 ACPI_NOTIFY_INFO Notify;
739 778
740 779 } ACPI_GENERIC_STATE;
741 780
742 781
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
743 782 /*****************************************************************************
744 783 *
745 784 * Interpreter typedefs and structs
746 785 *
747 786 ****************************************************************************/
748 787
749 788 typedef
750 789 ACPI_STATUS (*ACPI_EXECUTE_OP) (
751 790 struct acpi_walk_state *WalkState);
752 791
792 +/* Address Range info block */
753 793
794 +typedef struct acpi_address_range
795 +{
796 + struct acpi_address_range *Next;
797 + ACPI_NAMESPACE_NODE *RegionNode;
798 + ACPI_PHYSICAL_ADDRESS StartAddress;
799 + ACPI_PHYSICAL_ADDRESS EndAddress;
800 +
801 +} ACPI_ADDRESS_RANGE;
802 +
803 +
754 804 /*****************************************************************************
755 805 *
756 806 * Parser typedefs and structs
757 807 *
758 808 ****************************************************************************/
759 809
760 810 /*
761 811 * AML opcode, name, and argument layout
762 812 */
763 813 typedef struct acpi_opcode_info
764 814 {
765 815 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
766 816 char *Name; /* Opcode name (disassembler/debug only) */
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
767 817 #endif
768 818 UINT32 ParseArgs; /* Grammar/Parse time arguments */
769 819 UINT32 RuntimeArgs; /* Interpret time arguments */
770 820 UINT16 Flags; /* Misc flags */
771 821 UINT8 ObjectType; /* Corresponding internal object type */
772 822 UINT8 Class; /* Opcode class */
773 823 UINT8 Type; /* Opcode type */
774 824
775 825 } ACPI_OPCODE_INFO;
776 826
827 +/* Structure for Resource Tag information */
828 +
829 +typedef struct acpi_tag_info
830 +{
831 + UINT32 BitOffset;
832 + UINT32 BitLength;
833 +
834 +} ACPI_TAG_INFO;
835 +
836 +/* Value associated with the parse object */
837 +
777 838 typedef union acpi_parse_value
778 839 {
779 840 UINT64 Integer; /* Integer constant (Up to 64 bits) */
780 841 UINT32 Size; /* bytelist or field size */
781 842 char *String; /* NULL terminated string */
782 843 UINT8 *Buffer; /* buffer or string */
783 844 char *Name; /* NULL terminated string */
784 845 union acpi_parse_object *Arg; /* arguments and contained ops */
846 + ACPI_TAG_INFO Tag; /* Resource descriptor tag info */
785 847
786 848 } ACPI_PARSE_VALUE;
787 849
788 850
789 851 #ifdef ACPI_DISASSEMBLER
790 852 #define ACPI_DISASM_ONLY_MEMBERS(a) a;
791 853 #else
792 854 #define ACPI_DISASM_ONLY_MEMBERS(a)
793 855 #endif
794 856
795 857 #define ACPI_PARSE_COMMON \
796 858 union acpi_parse_object *Parent; /* Parent op */\
797 859 UINT8 DescriptorType; /* To differentiate various internal objs */\
798 860 UINT8 Flags; /* Type of Op */\
799 861 UINT16 AmlOpcode; /* AML opcode */\
800 862 UINT32 AmlOffset; /* Offset of declaration in AML */\
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
801 863 union acpi_parse_object *Next; /* Next op */\
802 864 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
803 865 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
804 866 UINT8 ArgListLength; /* Number of elements in the arg list */\
805 867 ACPI_DISASM_ONLY_MEMBERS (\
806 868 UINT8 DisasmFlags; /* Used during AML disassembly */\
807 869 UINT8 DisasmOpcode; /* Subtype used for disassembly */\
808 870 char AmlOpName[16]) /* Op name (debug only) */
809 871
810 872
811 -#define ACPI_DASM_BUFFER 0x00
812 -#define ACPI_DASM_RESOURCE 0x01
813 -#define ACPI_DASM_STRING 0x02
814 -#define ACPI_DASM_UNICODE 0x03
815 -#define ACPI_DASM_EISAID 0x04
816 -#define ACPI_DASM_MATCHOP 0x05
817 -#define ACPI_DASM_LNOT_PREFIX 0x06
818 -#define ACPI_DASM_LNOT_SUFFIX 0x07
819 -#define ACPI_DASM_IGNORE 0x08
873 +/* Flags for DisasmFlags field above */
820 874
875 +#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
876 +#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
877 +#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
878 +#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
879 +#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
880 +#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
881 +#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
882 +#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */
883 +#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */
884 +#define ACPI_DASM_IGNORE 0x09 /* Not used at this time */
885 +
821 886 /*
822 887 * Generic operation (for example: If, While, Store)
823 888 */
824 889 typedef struct acpi_parse_obj_common
825 890 {
826 891 ACPI_PARSE_COMMON
827 892 } ACPI_PARSE_OBJ_COMMON;
828 893
829 894
830 895 /*
831 896 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
832 897 * and bytelists.
833 898 */
834 899 typedef struct acpi_parse_obj_named
835 900 {
836 901 ACPI_PARSE_COMMON
837 902 UINT8 *Path;
838 903 UINT8 *Data; /* AML body or bytelist data */
839 904 UINT32 Length; /* AML length */
840 905 UINT32 Name; /* 4-byte name or zero if no name */
841 906
842 907 } ACPI_PARSE_OBJ_NAMED;
843 908
844 909
845 910 /* This version is used by the iASL compiler only */
846 911
847 912 #define ACPI_MAX_PARSEOP_NAME 20
848 913
849 914 typedef struct acpi_parse_obj_asl
850 915 {
851 916 ACPI_PARSE_COMMON
852 917 union acpi_parse_object *Child;
853 918 union acpi_parse_object *ParentMethod;
854 919 char *Filename;
855 920 char *ExternalName;
856 921 char *Namepath;
857 922 char NameSeg[4];
858 923 UINT32 ExtraValue;
859 924 UINT32 Column;
860 925 UINT32 LineNumber;
861 926 UINT32 LogicalLineNumber;
862 927 UINT32 LogicalByteOffset;
863 928 UINT32 EndLine;
864 929 UINT32 EndLogicalLine;
865 930 UINT32 AcpiBtype;
866 931 UINT32 AmlLength;
867 932 UINT32 AmlSubtreeLength;
868 933 UINT32 FinalAmlLength;
869 934 UINT32 FinalAmlOffset;
870 935 UINT32 CompileFlags;
871 936 UINT16 ParseOpcode;
872 937 UINT8 AmlOpcodeLength;
873 938 UINT8 AmlPkgLenBytes;
874 939 UINT8 Extra;
875 940 char ParseOpName[ACPI_MAX_PARSEOP_NAME];
876 941
877 942 } ACPI_PARSE_OBJ_ASL;
878 943
879 944 typedef union acpi_parse_object
880 945 {
881 946 ACPI_PARSE_OBJ_COMMON Common;
882 947 ACPI_PARSE_OBJ_NAMED Named;
883 948 ACPI_PARSE_OBJ_ASL Asl;
884 949
885 950 } ACPI_PARSE_OBJECT;
886 951
887 952
888 953 /*
889 954 * Parse state - one state per parser invocation and each control
890 955 * method.
891 956 */
892 957 typedef struct acpi_parse_state
893 958 {
894 959 UINT8 *AmlStart; /* First AML byte */
895 960 UINT8 *Aml; /* Next AML byte */
896 961 UINT8 *AmlEnd; /* (last + 1) AML byte */
897 962 UINT8 *PkgStart; /* Current package begin */
898 963 UINT8 *PkgEnd; /* Current package end */
899 964 union acpi_parse_object *StartOp; /* Root of parse tree */
900 965 struct acpi_namespace_node *StartNode;
901 966 union acpi_generic_state *Scope; /* Current scope */
902 967 union acpi_parse_object *StartScope;
903 968 UINT32 AmlSize;
904 969
905 970 } ACPI_PARSE_STATE;
906 971
907 972
908 973 /* Parse object flags */
909 974
910 975 #define ACPI_PARSEOP_GENERIC 0x01
911 976 #define ACPI_PARSEOP_NAMED 0x02
912 977 #define ACPI_PARSEOP_DEFERRED 0x04
↓ open down ↓ |
82 lines elided |
↑ open up ↑ |
913 978 #define ACPI_PARSEOP_BYTELIST 0x08
914 979 #define ACPI_PARSEOP_IN_STACK 0x10
915 980 #define ACPI_PARSEOP_TARGET 0x20
916 981 #define ACPI_PARSEOP_IN_CACHE 0x80
917 982
918 983 /* Parse object DisasmFlags */
919 984
920 985 #define ACPI_PARSEOP_IGNORE 0x01
921 986 #define ACPI_PARSEOP_PARAMLIST 0x02
922 987 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
988 +#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
923 989 #define ACPI_PARSEOP_SPECIAL 0x10
924 990
925 991
926 992 /*****************************************************************************
927 993 *
928 994 * Hardware (ACPI registers) and PNP
929 995 *
930 996 ****************************************************************************/
931 997
932 998 typedef struct acpi_bit_register_info
933 999 {
934 1000 UINT8 ParentRegister;
935 1001 UINT8 BitPosition;
936 1002 UINT16 AccessBitMask;
937 1003
938 1004 } ACPI_BIT_REGISTER_INFO;
939 1005
940 1006
941 1007 /*
942 1008 * Some ACPI registers have bits that must be ignored -- meaning that they
943 1009 * must be preserved.
944 1010 */
945 1011 #define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
946 1012
947 1013 /* Write-only bits must be zeroed by software */
948 1014
949 1015 #define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */
950 1016
951 1017 /* For control registers, both ignored and reserved bits must be preserved */
952 1018
953 1019 /*
954 1020 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
955 1021 * ACPI specification to be a "preserved" bit - "OSPM always preserves this
956 1022 * bit position", section 4.7.3.2.1. However, on some machines the OS must
957 1023 * write a one to this bit after resume for the machine to work properly.
958 1024 * To enable this, we no longer attempt to preserve this bit. No machines
959 1025 * are known to fail if the bit is not preserved. (May 2009)
960 1026 */
961 1027 #define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */
962 1028 #define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
963 1029 #define ACPI_PM1_CONTROL_PRESERVED_BITS \
964 1030 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
965 1031
966 1032 #define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
967 1033
968 1034 /*
969 1035 * Register IDs
970 1036 * These are the full ACPI registers
971 1037 */
972 1038 #define ACPI_REGISTER_PM1_STATUS 0x01
973 1039 #define ACPI_REGISTER_PM1_ENABLE 0x02
974 1040 #define ACPI_REGISTER_PM1_CONTROL 0x03
975 1041 #define ACPI_REGISTER_PM2_CONTROL 0x04
976 1042 #define ACPI_REGISTER_PM_TIMER 0x05
977 1043 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x06
978 1044 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07
979 1045
980 1046
981 1047 /* Masks used to access the BitRegisters */
982 1048
983 1049 #define ACPI_BITMASK_TIMER_STATUS 0x0001
984 1050 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
985 1051 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
986 1052 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
987 1053 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
988 1054 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
989 1055 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
990 1056 #define ACPI_BITMASK_WAKE_STATUS 0x8000
991 1057
992 1058 #define ACPI_BITMASK_ALL_FIXED_STATUS (\
993 1059 ACPI_BITMASK_TIMER_STATUS | \
994 1060 ACPI_BITMASK_BUS_MASTER_STATUS | \
995 1061 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
996 1062 ACPI_BITMASK_POWER_BUTTON_STATUS | \
997 1063 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
998 1064 ACPI_BITMASK_RT_CLOCK_STATUS | \
999 1065 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
1000 1066 ACPI_BITMASK_WAKE_STATUS)
1001 1067
1002 1068 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
1003 1069 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
1004 1070 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
1005 1071 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
1006 1072 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
1007 1073 #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
1008 1074
1009 1075 #define ACPI_BITMASK_SCI_ENABLE 0x0001
1010 1076 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
1011 1077 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
1012 1078 #define ACPI_BITMASK_SLEEP_TYPE 0x1C00
1013 1079 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
1014 1080
1015 1081 #define ACPI_BITMASK_ARB_DISABLE 0x0001
1016 1082
1017 1083
1018 1084 /* Raw bit position of each BitRegister */
1019 1085
1020 1086 #define ACPI_BITPOSITION_TIMER_STATUS 0x00
1021 1087 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
1022 1088 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
1023 1089 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
1024 1090 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
1025 1091 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
1026 1092 #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
1027 1093 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
1028 1094
1029 1095 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
1030 1096 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
1031 1097 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
1032 1098 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
1033 1099 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
1034 1100 #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
1035 1101
1036 1102 #define ACPI_BITPOSITION_SCI_ENABLE 0x00
↓ open down ↓ |
104 lines elided |
↑ open up ↑ |
1037 1103 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
1038 1104 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
1039 1105 #define ACPI_BITPOSITION_SLEEP_TYPE 0x0A
1040 1106 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
1041 1107
1042 1108 #define ACPI_BITPOSITION_ARB_DISABLE 0x00
1043 1109
1044 1110
1045 1111 /* Structs and definitions for _OSI support and I/O port validation */
1046 1112
1047 -#define ACPI_OSI_WIN_2000 0x01
1048 -#define ACPI_OSI_WIN_XP 0x02
1049 -#define ACPI_OSI_WIN_XP_SP1 0x03
1050 -#define ACPI_OSI_WINSRV_2003 0x04
1051 -#define ACPI_OSI_WIN_XP_SP2 0x05
1052 -#define ACPI_OSI_WINSRV_2003_SP1 0x06
1053 -#define ACPI_OSI_WIN_VISTA 0x07
1054 -#define ACPI_OSI_WINSRV_2008 0x08
1055 -#define ACPI_OSI_WIN_VISTA_SP1 0x09
1056 -#define ACPI_OSI_WIN_VISTA_SP2 0x0A
1057 -#define ACPI_OSI_WIN_7 0x0B
1058 -
1059 1113 #define ACPI_ALWAYS_ILLEGAL 0x00
1060 1114
1061 1115 typedef struct acpi_interface_info
1062 1116 {
1063 1117 char *Name;
1064 1118 struct acpi_interface_info *Next;
1065 1119 UINT8 Flags;
1066 1120 UINT8 Value;
1067 1121
1068 1122 } ACPI_INTERFACE_INFO;
1069 1123
1070 1124 #define ACPI_OSI_INVALID 0x01
1071 1125 #define ACPI_OSI_DYNAMIC 0x02
1126 +#define ACPI_OSI_FEATURE 0x04
1127 +#define ACPI_OSI_DEFAULT_INVALID 0x08
1128 +#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
1072 1129
1073 1130 typedef struct acpi_port_info
1074 1131 {
1075 1132 char *Name;
1076 1133 UINT16 Start;
1077 1134 UINT16 End;
1078 1135 UINT8 OsiDependency;
1079 1136
1080 1137 } ACPI_PORT_INFO;
1081 1138
1082 1139
1083 1140 /*****************************************************************************
1084 1141 *
1085 1142 * Resource descriptors
1086 1143 *
1087 1144 ****************************************************************************/
1088 1145
1089 1146 /* ResourceType values */
1090 1147
1091 1148 #define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
1092 1149 #define ACPI_ADDRESS_TYPE_IO_RANGE 1
1093 1150 #define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
1094 1151
1095 1152 /* Resource descriptor types and masks */
1096 1153
1097 1154 #define ACPI_RESOURCE_NAME_LARGE 0x80
1098 1155 #define ACPI_RESOURCE_NAME_SMALL 0x00
1099 1156
1100 1157 #define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
1101 1158 #define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
1102 1159 #define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
1103 1160
1104 1161
↓ open down ↓ |
23 lines elided |
↑ open up ↑ |
1105 1162 /*
1106 1163 * Small resource descriptor "names" as defined by the ACPI specification.
1107 1164 * Note: Bits 2:0 are used for the descriptor length
1108 1165 */
1109 1166 #define ACPI_RESOURCE_NAME_IRQ 0x20
1110 1167 #define ACPI_RESOURCE_NAME_DMA 0x28
1111 1168 #define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
1112 1169 #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
1113 1170 #define ACPI_RESOURCE_NAME_IO 0x40
1114 1171 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48
1115 -#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
1172 +#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
1116 1173 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
1117 1174 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
1118 1175 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
1119 1176 #define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
1120 1177 #define ACPI_RESOURCE_NAME_END_TAG 0x78
1121 1178
1122 1179 /*
1123 1180 * Large resource descriptor "names" as defined by the ACPI specification.
1124 1181 * Note: includes the Large Descriptor bit in bit[7]
1125 1182 */
1126 1183 #define ACPI_RESOURCE_NAME_MEMORY24 0x81
↓ open down ↓ |
1 lines elided |
↑ open up ↑ |
1127 1184 #define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
1128 1185 #define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
1129 1186 #define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
1130 1187 #define ACPI_RESOURCE_NAME_MEMORY32 0x85
1131 1188 #define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
1132 1189 #define ACPI_RESOURCE_NAME_ADDRESS32 0x87
1133 1190 #define ACPI_RESOURCE_NAME_ADDRESS16 0x88
1134 1191 #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
1135 1192 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
1136 1193 #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
1137 -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
1194 +#define ACPI_RESOURCE_NAME_GPIO 0x8C
1195 +#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
1196 +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
1138 1197
1139 1198
1140 1199 /*****************************************************************************
1141 1200 *
1142 1201 * Miscellaneous
1143 1202 *
1144 1203 ****************************************************************************/
1145 1204
1146 1205 #define ACPI_ASCII_ZERO 0x30
1147 1206
1148 1207
1149 1208 /*****************************************************************************
1150 1209 *
1151 1210 * Disassembler
↓ open down ↓ |
4 lines elided |
↑ open up ↑ |
1152 1211 *
1153 1212 ****************************************************************************/
1154 1213
1155 1214 typedef struct acpi_external_list
1156 1215 {
1157 1216 char *Path;
1158 1217 char *InternalPath;
1159 1218 struct acpi_external_list *Next;
1160 1219 UINT32 Value;
1161 1220 UINT16 Length;
1221 + UINT16 Flags;
1162 1222 UINT8 Type;
1163 - UINT8 Flags;
1164 1223
1165 1224 } ACPI_EXTERNAL_LIST;
1166 1225
1167 1226 /* Values for Flags field above */
1168 1227
1169 -#define ACPI_IPATH_ALLOCATED 0x01
1228 +#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
1229 +#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
1230 +#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
1231 +#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
1170 1232
1171 1233
1172 1234 typedef struct acpi_external_file
1173 1235 {
1174 1236 char *Path;
1175 1237 struct acpi_external_file *Next;
1176 1238
1177 1239 } ACPI_EXTERNAL_FILE;
1178 1240
1179 1241
1180 1242 /*****************************************************************************
1181 1243 *
1182 1244 * Debugger
1183 1245 *
1184 1246 ****************************************************************************/
1185 1247
1186 1248 typedef struct acpi_db_method_info
1187 1249 {
1250 + ACPI_HANDLE Method;
1188 1251 ACPI_HANDLE MainThreadGate;
1189 1252 ACPI_HANDLE ThreadCompleteGate;
1190 1253 ACPI_HANDLE InfoGate;
1191 1254 ACPI_THREAD_ID *Threads;
1192 1255 UINT32 NumThreads;
1193 1256 UINT32 NumCreated;
1194 1257 UINT32 NumCompleted;
1195 1258
1196 1259 char *Name;
1197 1260 UINT32 Flags;
1198 1261 UINT32 NumLoops;
1199 - char Pathname[128];
1262 + char Pathname[ACPI_DB_LINE_BUFFER_SIZE];
1200 1263 char **Args;
1201 1264 ACPI_OBJECT_TYPE *Types;
1202 1265
1203 1266 /*
1204 1267 * Arguments to be passed to method for the command
1205 1268 * Threads -
1206 1269 * the Number of threads, ID of current thread and
1207 1270 * Index of current thread inside all them created.
1208 1271 */
1209 1272 char InitArgs;
1210 1273 ACPI_OBJECT_TYPE ArgTypes[4];
1211 1274 char *Arguments[4];
1212 1275 char NumThreadsStr[11];
1213 1276 char IdOfThreadStr[11];
1214 1277 char IndexOfThreadStr[11];
1215 1278
↓ open down ↓ |
6 lines elided |
↑ open up ↑ |
1216 1279 } ACPI_DB_METHOD_INFO;
1217 1280
1218 1281 typedef struct acpi_integrity_info
1219 1282 {
1220 1283 UINT32 Nodes;
1221 1284 UINT32 Objects;
1222 1285
1223 1286 } ACPI_INTEGRITY_INFO;
1224 1287
1225 1288
1289 +#define ACPI_DB_DISABLE_OUTPUT 0x00
1226 1290 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1227 1291 #define ACPI_DB_CONSOLE_OUTPUT 0x02
1228 1292 #define ACPI_DB_DUPLICATE_OUTPUT 0x03
1229 1293
1230 1294
1231 1295 /*****************************************************************************
1232 1296 *
1233 1297 * Debug
1234 1298 *
1235 1299 ****************************************************************************/
1236 1300
1237 1301 /* Entry for a memory allocation (debug only) */
1238 1302
1239 1303 #define ACPI_MEM_MALLOC 0
1240 1304 #define ACPI_MEM_CALLOC 1
1241 1305 #define ACPI_MAX_MODULE_NAME 16
1242 1306
1243 1307 #define ACPI_COMMON_DEBUG_MEM_HEADER \
1244 1308 struct acpi_debug_mem_block *Previous; \
1245 1309 struct acpi_debug_mem_block *Next; \
1246 1310 UINT32 Size; \
1247 1311 UINT32 Component; \
1248 1312 UINT32 Line; \
1249 1313 char Module[ACPI_MAX_MODULE_NAME]; \
1250 1314 UINT8 AllocType;
1251 1315
1252 1316 typedef struct acpi_debug_mem_header
1253 1317 {
1254 1318 ACPI_COMMON_DEBUG_MEM_HEADER
1255 1319
1256 1320 } ACPI_DEBUG_MEM_HEADER;
1257 1321
1258 1322 typedef struct acpi_debug_mem_block
1259 1323 {
1260 1324 ACPI_COMMON_DEBUG_MEM_HEADER
1261 1325 UINT64 UserSpace;
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
1262 1326
1263 1327 } ACPI_DEBUG_MEM_BLOCK;
1264 1328
1265 1329
1266 1330 #define ACPI_MEM_LIST_GLOBAL 0
1267 1331 #define ACPI_MEM_LIST_NSNODE 1
1268 1332 #define ACPI_MEM_LIST_MAX 1
1269 1333 #define ACPI_NUM_MEM_LISTS 2
1270 1334
1271 1335
1336 +/*****************************************************************************
1337 + *
1338 + * Info/help support
1339 + *
1340 + ****************************************************************************/
1341 +
1342 +typedef struct ah_predefined_name
1343 +{
1344 + char *Name;
1345 + char *Description;
1346 +#ifndef ACPI_ASL_COMPILER
1347 + char *Action;
1348 +#endif
1349 +
1350 +} AH_PREDEFINED_NAME;
1351 +
1272 1352 #endif /* __ACLOCAL_H__ */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX