acrestyp.h revision 193529
133965Sjdp/******************************************************************************
278828Sobrien *
3218822Sdim * Name: acrestyp.h - Defines, types, and structures for resource descriptors
433965Sjdp *
533965Sjdp *****************************************************************************/
633965Sjdp
733965Sjdp/******************************************************************************
833965Sjdp *
933965Sjdp * 1. Copyright Notice
1033965Sjdp *
1133965Sjdp * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
1233965Sjdp * All rights reserved.
1333965Sjdp *
1433965Sjdp * 2. License
1533965Sjdp *
1633965Sjdp * 2.1. This is your license from Intel Corp. under its intellectual property
1733965Sjdp * rights.  You may have additional license terms from the party that provided
1833965Sjdp * you this software, covering your right to use that party's intellectual
1933965Sjdp * property rights.
20218822Sdim *
21218822Sdim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2233965Sjdp * copy of the source code appearing in this file ("Covered Code") an
2333965Sjdp * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2433965Sjdp * base code distributed originally by Intel ("Original Intel Code") to copy,
2533965Sjdp * make derivatives, distribute, use and display any portion of the Covered
2633965Sjdp * Code in any form, with the right to sublicense such rights; and
2733965Sjdp *
2833965Sjdp * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
2933965Sjdp * license (with the right to sublicense), under only those claims of Intel
3033965Sjdp * patents that are infringed by the Original Intel Code, to make, use, sell,
3177298Sobrien * offer to sell, and import the Covered Code and derivative works thereof
3233965Sjdp * solely to the minimum extent necessary to exercise the above copyright
33130561Sobrien * license, and in no event shall the patent license extend to any additions
3433965Sjdp * to or modifications of the Original Intel Code.  No other license or right
3533965Sjdp * is granted directly or by implication, estoppel or otherwise;
3633965Sjdp *
3733965Sjdp * The above copyright and patent license is granted only if the following
3833965Sjdp * conditions are met:
39130561Sobrien *
40130561Sobrien * 3. Conditions
41130561Sobrien *
42130561Sobrien * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43130561Sobrien * Redistribution of source code of any substantial portion of the Covered
44130561Sobrien * Code or modification with rights to further distribute source must include
45130561Sobrien * the above Copyright Notice, the above License, this list of Conditions,
46130561Sobrien * and the following Disclaimer and Export Compliance provision.  In addition,
47130561Sobrien * Licensee must cause all Covered Code to which Licensee contributes to
48130561Sobrien * contain a file documenting the changes Licensee made to create that Covered
49130561Sobrien * Code and the date of any change.  Licensee must include in that file the
50130561Sobrien * documentation of any changes made by any predecessor Licensee.  Licensee
51130561Sobrien * must include a prominent statement that the modification is derived,
52130561Sobrien * directly or indirectly, from Original Intel Code.
53130561Sobrien *
54130561Sobrien * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55130561Sobrien * Redistribution of source code of any substantial portion of the Covered
56130561Sobrien * Code or modification without rights to further distribute source must
57130561Sobrien * include the following Disclaimer and Export Compliance provision in the
58130561Sobrien * documentation and/or other materials provided with distribution.  In
5933965Sjdp * addition, Licensee may not authorize further sublicense of source of any
6033965Sjdp * portion of the Covered Code, and must include terms to the effect that the
6133965Sjdp * license from Licensee to its licensee is limited to the intellectual
6277298Sobrien * property embodied in the software Licensee provides to its licensee, and
6333965Sjdp * not to intellectual property embodied in modifications its licensee may
64130561Sobrien * make.
6533965Sjdp *
6633965Sjdp * 3.3. Redistribution of Executable. Redistribution in executable form of any
6733965Sjdp * substantial portion of the Covered Code or modification must reproduce the
6833965Sjdp * above Copyright Notice, and the following Disclaimer and Export Compliance
6933965Sjdp * provision in the documentation and/or other materials provided with the
7033965Sjdp * distribution.
7133965Sjdp *
7233965Sjdp * 3.4. Intel retains all right, title, and interest in and to the Original
7333965Sjdp * Intel Code.
7433965Sjdp *
7533965Sjdp * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7633965Sjdp * Intel shall be used in advertising or otherwise to promote the sale, use or
7733965Sjdp * other dealings in products derived from or relating to the Covered Code
7877298Sobrien * without prior written authorization from Intel.
7977298Sobrien *
8077298Sobrien * 4. Disclaimer and Export Compliance
8177298Sobrien *
8277298Sobrien * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8377298Sobrien * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84130561Sobrien * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8533965Sjdp * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8633965Sjdp * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8733965Sjdp * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8860484Sobrien * PARTICULAR PURPOSE.
8933965Sjdp *
9033965Sjdp * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9133965Sjdp * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9233965Sjdp * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9333965Sjdp * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94218822Sdim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95218822Sdim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
96218822Sdim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97218822Sdim * LIMITED REMEDY.
98218822Sdim *
99218822Sdim * 4.3. Licensee shall not export, either directly or indirectly, any of this
100218822Sdim * software or system incorporating such software without first obtaining any
101218822Sdim * required license or other approval from the U. S. Department of Commerce or
10277298Sobrien * any other agency or department of the United States Government.  In the
10377298Sobrien * event Licensee exports any such software from the United States or
10477298Sobrien * re-exports any such software from a foreign destination, Licensee shall
10577298Sobrien * ensure that the distribution and export/re-export of the software is in
10677298Sobrien * compliance with all laws, regulations, orders, or other restrictions of the
10777298Sobrien * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10877298Sobrien * any of its subsidiaries will export/re-export any technical data, process,
10933965Sjdp * software, or service, directly or indirectly, to any country for which the
11033965Sjdp * United States government or any agency thereof requires an export license,
11133965Sjdp * other governmental approval, or letter of assurance, without first obtaining
11289857Sobrien * such license, approval or letter.
11333965Sjdp *
11433965Sjdp *****************************************************************************/
11577298Sobrien
11677298Sobrien#ifndef __ACRESTYP_H__
11777298Sobrien#define __ACRESTYP_H__
11877298Sobrien
11977298Sobrien
12077298Sobrien/*
12177298Sobrien * Definitions for Resource Attributes
12277298Sobrien */
12377298Sobrientypedef UINT16                          ACPI_RS_LENGTH;    /* Resource Length field is fixed at 16 bits */
12477298Sobrientypedef UINT32                          ACPI_RSDESC_SIZE;  /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
12577298Sobrien
12677298Sobrien/*
12777298Sobrien * Memory Attributes
12877298Sobrien */
12977298Sobrien#define ACPI_READ_ONLY_MEMORY           (UINT8) 0x00
13077298Sobrien#define ACPI_READ_WRITE_MEMORY          (UINT8) 0x01
13177298Sobrien
13277298Sobrien#define ACPI_NON_CACHEABLE_MEMORY       (UINT8) 0x00
133130561Sobrien#define ACPI_CACHABLE_MEMORY            (UINT8) 0x01
134130561Sobrien#define ACPI_WRITE_COMBINING_MEMORY     (UINT8) 0x02
135130561Sobrien#define ACPI_PREFETCHABLE_MEMORY        (UINT8) 0x03
13633965Sjdp
13733965Sjdp/*
13833965Sjdp * IO Attributes
13933965Sjdp * The ISA IO ranges are:     n000-n0FFh,  n400-n4FFh, n800-n8FFh, nC00-nCFFh.
14033965Sjdp * The non-ISA IO ranges are: n100-n3FFh,  n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
14133965Sjdp */
14233965Sjdp#define ACPI_NON_ISA_ONLY_RANGES        (UINT8) 0x01
14360484Sobrien#define ACPI_ISA_ONLY_RANGES            (UINT8) 0x02
14433965Sjdp#define ACPI_ENTIRE_RANGE               (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
14533965Sjdp
14633965Sjdp/* Type of translation - 1=Sparse, 0=Dense */
14733965Sjdp
14877298Sobrien#define ACPI_SPARSE_TRANSLATION         (UINT8) 0x01
149223262Sbenl
15033965Sjdp/*
15133965Sjdp * IO Port Descriptor Decode
15233965Sjdp */
15333965Sjdp#define ACPI_DECODE_10                  (UINT8) 0x00    /* 10-bit IO address decode */
15433965Sjdp#define ACPI_DECODE_16                  (UINT8) 0x01    /* 16-bit IO address decode */
15533965Sjdp
15633965Sjdp/*
15733965Sjdp * IRQ Attributes
15833965Sjdp */
15933965Sjdp#define ACPI_LEVEL_SENSITIVE            (UINT8) 0x00
16033965Sjdp#define ACPI_EDGE_SENSITIVE             (UINT8) 0x01
16133965Sjdp
16277298Sobrien#define ACPI_ACTIVE_HIGH                (UINT8) 0x00
16333965Sjdp#define ACPI_ACTIVE_LOW                 (UINT8) 0x01
16433965Sjdp
16533965Sjdp#define ACPI_EXCLUSIVE                  (UINT8) 0x00
16633965Sjdp#define ACPI_SHARED                     (UINT8) 0x01
16733965Sjdp
16833965Sjdp/*
16933965Sjdp * DMA Attributes
17033965Sjdp */
17133965Sjdp#define ACPI_COMPATIBILITY              (UINT8) 0x00
17233965Sjdp#define ACPI_TYPE_A                     (UINT8) 0x01
17333965Sjdp#define ACPI_TYPE_B                     (UINT8) 0x02
17433965Sjdp#define ACPI_TYPE_F                     (UINT8) 0x03
17533965Sjdp
17677298Sobrien#define ACPI_NOT_BUS_MASTER             (UINT8) 0x00
17733965Sjdp#define ACPI_BUS_MASTER                 (UINT8) 0x01
17877298Sobrien
17977298Sobrien#define ACPI_TRANSFER_8                 (UINT8) 0x00
18033965Sjdp#define ACPI_TRANSFER_8_16              (UINT8) 0x01
18177298Sobrien#define ACPI_TRANSFER_16                (UINT8) 0x02
18277298Sobrien
18377298Sobrien/*
18433965Sjdp * Start Dependent Functions Priority definitions
185130561Sobrien */
18633965Sjdp#define ACPI_GOOD_CONFIGURATION         (UINT8) 0x00
18733965Sjdp#define ACPI_ACCEPTABLE_CONFIGURATION   (UINT8) 0x01
18833965Sjdp#define ACPI_SUB_OPTIMAL_CONFIGURATION  (UINT8) 0x02
189130561Sobrien
19033965Sjdp/*
19133965Sjdp * 16, 32 and 64-bit Address Descriptor resource types
19233965Sjdp */
19333965Sjdp#define ACPI_MEMORY_RANGE               (UINT8) 0x00
19477298Sobrien#define ACPI_IO_RANGE                   (UINT8) 0x01
19533965Sjdp#define ACPI_BUS_NUMBER_RANGE           (UINT8) 0x02
19677298Sobrien
19777298Sobrien#define ACPI_ADDRESS_NOT_FIXED          (UINT8) 0x00
19833965Sjdp#define ACPI_ADDRESS_FIXED              (UINT8) 0x01
19977298Sobrien
20077298Sobrien#define ACPI_POS_DECODE                 (UINT8) 0x00
20177298Sobrien#define ACPI_SUB_DECODE                 (UINT8) 0x01
20277298Sobrien
20333965Sjdp#define ACPI_PRODUCER                   (UINT8) 0x00
204130561Sobrien#define ACPI_CONSUMER                   (UINT8) 0x01
205130561Sobrien
20633965Sjdp
20733965Sjdp/*
20833965Sjdp * If possible, pack the following structures to byte alignment
20933965Sjdp */
21033965Sjdp#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
21133965Sjdp#pragma pack(1)
21233965Sjdp#endif
21333965Sjdp
21433965Sjdp/* UUID data structures for use in vendor-defined resource descriptors */
21533965Sjdp
21633965Sjdptypedef struct acpi_uuid
21733965Sjdp{
21860484Sobrien    UINT8                           Data[ACPI_UUID_LENGTH];
21960484Sobrien} ACPI_UUID;
22060484Sobrien
22160484Sobrientypedef struct acpi_vendor_uuid
22260484Sobrien{
22338889Sjdp    UINT8                           Subtype;
22438889Sjdp    UINT8                           Data[ACPI_UUID_LENGTH];
22538889Sjdp
22633965Sjdp} ACPI_VENDOR_UUID;
22733965Sjdp
22833965Sjdp/*
22933965Sjdp * Structures used to describe device resources
23033965Sjdp */
23177298Sobrientypedef struct acpi_resource_irq
23277298Sobrien{
23377298Sobrien    UINT8                           DescriptorLength;
23433965Sjdp    UINT8                           Triggering;
23533965Sjdp    UINT8                           Polarity;
236130561Sobrien    UINT8                           Sharable;
237130561Sobrien    UINT8                           InterruptCount;
238130561Sobrien    UINT8                           Interrupts[1];
23933965Sjdp
24033965Sjdp} ACPI_RESOURCE_IRQ;
24133965Sjdp
24233965Sjdptypedef struct ACPI_RESOURCE_DMA
24333965Sjdp{
24433965Sjdp    UINT8                           Type;
24533965Sjdp    UINT8                           BusMaster;
24633965Sjdp    UINT8                           Transfer;
24733965Sjdp    UINT8                           ChannelCount;
24833965Sjdp    UINT8                           Channels[1];
24960484Sobrien
25060484Sobrien} ACPI_RESOURCE_DMA;
25160484Sobrien
25260484Sobrientypedef struct acpi_resource_start_dependent
25360484Sobrien{
25438889Sjdp    UINT8                           DescriptorLength;
25538889Sjdp    UINT8                           CompatibilityPriority;
25638889Sjdp    UINT8                           PerformanceRobustness;
25733965Sjdp
25833965Sjdp} ACPI_RESOURCE_START_DEPENDENT;
25933965Sjdp
26077298Sobrien
26133965Sjdp/*
26277298Sobrien * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
26377298Sobrien * needed because it has no fields
26477298Sobrien */
265130561Sobrien
26633965Sjdp
26733965Sjdptypedef struct acpi_resource_io
26833965Sjdp{
26933965Sjdp    UINT8                           IoDecode;
27033965Sjdp    UINT8                           Alignment;
27133965Sjdp    UINT8                           AddressLength;
272130561Sobrien    UINT16                          Minimum;
273130561Sobrien    UINT16                          Maximum;
274130561Sobrien
275130561Sobrien} ACPI_RESOURCE_IO;
276130561Sobrien
277130561Sobrientypedef struct acpi_resource_fixed_io
278130561Sobrien{
279130561Sobrien    UINT16                          Address;
28033965Sjdp    UINT8                           AddressLength;
28133965Sjdp
28233965Sjdp} ACPI_RESOURCE_FIXED_IO;
28333965Sjdp
28433965Sjdptypedef struct acpi_resource_vendor
28533965Sjdp{
28633965Sjdp    UINT16                          ByteLength;
28777298Sobrien    UINT8                           ByteData[1];
288130561Sobrien
28933965Sjdp} ACPI_RESOURCE_VENDOR;
29033965Sjdp
29133965Sjdp/* Vendor resource with UUID info (introduced in ACPI 3.0) */
29233965Sjdp
29377298Sobrientypedef struct acpi_resource_vendor_typed
29433965Sjdp{
29577298Sobrien    UINT16                          ByteLength;
29677298Sobrien    UINT8                           UuidSubtype;
29738889Sjdp    UINT8                           Uuid[ACPI_UUID_LENGTH];
29833965Sjdp    UINT8                           ByteData[1];
29933965Sjdp
30033965Sjdp} ACPI_RESOURCE_VENDOR_TYPED;
30133965Sjdp
30233965Sjdptypedef struct acpi_resource_end_tag
30333965Sjdp{
30433965Sjdp    UINT8                           Checksum;
30533965Sjdp
30633965Sjdp} ACPI_RESOURCE_END_TAG;
30733965Sjdp
30833965Sjdptypedef struct acpi_resource_memory24
30933965Sjdp{
31033965Sjdp    UINT8                           WriteProtect;
31133965Sjdp    UINT16                          Minimum;
31233965Sjdp    UINT16                          Maximum;
31333965Sjdp    UINT16                          Alignment;
31433965Sjdp    UINT16                          AddressLength;
31533965Sjdp
31633965Sjdp} ACPI_RESOURCE_MEMORY24;
31777298Sobrien
318130561Sobrientypedef struct acpi_resource_memory32
319130561Sobrien{
32033965Sjdp    UINT8                           WriteProtect;
32133965Sjdp    UINT32                          Minimum;
32233965Sjdp    UINT32                          Maximum;
32333965Sjdp    UINT32                          Alignment;
32433965Sjdp    UINT32                          AddressLength;
32533965Sjdp
32633965Sjdp} ACPI_RESOURCE_MEMORY32;
32733965Sjdp
32877298Sobrientypedef struct acpi_resource_fixed_memory32
32977298Sobrien{
33077298Sobrien    UINT8                           WriteProtect;
33177298Sobrien    UINT32                          Address;
33277298Sobrien    UINT32                          AddressLength;
33377298Sobrien
33477298Sobrien} ACPI_RESOURCE_FIXED_MEMORY32;
33577298Sobrien
33677298Sobrientypedef struct acpi_memory_attribute
33777298Sobrien{
33877298Sobrien    UINT8                           WriteProtect;
33977298Sobrien    UINT8                           Caching;
34077298Sobrien    UINT8                           RangeType;
34177298Sobrien    UINT8                           Translation;
34277298Sobrien
34377298Sobrien} ACPI_MEMORY_ATTRIBUTE;
34477298Sobrien
34577298Sobrientypedef struct acpi_io_attribute
34677298Sobrien{
34777298Sobrien    UINT8                           RangeType;
34877298Sobrien    UINT8                           Translation;
349130561Sobrien    UINT8                           TranslationType;
35077298Sobrien    UINT8                           Reserved1;
35177298Sobrien
35277298Sobrien} ACPI_IO_ATTRIBUTE;
35377298Sobrien
35477298Sobrientypedef union acpi_resource_attribute
35577298Sobrien{
35677298Sobrien    ACPI_MEMORY_ATTRIBUTE           Mem;
35777298Sobrien    ACPI_IO_ATTRIBUTE               Io;
35877298Sobrien
35938889Sjdp    /* Used for the *WordSpace macros */
360130561Sobrien
36133965Sjdp    UINT8                           TypeSpecific;
36233965Sjdp
36333965Sjdp} ACPI_RESOURCE_ATTRIBUTE;
36460484Sobrien
36577298Sobrientypedef struct acpi_resource_source
36677298Sobrien{
36733965Sjdp    UINT8                           Index;
36833965Sjdp    UINT16                          StringLength;
36960484Sobrien    char                            *StringPtr;
370130561Sobrien
37160484Sobrien} ACPI_RESOURCE_SOURCE;
37277298Sobrien
37360484Sobrien/* Fields common to all address descriptors, 16/32/64 bit */
37460484Sobrien
37533965Sjdp#define ACPI_RESOURCE_ADDRESS_COMMON \
376130561Sobrien    UINT8                           ResourceType; \
37733965Sjdp    UINT8                           ProducerConsumer; \
378130561Sobrien    UINT8                           Decode; \
37933965Sjdp    UINT8                           MinAddressFixed; \
38033965Sjdp    UINT8                           MaxAddressFixed; \
38133965Sjdp    ACPI_RESOURCE_ATTRIBUTE         Info;
38233965Sjdp
38333965Sjdptypedef struct acpi_resource_address
38433965Sjdp{
38533965Sjdp    ACPI_RESOURCE_ADDRESS_COMMON
386218822Sdim
387218822Sdim} ACPI_RESOURCE_ADDRESS;
388218822Sdim
389218822Sdimtypedef struct acpi_resource_address16
390218822Sdim{
391218822Sdim    ACPI_RESOURCE_ADDRESS_COMMON
392218822Sdim    UINT16                          Granularity;
393218822Sdim    UINT16                          Minimum;
394218822Sdim    UINT16                          Maximum;
395218822Sdim    UINT16                          TranslationOffset;
396218822Sdim    UINT16                          AddressLength;
397218822Sdim    ACPI_RESOURCE_SOURCE            ResourceSource;
398218822Sdim
399218822Sdim} ACPI_RESOURCE_ADDRESS16;
400218822Sdim
401218822Sdimtypedef struct acpi_resource_address32
402218822Sdim{
403218822Sdim    ACPI_RESOURCE_ADDRESS_COMMON
404218822Sdim    UINT32                          Granularity;
405218822Sdim    UINT32                          Minimum;
406218822Sdim    UINT32                          Maximum;
407218822Sdim    UINT32                          TranslationOffset;
408218822Sdim    UINT32                          AddressLength;
409218822Sdim    ACPI_RESOURCE_SOURCE            ResourceSource;
410218822Sdim
411218822Sdim} ACPI_RESOURCE_ADDRESS32;
412218822Sdim
413218822Sdimtypedef struct acpi_resource_address64
414218822Sdim{
415218822Sdim    ACPI_RESOURCE_ADDRESS_COMMON
416218822Sdim    UINT64                          Granularity;
417218822Sdim    UINT64                          Minimum;
418218822Sdim    UINT64                          Maximum;
419218822Sdim    UINT64                          TranslationOffset;
420218822Sdim    UINT64                          AddressLength;
421218822Sdim    ACPI_RESOURCE_SOURCE            ResourceSource;
422218822Sdim
423218822Sdim} ACPI_RESOURCE_ADDRESS64;
424218822Sdim
425218822Sdimtypedef struct acpi_resource_extended_address64
426218822Sdim{
427218822Sdim    ACPI_RESOURCE_ADDRESS_COMMON
428218822Sdim    UINT8                           RevisionID;
429218822Sdim    UINT64                          Granularity;
430218822Sdim    UINT64                          Minimum;
431218822Sdim    UINT64                          Maximum;
432218822Sdim    UINT64                          TranslationOffset;
433218822Sdim    UINT64                          AddressLength;
434218822Sdim    UINT64                          TypeSpecific;
435218822Sdim
436218822Sdim} ACPI_RESOURCE_EXTENDED_ADDRESS64;
437218822Sdim
438218822Sdimtypedef struct acpi_resource_extended_irq
439{
440    UINT8                           ProducerConsumer;
441    UINT8                           Triggering;
442    UINT8                           Polarity;
443    UINT8                           Sharable;
444    UINT8                           InterruptCount;
445    ACPI_RESOURCE_SOURCE            ResourceSource;
446    UINT32                          Interrupts[1];
447
448} ACPI_RESOURCE_EXTENDED_IRQ;
449
450typedef struct acpi_resource_generic_register
451{
452    UINT8                           SpaceId;
453    UINT8                           BitWidth;
454    UINT8                           BitOffset;
455    UINT8                           AccessSize;
456    UINT64                          Address;
457
458} ACPI_RESOURCE_GENERIC_REGISTER;
459
460
461/* ACPI_RESOURCE_TYPEs */
462
463#define ACPI_RESOURCE_TYPE_IRQ                  0
464#define ACPI_RESOURCE_TYPE_DMA                  1
465#define ACPI_RESOURCE_TYPE_START_DEPENDENT      2
466#define ACPI_RESOURCE_TYPE_END_DEPENDENT        3
467#define ACPI_RESOURCE_TYPE_IO                   4
468#define ACPI_RESOURCE_TYPE_FIXED_IO             5
469#define ACPI_RESOURCE_TYPE_VENDOR               6
470#define ACPI_RESOURCE_TYPE_END_TAG              7
471#define ACPI_RESOURCE_TYPE_MEMORY24             8
472#define ACPI_RESOURCE_TYPE_MEMORY32             9
473#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32       10
474#define ACPI_RESOURCE_TYPE_ADDRESS16            11
475#define ACPI_RESOURCE_TYPE_ADDRESS32            12
476#define ACPI_RESOURCE_TYPE_ADDRESS64            13
477#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64   14  /* ACPI 3.0 */
478#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ         15
479#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER     16
480#define ACPI_RESOURCE_TYPE_MAX                  16
481
482/* Master union for resource descriptors */
483
484typedef union acpi_resource_data
485{
486    ACPI_RESOURCE_IRQ                       Irq;
487    ACPI_RESOURCE_DMA                       Dma;
488    ACPI_RESOURCE_START_DEPENDENT           StartDpf;
489    ACPI_RESOURCE_IO                        Io;
490    ACPI_RESOURCE_FIXED_IO                  FixedIo;
491    ACPI_RESOURCE_VENDOR                    Vendor;
492    ACPI_RESOURCE_VENDOR_TYPED              VendorTyped;
493    ACPI_RESOURCE_END_TAG                   EndTag;
494    ACPI_RESOURCE_MEMORY24                  Memory24;
495    ACPI_RESOURCE_MEMORY32                  Memory32;
496    ACPI_RESOURCE_FIXED_MEMORY32            FixedMemory32;
497    ACPI_RESOURCE_ADDRESS16                 Address16;
498    ACPI_RESOURCE_ADDRESS32                 Address32;
499    ACPI_RESOURCE_ADDRESS64                 Address64;
500    ACPI_RESOURCE_EXTENDED_ADDRESS64        ExtAddress64;
501    ACPI_RESOURCE_EXTENDED_IRQ              ExtendedIrq;
502    ACPI_RESOURCE_GENERIC_REGISTER          GenericReg;
503
504    /* Common fields */
505
506    ACPI_RESOURCE_ADDRESS                   Address;        /* Common 16/32/64 address fields */
507
508} ACPI_RESOURCE_DATA;
509
510
511/* Common resource header */
512
513typedef struct acpi_resource
514{
515    UINT32                          Type;
516    UINT32                          Length;
517    ACPI_RESOURCE_DATA              Data;
518
519} ACPI_RESOURCE;
520
521/* restore default alignment */
522
523#pragma pack()
524
525
526#define ACPI_RS_SIZE_NO_DATA                8       /* Id + Length fields */
527#define ACPI_RS_SIZE_MIN                    (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
528#define ACPI_RS_SIZE(Type)                  (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
529
530#define ACPI_NEXT_RESOURCE(Res)             (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length)
531
532
533typedef struct acpi_pci_routing_table
534{
535    UINT32                          Length;
536    UINT32                          Pin;
537    ACPI_INTEGER                    Address;        /* here for 64-bit alignment */
538    UINT32                          SourceIndex;
539    char                            Source[4];      /* pad to 64 bits so sizeof() works in all cases */
540
541} ACPI_PCI_ROUTING_TABLE;
542
543#endif /* __ACRESTYP_H__ */
544
545