1 /****************************************************************************** 2 * 3 * Module Name: amlresrc.h - AML resource descriptors 4 * 5 *****************************************************************************/ 6 7 /****************************************************************************** 8 * 9 * 1. Copyright Notice 10 * 11 * Some or all of this work - Copyright (c) 1999 - 2013, 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 /* acpisrc:StructDefs -- for acpisrc conversion */ 117 118 #ifndef __AMLRESRC_H 119 #define __AMLRESRC_H 120 121 122 /* 123 * Resource descriptor tags, as defined in the ACPI specification. 124 * Used to symbolically reference fields within a descriptor. 125 */ 126 #define ACPI_RESTAG_ADDRESS "_ADR" 127 #define ACPI_RESTAG_ALIGNMENT "_ALN" 128 #define ACPI_RESTAG_ADDRESSSPACE "_ASI" 129 #define ACPI_RESTAG_ACCESSSIZE "_ASZ" 130 #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" 131 #define ACPI_RESTAG_BASEADDRESS "_BAS" 132 #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ 133 #define ACPI_RESTAG_DEBOUNCETIME "_DBT" 134 #define ACPI_RESTAG_DECODE "_DEC" 135 #define ACPI_RESTAG_DEVICEPOLARITY "_DPL" 136 #define ACPI_RESTAG_DMA "_DMA" 137 #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ 138 #define ACPI_RESTAG_DRIVESTRENGTH "_DRS" 139 #define ACPI_RESTAG_ENDIANNESS "_END" 140 #define ACPI_RESTAG_FLOWCONTROL "_FLC" 141 #define ACPI_RESTAG_GRANULARITY "_GRA" 142 #define ACPI_RESTAG_INTERRUPT "_INT" 143 #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */ 144 #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */ 145 #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ 146 #define ACPI_RESTAG_IORESTRICTION "_IOR" 147 #define ACPI_RESTAG_LENGTH "_LEN" 148 #define ACPI_RESTAG_LINE "_LIN" 149 #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ 150 #define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ 151 #define ACPI_RESTAG_MAXADDR "_MAX" 152 #define ACPI_RESTAG_MINADDR "_MIN" 153 #define ACPI_RESTAG_MAXTYPE "_MAF" 154 #define ACPI_RESTAG_MINTYPE "_MIF" 155 #define ACPI_RESTAG_MODE "_MOD" 156 #define ACPI_RESTAG_PARITY "_PAR" 157 #define ACPI_RESTAG_PHASE "_PHA" 158 #define ACPI_RESTAG_PIN "_PIN" 159 #define ACPI_RESTAG_PINCONFIG "_PPI" 160 #define ACPI_RESTAG_POLARITY "_POL" 161 #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" 162 #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" 163 #define ACPI_RESTAG_RANGETYPE "_RNG" 164 #define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */ 165 #define ACPI_RESTAG_LENGTH_RX "_RXL" 166 #define ACPI_RESTAG_LENGTH_TX "_TXL" 167 #define ACPI_RESTAG_SLAVEMODE "_SLV" 168 #define ACPI_RESTAG_SPEED "_SPE" 169 #define ACPI_RESTAG_STOPBITS "_STB" 170 #define ACPI_RESTAG_TRANSLATION "_TRA" 171 #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ 172 #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ 173 #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ 174 #define ACPI_RESTAG_VENDORDATA "_VEN" 175 176 177 /* Default sizes for "small" resource descriptors */ 178 179 #define ASL_RDESC_IRQ_SIZE 0x02 180 #define ASL_RDESC_DMA_SIZE 0x02 181 #define ASL_RDESC_ST_DEPEND_SIZE 0x00 182 #define ASL_RDESC_END_DEPEND_SIZE 0x00 183 #define ASL_RDESC_IO_SIZE 0x07 184 #define ASL_RDESC_FIXED_IO_SIZE 0x03 185 #define ASL_RDESC_FIXED_DMA_SIZE 0x05 186 #define ASL_RDESC_END_TAG_SIZE 0x01 187 188 189 typedef struct asl_resource_node 190 { 191 UINT32 BufferLength; 192 void *Buffer; 193 struct asl_resource_node *Next; 194 195 } ASL_RESOURCE_NODE; 196 197 198 /* Macros used to generate AML resource length fields */ 199 200 #define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (AML_RESOURCE_LARGE_HEADER)) 201 #define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (AML_RESOURCE_SMALL_HEADER)) 202 203 /* 204 * Resource descriptors defined in the ACPI specification. 205 * 206 * Packing/alignment must be BYTE because these descriptors 207 * are used to overlay the raw AML byte stream. 208 */ 209 #pragma pack(1) 210 211 /* 212 * SMALL descriptors 213 */ 214 #define AML_RESOURCE_SMALL_HEADER_COMMON \ 215 UINT8 DescriptorType; 216 217 typedef struct aml_resource_small_header 218 { 219 AML_RESOURCE_SMALL_HEADER_COMMON 220 221 } AML_RESOURCE_SMALL_HEADER; 222 223 224 typedef struct aml_resource_irq 225 { 226 AML_RESOURCE_SMALL_HEADER_COMMON 227 UINT16 IrqMask; 228 UINT8 Flags; 229 230 } AML_RESOURCE_IRQ; 231 232 233 typedef struct aml_resource_irq_noflags 234 { 235 AML_RESOURCE_SMALL_HEADER_COMMON 236 UINT16 IrqMask; 237 238 } AML_RESOURCE_IRQ_NOFLAGS; 239 240 241 typedef struct aml_resource_dma 242 { 243 AML_RESOURCE_SMALL_HEADER_COMMON 244 UINT8 DmaChannelMask; 245 UINT8 Flags; 246 247 } AML_RESOURCE_DMA; 248 249 250 typedef struct aml_resource_start_dependent 251 { 252 AML_RESOURCE_SMALL_HEADER_COMMON 253 UINT8 Flags; 254 255 } AML_RESOURCE_START_DEPENDENT; 256 257 258 typedef struct aml_resource_start_dependent_noprio 259 { 260 AML_RESOURCE_SMALL_HEADER_COMMON 261 262 } AML_RESOURCE_START_DEPENDENT_NOPRIO; 263 264 265 typedef struct aml_resource_end_dependent 266 { 267 AML_RESOURCE_SMALL_HEADER_COMMON 268 269 } AML_RESOURCE_END_DEPENDENT; 270 271 272 typedef struct aml_resource_io 273 { 274 AML_RESOURCE_SMALL_HEADER_COMMON 275 UINT8 Flags; 276 UINT16 Minimum; 277 UINT16 Maximum; 278 UINT8 Alignment; 279 UINT8 AddressLength; 280 281 } AML_RESOURCE_IO; 282 283 284 typedef struct aml_resource_fixed_io 285 { 286 AML_RESOURCE_SMALL_HEADER_COMMON 287 UINT16 Address; 288 UINT8 AddressLength; 289 290 } AML_RESOURCE_FIXED_IO; 291 292 293 typedef struct aml_resource_vendor_small 294 { 295 AML_RESOURCE_SMALL_HEADER_COMMON 296 297 } AML_RESOURCE_VENDOR_SMALL; 298 299 300 typedef struct aml_resource_end_tag 301 { 302 AML_RESOURCE_SMALL_HEADER_COMMON 303 UINT8 Checksum; 304 305 } AML_RESOURCE_END_TAG; 306 307 308 typedef struct aml_resource_fixed_dma 309 { 310 AML_RESOURCE_SMALL_HEADER_COMMON 311 UINT16 RequestLines; 312 UINT16 Channels; 313 UINT8 Width; 314 315 } AML_RESOURCE_FIXED_DMA; 316 317 318 /* 319 * LARGE descriptors 320 */ 321 #define AML_RESOURCE_LARGE_HEADER_COMMON \ 322 UINT8 DescriptorType;\ 323 UINT16 ResourceLength; 324 325 typedef struct aml_resource_large_header 326 { 327 AML_RESOURCE_LARGE_HEADER_COMMON 328 329 } AML_RESOURCE_LARGE_HEADER; 330 331 332 /* General Flags for address space resource descriptors */ 333 334 #define ACPI_RESOURCE_FLAG_DEC 2 335 #define ACPI_RESOURCE_FLAG_MIF 4 336 #define ACPI_RESOURCE_FLAG_MAF 8 337 338 typedef struct aml_resource_memory24 339 { 340 AML_RESOURCE_LARGE_HEADER_COMMON 341 UINT8 Flags; 342 UINT16 Minimum; 343 UINT16 Maximum; 344 UINT16 Alignment; 345 UINT16 AddressLength; 346 347 } AML_RESOURCE_MEMORY24; 348 349 350 typedef struct aml_resource_vendor_large 351 { 352 AML_RESOURCE_LARGE_HEADER_COMMON 353 354 } AML_RESOURCE_VENDOR_LARGE; 355 356 357 typedef struct aml_resource_memory32 358 { 359 AML_RESOURCE_LARGE_HEADER_COMMON 360 UINT8 Flags; 361 UINT32 Minimum; 362 UINT32 Maximum; 363 UINT32 Alignment; 364 UINT32 AddressLength; 365 366 } AML_RESOURCE_MEMORY32; 367 368 369 typedef struct aml_resource_fixed_memory32 370 { 371 AML_RESOURCE_LARGE_HEADER_COMMON 372 UINT8 Flags; 373 UINT32 Address; 374 UINT32 AddressLength; 375 376 } AML_RESOURCE_FIXED_MEMORY32; 377 378 379 #define AML_RESOURCE_ADDRESS_COMMON \ 380 UINT8 ResourceType; \ 381 UINT8 Flags; \ 382 UINT8 SpecificFlags; 383 384 385 typedef struct aml_resource_address 386 { 387 AML_RESOURCE_LARGE_HEADER_COMMON 388 AML_RESOURCE_ADDRESS_COMMON 389 390 } AML_RESOURCE_ADDRESS; 391 392 393 typedef struct aml_resource_extended_address64 394 { 395 AML_RESOURCE_LARGE_HEADER_COMMON 396 AML_RESOURCE_ADDRESS_COMMON 397 UINT8 RevisionID; 398 UINT8 Reserved; 399 UINT64 Granularity; 400 UINT64 Minimum; 401 UINT64 Maximum; 402 UINT64 TranslationOffset; 403 UINT64 AddressLength; 404 UINT64 TypeSpecific; 405 406 } AML_RESOURCE_EXTENDED_ADDRESS64; 407 408 #define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */ 409 410 411 typedef struct aml_resource_address64 412 { 413 AML_RESOURCE_LARGE_HEADER_COMMON 414 AML_RESOURCE_ADDRESS_COMMON 415 UINT64 Granularity; 416 UINT64 Minimum; 417 UINT64 Maximum; 418 UINT64 TranslationOffset; 419 UINT64 AddressLength; 420 421 } AML_RESOURCE_ADDRESS64; 422 423 424 typedef struct aml_resource_address32 425 { 426 AML_RESOURCE_LARGE_HEADER_COMMON 427 AML_RESOURCE_ADDRESS_COMMON 428 UINT32 Granularity; 429 UINT32 Minimum; 430 UINT32 Maximum; 431 UINT32 TranslationOffset; 432 UINT32 AddressLength; 433 434 } AML_RESOURCE_ADDRESS32; 435 436 437 typedef struct aml_resource_address16 438 { 439 AML_RESOURCE_LARGE_HEADER_COMMON 440 AML_RESOURCE_ADDRESS_COMMON 441 UINT16 Granularity; 442 UINT16 Minimum; 443 UINT16 Maximum; 444 UINT16 TranslationOffset; 445 UINT16 AddressLength; 446 447 } AML_RESOURCE_ADDRESS16; 448 449 450 typedef struct aml_resource_extended_irq 451 { 452 AML_RESOURCE_LARGE_HEADER_COMMON 453 UINT8 Flags; 454 UINT8 InterruptCount; 455 UINT32 Interrupts[1]; 456 /* ResSourceIndex, ResSource optional fields follow */ 457 458 } AML_RESOURCE_EXTENDED_IRQ; 459 460 461 typedef struct aml_resource_generic_register 462 { 463 AML_RESOURCE_LARGE_HEADER_COMMON 464 UINT8 AddressSpaceId; 465 UINT8 BitWidth; 466 UINT8 BitOffset; 467 UINT8 AccessSize; /* ACPI 3.0, was previously Reserved */ 468 UINT64 Address; 469 470 } AML_RESOURCE_GENERIC_REGISTER; 471 472 473 /* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */ 474 475 typedef struct aml_resource_gpio 476 { 477 AML_RESOURCE_LARGE_HEADER_COMMON 478 UINT8 RevisionId; 479 UINT8 ConnectionType; 480 UINT16 Flags; 481 UINT16 IntFlags; 482 UINT8 PinConfig; 483 UINT16 DriveStrength; 484 UINT16 DebounceTimeout; 485 UINT16 PinTableOffset; 486 UINT8 ResSourceIndex; 487 UINT16 ResSourceOffset; 488 UINT16 VendorOffset; 489 UINT16 VendorLength; 490 /* 491 * Optional fields follow immediately: 492 * 1) PIN list (Words) 493 * 2) Resource Source String 494 * 3) Vendor Data bytes 495 */ 496 497 } AML_RESOURCE_GPIO; 498 499 #define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */ 500 501 /* Values for ConnectionType above */ 502 503 #define AML_RESOURCE_GPIO_TYPE_INT 0 504 #define AML_RESOURCE_GPIO_TYPE_IO 1 505 #define AML_RESOURCE_MAX_GPIOTYPE 1 506 507 508 /* Common preamble for all serial descriptors (ACPI 5.0) */ 509 510 #define AML_RESOURCE_SERIAL_COMMON \ 511 UINT8 RevisionId; \ 512 UINT8 ResSourceIndex; \ 513 UINT8 Type; \ 514 UINT8 Flags; \ 515 UINT16 TypeSpecificFlags; \ 516 UINT8 TypeRevisionId; \ 517 UINT16 TypeDataLength; \ 518 519 /* Values for the type field above */ 520 521 #define AML_RESOURCE_I2C_SERIALBUSTYPE 1 522 #define AML_RESOURCE_SPI_SERIALBUSTYPE 2 523 #define AML_RESOURCE_UART_SERIALBUSTYPE 3 524 #define AML_RESOURCE_MAX_SERIALBUSTYPE 3 525 #define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */ 526 527 typedef struct aml_resource_common_serialbus 528 { 529 AML_RESOURCE_LARGE_HEADER_COMMON 530 AML_RESOURCE_SERIAL_COMMON 531 532 } AML_RESOURCE_COMMON_SERIALBUS; 533 534 typedef struct aml_resource_i2c_serialbus 535 { 536 AML_RESOURCE_LARGE_HEADER_COMMON 537 AML_RESOURCE_SERIAL_COMMON 538 UINT32 ConnectionSpeed; 539 UINT16 SlaveAddress; 540 /* 541 * Optional fields follow immediately: 542 * 1) Vendor Data bytes 543 * 2) Resource Source String 544 */ 545 546 } AML_RESOURCE_I2C_SERIALBUS; 547 548 #define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */ 549 #define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */ 550 #define AML_RESOURCE_I2C_MIN_DATA_LEN 6 551 552 typedef struct aml_resource_spi_serialbus 553 { 554 AML_RESOURCE_LARGE_HEADER_COMMON 555 AML_RESOURCE_SERIAL_COMMON 556 UINT32 ConnectionSpeed; 557 UINT8 DataBitLength; 558 UINT8 ClockPhase; 559 UINT8 ClockPolarity; 560 UINT16 DeviceSelection; 561 /* 562 * Optional fields follow immediately: 563 * 1) Vendor Data bytes 564 * 2) Resource Source String 565 */ 566 567 } AML_RESOURCE_SPI_SERIALBUS; 568 569 #define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */ 570 #define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */ 571 #define AML_RESOURCE_SPI_MIN_DATA_LEN 9 572 573 574 typedef struct aml_resource_uart_serialbus 575 { 576 AML_RESOURCE_LARGE_HEADER_COMMON 577 AML_RESOURCE_SERIAL_COMMON 578 UINT32 DefaultBaudRate; 579 UINT16 RxFifoSize; 580 UINT16 TxFifoSize; 581 UINT8 Parity; 582 UINT8 LinesEnabled; 583 /* 584 * Optional fields follow immediately: 585 * 1) Vendor Data bytes 586 * 2) Resource Source String 587 */ 588 589 } AML_RESOURCE_UART_SERIALBUS; 590 591 #define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */ 592 #define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ 593 #define AML_RESOURCE_UART_MIN_DATA_LEN 10 594 595 596 /* restore default alignment */ 597 598 #pragma pack() 599 600 /* Union of all resource descriptors, so we can allocate the worst case */ 601 602 typedef union aml_resource 603 { 604 /* Descriptor headers */ 605 606 UINT8 DescriptorType; 607 AML_RESOURCE_SMALL_HEADER SmallHeader; 608 AML_RESOURCE_LARGE_HEADER LargeHeader; 609 610 /* Small resource descriptors */ 611 612 AML_RESOURCE_IRQ Irq; 613 AML_RESOURCE_DMA Dma; 614 AML_RESOURCE_START_DEPENDENT StartDpf; 615 AML_RESOURCE_END_DEPENDENT EndDpf; 616 AML_RESOURCE_IO Io; 617 AML_RESOURCE_FIXED_IO FixedIo; 618 AML_RESOURCE_FIXED_DMA FixedDma; 619 AML_RESOURCE_VENDOR_SMALL VendorSmall; 620 AML_RESOURCE_END_TAG EndTag; 621 622 /* Large resource descriptors */ 623 624 AML_RESOURCE_MEMORY24 Memory24; 625 AML_RESOURCE_GENERIC_REGISTER GenericReg; 626 AML_RESOURCE_VENDOR_LARGE VendorLarge; 627 AML_RESOURCE_MEMORY32 Memory32; 628 AML_RESOURCE_FIXED_MEMORY32 FixedMemory32; 629 AML_RESOURCE_ADDRESS16 Address16; 630 AML_RESOURCE_ADDRESS32 Address32; 631 AML_RESOURCE_ADDRESS64 Address64; 632 AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; 633 AML_RESOURCE_EXTENDED_IRQ ExtendedIrq; 634 AML_RESOURCE_GPIO Gpio; 635 AML_RESOURCE_I2C_SERIALBUS I2cSerialBus; 636 AML_RESOURCE_SPI_SERIALBUS SpiSerialBus; 637 AML_RESOURCE_UART_SERIALBUS UartSerialBus; 638 AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; 639 640 /* Utility overlays */ 641 642 AML_RESOURCE_ADDRESS Address; 643 UINT32 DwordItem; 644 UINT16 WordItem; 645 UINT8 ByteItem; 646 647 } AML_RESOURCE; 648 649 #endif 650