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