RTEMS 7.0-rc1
Loading...
Searching...
No Matches
aclocal.h
1/******************************************************************************
2 *
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
4 *
5 *****************************************************************************/
6
7/******************************************************************************
8 *
9 * 1. Copyright Notice
10 *
11 * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
12 * All rights reserved.
13 *
14 * 2. License
15 *
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
19 * property rights.
20 *
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
27 *
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
36 *
37 * The above copyright and patent license is granted only if the following
38 * conditions are met:
39 *
40 * 3. Conditions
41 *
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
53 *
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
64 * make.
65 *
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
70 * distribution.
71 *
72 * 3.4. Intel retains all right, title, and interest in and to the Original
73 * Intel Code.
74 *
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
79 *
80 * 4. Disclaimer and Export Compliance
81 *
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88 * PARTICULAR PURPOSE.
89 *
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97 * LIMITED REMEDY.
98 *
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
113 *
114 *****************************************************************************
115 *
116 * Alternatively, you may choose to be licensed under the terms of the
117 * following license:
118 *
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
121 * are met:
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
133 *
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145 *
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
149 *
150 *****************************************************************************/
151
152#ifndef __ACLOCAL_H__
153#define __ACLOCAL_H__
154
155
156/* acpisrc:StructDefs -- for acpisrc conversion */
157
158#define ACPI_SERIALIZED 0xFF
159
160typedef UINT32 ACPI_MUTEX_HANDLE;
161#define ACPI_GLOBAL_LOCK (ACPI_SEMAPHORE) (-1)
162
163/* Total number of aml opcodes defined */
164
165#define AML_NUM_OPCODES 0x83
166
167
168/* Forward declarations */
169
170struct acpi_walk_state;
171struct acpi_obj_mutex;
173
174
175/*****************************************************************************
176 *
177 * Mutex typedefs and structs
178 *
179 ****************************************************************************/
180
181
182/*
183 * Predefined handles for the mutex objects used within the subsystem
184 * All mutex objects are automatically created by AcpiUtMutexInitialize.
185 *
186 * The acquire/release ordering protocol is implied via this list. Mutexes
187 * with a lower value must be acquired before mutexes with a higher value.
188 *
189 * NOTE: any changes here must be reflected in the AcpiGbl_MutexNames
190 * table below also!
191 */
192#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
193#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
194#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
195#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
196#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
197#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
198
199#define ACPI_MAX_MUTEX 5
200#define ACPI_NUM_MUTEX (ACPI_MAX_MUTEX+1)
201
202
203/* Lock structure for reader/writer interfaces */
204
205typedef struct acpi_rw_lock
206{
207 ACPI_MUTEX WriterMutex;
208 ACPI_MUTEX ReaderMutex;
209 UINT32 NumReaders;
210
212
213
214/*
215 * Predefined handles for spinlocks used within the subsystem.
216 * These spinlocks are created by AcpiUtMutexInitialize
217 */
218#define ACPI_LOCK_GPES 0
219#define ACPI_LOCK_HARDWARE 1
220
221#define ACPI_MAX_LOCK 1
222#define ACPI_NUM_LOCK (ACPI_MAX_LOCK+1)
223
224
225/* This Thread ID means that the mutex is not in use (unlocked) */
226
227#define ACPI_MUTEX_NOT_ACQUIRED ((ACPI_THREAD_ID) -1)
228
229/* This Thread ID means an invalid thread ID */
230
231#ifdef ACPI_OS_INVALID_THREAD_ID
232#define ACPI_INVALID_THREAD_ID ACPI_OS_INVALID_THREAD_ID
233#else
234#define ACPI_INVALID_THREAD_ID ((ACPI_THREAD_ID) 0xFFFFFFFF)
235#endif
236
237/* Table for the global mutexes */
238
239typedef struct acpi_mutex_info
240{
241 ACPI_MUTEX Mutex;
242 UINT32 UseCount;
243 ACPI_THREAD_ID ThreadId;
244
246
247
248/* Lock flag parameter for various interfaces */
249
250#define ACPI_MTX_DO_NOT_LOCK 0
251#define ACPI_MTX_LOCK 1
252
253
254/* Field access granularities */
255
256#define ACPI_FIELD_BYTE_GRANULARITY 1
257#define ACPI_FIELD_WORD_GRANULARITY 2
258#define ACPI_FIELD_DWORD_GRANULARITY 4
259#define ACPI_FIELD_QWORD_GRANULARITY 8
260
261
262#define ACPI_ENTRY_NOT_FOUND NULL
263
264
265/*****************************************************************************
266 *
267 * Namespace typedefs and structs
268 *
269 ****************************************************************************/
270
271/* Operational modes of the AML interpreter/scanner */
272
273typedef enum
274{
275 ACPI_IMODE_LOAD_PASS1 = 0x01,
276 ACPI_IMODE_LOAD_PASS2 = 0x02,
277 ACPI_IMODE_EXECUTE = 0x03
278
279} ACPI_INTERPRETER_MODE;
280
281
282/*
283 * The Namespace Node describes a named object that appears in the AML.
284 * DescriptorType is used to differentiate between internal descriptors.
285 *
286 * The node is optimized for both 32-bit and 64-bit platforms:
287 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
288 *
289 * Note: The DescriptorType and Type fields must appear in the identical
290 * position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
291 * structures.
292 */
294{
295 union acpi_operand_object *Object; /* Interpreter object */
296 UINT8 DescriptorType; /* Differentiate object descriptor types */
297 UINT8 Type; /* ACPI Type associated with this name */
298 UINT16 Flags; /* Miscellaneous flags */
299 ACPI_NAME_UNION Name; /* ACPI Name, always 4 chars per ACPI spec */
300 struct acpi_namespace_node *Parent; /* Parent node */
301 struct acpi_namespace_node *Child; /* First child */
302 struct acpi_namespace_node *Peer; /* First peer */
303 ACPI_OWNER_ID OwnerId; /* Node creator */
304
305 /*
306 * The following fields are used by the ASL compiler and disassembler only
307 */
308#ifdef ACPI_LARGE_NAMESPACE_NODE
309 union acpi_parse_object *Op;
310 void *MethodLocals;
311 void *MethodArgs;
312 UINT32 Value;
313 UINT32 Length;
314 UINT8 ArgCount;
315
316#endif
317
319
320
321/* Namespace Node flags */
322
323#define ANOBJ_RESERVED 0x01 /* Available for use */
324#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
325#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
326#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
327#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
328#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
329#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
330#define ANOBJ_NODE_EARLY_INIT 0x80 /* AcpiExec only: Node was create via init file (-fi) */
331
332#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
333#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
334#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
335#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
336
337
338/* Internal ACPI table management - master table list */
339
340typedef struct acpi_table_list
341{
342 ACPI_TABLE_DESC *Tables; /* Table descriptor array */
343 UINT32 CurrentTableCount; /* Tables currently in the array */
344 UINT32 MaxTableCount; /* Max tables array will hold */
345 UINT8 Flags;
346
348
349/* Flags for above */
350
351#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
352#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
353#define ACPI_ROOT_ALLOW_RESIZE (2)
354
355
356/* List to manage incoming ACPI tables */
357
359{
360 ACPI_TABLE_HEADER *Table;
361 struct acpi_new_table_desc *Next;
362
364
365
366/* Predefined table indexes */
367
368#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
369
370
371typedef struct acpi_find_context
372{
373 char *SearchFor;
374 ACPI_HANDLE *List;
375 UINT32 *Count;
376
378
379
381{
383
385
386
387/* Object types used during package copies */
388
389#define ACPI_COPY_TYPE_SIMPLE 0
390#define ACPI_COPY_TYPE_PACKAGE 1
391
392
393/* Info structure used to convert external<->internal namestrings */
394
396{
397 const char *ExternalName;
398 const char *NextExternalChar;
399 char *InternalName;
400 UINT32 Length;
401 UINT32 NumSegments;
402 UINT32 NumCarats;
403 BOOLEAN FullyQualified;
404
406
407
408/* Field creation info */
409
411{
412 ACPI_NAMESPACE_NODE *RegionNode;
413 ACPI_NAMESPACE_NODE *FieldNode;
414 ACPI_NAMESPACE_NODE *RegisterNode;
415 ACPI_NAMESPACE_NODE *DataRegisterNode;
416 ACPI_NAMESPACE_NODE *ConnectionNode;
417 UINT8 *ResourceBuffer;
418 UINT32 BankValue;
419 UINT32 FieldBitPosition;
420 UINT32 FieldBitLength;
421 UINT16 ResourceLength;
422 UINT16 PinNumberIndex;
423 UINT8 FieldFlags;
424 UINT8 Attribute;
425 UINT8 FieldType;
426 UINT8 AccessLength;
427
429
430
431typedef
432ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
433 struct acpi_walk_state *WalkState);
434
435
436/*
437 * Bitmapped ACPI types. Used internally only
438 */
439#define ACPI_BTYPE_ANY 0x00000000
440#define ACPI_BTYPE_INTEGER 0x00000001
441#define ACPI_BTYPE_STRING 0x00000002
442#define ACPI_BTYPE_BUFFER 0x00000004
443#define ACPI_BTYPE_PACKAGE 0x00000008
444#define ACPI_BTYPE_FIELD_UNIT 0x00000010
445#define ACPI_BTYPE_DEVICE 0x00000020
446#define ACPI_BTYPE_EVENT 0x00000040
447#define ACPI_BTYPE_METHOD 0x00000080
448#define ACPI_BTYPE_MUTEX 0x00000100
449#define ACPI_BTYPE_REGION 0x00000200
450#define ACPI_BTYPE_POWER 0x00000400
451#define ACPI_BTYPE_PROCESSOR 0x00000800
452#define ACPI_BTYPE_THERMAL 0x00001000
453#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
454#define ACPI_BTYPE_DDB_HANDLE 0x00004000
455#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
456#define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */
457#define ACPI_BTYPE_RESOURCE 0x00020000
458#define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */
459
460#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
461
462#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
463
464 /* Used by Copy, DeRefOf, Store, Printf, Fprintf */
465
466#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
467#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
468#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
469#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
470
471#pragma pack(1)
472
473/*
474 * Information structure for ACPI predefined names.
475 * Each entry in the table contains the following items:
476 *
477 * Name - The ACPI reserved name
478 * ParamCount - Number of arguments to the method
479 * ExpectedReturnBtypes - Allowed type(s) for the return value
480 */
481typedef struct acpi_name_info
482{
483#ifdef __rtems__
484 __attribute__ ((nonstring))
485#endif /* rtems */
486 char Name[ACPI_NAMESEG_SIZE];
487 UINT16 ArgumentList;
488 UINT8 ExpectedBtypes;
489
491
492/*
493 * Secondary information structures for ACPI predefined objects that return
494 * package objects. This structure appears as the next entry in the table
495 * after the NAME_INFO structure above.
496 *
497 * The reason for this is to minimize the size of the predefined name table.
498 */
499
500/*
501 * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
502 * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
503 * ACPI_PTYPE2_FIX_VAR
504 */
505typedef struct acpi_package_info
506{
507 UINT8 Type;
508 UINT8 ObjectType1;
509 UINT8 Count1;
510 UINT8 ObjectType2;
511 UINT8 Count2;
512 UINT16 Reserved;
513
515
516/* Used for ACPI_PTYPE2_FIXED */
517
518typedef struct acpi_package_info2
519{
520 UINT8 Type;
521 UINT8 Count;
522 UINT8 ObjectType[4];
523 UINT8 Reserved;
524
526
527/* Used for ACPI_PTYPE1_OPTION */
528
529typedef struct acpi_package_info3
530{
531 UINT8 Type;
532 UINT8 Count;
533 UINT8 ObjectType[2];
534 UINT8 TailObjectType;
535 UINT16 Reserved;
536
538
539typedef struct acpi_package_info4
540{
541 UINT8 Type;
542 UINT8 ObjectType1;
543 UINT8 Count1;
544 UINT8 SubObjectTypes;
545 UINT8 PkgCount;
546 UINT16 Reserved;
547
549
551{
552 ACPI_NAME_INFO Info;
553 ACPI_PACKAGE_INFO RetInfo;
554 ACPI_PACKAGE_INFO2 RetInfo2;
555 ACPI_PACKAGE_INFO3 RetInfo3;
556 ACPI_PACKAGE_INFO4 RetInfo4;
557
559
560/* Reset to default packing */
561
562#pragma pack()
563
564
565/* Return object auto-repair info */
566
567typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
568 struct acpi_namespace_node *Scope,
569 union acpi_operand_object *OriginalObject,
570 union acpi_operand_object **ConvertedObject);
571
573{
574#ifdef __rtems__
575 __attribute__ ((nonstring))
576#endif /* rtems */
577 char Name[ACPI_NAMESEG_SIZE];
578 UINT32 UnexpectedBtypes;
579 UINT32 PackageIndex;
580 ACPI_OBJECT_CONVERTER ObjectConverter;
581
583
584
585/*
586 * Bitmapped return value types
587 * Note: the actual data types must be contiguous, a loop in nspredef.c
588 * depends on this.
589 */
590#define ACPI_RTYPE_ANY 0x00
591#define ACPI_RTYPE_NONE 0x01
592#define ACPI_RTYPE_INTEGER 0x02
593#define ACPI_RTYPE_STRING 0x04
594#define ACPI_RTYPE_BUFFER 0x08
595#define ACPI_RTYPE_PACKAGE 0x10
596#define ACPI_RTYPE_REFERENCE 0x20
597#define ACPI_RTYPE_ALL 0x3F
598
599#define ACPI_NUM_RTYPES 5 /* Number of actual object types */
600
601
602/* Info for running the _REG methods */
603
604typedef struct acpi_reg_walk_info
605{
606 UINT32 Function;
607 UINT32 RegRunCount;
608 ACPI_ADR_SPACE_TYPE SpaceId;
609
611
612
613/*****************************************************************************
614 *
615 * Event typedefs and structs
616 *
617 ****************************************************************************/
618
619/* Dispatch info for each host-installed SCI handler */
620
622{
623 struct acpi_sci_handler_info *Next;
624 ACPI_SCI_HANDLER Address; /* Address of handler */
625 void *Context; /* Context to be passed to handler */
626
628
629/* Dispatch info for each GPE -- either a method or handler, cannot be both */
630
632{
633 ACPI_GPE_HANDLER Address; /* Address of handler, if any */
634 void *Context; /* Context to be passed to handler */
635 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
636 UINT8 OriginalFlags; /* Original (pre-handler) GPE info */
637 BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */
638
640
641/* Notify info for implicit notify, multiple device objects */
642
644{
645 ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */
646 struct acpi_gpe_notify_info *Next;
647
649
650/*
651 * GPE dispatch info. At any time, the GPE can have at most one type
652 * of dispatch - Method, Handler, or Implicit Notify.
653 */
655{
656 ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
657 ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */
658 ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */
659
661
662/*
663 * Information about a GPE, one per each GPE in an array.
664 * NOTE: Important to keep this struct as small as possible.
665 */
667{
668 union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */
669 struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */
670 UINT8 Flags; /* Misc info about this GPE */
671 UINT8 GpeNumber; /* This GPE */
672 UINT8 RuntimeCount; /* References to a run GPE */
673 BOOLEAN DisableForDispatch; /* Masked during dispatching */
674
676
677/* Information about a GPE register pair, one per each status/enable pair in an array */
678
680{
681 ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
682 ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
683 UINT16 BaseGpeNumber; /* Base GPE number for this register */
684 UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
685 UINT8 EnableForRun; /* GPEs to keep enabled when running */
686 UINT8 MaskForRun; /* GPEs to keep masked when running */
687 UINT8 EnableMask; /* Current mask of enabled GPEs */
688
690
691/*
692 * Information about a GPE register block, one per each installed block --
693 * GPE0, GPE1, and one per each installed GPE Block Device.
694 */
696{
698 struct acpi_gpe_block_info *Previous;
699 struct acpi_gpe_block_info *Next;
700 struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
701 ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
702 ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
703 UINT64 Address; /* Base address of the block */
704 UINT32 RegisterCount; /* Number of register pairs in block */
705 UINT16 GpeCount; /* Number of individual GPEs in block */
706 UINT16 BlockBaseNumber;/* Base GPE number for this block */
707 UINT8 SpaceId;
708 BOOLEAN Initialized; /* TRUE if this block is initialized */
709
711
712/* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
713
715{
716 struct acpi_gpe_xrupt_info *Previous;
717 struct acpi_gpe_xrupt_info *Next;
718 ACPI_GPE_BLOCK_INFO *GpeBlockListHead; /* List of GPE blocks for this xrupt */
719 UINT32 InterruptNumber; /* System interrupt number */
720
722
723typedef struct acpi_gpe_walk_info
724{
725 ACPI_NAMESPACE_NODE *GpeDevice;
726 ACPI_GPE_BLOCK_INFO *GpeBlock;
727 UINT16 Count;
728 ACPI_OWNER_ID OwnerId;
729 BOOLEAN ExecuteByOwnerId;
730
732
734{
735 UINT32 Index;
736 UINT32 NextBlockBaseIndex;
737 ACPI_STATUS Status;
738 ACPI_NAMESPACE_NODE *GpeDevice;
739
741
742typedef ACPI_STATUS (*ACPI_GPE_CALLBACK) (
743 ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
744 ACPI_GPE_BLOCK_INFO *GpeBlock,
745 void *Context);
746
747
748/* Information about each particular fixed event */
749
751{
752 ACPI_EVENT_HANDLER Handler; /* Address of handler. */
753 void *Context; /* Context to be passed to handler */
754
756
758{
759 UINT8 StatusRegisterId;
760 UINT8 EnableRegisterId;
761 UINT16 StatusBitMask;
762 UINT16 EnableBitMask;
763
765
766/* Information used during field processing */
767
768typedef struct acpi_field_info
769{
770 UINT8 SkipField;
771 UINT8 FieldFlag;
772 UINT32 PkgLength;
773
775
776/* Information about the interrupt ID and _EVT of a GED device */
777
779{
780 struct acpi_ged_handler_info *Next;
781 UINT32 IntId; /* The interrupt ID that triggers the execution of the EvtMethod. */
782 ACPI_NAMESPACE_NODE *EvtMethod; /* The _EVT method to be executed when an interrupt with ID = IntID is received */
783
785
786/*****************************************************************************
787 *
788 * Generic "state" object for stacks
789 *
790 ****************************************************************************/
791
792#define ACPI_CONTROL_NORMAL 0xC0
793#define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
794#define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
795#define ACPI_CONTROL_PREDICATE_FALSE 0xC3
796#define ACPI_CONTROL_PREDICATE_TRUE 0xC4
797
798
799#define ACPI_STATE_COMMON \
800 void *Next; \
801 UINT8 DescriptorType; /* To differentiate various internal objs */\
802 UINT8 Flags; \
803 UINT16 Value; \
804 UINT16 State
805
806 /* There are 2 bytes available here until the next natural alignment boundary */
807
808typedef struct acpi_common_state
809{
810 ACPI_STATE_COMMON;
812
813
814/*
815 * Update state - used to traverse complex objects such as packages
816 */
817typedef struct acpi_update_state
818{
819 ACPI_STATE_COMMON;
820 union acpi_operand_object *Object;
821
823
824
825/*
826 * Pkg state - used to traverse nested package structures
827 */
828typedef struct acpi_pkg_state
829{
830 ACPI_STATE_COMMON;
831 UINT32 Index;
832 union acpi_operand_object *SourceObject;
833 union acpi_operand_object *DestObject;
834 struct acpi_walk_state *WalkState;
835 void *ThisTargetObj;
836 UINT32 NumPackages;
837
839
840
841/*
842 * Control state - one per if/else and while constructs.
843 * Allows nesting of these constructs
844 */
845typedef struct acpi_control_state
846{
847 ACPI_STATE_COMMON;
848 UINT16 Opcode;
849 union acpi_parse_object *PredicateOp;
850 UINT8 *AmlPredicateStart; /* Start of if/while predicate */
851 UINT8 *PackageEnd; /* End of if/while block */
852 UINT64 LoopTimeout; /* While() loop timeout */
853
855
856
857/*
858 * Scope state - current scope during namespace lookups
859 */
860typedef struct acpi_scope_state
861{
862 ACPI_STATE_COMMON;
864
866
867
868typedef struct acpi_pscope_state
869{
870 ACPI_STATE_COMMON;
871 UINT32 ArgCount; /* Number of fixed arguments */
872 union acpi_parse_object *Op; /* Current op being parsed */
873 UINT8 *ArgEnd; /* Current argument end */
874 UINT8 *PkgEnd; /* Current package end */
875 UINT32 ArgList; /* Next argument to parse */
876
878
879
880/*
881 * Thread state - one per thread across multiple walk states. Multiple walk
882 * states are created when there are nested control methods executing.
883 */
884typedef struct acpi_thread_state
885{
886 ACPI_STATE_COMMON;
887 UINT8 CurrentSyncLevel; /* Mutex Sync (nested acquire) level */
888 struct acpi_walk_state *WalkStateList; /* Head of list of WalkStates for this thread */
889 union acpi_operand_object *AcquiredMutexList; /* List of all currently acquired mutexes */
890 ACPI_THREAD_ID ThreadId; /* Running thread ID */
891
893
894
895/*
896 * Result values - used to accumulate the results of nested
897 * AML arguments
898 */
899typedef struct acpi_result_values
900{
901 ACPI_STATE_COMMON;
902 union acpi_operand_object *ObjDesc [ACPI_RESULTS_FRAME_OBJ_NUM];
903
905
906
907typedef
908ACPI_STATUS (*ACPI_PARSE_DOWNWARDS) (
909 struct acpi_walk_state *WalkState,
910 union acpi_parse_object **OutOp);
911
912typedef
913ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
914 struct acpi_walk_state *WalkState);
915
916
917/* Global handlers for AML Notifies */
918
920{
921 ACPI_NOTIFY_HANDLER Handler;
922 void *Context;
923
925
926/*
927 * Notify info - used to pass info to the deferred notify
928 * handler/dispatcher.
929 */
930typedef struct acpi_notify_info
931{
932 ACPI_STATE_COMMON;
933 UINT8 HandlerListId;
935 union acpi_operand_object *HandlerListHead;
937
939
940
941/* Generic state is union of structs above */
942
944{
945 ACPI_COMMON_STATE Common;
946 ACPI_CONTROL_STATE Control;
947 ACPI_UPDATE_STATE Update;
948 ACPI_SCOPE_STATE Scope;
949 ACPI_PSCOPE_STATE ParseScope;
950 ACPI_PKG_STATE Pkg;
951 ACPI_THREAD_STATE Thread;
952 ACPI_RESULT_VALUES Results;
953 ACPI_NOTIFY_INFO Notify;
954
956
957
958/*****************************************************************************
959 *
960 * Interpreter typedefs and structs
961 *
962 ****************************************************************************/
963
964typedef
965ACPI_STATUS (*ACPI_EXECUTE_OP) (
966 struct acpi_walk_state *WalkState);
967
968/* Address Range info block */
969
970typedef struct acpi_address_range
971{
972 struct acpi_address_range *Next;
973 ACPI_NAMESPACE_NODE *RegionNode;
974 ACPI_PHYSICAL_ADDRESS StartAddress;
975 ACPI_PHYSICAL_ADDRESS EndAddress;
976
978
979
980/*****************************************************************************
981 *
982 * Parser typedefs and structs
983 *
984 ****************************************************************************/
985
986/*
987 * AML opcode, name, and argument layout
988 */
989typedef struct acpi_opcode_info
990{
991#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
992 char *Name; /* Opcode name (disassembler/debug only) */
993#endif
994 UINT32 ParseArgs; /* Grammar/Parse time arguments */
995 UINT32 RuntimeArgs; /* Interpret time arguments */
996 UINT16 Flags; /* Misc flags */
997 UINT8 ObjectType; /* Corresponding internal object type */
998 UINT8 Class; /* Opcode class */
999 UINT8 Type; /* Opcode type */
1000
1002
1003/* Structure for Resource Tag information */
1004
1005typedef struct acpi_tag_info
1006{
1007 UINT32 BitOffset;
1008 UINT32 BitLength;
1009
1011
1012/* Value associated with the parse object */
1013
1014typedef union acpi_parse_value
1015{
1016 UINT64 Integer; /* Integer constant (Up to 64 bits) */
1017 UINT32 Size; /* bytelist or field size */
1018 char *String; /* NULL terminated string */
1019 UINT8 *Buffer; /* buffer or string */
1020 char *Name; /* NULL terminated string */
1021 union acpi_parse_object *Arg; /* arguments and contained ops */
1022 ACPI_TAG_INFO Tag; /* Resource descriptor tag info */
1023
1025
1026
1027#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
1028#define ACPI_DISASM_ONLY_MEMBERS(a) a;
1029#else
1030#define ACPI_DISASM_ONLY_MEMBERS(a)
1031#endif
1032
1033#if defined(ACPI_ASL_COMPILER)
1034#define ACPI_CONVERTER_ONLY_MEMBERS(a) a;
1035#else
1036#define ACPI_CONVERTER_ONLY_MEMBERS(a)
1037#endif
1038
1039#define ACPI_PARSE_COMMON \
1040 union acpi_parse_object *Parent; /* Parent op */\
1041 UINT8 DescriptorType; /* To differentiate various internal objs */\
1042 UINT8 Flags; /* Type of Op */\
1043 UINT16 AmlOpcode; /* AML opcode */\
1044 UINT8 *Aml; /* Address of declaration in AML */\
1045 union acpi_parse_object *Next; /* Next op */\
1046 ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
1047 ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
1048 UINT8 ArgListLength; /* Number of elements in the arg list */\
1049 ACPI_DISASM_ONLY_MEMBERS (\
1050 UINT16 DisasmFlags; /* Used during AML disassembly */\
1051 UINT8 DisasmOpcode; /* Subtype used for disassembly */\
1052 char *OperatorSymbol; /* Used for C-style operator name strings */\
1053 char AmlOpName[16]) /* Op name (debug only) */\
1054 ACPI_CONVERTER_ONLY_MEMBERS (\
1055 char *InlineComment; /* Inline comment */\
1056 char *EndNodeComment; /* End of node comment */\
1057 char *NameComment; /* Comment associated with the first parameter of the name node */\
1058 char *CloseBraceComment; /* Comments that come after } on the same as } */\
1059 ACPI_COMMENT_NODE *CommentList; /* comments that appears before this node */\
1060 ACPI_COMMENT_NODE *EndBlkComment; /* comments that at the end of a block but before ) or } */\
1061 char *CvFilename; /* Filename associated with this node. Used for ASL/ASL+ converter */\
1062 char *CvParentFilename) /* Parent filename associated with this node. Used for ASL/ASL+ converter */
1063
1064
1065/* categories of comments */
1066
1067typedef enum
1068{
1069 STANDARD_COMMENT = 1,
1070 INLINE_COMMENT,
1071 ENDNODE_COMMENT,
1072 OPENBRACE_COMMENT,
1073 CLOSE_BRACE_COMMENT,
1074 STD_DEFBLK_COMMENT,
1075 END_DEFBLK_COMMENT,
1076 FILENAME_COMMENT,
1077 PARENTFILENAME_COMMENT,
1078 ENDBLK_COMMENT,
1079 INCLUDE_COMMENT
1080
1081} ASL_COMMENT_TYPES;
1082
1083
1084/* Internal opcodes for DisasmOpcode field above */
1085
1086#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
1087#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
1088#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
1089#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
1090#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
1091#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
1092#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
1093#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
1094#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */
1095#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */
1096#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
1097#define ACPI_DASM_IGNORE_SINGLE 0x0B /* Ignore the opcode but not it's children */
1098#define ACPI_DASM_SWITCH 0x0C /* While is a Switch */
1099#define ACPI_DASM_SWITCH_PREDICATE 0x0D /* Object is a predicate for a Switch or Case block */
1100#define ACPI_DASM_CASE 0x0E /* If/Else is a Case in a Switch/Case block */
1101#define ACPI_DASM_DEFAULT 0x0F /* Else is a Default in a Switch/Case block */
1102
1103
1104/*
1105 * List struct used in the -ca option
1106 */
1107typedef struct acpi_comment_node
1108{
1109 char *Comment;
1110 struct acpi_comment_node *Next;
1111
1113
1114
1116{
1117 UINT8 *Addr;
1118 struct acpi_comment_addr_node *Next;
1120
1121/*
1122 * File node - used for "Include" operator file stack and
1123 * dependency tree for the -ca option
1124 */
1125typedef struct acpi_file_node
1126{
1127 void *File;
1128 char *Filename;
1129 char *FileStart; /* Points to AML and indicates when the AML for this particular file starts. */
1130 char *FileEnd; /* Points to AML and indicates when the AML for this particular file ends. */
1131 struct acpi_file_node *Next;
1132 struct acpi_file_node *Parent;
1133 BOOLEAN IncludeWritten;
1134 ACPI_COMMENT_NODE *IncludeComment;
1135
1137
1138
1139/*
1140 * Generic operation (for example: If, While, Store)
1141 */
1143{
1144 ACPI_PARSE_COMMON
1146
1147
1148/*
1149 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and OpRegions),
1150 * and bytelists.
1151 */
1153{
1154 ACPI_PARSE_COMMON
1155 char *Path;
1156 UINT8 *Data; /* AML body or bytelist data */
1157 UINT32 Length; /* AML length */
1158 UINT32 Name; /* 4-byte name or zero if no name */
1159
1161
1162
1163/* This version is used by the iASL compiler only */
1164
1165#define ACPI_MAX_PARSEOP_NAME 20
1166
1168{
1169 ACPI_PARSE_COMMON
1170 union acpi_parse_object *Child;
1171 union acpi_parse_object *ParentMethod;
1172 char *Filename;
1173 BOOLEAN FileChanged;
1174 char *ParentFilename;
1175 char *ExternalName;
1176 char *Namepath;
1177 char NameSeg[4];
1178 UINT32 ExtraValue;
1179 UINT32 Column;
1180 UINT32 LineNumber;
1181 UINT32 LogicalLineNumber;
1182 UINT32 LogicalByteOffset;
1183 UINT32 EndLine;
1184 UINT32 EndLogicalLine;
1185 UINT32 AcpiBtype;
1186 UINT32 AmlLength;
1187 UINT32 AmlSubtreeLength;
1188 UINT32 FinalAmlLength;
1189 UINT32 FinalAmlOffset;
1190 UINT32 CompileFlags;
1191 UINT16 ParseOpcode;
1192 UINT8 AmlOpcodeLength;
1193 UINT8 AmlPkgLenBytes;
1194 UINT8 Extra;
1195 char ParseOpName[ACPI_MAX_PARSEOP_NAME];
1196
1198
1200{
1201 ACPI_PARSE_OBJ_COMMON Common;
1204
1206
1207typedef struct asl_comment_state
1208{
1209 UINT8 CommentType;
1210 UINT32 SpacesBefore;
1211 ACPI_PARSE_OBJECT *LatestParseOp;
1212 ACPI_PARSE_OBJECT *ParsingParenBraceNode;
1213 BOOLEAN CaptureComments;
1214
1216
1217
1218/*
1219 * Parse state - one state per parser invocation and each control
1220 * method.
1221 */
1222typedef struct acpi_parse_state
1223{
1224 UINT8 *AmlStart; /* First AML byte */
1225 UINT8 *Aml; /* Next AML byte */
1226 UINT8 *AmlEnd; /* (last + 1) AML byte */
1227 UINT8 *PkgStart; /* Current package begin */
1228 UINT8 *PkgEnd; /* Current package end */
1229 union acpi_parse_object *StartOp; /* Root of parse tree */
1230 struct acpi_namespace_node *StartNode;
1231 union acpi_generic_state *Scope; /* Current scope */
1232 union acpi_parse_object *StartScope;
1233 UINT32 AmlSize;
1234
1236
1237
1238/* Parse object flags */
1239
1240#define ACPI_PARSEOP_GENERIC 0x01
1241#define ACPI_PARSEOP_NAMED_OBJECT 0x02
1242#define ACPI_PARSEOP_DEFERRED 0x04
1243#define ACPI_PARSEOP_BYTELIST 0x08
1244#define ACPI_PARSEOP_IN_STACK 0x10
1245#define ACPI_PARSEOP_TARGET 0x20
1246#define ACPI_PARSEOP_IN_CACHE 0x80
1247
1248/* Parse object DisasmFlags */
1249
1250#define ACPI_PARSEOP_IGNORE 0x0001
1251#define ACPI_PARSEOP_PARAMETER_LIST 0x0002
1252#define ACPI_PARSEOP_EMPTY_TERMLIST 0x0004
1253#define ACPI_PARSEOP_PREDEFINED_CHECKED 0x0008
1254#define ACPI_PARSEOP_CLOSING_PAREN 0x0010
1255#define ACPI_PARSEOP_COMPOUND_ASSIGNMENT 0x0020
1256#define ACPI_PARSEOP_ASSIGNMENT 0x0040
1257#define ACPI_PARSEOP_ELSEIF 0x0080
1258#define ACPI_PARSEOP_LEGACY_ASL_ONLY 0x0100
1259
1260
1261/*****************************************************************************
1262 *
1263 * Hardware (ACPI registers) and PNP
1264 *
1265 ****************************************************************************/
1266
1268{
1269 UINT8 ParentRegister;
1270 UINT8 BitPosition;
1271 UINT16 AccessBitMask;
1272
1274
1275
1276/*
1277 * Some ACPI registers have bits that must be ignored -- meaning that they
1278 * must be preserved.
1279 */
1280#define ACPI_PM1_STATUS_PRESERVED_BITS 0x0800 /* Bit 11 */
1281
1282/* Write-only bits must be zeroed by software */
1283
1284#define ACPI_PM1_CONTROL_WRITEONLY_BITS 0x2004 /* Bits 13, 2 */
1285
1286/* For control registers, both ignored and reserved bits must be preserved */
1287
1288/*
1289 * For PM1 control, the SCI enable bit (bit 0, SCI_EN) is defined by the
1290 * ACPI specification to be a "preserved" bit - "OSPM always preserves this
1291 * bit position", section 4.7.3.2.1. However, on some machines the OS must
1292 * write a one to this bit after resume for the machine to work properly.
1293 * To enable this, we no longer attempt to preserve this bit. No machines
1294 * are known to fail if the bit is not preserved. (May 2009)
1295 */
1296#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bit 9 */
1297#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
1298#define ACPI_PM1_CONTROL_PRESERVED_BITS \
1299 (ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
1300
1301#define ACPI_PM2_CONTROL_PRESERVED_BITS 0xFFFFFFFE /* All except bit 0 */
1302
1303/*
1304 * Register IDs
1305 * These are the full ACPI registers
1306 */
1307#define ACPI_REGISTER_PM1_STATUS 0x01
1308#define ACPI_REGISTER_PM1_ENABLE 0x02
1309#define ACPI_REGISTER_PM1_CONTROL 0x03
1310#define ACPI_REGISTER_PM2_CONTROL 0x04
1311#define ACPI_REGISTER_PM_TIMER 0x05
1312#define ACPI_REGISTER_PROCESSOR_BLOCK 0x06
1313#define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x07
1314
1315
1316/* Masks used to access the BitRegisters */
1317
1318#define ACPI_BITMASK_TIMER_STATUS 0x0001
1319#define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
1320#define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
1321#define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
1322#define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
1323#define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
1324#define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
1325#define ACPI_BITMASK_WAKE_STATUS 0x8000
1326
1327#define ACPI_BITMASK_ALL_FIXED_STATUS (\
1328 ACPI_BITMASK_TIMER_STATUS | \
1329 ACPI_BITMASK_BUS_MASTER_STATUS | \
1330 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
1331 ACPI_BITMASK_POWER_BUTTON_STATUS | \
1332 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
1333 ACPI_BITMASK_RT_CLOCK_STATUS | \
1334 ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
1335 ACPI_BITMASK_WAKE_STATUS)
1336
1337#define ACPI_BITMASK_TIMER_ENABLE 0x0001
1338#define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
1339#define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
1340#define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
1341#define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
1342#define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
1343
1344#define ACPI_BITMASK_SCI_ENABLE 0x0001
1345#define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
1346#define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
1347#define ACPI_BITMASK_SLEEP_TYPE 0x1C00
1348#define ACPI_BITMASK_SLEEP_ENABLE 0x2000
1349
1350#define ACPI_BITMASK_ARB_DISABLE 0x0001
1351
1352
1353/* Raw bit position of each BitRegister */
1354
1355#define ACPI_BITPOSITION_TIMER_STATUS 0x00
1356#define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
1357#define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
1358#define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
1359#define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
1360#define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
1361#define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
1362#define ACPI_BITPOSITION_WAKE_STATUS 0x0F
1363
1364#define ACPI_BITPOSITION_TIMER_ENABLE 0x00
1365#define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
1366#define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
1367#define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
1368#define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
1369#define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
1370
1371#define ACPI_BITPOSITION_SCI_ENABLE 0x00
1372#define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
1373#define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
1374#define ACPI_BITPOSITION_SLEEP_TYPE 0x0A
1375#define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
1376
1377#define ACPI_BITPOSITION_ARB_DISABLE 0x00
1378
1379
1380/* Structs and definitions for _OSI support and I/O port validation */
1381
1382#define ACPI_ALWAYS_ILLEGAL 0x00
1383
1385{
1386 char *Name;
1387 struct acpi_interface_info *Next;
1388 UINT8 Flags;
1389 UINT8 Value;
1390
1392
1393#define ACPI_OSI_INVALID 0x01
1394#define ACPI_OSI_DYNAMIC 0x02
1395#define ACPI_OSI_FEATURE 0x04
1396#define ACPI_OSI_DEFAULT_INVALID 0x08
1397#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
1398
1399typedef struct acpi_port_info
1400{
1401 char *Name;
1402 UINT16 Start;
1403 UINT16 End;
1404 UINT8 OsiDependency;
1405
1407
1408
1409/*****************************************************************************
1410 *
1411 * Resource descriptors
1412 *
1413 ****************************************************************************/
1414
1415/* ResourceType values */
1416
1417#define ACPI_ADDRESS_TYPE_MEMORY_RANGE 0
1418#define ACPI_ADDRESS_TYPE_IO_RANGE 1
1419#define ACPI_ADDRESS_TYPE_BUS_NUMBER_RANGE 2
1420
1421#define ACPI_ADDRESS_TYPE_PCC_NUMBER 0xA
1422
1423/* Resource descriptor types and masks */
1424
1425#define ACPI_RESOURCE_NAME_LARGE 0x80
1426#define ACPI_RESOURCE_NAME_SMALL 0x00
1427
1428#define ACPI_RESOURCE_NAME_SMALL_MASK 0x78 /* Bits 6:3 contain the type */
1429#define ACPI_RESOURCE_NAME_SMALL_LENGTH_MASK 0x07 /* Bits 2:0 contain the length */
1430#define ACPI_RESOURCE_NAME_LARGE_MASK 0x7F /* Bits 6:0 contain the type */
1431
1432
1433/*
1434 * Small resource descriptor "names" as defined by the ACPI specification.
1435 * Note: Bits 2:0 are used for the descriptor length
1436 */
1437#define ACPI_RESOURCE_NAME_IRQ 0x20
1438#define ACPI_RESOURCE_NAME_DMA 0x28
1439#define ACPI_RESOURCE_NAME_START_DEPENDENT 0x30
1440#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
1441#define ACPI_RESOURCE_NAME_IO 0x40
1442#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
1443#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
1444#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
1445#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
1446#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
1447#define ACPI_RESOURCE_NAME_VENDOR_SMALL 0x70
1448#define ACPI_RESOURCE_NAME_END_TAG 0x78
1449
1450/*
1451 * Large resource descriptor "names" as defined by the ACPI specification.
1452 * Note: includes the Large Descriptor bit in bit[7]
1453 */
1454#define ACPI_RESOURCE_NAME_MEMORY24 0x81
1455#define ACPI_RESOURCE_NAME_GENERIC_REGISTER 0x82
1456#define ACPI_RESOURCE_NAME_RESERVED_L1 0x83
1457#define ACPI_RESOURCE_NAME_VENDOR_LARGE 0x84
1458#define ACPI_RESOURCE_NAME_MEMORY32 0x85
1459#define ACPI_RESOURCE_NAME_FIXED_MEMORY32 0x86
1460#define ACPI_RESOURCE_NAME_ADDRESS32 0x87
1461#define ACPI_RESOURCE_NAME_ADDRESS16 0x88
1462#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
1463#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
1464#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
1465#define ACPI_RESOURCE_NAME_GPIO 0x8C
1466#define ACPI_RESOURCE_NAME_PIN_FUNCTION 0x8D
1467#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
1468#define ACPI_RESOURCE_NAME_PIN_CONFIG 0x8F
1469#define ACPI_RESOURCE_NAME_PIN_GROUP 0x90
1470#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91
1471#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92
1472#define ACPI_RESOURCE_NAME_CLOCK_INPUT 0x93
1473#define ACPI_RESOURCE_NAME_LARGE_MAX 0x94
1474
1475
1476/*****************************************************************************
1477 *
1478 * Miscellaneous
1479 *
1480 ****************************************************************************/
1481
1482#define ACPI_ASCII_ZERO 0x30
1483
1484
1485/*****************************************************************************
1486 *
1487 * Disassembler
1488 *
1489 ****************************************************************************/
1490
1492{
1493 char *Path;
1494 char *InternalPath;
1495 struct acpi_external_list *Next;
1496 UINT32 Value;
1497 UINT16 Length;
1498 UINT16 Flags;
1499 UINT8 Type;
1500
1502
1503/* Values for Flags field above */
1504
1505#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
1506#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
1507#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
1508#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
1509#define ACPI_EXT_ORIGIN_FROM_OPCODE 0x10 /* External came from a External() opcode */
1510#define ACPI_EXT_CONFLICTING_DECLARATION 0x20 /* External has a conflicting declaration within AML */
1511
1512
1514{
1515 char *Path;
1516 struct acpi_external_file *Next;
1517
1519
1520
1522{
1524 struct acpi_parse_object_list *Next;
1525
1527
1528/*****************************************************************************
1529 *
1530 * Debugger
1531 *
1532 ****************************************************************************/
1533
1535{
1536 ACPI_HANDLE Method;
1537 ACPI_HANDLE MainThreadGate;
1538 ACPI_HANDLE ThreadCompleteGate;
1539 ACPI_HANDLE InfoGate;
1540 ACPI_THREAD_ID *Threads;
1541 UINT32 NumThreads;
1542 UINT32 NumCreated;
1543 UINT32 NumCompleted;
1544
1545 char *Name;
1546 UINT32 Flags;
1547 UINT32 NumLoops;
1548 char Pathname[ACPI_DB_LINE_BUFFER_SIZE];
1549 char **Args;
1550 ACPI_OBJECT_TYPE *Types;
1551
1552 /*
1553 * Arguments to be passed to method for the commands Threads and
1554 * Background. Note, ACPI specifies a maximum of 7 arguments (0 - 6).
1555 *
1556 * For the Threads command, the Number of threads, ID of current
1557 * thread and Index of current thread inside all them created.
1558 */
1559 char InitArgs;
1560#ifdef ACPI_DEBUGGER
1561 ACPI_OBJECT_TYPE ArgTypes[ACPI_METHOD_NUM_ARGS];
1562#endif
1563 char *Arguments[ACPI_METHOD_NUM_ARGS];
1564 char NumThreadsStr[11];
1565 char IdOfThreadStr[11];
1566 char IndexOfThreadStr[11];
1567
1569
1571{
1572 UINT32 Nodes;
1573 UINT32 Objects;
1574
1576
1577
1578#define ACPI_DB_DISABLE_OUTPUT 0x00
1579#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
1580#define ACPI_DB_CONSOLE_OUTPUT 0x02
1581#define ACPI_DB_DUPLICATE_OUTPUT 0x03
1582
1583
1584typedef struct acpi_object_info
1585{
1586 UINT32 Types[ACPI_TOTAL_TYPES];
1587
1589
1590
1591/*****************************************************************************
1592 *
1593 * Debug
1594 *
1595 ****************************************************************************/
1596
1597/* Entry for a memory allocation (debug only) */
1598
1599#define ACPI_MEM_MALLOC 0
1600#define ACPI_MEM_CALLOC 1
1601#define ACPI_MAX_MODULE_NAME 16
1602
1603#define ACPI_COMMON_DEBUG_MEM_HEADER \
1604 struct acpi_debug_mem_block *Previous; \
1605 struct acpi_debug_mem_block *Next; \
1606 UINT32 Size; \
1607 UINT32 Component; \
1608 UINT32 Line; \
1609 char Module[ACPI_MAX_MODULE_NAME]; \
1610 UINT8 AllocType;
1611
1613{
1614 ACPI_COMMON_DEBUG_MEM_HEADER
1615
1617
1619{
1620 ACPI_COMMON_DEBUG_MEM_HEADER
1621 UINT64 UserSpace;
1622
1624
1625
1626#define ACPI_MEM_LIST_GLOBAL 0
1627#define ACPI_MEM_LIST_NSNODE 1
1628#define ACPI_MEM_LIST_MAX 1
1629#define ACPI_NUM_MEM_LISTS 2
1630
1631
1632/*****************************************************************************
1633 *
1634 * Info/help support
1635 *
1636 ****************************************************************************/
1637
1639{
1640 char *Name;
1641 char *Description;
1642#ifndef ACPI_ASL_COMPILER
1643 char *Action;
1644#endif
1645
1647
1648typedef struct ah_device_id
1649{
1650 char *Name;
1651 char *Description;
1652
1653} AH_DEVICE_ID;
1654
1655typedef struct ah_uuid
1656{
1657 char *Description;
1658 char *String;
1659
1660} AH_UUID;
1661
1662typedef struct ah_table
1663{
1664 char *Signature;
1665 char *Description;
1666
1667} AH_TABLE;
1668
1669#endif /* __ACLOCAL_H__ */
Test context for spec:/rtems/barrier/req/create test case.
Definition: tc-barrier-create.c:144
Definition: xnandpsu_onfi.h:185
Definition: aclocal.h:971
Definition: aclocal.h:1268
Definition: aclocal.h:1116
Definition: aclocal.h:1108
Definition: aclocal.h:809
Definition: aclocal.h:846
Definition: aclocal.h:411
Definition: aclocal.h:1535
Definition: aclocal.h:1619
Definition: aclocal.h:1613
Definition: aclocal.h:1514
Definition: aclocal.h:1492
Definition: aclocal.h:769
Definition: aclocal.h:1126
Definition: aclocal.h:372
Definition: aclocal.h:751
Definition: aclocal.h:758
Definition: aclocal.h:779
Definition: actbl.h:240
Definition: aclocal.h:920
Definition: aclocal.h:696
Definition: aclocal.h:734
Definition: aclocal.h:667
Definition: aclocal.h:632
Definition: aclocal.h:644
Definition: aclocal.h:680
Definition: aclocal.h:724
Definition: aclocal.h:715
Definition: aclocal.h:1571
Definition: aclocal.h:1385
Definition: aclocal.h:240
Definition: aclocal.h:482
Definition: aclocal.h:294
Definition: aclocal.h:396
Definition: aclocal.h:359
Definition: aclocal.h:931
Definition: aclocal.h:381
Definition: aclocal.h:1585
Definition: aclocal.h:990
Definition: aclocal.h:519
Definition: aclocal.h:530
Definition: aclocal.h:540
Definition: aclocal.h:506
Definition: aclocal.h:1168
Definition: aclocal.h:1143
Definition: aclocal.h:1153
Definition: aclocal.h:1522
Definition: aclocal.h:1223
Definition: aclocal.h:829
Definition: aclocal.h:1400
Definition: aclocal.h:869
Definition: aclocal.h:605
Definition: aclocal.h:900
Definition: aclocal.h:206
Definition: aclocal.h:622
Definition: aclocal.h:861
Definition: aclocal.h:573
Definition: actbl.h:510
Definition: actbl.h:215
Definition: aclocal.h:341
Definition: aclocal.h:1006
Definition: aclocal.h:885
Definition: aclocal.h:818
Definition: acstruct.h:182
Definition: aclocal.h:1649
Definition: aclocal.h:1639
Definition: aclocal.h:1663
Definition: aclocal.h:1656
Definition: aclocal.h:1208
Definition: aclocal.h:944
Definition: aclocal.h:655
Definition: actbl.h:500
Definition: acobject.h:626
Definition: aclocal.h:1200
Definition: aclocal.h:1015
Definition: aclocal.h:551