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