actypes.h revision 99146
11844Swollman/******************************************************************************
250476Speter *
323549Swosch * Name: actypes.h - Common data types for the entire ACPI subsystem
423549Swosch *       $Revision: 227 $
535784Swosch *
623549Swosch *****************************************************************************/
723549Swosch
823549Swosch/******************************************************************************
923549Swosch *
1023549Swosch * 1. Copyright Notice
1123549Swosch *
1223549Swosch * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
1323549Swosch * All rights reserved.
1423549Swosch *
1595327Sobrien * 2. License
1623549Swosch *
1723549Swosch * 2.1. This is your license from Intel Corp. under its intellectual property
1823549Swosch * rights.  You may have additional license terms from the party that provided
1923549Swosch * you this software, covering your right to use that party's intellectual
2023549Swosch * property rights.
2123549Swosch *
2223549Swosch * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2323549Swosch * copy of the source code appearing in this file ("Covered Code") an
2423549Swosch * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2523549Swosch * base code distributed originally by Intel ("Original Intel Code") to copy,
2623549Swosch * make derivatives, distribute, use and display any portion of the Covered
2795509Sru * Code in any form, with the right to sublicense such rights; and
2896164Sru *
2944922Sbde * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3023549Swosch * license (with the right to sublicense), under only those claims of Intel
311638Srgrimes * patents that are infringed by the Original Intel Code, to make, use, sell,
3294940Sru * offer to sell, and import the Covered Code and derivative works thereof
3323549Swosch * solely to the minimum extent necessary to exercise the above copyright
3495306Sru * license, and in no event shall the patent license extend to any additions
3595306Sru * to or modifications of the Original Intel Code.  No other license or right
3690311Sru * is granted directly or by implication, estoppel or otherwise;
3795306Sru *
3890311Sru * The above copyright and patent license is granted only if the following
3990311Sru * conditions are met:
4090311Sru *
4190311Sru * 3. Conditions
4290311Sru *
4390311Sru * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4490311Sru * Redistribution of source code of any substantial portion of the Covered
4590311Sru * Code or modification with rights to further distribute source must include
4690311Sru * the above Copyright Notice, the above License, this list of Conditions,
4795306Sru * and the following Disclaimer and Export Compliance provision.  In addition,
481638Srgrimes * Licensee must cause all Covered Code to which Licensee contributes to
4995306Sru * contain a file documenting the changes Licensee made to create that Covered
501638Srgrimes * Code and the date of any change.  Licensee must include in that file the
511638Srgrimes * documentation of any changes made by any predecessor Licensee.  Licensee
5253152Smarcel * must include a prominent statement that the modification is derived,
5353152Smarcel * directly or indirectly, from Original Intel Code.
541638Srgrimes *
551638Srgrimes * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
561638Srgrimes * Redistribution of source code of any substantial portion of the Covered
571638Srgrimes * Code or modification without rights to further distribute source must
581638Srgrimes * include the following Disclaimer and Export Compliance provision in the
591638Srgrimes * documentation and/or other materials provided with distribution.  In
6095509Sru * addition, Licensee may not authorize further sublicense of source of any
6196668Sru * portion of the Covered Code, and must include terms to the effect that the
6295356Sru * license from Licensee to its licensee is limited to the intellectual
6395306Sru * property embodied in the software Licensee provides to its licensee, and
6415061Swosch * not to intellectual property embodied in modifications its licensee may
651638Srgrimes * make.
6696668Sru *
6796668Sru * 3.3. Redistribution of Executable. Redistribution in executable form of any
6896668Sru * substantial portion of the Covered Code or modification must reproduce the
6996668Sru * above Copyright Notice, and the following Disclaimer and Export Compliance
7096668Sru * provision in the documentation and/or other materials provided with the
7196668Sru * distribution.
7296668Sru *
7396668Sru * 3.4. Intel retains all right, title, and interest in and to the Original
7496668Sru * Intel Code.
7596668Sru *
7696668Sru * 3.5. Neither the name Intel nor any other trademark owned or controlled by
771638Srgrimes * Intel shall be used in advertising or otherwise to promote the sale, use or
781638Srgrimes * other dealings in products derived from or relating to the Covered Code
791638Srgrimes * without prior written authorization from Intel.
801638Srgrimes *
811638Srgrimes * 4. Disclaimer and Export Compliance
821638Srgrimes *
831638Srgrimes * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
841638Srgrimes * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
851638Srgrimes * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8695306Sru * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
871638Srgrimes * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
90 *
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
99 *
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government.  In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
114 *
115 *****************************************************************************/
116
117#ifndef __ACTYPES_H__
118#define __ACTYPES_H__
119
120/*! [Begin] no source code translation (keep the typedefs) */
121
122/*
123 * Data types - Fixed across all compilation models
124 *
125 * BOOLEAN      Logical Boolean.
126 *              1 byte value containing a 0 for FALSE or a 1 for TRUE.
127 *              Other values are undefined.
128 *
129 * INT8         8-bit  (1 byte) signed value
130 * UINT8        8-bit  (1 byte) unsigned value
131 * INT16        16-bit (2 byte) signed value
132 * UINT16       16-bit (2 byte) unsigned value
133 * INT32        32-bit (4 byte) signed value
134 * UINT32       32-bit (4 byte) unsigned value
135 * INT64        64-bit (8 byte) signed value
136 * UINT64       64-bit (8 byte) unsigned value
137 * NATIVE_INT   32-bit on IA-32, 64-bit on IA-64 signed value
138 * NATIVE_UINT  32-bit on IA-32, 64-bit on IA-64 unsigned value
139 */
140
141
142#ifdef _IA64
143/*
144 * 64-bit type definitions
145 */
146typedef unsigned char                   UINT8;
147typedef unsigned char                   BOOLEAN;
148typedef unsigned short                  UINT16;
149typedef int                             INT32;
150typedef unsigned int                    UINT32;
151typedef COMPILER_DEPENDENT_INT64        INT64;
152typedef COMPILER_DEPENDENT_UINT64       UINT64;
153
154typedef UINT64                          NATIVE_UINT;
155typedef UINT64                          NATIVE_INT;
156
157typedef UINT64                          ACPI_TBLPTR;
158typedef UINT64                          ACPI_IO_ADDRESS;
159typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
160typedef UINT64                          ACPI_SIZE;
161
162#define ALIGNED_ADDRESS_BOUNDARY        0x00000008      /* No hardware alignment support in IA64 */
163#define ACPI_USE_NATIVE_DIVIDE                          /* Native 64-bit integer support */
164#define ACPI_MAX_PTR                    0xFFFFFFFFFFFFFFFF
165
166
167#elif _IA16
168/*
169 * 16-bit type definitions
170 */
171typedef unsigned char                   UINT8;
172typedef unsigned char                   BOOLEAN;
173typedef unsigned int                    UINT16;
174typedef long                            INT32;
175typedef int                             INT16;
176typedef unsigned long                   UINT32;
177
178typedef struct
179{
180    UINT32                                  Lo;
181    UINT32                                  Hi;
182
183} UINT64;
184
185typedef UINT16                          NATIVE_UINT;
186typedef INT16                           NATIVE_INT;
187
188typedef UINT32                          ACPI_TBLPTR;
189typedef UINT32                          ACPI_IO_ADDRESS;
190typedef char                            *ACPI_PHYSICAL_ADDRESS;
191typedef UINT32                          ACPI_SIZE;
192
193#define ALIGNED_ADDRESS_BOUNDARY        0x00000002
194#define _HW_ALIGNMENT_SUPPORT
195#define ACPI_USE_NATIVE_DIVIDE                          /* No 64-bit integers, ok to use native divide */
196#define ACPI_MAX_PTR                    0xFFFF
197
198/*
199 * (16-bit only) internal integers must be 32-bits, so
200 * 64-bit integers cannot be supported
201 */
202#define ACPI_NO_INTEGER64_SUPPORT
203
204
205#else
206/*
207 * 32-bit type definitions (default)
208 */
209typedef unsigned char                   UINT8;
210typedef unsigned char                   BOOLEAN;
211typedef unsigned short                  UINT16;
212typedef int                             INT32;
213typedef unsigned int                    UINT32;
214typedef COMPILER_DEPENDENT_INT64        INT64;
215typedef COMPILER_DEPENDENT_UINT64       UINT64;
216
217typedef UINT32                          NATIVE_UINT;
218typedef INT32                           NATIVE_INT;
219
220typedef UINT64                          ACPI_TBLPTR;
221typedef UINT32                          ACPI_IO_ADDRESS;
222typedef UINT64                          ACPI_PHYSICAL_ADDRESS;
223typedef UINT32                          ACPI_SIZE;
224
225#define ALIGNED_ADDRESS_BOUNDARY        0x00000004
226#define _HW_ALIGNMENT_SUPPORT
227#define ACPI_MAX_PTR                    0xFFFFFFFF
228#endif
229
230
231
232/*
233 * Miscellaneous common types
234 */
235
236typedef UINT32                          UINT32_BIT;
237typedef NATIVE_UINT                     ACPI_PTRDIFF;
238typedef char                            NATIVE_CHAR;
239
240
241/*
242 * Data type ranges
243 */
244#define ACPI_UINT8_MAX                  (UINT8)  0xFF
245#define ACPI_UINT16_MAX                 (UINT16) 0xFFFF
246#define ACPI_UINT32_MAX                 (UINT32) 0xFFFFFFFF
247#define ACPI_UINT64_MAX                 (UINT64) 0xFFFFFFFFFFFFFFFF
248#define ACPI_ASCII_MAX                  0x7F
249
250
251#ifdef DEFINE_ALTERNATE_TYPES
252/*
253 * Types used only in translated source, defined here to enable
254 * cross-platform compilation only.
255 */
256typedef INT32                           s32;
257typedef UINT8                           u8;
258typedef UINT16                          u16;
259typedef UINT32                          u32;
260typedef UINT64                          u64;
261#endif
262/*! [End] no source code translation !*/
263
264
265/*
266 * Pointer overlays to avoid lots of typecasting for
267 * code that accepts both physical and logical pointers.
268 */
269typedef union AcpiPointers
270{
271    ACPI_PHYSICAL_ADDRESS       Physical;
272    void                        *Logical;
273    ACPI_TBLPTR                 Value;
274
275} ACPI_POINTERS;
276
277typedef struct AcpiPointer
278{
279    UINT32                      PointerType;
280    ACPI_POINTERS               Pointer;
281
282} ACPI_POINTER;
283
284/* PointerTypes for above */
285
286#define ACPI_LOGICAL_POINTER            0x01
287#define ACPI_PHYSICAL_POINTER           0x02
288
289
290/*
291 * Useful defines
292 */
293
294#ifdef FALSE
295#undef FALSE
296#endif
297#define FALSE                           (1 == 0)
298
299#ifdef TRUE
300#undef TRUE
301#endif
302#define TRUE                            (1 == 1)
303
304#ifndef NULL
305#define NULL                            (void *) 0
306#endif
307
308
309/*
310 * Local datatypes
311 */
312
313typedef UINT32                          ACPI_STATUS;    /* All ACPI Exceptions */
314typedef UINT32                          ACPI_NAME;      /* 4-byte ACPI name */
315typedef char*                           ACPI_STRING;    /* Null terminated ASCII string */
316typedef void*                           ACPI_HANDLE;    /* Actually a ptr to an Node */
317
318typedef struct
319{
320    UINT32                      Lo;
321    UINT32                      Hi;
322
323} UINT64_STRUCT;
324
325typedef union
326{
327    UINT64                      Full;
328    UINT64_STRUCT               Part;
329
330} UINT64_OVERLAY;
331
332
333/*
334 * Acpi integer width. In ACPI version 1, integers are
335 * 32 bits.  In ACPI version 2, integers are 64 bits.
336 * Note that this pertains to the ACPI integer type only, not
337 * other integers used in the implementation of the ACPI CA
338 * subsystem.
339 */
340#ifdef ACPI_NO_INTEGER64_SUPPORT
341
342/* 32-bit integers only, no 64-bit support */
343
344typedef UINT32                          ACPI_INTEGER;
345#define ACPI_INTEGER_MAX                ACPI_UINT32_MAX
346#define ACPI_INTEGER_BIT_SIZE           32
347#define ACPI_MAX_BCD_VALUE              99999999
348#define ACPI_MAX_BCD_DIGITS             8
349#define ACPI_MAX_DECIMAL_DIGITS         10
350
351#define ACPI_USE_NATIVE_DIVIDE          /* Use compiler native 32-bit divide */
352
353
354#else
355
356/* 64-bit integers */
357
358typedef UINT64                          ACPI_INTEGER;
359#define ACPI_INTEGER_MAX                ACPI_UINT64_MAX
360#define ACPI_INTEGER_BIT_SIZE           64
361#define ACPI_MAX_BCD_VALUE              9999999999999999
362#define ACPI_MAX_BCD_DIGITS             16
363#define ACPI_MAX_DECIMAL_DIGITS         19
364
365#ifdef _IA64
366#define ACPI_USE_NATIVE_DIVIDE          /* Use compiler native 64-bit divide */
367#endif
368#endif
369
370
371/*
372 * Constants with special meanings
373 */
374
375#define ACPI_ROOT_OBJECT                (ACPI_HANDLE) ACPI_PTR_ADD (char, NULL, ACPI_UINT32_MAX)
376
377
378/*
379 * Initialization sequence
380 */
381#define ACPI_FULL_INITIALIZATION        0x00
382#define ACPI_NO_ADDRESS_SPACE_INIT      0x01
383#define ACPI_NO_HARDWARE_INIT           0x02
384#define ACPI_NO_EVENT_INIT              0x04
385#define ACPI_NO_HANDLER_INIT            0x08
386#define ACPI_NO_ACPI_ENABLE             0x10
387#define ACPI_NO_DEVICE_INIT             0x20
388#define ACPI_NO_OBJECT_INIT             0x40
389
390/*
391 * Initialization state
392 */
393#define ACPI_INITIALIZED_OK             0x01
394
395/*
396 * Power state values
397 */
398
399#define ACPI_STATE_UNKNOWN              (UINT8) 0xFF
400
401#define ACPI_STATE_S0                   (UINT8) 0
402#define ACPI_STATE_S1                   (UINT8) 1
403#define ACPI_STATE_S2                   (UINT8) 2
404#define ACPI_STATE_S3                   (UINT8) 3
405#define ACPI_STATE_S4                   (UINT8) 4
406#define ACPI_STATE_S5                   (UINT8) 5
407#define ACPI_S_STATES_MAX               ACPI_STATE_S5
408#define ACPI_S_STATE_COUNT              6
409
410#define ACPI_STATE_D0                   (UINT8) 0
411#define ACPI_STATE_D1                   (UINT8) 1
412#define ACPI_STATE_D2                   (UINT8) 2
413#define ACPI_STATE_D3                   (UINT8) 3
414#define ACPI_D_STATES_MAX               ACPI_STATE_D3
415#define ACPI_D_STATE_COUNT              4
416
417#define ACPI_STATE_C0                   (UINT8) 0
418#define ACPI_STATE_C1                   (UINT8) 1
419#define ACPI_STATE_C2                   (UINT8) 2
420#define ACPI_STATE_C3                   (UINT8) 3
421#define ACPI_C_STATES_MAX               ACPI_STATE_C3
422#define ACPI_C_STATE_COUNT              4
423
424/*
425 * Sleep type invalid value
426 */
427#define ACPI_SLEEP_TYPE_MAX             0x7
428#define ACPI_SLEEP_TYPE_INVALID         0xFF
429
430/*
431 * Standard notify values
432 */
433#define ACPI_NOTIFY_BUS_CHECK           (UINT8) 0
434#define ACPI_NOTIFY_DEVICE_CHECK        (UINT8) 1
435#define ACPI_NOTIFY_DEVICE_WAKE         (UINT8) 2
436#define ACPI_NOTIFY_EJECT_REQUEST       (UINT8) 3
437#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT  (UINT8) 4
438#define ACPI_NOTIFY_FREQUENCY_MISMATCH  (UINT8) 5
439#define ACPI_NOTIFY_BUS_MODE_MISMATCH   (UINT8) 6
440#define ACPI_NOTIFY_POWER_FAULT         (UINT8) 7
441
442
443/*
444 *  Table types.  These values are passed to the table related APIs
445 */
446
447typedef UINT32                          ACPI_TABLE_TYPE;
448
449#define ACPI_TABLE_RSDP                 (ACPI_TABLE_TYPE) 0
450#define ACPI_TABLE_DSDT                 (ACPI_TABLE_TYPE) 1
451#define ACPI_TABLE_FADT                 (ACPI_TABLE_TYPE) 2
452#define ACPI_TABLE_FACS                 (ACPI_TABLE_TYPE) 3
453#define ACPI_TABLE_PSDT                 (ACPI_TABLE_TYPE) 4
454#define ACPI_TABLE_SSDT                 (ACPI_TABLE_TYPE) 5
455#define ACPI_TABLE_XSDT                 (ACPI_TABLE_TYPE) 6
456#define ACPI_TABLE_MAX                  6
457#define NUM_ACPI_TABLES                 (ACPI_TABLE_MAX+1)
458
459
460/*
461 * Types associated with names.  The first group of
462 * values correspond to the definition of the ACPI
463 * ObjectType operator (See the ACPI Spec).  Therefore,
464 * only add to the first group if the spec changes.
465 *
466 * Types must be kept in sync with the AcpiNsProperties
467 * and AcpiNsTypeNames arrays
468 */
469
470typedef UINT32                          ACPI_OBJECT_TYPE;
471
472#define ACPI_TYPE_ANY                   0x00
473#define ACPI_TYPE_INTEGER               0x01  /* Byte/Word/Dword/Zero/One/Ones */
474#define ACPI_TYPE_STRING                0x02
475#define ACPI_TYPE_BUFFER                0x03
476#define ACPI_TYPE_PACKAGE               0x04  /* ByteConst, multiple DataTerm/Constant/SuperName */
477#define ACPI_TYPE_FIELD_UNIT            0x05
478#define ACPI_TYPE_DEVICE                0x06  /* Name, multiple Node */
479#define ACPI_TYPE_EVENT                 0x07
480#define ACPI_TYPE_METHOD                0x08  /* Name, ByteConst, multiple Code */
481#define ACPI_TYPE_MUTEX                 0x09
482#define ACPI_TYPE_REGION                0x0A
483#define ACPI_TYPE_POWER                 0x0B  /* Name,ByteConst,WordConst,multi Node */
484#define ACPI_TYPE_PROCESSOR             0x0C  /* Name,ByteConst,DWordConst,ByteConst,multi NmO */
485#define ACPI_TYPE_THERMAL               0x0D  /* Name, multiple Node */
486#define ACPI_TYPE_BUFFER_FIELD          0x0E
487#define ACPI_TYPE_DDB_HANDLE            0x0F
488#define ACPI_TYPE_DEBUG_OBJECT          0x10
489
490#define ACPI_TYPE_MAX                   0x10
491
492/*
493 * This section contains object types that do not relate to the ACPI ObjectType operator.
494 * They are used for various internal purposes only.  If new predefined ACPI_TYPEs are
495 * added (via the ACPI specification), these internal types must move upwards.
496 * Also, values exceeding the largest official ACPI ObjectType must not overlap with
497 * defined AML opcodes.
498 */
499#define INTERNAL_TYPE_BEGIN             0x11
500
501#define INTERNAL_TYPE_REGION_FIELD      0x11
502#define INTERNAL_TYPE_BANK_FIELD        0x12
503#define INTERNAL_TYPE_INDEX_FIELD       0x13
504#define INTERNAL_TYPE_REFERENCE         0x14  /* Arg#, Local#, Name, Debug; used only in descriptors */
505#define INTERNAL_TYPE_ALIAS             0x15
506#define INTERNAL_TYPE_NOTIFY            0x16
507#define INTERNAL_TYPE_ADDRESS_HANDLER   0x17
508#define INTERNAL_TYPE_RESOURCE          0x18
509#define INTERNAL_TYPE_RESOURCE_FIELD    0x19
510
511
512#define INTERNAL_TYPE_NODE_MAX          0x19
513
514/* These are pseudo-types because there are never any namespace nodes with these types */
515
516#define INTERNAL_TYPE_FIELD_DEFN        0x1A  /* Name, ByteConst, multiple FieldElement */
517#define INTERNAL_TYPE_BANK_FIELD_DEFN   0x1B  /* 2 Name,DWordConst,ByteConst,multi FieldElement */
518#define INTERNAL_TYPE_INDEX_FIELD_DEFN  0x1C  /* 2 Name, ByteConst, multiple FieldElement */
519#define INTERNAL_TYPE_IF                0x1D
520#define INTERNAL_TYPE_ELSE              0x1E
521#define INTERNAL_TYPE_WHILE             0x1F
522#define INTERNAL_TYPE_SCOPE             0x20  /* Name, multiple Node */
523#define INTERNAL_TYPE_DEF_ANY           0x21  /* type is Any, suppress search of enclosing scopes */
524#define INTERNAL_TYPE_EXTRA             0x22
525#define INTERNAL_TYPE_DATA              0x23
526
527#define INTERNAL_TYPE_MAX               0x23
528
529#define INTERNAL_TYPE_INVALID           0x24
530#define ACPI_TYPE_NOT_FOUND             0xFF
531
532
533/*
534 * Bitmapped ACPI types
535 * Used internally only
536 */
537#define ACPI_BTYPE_ANY                  0x00000000
538#define ACPI_BTYPE_INTEGER              0x00000001
539#define ACPI_BTYPE_STRING               0x00000002
540#define ACPI_BTYPE_BUFFER               0x00000004
541#define ACPI_BTYPE_PACKAGE              0x00000008
542#define ACPI_BTYPE_FIELD_UNIT           0x00000010
543#define ACPI_BTYPE_DEVICE               0x00000020
544#define ACPI_BTYPE_EVENT                0x00000040
545#define ACPI_BTYPE_METHOD               0x00000080
546#define ACPI_BTYPE_MUTEX                0x00000100
547#define ACPI_BTYPE_REGION               0x00000200
548#define ACPI_BTYPE_POWER                0x00000400
549#define ACPI_BTYPE_PROCESSOR            0x00000800
550#define ACPI_BTYPE_THERMAL              0x00001000
551#define ACPI_BTYPE_BUFFER_FIELD         0x00002000
552#define ACPI_BTYPE_DDB_HANDLE           0x00004000
553#define ACPI_BTYPE_DEBUG_OBJECT         0x00008000
554#define ACPI_BTYPE_REFERENCE            0x00010000
555#define ACPI_BTYPE_RESOURCE             0x00020000
556
557#define ACPI_BTYPE_COMPUTE_DATA         (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
558
559#define ACPI_BTYPE_DATA                 (ACPI_BTYPE_COMPUTE_DATA  | ACPI_BTYPE_PACKAGE)
560#define ACPI_BTYPE_DATA_REFERENCE       (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
561#define ACPI_BTYPE_DEVICE_OBJECTS       (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
562#define ACPI_BTYPE_OBJECTS_AND_REFS     0x0001FFFF  /* ARG or LOCAL */
563#define ACPI_BTYPE_ALL_OBJECTS          0x0000FFFF
564
565/*
566 * All I/O
567 */
568#define ACPI_READ                       0
569#define ACPI_WRITE                      1
570
571
572/*
573 * AcpiEvent Types: Fixed & General Purpose
574 */
575
576typedef UINT32                          ACPI_EVENT_TYPE;
577
578#define ACPI_EVENT_FIXED                0
579#define ACPI_EVENT_GPE                  1
580
581/*
582 * Fixed events
583 */
584
585#define ACPI_EVENT_PMTIMER              0
586#define ACPI_EVENT_GLOBAL               1
587#define ACPI_EVENT_POWER_BUTTON         2
588#define ACPI_EVENT_SLEEP_BUTTON         3
589#define ACPI_EVENT_RTC                  4
590#define ACPI_EVENT_MAX                  4
591#define ACPI_NUM_FIXED_EVENTS           ACPI_EVENT_MAX + 1
592
593#define ACPI_GPE_INVALID                0xFF
594#define ACPI_GPE_MAX                    0xFF
595#define ACPI_NUM_GPE                    256
596
597#define ACPI_EVENT_LEVEL_TRIGGERED      1
598#define ACPI_EVENT_EDGE_TRIGGERED       2
599
600/*
601 * GPEs
602 */
603
604#define ACPI_EVENT_WAKE_ENABLE          0x1
605
606#define ACPI_EVENT_WAKE_DISABLE         0x1
607
608
609/*
610 * AcpiEvent Status:
611 * -------------
612 * The encoding of ACPI_EVENT_STATUS is illustrated below.
613 * Note that a set bit (1) indicates the property is TRUE
614 * (e.g. if bit 0 is set then the event is enabled).
615 * +-------------+-+-+-+
616 * |   Bits 31:3 |2|1|0|
617 * +-------------+-+-+-+
618 *          |     | | |
619 *          |     | | +- Enabled?
620 *          |     | +--- Enabled for wake?
621 *          |     +----- Set?
622 *          +----------- <Reserved>
623 */
624typedef UINT32                          ACPI_EVENT_STATUS;
625
626#define ACPI_EVENT_FLAG_DISABLED        (ACPI_EVENT_STATUS) 0x00
627#define ACPI_EVENT_FLAG_ENABLED         (ACPI_EVENT_STATUS) 0x01
628#define ACPI_EVENT_FLAG_WAKE_ENABLED    (ACPI_EVENT_STATUS) 0x02
629#define ACPI_EVENT_FLAG_SET             (ACPI_EVENT_STATUS) 0x04
630
631
632/* Notify types */
633
634#define ACPI_SYSTEM_NOTIFY              0
635#define ACPI_DEVICE_NOTIFY              1
636#define ACPI_MAX_NOTIFY_HANDLER_TYPE    1
637
638#define ACPI_MAX_SYS_NOTIFY                  0x7f
639
640
641/* Address Space (Operation Region) Types */
642
643typedef UINT8                           ACPI_ADR_SPACE_TYPE;
644
645#define ACPI_ADR_SPACE_SYSTEM_MEMORY    (ACPI_ADR_SPACE_TYPE) 0
646#define ACPI_ADR_SPACE_SYSTEM_IO        (ACPI_ADR_SPACE_TYPE) 1
647#define ACPI_ADR_SPACE_PCI_CONFIG       (ACPI_ADR_SPACE_TYPE) 2
648#define ACPI_ADR_SPACE_EC               (ACPI_ADR_SPACE_TYPE) 3
649#define ACPI_ADR_SPACE_SMBUS            (ACPI_ADR_SPACE_TYPE) 4
650#define ACPI_ADR_SPACE_CMOS             (ACPI_ADR_SPACE_TYPE) 5
651#define ACPI_ADR_SPACE_PCI_BAR_TARGET   (ACPI_ADR_SPACE_TYPE) 6
652#define ACPI_ADR_SPACE_DATA_TABLE       (ACPI_ADR_SPACE_TYPE) 7
653
654
655/*
656 * External ACPI object definition
657 */
658
659typedef union AcpiObj
660{
661    ACPI_OBJECT_TYPE            Type;   /* See definition of AcpiNsType for values */
662    struct
663    {
664        ACPI_OBJECT_TYPE            Type;
665        ACPI_INTEGER                Value;      /* The actual number */
666    } Integer;
667
668    struct
669    {
670        ACPI_OBJECT_TYPE            Type;
671        UINT32                      Length;     /* # of bytes in string, excluding trailing null */
672        NATIVE_CHAR                 *Pointer;   /* points to the string value */
673    } String;
674
675    struct
676    {
677        ACPI_OBJECT_TYPE            Type;
678        UINT32                      Length;     /* # of bytes in buffer */
679        UINT8                       *Pointer;   /* points to the buffer */
680    } Buffer;
681
682    struct
683    {
684        ACPI_OBJECT_TYPE            Type;
685        UINT32                      Fill1;
686        ACPI_HANDLE                 Handle;     /* object reference */
687    } Reference;
688
689    struct
690    {
691        ACPI_OBJECT_TYPE            Type;
692        UINT32                      Count;      /* # of elements in package */
693        union AcpiObj               *Elements;  /* Pointer to an array of ACPI_OBJECTs */
694    } Package;
695
696    struct
697    {
698        ACPI_OBJECT_TYPE            Type;
699        UINT32                      ProcId;
700        ACPI_IO_ADDRESS             PblkAddress;
701        UINT32                      PblkLength;
702    } Processor;
703
704    struct
705    {
706        ACPI_OBJECT_TYPE            Type;
707        UINT32                      SystemLevel;
708        UINT32                      ResourceOrder;
709    } PowerResource;
710
711} ACPI_OBJECT;
712
713
714/*
715 * List of objects, used as a parameter list for control method evaluation
716 */
717
718typedef struct AcpiObjList
719{
720    UINT32                      Count;
721    ACPI_OBJECT                 *Pointer;
722
723} ACPI_OBJECT_LIST;
724
725
726/*
727 * Miscellaneous common Data Structures used by the interfaces
728 */
729
730#define ACPI_NO_BUFFER              0
731#define ACPI_ALLOCATE_BUFFER        (ACPI_SIZE) (-1)
732#define ACPI_ALLOCATE_LOCAL_BUFFER  (ACPI_SIZE) (-2)
733
734typedef struct
735{
736    ACPI_SIZE                   Length;         /* Length in bytes of the buffer */
737    void                        *Pointer;       /* pointer to buffer */
738
739} ACPI_BUFFER;
740
741
742/*
743 * NameType for AcpiGetName
744 */
745
746#define ACPI_FULL_PATHNAME              0
747#define ACPI_SINGLE_NAME                1
748#define ACPI_NAME_TYPE_MAX              1
749
750
751/*
752 * Structure and flags for AcpiGetSystemInfo
753 */
754
755#define ACPI_SYS_MODE_UNKNOWN           0x0000
756#define ACPI_SYS_MODE_ACPI              0x0001
757#define ACPI_SYS_MODE_LEGACY            0x0002
758#define ACPI_SYS_MODES_MASK             0x0003
759
760
761/*
762 * ACPI Table Info.  One per ACPI table _type_
763 */
764typedef struct AcpiTableInfo
765{
766    UINT32                      Count;
767
768} ACPI_TABLE_INFO;
769
770
771/*
772 * System info returned by AcpiGetSystemInfo()
773 */
774
775typedef struct _AcpiSysInfo
776{
777    UINT32                      AcpiCaVersion;
778    UINT32                      Flags;
779    UINT32                      TimerResolution;
780    UINT32                      Reserved1;
781    UINT32                      Reserved2;
782    UINT32                      DebugLevel;
783    UINT32                      DebugLayer;
784    UINT32                      NumTableTypes;
785    ACPI_TABLE_INFO             TableInfo [NUM_ACPI_TABLES];
786
787} ACPI_SYSTEM_INFO;
788
789
790/*
791 * Various handlers and callback procedures
792 */
793
794typedef
795UINT32 (*ACPI_EVENT_HANDLER) (
796    void                        *Context);
797
798typedef
799void (*ACPI_GPE_HANDLER) (
800    void                        *Context);
801
802typedef
803void (*ACPI_NOTIFY_HANDLER) (
804    ACPI_HANDLE                 Device,
805    UINT32                      Value,
806    void                        *Context);
807
808typedef
809void (*ACPI_OBJECT_HANDLER) (
810    ACPI_HANDLE                 Object,
811    UINT32                      Function,
812    void                        *Data);
813
814
815/* Address Spaces (Operation Regions */
816
817typedef
818ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
819    UINT32                      Function,
820    ACPI_PHYSICAL_ADDRESS       Address,
821    UINT32                      BitWidth,
822    ACPI_INTEGER                *Value,
823    void                        *HandlerContext,
824    void                        *RegionContext);
825
826#define ACPI_DEFAULT_HANDLER        ((ACPI_ADR_SPACE_HANDLER) NULL)
827
828
829typedef
830ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
831    ACPI_HANDLE                 RegionHandle,
832    UINT32                      Function,
833    void                        *HandlerContext,
834    void                        **RegionContext);
835
836#define ACPI_REGION_ACTIVATE    0
837#define ACPI_REGION_DEACTIVATE  1
838
839typedef
840ACPI_STATUS (*ACPI_WALK_CALLBACK) (
841    ACPI_HANDLE                 ObjHandle,
842    UINT32                      NestingLevel,
843    void                        *Context,
844    void                        **ReturnValue);
845
846
847/* Interrupt handler return values */
848
849#define ACPI_INTERRUPT_NOT_HANDLED      0x00
850#define ACPI_INTERRUPT_HANDLED          0x01
851
852
853/* Structure and flags for AcpiGetDeviceInfo */
854
855#define ACPI_VALID_HID                  0x1
856#define ACPI_VALID_UID                  0x2
857#define ACPI_VALID_ADR                  0x4
858#define ACPI_VALID_STA                  0x8
859
860
861#define ACPI_COMMON_OBJ_INFO \
862    ACPI_OBJECT_TYPE            Type;           /* ACPI object type */ \
863    ACPI_NAME                   Name            /* ACPI object Name */
864
865
866typedef struct
867{
868    ACPI_COMMON_OBJ_INFO;
869} ACPI_OBJ_INFO_HEADER;
870
871
872typedef struct
873{
874    ACPI_COMMON_OBJ_INFO;
875
876    UINT32                      Valid;              /*  Are the next bits legit? */
877    NATIVE_CHAR                 HardwareId[9];      /*  _HID value if any */
878    NATIVE_CHAR                 UniqueId[9];        /*  _UID value if any */
879    ACPI_INTEGER                Address;            /*  _ADR value if any */
880    UINT32                      CurrentStatus;      /*  _STA value */
881} ACPI_DEVICE_INFO;
882
883
884/* Context structs for address space handlers */
885
886typedef struct
887{
888    UINT16                      Segment;
889    UINT16                      Bus;
890    UINT16                      Device;
891    UINT16                      Function;
892} ACPI_PCI_ID;
893
894
895typedef struct
896{
897    UINT32                      Length;
898    ACPI_PHYSICAL_ADDRESS       Address;
899    ACPI_PHYSICAL_ADDRESS       MappedPhysicalAddress;
900    UINT8                       *MappedLogicalAddress;
901    UINT32                      MappedLength;
902} ACPI_MEM_SPACE_CONTEXT;
903
904
905/* Sleep states */
906
907#define ACPI_NUM_SLEEP_STATES           7
908
909
910/*
911 * Definitions for Resource Attributes
912 */
913
914/*
915 *  Memory Attributes
916 */
917#define ACPI_READ_ONLY_MEMORY           (UINT8) 0x00
918#define ACPI_READ_WRITE_MEMORY          (UINT8) 0x01
919
920#define ACPI_NON_CACHEABLE_MEMORY       (UINT8) 0x00
921#define ACPI_CACHABLE_MEMORY            (UINT8) 0x01
922#define ACPI_WRITE_COMBINING_MEMORY     (UINT8) 0x02
923#define ACPI_PREFETCHABLE_MEMORY        (UINT8) 0x03
924
925/*
926 *  IO Attributes
927 *  The ISA IO ranges are:     n000-n0FFh,  n400-n4FFh, n800-n8FFh, nC00-nCFFh.
928 *  The non-ISA IO ranges are: n100-n3FFh,  n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
929 */
930#define ACPI_NON_ISA_ONLY_RANGES        (UINT8) 0x01
931#define ACPI_ISA_ONLY_RANGES            (UINT8) 0x02
932#define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
933
934/*
935 *  IO Port Descriptor Decode
936 */
937#define ACPI_DECODE_10                  (UINT8) 0x00    /* 10-bit IO address decode */
938#define ACPI_DECODE_16                  (UINT8) 0x01    /* 16-bit IO address decode */
939
940/*
941 *  IRQ Attributes
942 */
943#define ACPI_EDGE_SENSITIVE             (UINT8) 0x00
944#define ACPI_LEVEL_SENSITIVE            (UINT8) 0x01
945
946#define ACPI_ACTIVE_HIGH                (UINT8) 0x00
947#define ACPI_ACTIVE_LOW                 (UINT8) 0x01
948
949#define ACPI_EXCLUSIVE                  (UINT8) 0x00
950#define ACPI_SHARED                     (UINT8) 0x01
951
952/*
953 *  DMA Attributes
954 */
955#define ACPI_COMPATIBILITY              (UINT8) 0x00
956#define ACPI_TYPE_A                     (UINT8) 0x01
957#define ACPI_TYPE_B                     (UINT8) 0x02
958#define ACPI_TYPE_F                     (UINT8) 0x03
959
960#define ACPI_NOT_BUS_MASTER             (UINT8) 0x00
961#define ACPI_BUS_MASTER                 (UINT8) 0x01
962
963#define ACPI_TRANSFER_8                 (UINT8) 0x00
964#define ACPI_TRANSFER_8_16              (UINT8) 0x01
965#define ACPI_TRANSFER_16                (UINT8) 0x02
966
967/*
968 * Start Dependent Functions Priority definitions
969 */
970#define ACPI_GOOD_CONFIGURATION         (UINT8) 0x00
971#define ACPI_ACCEPTABLE_CONFIGURATION   (UINT8) 0x01
972#define ACPI_SUB_OPTIMAL_CONFIGURATION  (UINT8) 0x02
973
974/*
975 *  16, 32 and 64-bit Address Descriptor resource types
976 */
977#define ACPI_MEMORY_RANGE               (UINT8) 0x00
978#define ACPI_IO_RANGE                   (UINT8) 0x01
979#define ACPI_BUS_NUMBER_RANGE           (UINT8) 0x02
980
981#define ACPI_ADDRESS_NOT_FIXED          (UINT8) 0x00
982#define ACPI_ADDRESS_FIXED              (UINT8) 0x01
983
984#define ACPI_POS_DECODE                 (UINT8) 0x00
985#define ACPI_SUB_DECODE                 (UINT8) 0x01
986
987#define ACPI_PRODUCER                   (UINT8) 0x00
988#define ACPI_CONSUMER                   (UINT8) 0x01
989
990
991/*
992 *  Structures used to describe device resources
993 */
994typedef struct
995{
996    UINT32                      EdgeLevel;
997    UINT32                      ActiveHighLow;
998    UINT32                      SharedExclusive;
999    UINT32                      NumberOfInterrupts;
1000    UINT32                      Interrupts[1];
1001
1002} ACPI_RESOURCE_IRQ;
1003
1004typedef struct
1005{
1006    UINT32                      Type;
1007    UINT32                      BusMaster;
1008    UINT32                      Transfer;
1009    UINT32                      NumberOfChannels;
1010    UINT32                      Channels[1];
1011
1012} ACPI_RESOURCE_DMA;
1013
1014typedef struct
1015{
1016    UINT32                      CompatibilityPriority;
1017    UINT32                      PerformanceRobustness;
1018
1019} ACPI_RESOURCE_START_DPF;
1020
1021/*
1022 * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
1023 *  needed because it has no fields
1024 */
1025
1026typedef struct
1027{
1028    UINT32                      IoDecode;
1029    UINT32                      MinBaseAddress;
1030    UINT32                      MaxBaseAddress;
1031    UINT32                      Alignment;
1032    UINT32                      RangeLength;
1033
1034} ACPI_RESOURCE_IO;
1035
1036typedef struct
1037{
1038    UINT32                      BaseAddress;
1039    UINT32                      RangeLength;
1040
1041} ACPI_RESOURCE_FIXED_IO;
1042
1043typedef struct
1044{
1045    UINT32                      Length;
1046    UINT8                       Reserved[1];
1047
1048} ACPI_RESOURCE_VENDOR;
1049
1050typedef struct
1051{
1052    UINT8                       Checksum;
1053
1054} ACPI_RESOURCE_END_TAG;
1055
1056typedef struct
1057{
1058    UINT32                      ReadWriteAttribute;
1059    UINT32                      MinBaseAddress;
1060    UINT32                      MaxBaseAddress;
1061    UINT32                      Alignment;
1062    UINT32                      RangeLength;
1063
1064} ACPI_RESOURCE_MEM24;
1065
1066typedef struct
1067{
1068    UINT32                      ReadWriteAttribute;
1069    UINT32                      MinBaseAddress;
1070    UINT32                      MaxBaseAddress;
1071    UINT32                      Alignment;
1072    UINT32                      RangeLength;
1073
1074} ACPI_RESOURCE_MEM32;
1075
1076typedef struct
1077{
1078    UINT32                      ReadWriteAttribute;
1079    UINT32                      RangeBaseAddress;
1080    UINT32                      RangeLength;
1081
1082} ACPI_RESOURCE_FIXED_MEM32;
1083
1084typedef struct
1085{
1086    UINT16                      CacheAttribute;
1087    UINT16                      ReadWriteAttribute;
1088
1089} ACPI_MEMORY_ATTRIBUTE;
1090
1091typedef struct
1092{
1093    UINT16                      RangeAttribute;
1094    UINT16                      Reserved;
1095
1096} ACPI_IO_ATTRIBUTE;
1097
1098typedef struct
1099{
1100    UINT16                      Reserved1;
1101    UINT16                      Reserved2;
1102
1103} ACPI_BUS_ATTRIBUTE;
1104
1105typedef union
1106{
1107    ACPI_MEMORY_ATTRIBUTE       Memory;
1108    ACPI_IO_ATTRIBUTE           Io;
1109    ACPI_BUS_ATTRIBUTE          Bus;
1110
1111} ACPI_RESOURCE_ATTRIBUTE;
1112
1113typedef struct
1114{
1115    UINT32                      Index;
1116    UINT32                      StringLength;
1117    NATIVE_CHAR                 *StringPtr;
1118
1119} ACPI_RESOURCE_SOURCE;
1120
1121typedef struct
1122{
1123    UINT32                      ResourceType;
1124    UINT32                      ProducerConsumer;
1125    UINT32                      Decode;
1126    UINT32                      MinAddressFixed;
1127    UINT32                      MaxAddressFixed;
1128    ACPI_RESOURCE_ATTRIBUTE     Attribute;
1129    UINT32                      Granularity;
1130    UINT32                      MinAddressRange;
1131    UINT32                      MaxAddressRange;
1132    UINT32                      AddressTranslationOffset;
1133    UINT32                      AddressLength;
1134    ACPI_RESOURCE_SOURCE        ResourceSource;
1135
1136} ACPI_RESOURCE_ADDRESS16;
1137
1138typedef struct
1139{
1140    UINT32                      ResourceType;
1141    UINT32                      ProducerConsumer;
1142    UINT32                      Decode;
1143    UINT32                      MinAddressFixed;
1144    UINT32                      MaxAddressFixed;
1145    ACPI_RESOURCE_ATTRIBUTE     Attribute;
1146    UINT32                      Granularity;
1147    UINT32                      MinAddressRange;
1148    UINT32                      MaxAddressRange;
1149    UINT32                      AddressTranslationOffset;
1150    UINT32                      AddressLength;
1151    ACPI_RESOURCE_SOURCE        ResourceSource;
1152
1153} ACPI_RESOURCE_ADDRESS32;
1154
1155typedef struct
1156{
1157    UINT32                      ResourceType;
1158    UINT32                      ProducerConsumer;
1159    UINT32                      Decode;
1160    UINT32                      MinAddressFixed;
1161    UINT32                      MaxAddressFixed;
1162    ACPI_RESOURCE_ATTRIBUTE     Attribute;
1163    UINT64                      Granularity;
1164    UINT64                      MinAddressRange;
1165    UINT64                      MaxAddressRange;
1166    UINT64                      AddressTranslationOffset;
1167    UINT64                      AddressLength;
1168    ACPI_RESOURCE_SOURCE        ResourceSource;
1169
1170} ACPI_RESOURCE_ADDRESS64;
1171
1172typedef struct
1173{
1174    UINT32                      ProducerConsumer;
1175    UINT32                      EdgeLevel;
1176    UINT32                      ActiveHighLow;
1177    UINT32                      SharedExclusive;
1178    UINT32                      NumberOfInterrupts;
1179    ACPI_RESOURCE_SOURCE        ResourceSource;
1180    UINT32                      Interrupts[1];
1181
1182} ACPI_RESOURCE_EXT_IRQ;
1183
1184
1185/* ACPI_RESOURCE_TYPEs */
1186
1187#define ACPI_RSTYPE_IRQ                 0
1188#define ACPI_RSTYPE_DMA                 1
1189#define ACPI_RSTYPE_START_DPF           2
1190#define ACPI_RSTYPE_END_DPF             3
1191#define ACPI_RSTYPE_IO                  4
1192#define ACPI_RSTYPE_FIXED_IO            5
1193#define ACPI_RSTYPE_VENDOR              6
1194#define ACPI_RSTYPE_END_TAG             7
1195#define ACPI_RSTYPE_MEM24               8
1196#define ACPI_RSTYPE_MEM32               9
1197#define ACPI_RSTYPE_FIXED_MEM32         10
1198#define ACPI_RSTYPE_ADDRESS16           11
1199#define ACPI_RSTYPE_ADDRESS32           12
1200#define ACPI_RSTYPE_ADDRESS64           13
1201#define ACPI_RSTYPE_EXT_IRQ             14
1202
1203typedef UINT32                          ACPI_RESOURCE_TYPE;
1204
1205typedef union
1206{
1207    ACPI_RESOURCE_IRQ           Irq;
1208    ACPI_RESOURCE_DMA           Dma;
1209    ACPI_RESOURCE_START_DPF     StartDpf;
1210    ACPI_RESOURCE_IO            Io;
1211    ACPI_RESOURCE_FIXED_IO      FixedIo;
1212    ACPI_RESOURCE_VENDOR        VendorSpecific;
1213    ACPI_RESOURCE_END_TAG       EndTag;
1214    ACPI_RESOURCE_MEM24         Memory24;
1215    ACPI_RESOURCE_MEM32         Memory32;
1216    ACPI_RESOURCE_FIXED_MEM32   FixedMemory32;
1217    ACPI_RESOURCE_ADDRESS16     Address16;
1218    ACPI_RESOURCE_ADDRESS32     Address32;
1219    ACPI_RESOURCE_ADDRESS64     Address64;
1220    ACPI_RESOURCE_EXT_IRQ       ExtendedIrq;
1221
1222} ACPI_RESOURCE_DATA;
1223
1224typedef struct AcpiResource
1225{
1226    ACPI_RESOURCE_TYPE          Id;
1227    UINT32                      Length;
1228    ACPI_RESOURCE_DATA          Data;
1229
1230} ACPI_RESOURCE;
1231
1232#define ACPI_RESOURCE_LENGTH                12
1233#define ACPI_RESOURCE_LENGTH_NO_DATA        8       /* Id + Length fields */
1234
1235#define ACPI_SIZEOF_RESOURCE(Type)          (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (Type))
1236
1237#define ACPI_NEXT_RESOURCE(Res)             (ACPI_RESOURCE *)((UINT8 *) Res + Res->length)
1238
1239#ifdef _HW_ALIGNMENT_SUPPORT
1240#define ACPI_ALIGN_RESOURCE_SIZE(Length)    (Length)
1241#else
1242#define ACPI_ALIGN_RESOURCE_SIZE(Length)    ACPI_ROUND_UP_TO_NATIVE_WORD(Length)
1243#endif
1244
1245/*
1246 * END: of definitions for Resource Attributes
1247 */
1248
1249
1250typedef struct acpi_pci_routing_table
1251{
1252    UINT32                      Length;
1253    UINT32                      Pin;
1254    ACPI_INTEGER                Address;        /* here for 64-bit alignment */
1255    UINT32                      SourceIndex;
1256    NATIVE_CHAR                 Source[4];      /* pad to 64 bits so sizeof() works in all cases */
1257
1258} ACPI_PCI_ROUTING_TABLE;
1259
1260/*
1261 * END: of definitions for PCI Routing tables
1262 */
1263
1264
1265#endif /* __ACTYPES_H__ */
1266