actypes.h revision 69746
1/****************************************************************************** 2 * 3 * Name: actypes.h - Common data types for the entire ACPI subsystem 4 * $Revision: 155 $ 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, Intel Corp. All rights 13 * 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 * Data types - Fixed across all compilation models 124 * 125 * BOOLEAN Logical Boolean. 126 * 1 byte value containing a 0 for FALSE or a 1 for TRUE. 127 * Other values are undefined. 128 * 129 * INT8 8-bit (1 byte) signed value 130 * UINT8 8-bit (1 byte) unsigned value 131 * INT16 16-bit (2 byte) signed value 132 * UINT16 16-bit (2 byte) unsigned value 133 * INT32 32-bit (4 byte) signed value 134 * UINT32 32-bit (4 byte) unsigned value 135 * INT64 64-bit (8 byte) signed value 136 * UINT64 64-bit (8 byte) unsigned value 137 * NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value 138 * NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value 139 * UCHAR Character. 1 byte unsigned value. 140 */ 141 142 143#ifdef _IA64 144/* 145 * 64-bit type definitions 146 */ 147typedef unsigned char UINT8; 148typedef unsigned char BOOLEAN; 149typedef unsigned char UCHAR; 150typedef unsigned short UINT16; 151typedef int INT32; 152typedef unsigned int UINT32; 153typedef COMPILER_DEPENDENT_UINT64 UINT64; 154 155typedef UINT64 NATIVE_UINT; 156typedef INT64 NATIVE_INT; 157 158typedef NATIVE_UINT ACPI_TBLPTR; 159typedef UINT64 ACPI_IO_ADDRESS; 160typedef UINT64 ACPI_PHYSICAL_ADDRESS; 161 162#define ALIGNED_ADDRESS_BOUNDARY 0x00000008 163 164/* (No hardware alignment support in IA64) */ 165 166 167#elif _IA16 168/* 169 * 16-bit type definitions 170 */ 171typedef unsigned char UINT8; 172typedef unsigned char BOOLEAN; 173typedef unsigned char UCHAR; 174typedef unsigned int UINT16; 175typedef long INT32; 176typedef int INT16; 177typedef unsigned long UINT32; 178 179typedef UINT16 NATIVE_UINT; 180typedef INT16 NATIVE_INT; 181 182typedef UINT32 ACPI_TBLPTR; 183typedef UINT32 ACPI_IO_ADDRESS; 184typedef UINT32 ACPI_PHYSICAL_ADDRESS; 185 186#define ALIGNED_ADDRESS_BOUNDARY 0x00000002 187#define _HW_ALIGNMENT_SUPPORT 188 189/* 190 * (16-bit only) internal integers must be 32-bits, so 191 * 64-bit integers cannot be supported 192 */ 193#define ACPI_NO_INTEGER64_SUPPORT 194 195 196#else 197/* 198 * 32-bit type definitions (default) 199 */ 200typedef unsigned char UINT8; 201typedef unsigned char BOOLEAN; 202typedef unsigned char UCHAR; 203typedef unsigned short UINT16; 204typedef int INT32; 205typedef unsigned int UINT32; 206typedef COMPILER_DEPENDENT_UINT64 UINT64; 207 208typedef UINT32 NATIVE_UINT; 209typedef INT32 NATIVE_INT; 210 211typedef NATIVE_UINT ACPI_TBLPTR; 212typedef UINT32 ACPI_IO_ADDRESS; 213typedef UINT64 ACPI_PHYSICAL_ADDRESS; 214 215#define ALIGNED_ADDRESS_BOUNDARY 0x00000004 216#define _HW_ALIGNMENT_SUPPORT 217#endif 218 219 220 221/* 222 * Miscellaneous common types 223 */ 224 225typedef UINT32 UINT32_BIT; 226typedef NATIVE_UINT ACPI_PTRDIFF; 227typedef char NATIVE_CHAR; 228 229 230/* 231 * Data type ranges 232 */ 233 234#define ACPI_UINT8_MAX (UINT8) 0xFF 235#define ACPI_UINT16_MAX (UINT16) 0xFFFF 236#define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF 237#define ACPI_UINT64_MAX (UINT64) 0xFFFFFFFFFFFFFFFF 238 239 240#ifdef DEFINE_ALTERNATE_TYPES 241/* 242 * Types used only in translated source 243 */ 244typedef INT32 s32; 245typedef UINT8 u8; 246typedef UINT16 u16; 247typedef UINT32 u32; 248typedef UINT64 u64; 249#endif 250/*! [End] no source code translation !*/ 251 252 253/* 254 * Useful defines 255 */ 256 257#ifdef FALSE 258#undef FALSE 259#endif 260#define FALSE (1 == 0) 261 262#ifdef TRUE 263#undef TRUE 264#endif 265#define TRUE (1 == 1) 266 267#ifndef NULL 268#define NULL (void *) 0 269#endif 270 271 272/* 273 * Local datatypes 274 */ 275 276typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */ 277typedef UINT32 ACPI_NAME; /* 4-INT8 ACPI name */ 278typedef char* ACPI_STRING; /* Null terminated ASCII string */ 279typedef void* ACPI_HANDLE; /* Actually a ptr to an Node */ 280 281 282/* 283 * Acpi integer width. In ACPI version 1, integers are 284 * 32 bits. In ACPI version 2, integers are 64 bits. 285 * Note that this pertains to the ACPI integer type only, not 286 * other integers used in the implementation of the ACPI CA 287 * subsystem. 288 */ 289#ifdef ACPI_NO_INTEGER64_SUPPORT 290 291/* 32-bit Integers */ 292 293typedef UINT32 ACPI_INTEGER; 294#define ACPI_INTEGER_MAX ACPI_UINT32_MAX; 295#define ACPI_INTEGER_BIT_SIZE 32 296 297#else 298 299/* 64-bit Integers */ 300 301typedef UINT64 ACPI_INTEGER; 302#define ACPI_INTEGER_MAX ACPI_UINT64_MAX; 303#define ACPI_INTEGER_BIT_SIZE 64 304 305#endif 306 307 308/* 309 * Constants with special meanings 310 */ 311 312#define ACPI_ROOT_OBJECT (ACPI_HANDLE)(-1) 313 314#define ACPI_FULL_INITIALIZATION 0x00 315#define ACPI_NO_ADDRESS_SPACE_INIT 0x01 316#define ACPI_NO_HARDWARE_INIT 0x02 317#define ACPI_NO_EVENT_INIT 0x04 318#define ACPI_NO_ACPI_ENABLE 0x08 319#define ACPI_NO_DEVICE_INIT 0x10 320#define ACPI_NO_PCI_INIT 0x20 321#define ACPI_NO_OBJECT_INIT 0x40 322 323 324/* 325 * Sleep state constants 326 */ 327#define ACPI_STATE_S0 (UINT8) 0 328#define ACPI_STATE_S1 (UINT8) 1 329#define ACPI_STATE_S2 (UINT8) 2 330#define ACPI_STATE_S3 (UINT8) 3 331#define ACPI_STATE_S4 (UINT8) 4 332#define ACPI_STATE_S4BIOS (UINT8) 5 333#define ACPI_STATE_S5 (UINT8) 6 334#define ACPI_S_STATES_MAX ACPI_STATE_S5 335 336 337/* 338 * Table types. These values are passed to the table related APIs 339 */ 340 341typedef UINT32 ACPI_TABLE_TYPE; 342 343#define ACPI_TABLE_RSDP (ACPI_TABLE_TYPE) 0 344#define ACPI_TABLE_DSDT (ACPI_TABLE_TYPE) 1 345#define ACPI_TABLE_FADT (ACPI_TABLE_TYPE) 2 346#define ACPI_TABLE_FACS (ACPI_TABLE_TYPE) 3 347#define ACPI_TABLE_PSDT (ACPI_TABLE_TYPE) 4 348#define ACPI_TABLE_SSDT (ACPI_TABLE_TYPE) 5 349#define ACPI_TABLE_XSDT (ACPI_TABLE_TYPE) 6 350#define ACPI_TABLE_MAX 6 351#define NUM_ACPI_TABLES (ACPI_TABLE_MAX+1) 352 353 354/* 355 * Types associated with names. The first group of 356 * values correspond to the definition of the ACPI 357 * ObjectType operator (See the ACPI Spec). Therefore, 358 * only add to the first group if the spec changes! 359 * 360 * Types must be kept in sync with the AcpiNsProperties 361 * and AcpiNsTypeNames arrays 362 */ 363 364typedef UINT32 ACPI_OBJECT_TYPE; 365typedef UINT8 OBJECT_TYPE_INTERNAL; 366 367#define ACPI_TYPE_ANY 0 /* 0x00 */ 368#define ACPI_TYPE_NUMBER 1 /* 0x01 Byte/Word/Dword/Zero/One/Ones */ 369#define ACPI_TYPE_STRING 2 /* 0x02 */ 370#define ACPI_TYPE_BUFFER 3 /* 0x03 */ 371#define ACPI_TYPE_PACKAGE 4 /* 0x04 ByteConst, multiple DataTerm/Constant/SuperName */ 372#define ACPI_TYPE_FIELD_UNIT 5 /* 0x05 */ 373#define ACPI_TYPE_DEVICE 6 /* 0x06 Name, multiple Node */ 374#define ACPI_TYPE_EVENT 7 /* 0x07 */ 375#define ACPI_TYPE_METHOD 8 /* 0x08 Name, ByteConst, multiple Code */ 376#define ACPI_TYPE_MUTEX 9 /* 0x09 */ 377#define ACPI_TYPE_REGION 10 /* 0x0A */ 378#define ACPI_TYPE_POWER 11 /* 0x0B Name,ByteConst,WordConst,multi Node */ 379#define ACPI_TYPE_PROCESSOR 12 /* 0x0C Name,ByteConst,DWordConst,ByteConst,multi NmO */ 380#define ACPI_TYPE_THERMAL 13 /* 0x0D Name, multiple Node */ 381#define ACPI_TYPE_BUFFER_FIELD 14 /* 0x0E */ 382#define ACPI_TYPE_DDB_HANDLE 15 /* 0x0F */ 383#define ACPI_TYPE_DEBUG_OBJECT 16 /* 0x10 */ 384 385#define ACPI_TYPE_MAX 16 386 387/* 388 * This section contains object types that do not relate to the ACPI ObjectType operator. 389 * They are used for various internal purposes only. If new predefined ACPI_TYPEs are 390 * added (via the ACPI specification), these internal types must move upwards. 391 * Also, values exceeding the largest official ACPI ObjectType must not overlap with 392 * defined AML opcodes. 393 */ 394#define INTERNAL_TYPE_BEGIN 17 395 396#define INTERNAL_TYPE_DEF_FIELD 17 /* 0x11 */ 397#define INTERNAL_TYPE_BANK_FIELD 18 /* 0x12 */ 398#define INTERNAL_TYPE_INDEX_FIELD 19 /* 0x13 */ 399#define INTERNAL_TYPE_REFERENCE 20 /* 0x14 Arg#, Local#, Name, Debug; used only in descriptors */ 400#define INTERNAL_TYPE_ALIAS 21 /* 0x15 */ 401#define INTERNAL_TYPE_NOTIFY 22 /* 0x16 */ 402#define INTERNAL_TYPE_ADDRESS_HANDLER 23 /* 0x17 */ 403#define INTERNAL_TYPE_RESOURCE 24 /* 0x18 */ 404 405 406#define INTERNAL_TYPE_NODE_MAX 24 407 408/* These are pseudo-types because there are never any namespace nodes with these types */ 409 410#define INTERNAL_TYPE_DEF_FIELD_DEFN 25 /* 0x19 Name, ByteConst, multiple FieldElement */ 411#define INTERNAL_TYPE_BANK_FIELD_DEFN 26 /* 0x1A 2 Name,DWordConst,ByteConst,multi FieldElement */ 412#define INTERNAL_TYPE_INDEX_FIELD_DEFN 27 /* 0x1B 2 Name, ByteConst, multiple FieldElement */ 413#define INTERNAL_TYPE_IF 28 /* 0x1C OpCode, multiple Code */ 414#define INTERNAL_TYPE_ELSE 29 /* 0x1D multiple Code */ 415#define INTERNAL_TYPE_WHILE 30 /* 0x1E OpCode, multiple Code */ 416#define INTERNAL_TYPE_SCOPE 31 /* 0x1F Name, multiple Node */ 417#define INTERNAL_TYPE_DEF_ANY 32 /* 0x20 type is Any, suppress search of enclosing scopes */ 418#define INTERNAL_TYPE_EXTRA 33 /* 0x21 */ 419 420#define INTERNAL_TYPE_MAX 33 421 422#define INTERNAL_TYPE_INVALID 34 423#define ACPI_TYPE_NOT_FOUND 0xFF 424 425/* 426 * AcpiEvent Types: 427 * ------------ 428 * Fixed & general purpose... 429 */ 430 431typedef UINT32 ACPI_EVENT_TYPE; 432 433#define ACPI_EVENT_FIXED (ACPI_EVENT_TYPE) 0 434#define ACPI_EVENT_GPE (ACPI_EVENT_TYPE) 1 435 436/* 437 * Fixed events 438 */ 439 440#define ACPI_EVENT_PMTIMER (ACPI_EVENT_TYPE) 0 441 /* 442 * There's no bus master event so index 1 is used for IRQ's that are not 443 * handled by the SCI handler 444 */ 445#define ACPI_EVENT_NOT_USED (ACPI_EVENT_TYPE) 1 446#define ACPI_EVENT_GLOBAL (ACPI_EVENT_TYPE) 2 447#define ACPI_EVENT_POWER_BUTTON (ACPI_EVENT_TYPE) 3 448#define ACPI_EVENT_SLEEP_BUTTON (ACPI_EVENT_TYPE) 4 449#define ACPI_EVENT_RTC (ACPI_EVENT_TYPE) 5 450#define ACPI_EVENT_GENERAL (ACPI_EVENT_TYPE) 6 451#define ACPI_EVENT_MAX 6 452#define NUM_FIXED_EVENTS (ACPI_EVENT_TYPE) 7 453 454#define ACPI_GPE_INVALID 0xFF 455#define ACPI_GPE_MAX 0xFF 456#define NUM_GPE 256 457 458#define ACPI_EVENT_LEVEL_TRIGGERED (ACPI_EVENT_TYPE) 1 459#define ACPI_EVENT_EDGE_TRIGGERED (ACPI_EVENT_TYPE) 2 460 461/* 462 * AcpiEvent Status: 463 * ------------- 464 * The encoding of ACPI_EVENT_STATUS is illustrated below. 465 * Note that a set bit (1) indicates the property is TRUE 466 * (e.g. if bit 0 is set then the event is enabled). 467 * +---------------+-+-+ 468 * | Bits 31:2 |1|0| 469 * +---------------+-+-+ 470 * | | | 471 * | | +- Enabled? 472 * | +--- Set? 473 * +----------- <Reserved> 474 */ 475typedef UINT32 ACPI_EVENT_STATUS; 476 477#define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00 478#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01 479#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x02 480 481 482/* Notify types */ 483 484#define ACPI_SYSTEM_NOTIFY 0 485#define ACPI_DEVICE_NOTIFY 1 486#define ACPI_MAX_NOTIFY_HANDLER_TYPE 1 487 488#define MAX_SYS_NOTIFY 0x7f 489 490 491/* Address Space (Operation Region) Types */ 492 493typedef UINT8 ACPI_ADDRESS_SPACE_TYPE; 494 495#define ADDRESS_SPACE_SYSTEM_MEMORY (ACPI_ADDRESS_SPACE_TYPE) 0 496#define ADDRESS_SPACE_SYSTEM_IO (ACPI_ADDRESS_SPACE_TYPE) 1 497#define ADDRESS_SPACE_PCI_CONFIG (ACPI_ADDRESS_SPACE_TYPE) 2 498#define ADDRESS_SPACE_EC (ACPI_ADDRESS_SPACE_TYPE) 3 499#define ADDRESS_SPACE_SMBUS (ACPI_ADDRESS_SPACE_TYPE) 4 500#define ADDRESS_SPACE_CMOS (ACPI_ADDRESS_SPACE_TYPE) 5 501#define ADDRESS_SPACE_PCI_BAR_TARGET (ACPI_ADDRESS_SPACE_TYPE) 6 502 503 504/* 505 * External ACPI object definition 506 */ 507 508typedef union AcpiObj 509{ 510 ACPI_OBJECT_TYPE Type; /* See definition of AcpiNsType for values */ 511 struct 512 { 513 ACPI_OBJECT_TYPE Type; 514 ACPI_INTEGER Value; /* The actual number */ 515 } Number; 516 517 struct 518 { 519 ACPI_OBJECT_TYPE Type; 520 UINT32 Length; /* # of bytes in string, excluding trailing null */ 521 NATIVE_CHAR *Pointer; /* points to the string value */ 522 } String; 523 524 struct 525 { 526 ACPI_OBJECT_TYPE Type; 527 UINT32 Length; /* # of bytes in buffer */ 528 UINT8 *Pointer; /* points to the buffer */ 529 } Buffer; 530 531 struct 532 { 533 ACPI_OBJECT_TYPE Type; 534 UINT32 Fill1; 535 ACPI_HANDLE Handle; /* object reference */ 536 } Reference; 537 538 struct 539 { 540 ACPI_OBJECT_TYPE Type; 541 UINT32 Count; /* # of elements in package */ 542 union AcpiObj *Elements; /* Pointer to an array of ACPI_OBJECTs */ 543 } Package; 544 545 struct 546 { 547 ACPI_OBJECT_TYPE Type; 548 UINT32 ProcId; 549 UINT32 PblkAddress; 550 UINT32 PblkLength; 551 } Processor; 552 553 struct 554 { 555 ACPI_OBJECT_TYPE Type; 556 UINT32 SystemLevel; 557 UINT32 ResourceOrder; 558 } PowerResource; 559 560} ACPI_OBJECT, *PACPI_OBJECT; 561 562 563/* 564 * List of objects, used as a parameter list for control method evaluation 565 */ 566 567typedef struct AcpiObjList 568{ 569 UINT32 Count; 570 ACPI_OBJECT *Pointer; 571 572} ACPI_OBJECT_LIST, *PACPI_OBJECT_LIST; 573 574 575/* 576 * Miscellaneous common Data Structures used by the interfaces 577 */ 578 579typedef struct 580{ 581 UINT32 Length; /* Length in bytes of the buffer */ 582 void *Pointer; /* pointer to buffer */ 583 584} ACPI_BUFFER; 585 586 587/* 588 * NameType for AcpiGetName 589 */ 590 591#define ACPI_FULL_PATHNAME 0 592#define ACPI_SINGLE_NAME 1 593#define ACPI_NAME_TYPE_MAX 1 594 595 596/* 597 * Structure and flags for AcpiGetSystemInfo 598 */ 599 600#define SYS_MODE_UNKNOWN 0x0000 601#define SYS_MODE_ACPI 0x0001 602#define SYS_MODE_LEGACY 0x0002 603#define SYS_MODES_MASK 0x0003 604 605/* 606 * ACPI CPU Cx state handler 607 */ 608typedef 609ACPI_STATUS (*ACPI_SET_C_STATE_HANDLER) ( 610 NATIVE_UINT PblkAddress); 611 612/* 613 * ACPI Cx State info 614 */ 615typedef struct 616{ 617 UINT32 StateNumber; 618 UINT32 Latency; 619} ACPI_CX_STATE; 620 621/* 622 * ACPI CPU throttling info 623 */ 624typedef struct 625{ 626 UINT32 StateNumber; 627 UINT32 PercentOfClock; 628} ACPI_CPU_THROTTLING_STATE; 629 630/* 631 * ACPI Table Info. One per ACPI table _type_ 632 */ 633typedef struct AcpiTableInfo 634{ 635 UINT32 Count; 636 637} ACPI_TABLE_INFO; 638 639 640/* 641 * System info returned by AcpiGetSystemInfo() 642 */ 643 644typedef struct _AcpiSysInfo 645{ 646 UINT32 AcpiCaVersion; 647 UINT32 Flags; 648 UINT32 TimerResolution; 649 UINT32 Reserved1; 650 UINT32 Reserved2; 651 UINT32 DebugLevel; 652 UINT32 DebugLayer; 653 UINT32 NumTableTypes; 654 ACPI_TABLE_INFO TableInfo [NUM_ACPI_TABLES]; 655 656} ACPI_SYSTEM_INFO; 657 658 659/* 660 * System Initiailization data. This data is passed to ACPIInitialize 661 * copyied to global data and retained by ACPI CA 662 */ 663 664typedef struct _AcpiInitData 665{ 666 void *RSDP_PhysicalAddress; /* Address of RSDP, needed it it is */ 667 /* not found in the IA32 manner */ 668} ACPI_INIT_DATA; 669 670/* 671 * Various handlers and callback procedures 672 */ 673 674typedef 675UINT32 (*FIXED_EVENT_HANDLER) ( 676 void *Context); 677 678typedef 679void (*GPE_HANDLER) ( 680 void *Context); 681 682typedef 683void (*NOTIFY_HANDLER) ( 684 ACPI_HANDLE Device, 685 UINT32 Value, 686 void *Context); 687 688#define ADDRESS_SPACE_READ 1 689#define ADDRESS_SPACE_WRITE 2 690 691typedef 692ACPI_STATUS (*ADDRESS_SPACE_HANDLER) ( 693 UINT32 Function, 694 ACPI_PHYSICAL_ADDRESS Address, 695 UINT32 BitWidth, 696 UINT32 *Value, 697 void *HandlerContext, 698 void *RegionContext); 699 700#define ACPI_DEFAULT_HANDLER ((ADDRESS_SPACE_HANDLER) NULL) 701 702 703typedef 704ACPI_STATUS (*ADDRESS_SPACE_SETUP) ( 705 ACPI_HANDLE RegionHandle, 706 UINT32 Function, 707 void *HandlerContext, 708 void **RegionContext); 709 710#define ACPI_REGION_ACTIVATE 0 711#define ACPI_REGION_DEACTIVATE 1 712 713typedef 714ACPI_STATUS (*WALK_CALLBACK) ( 715 ACPI_HANDLE ObjHandle, 716 UINT32 NestingLevel, 717 void *Context, 718 void **ReturnValue); 719 720 721/* Interrupt handler return values */ 722 723#define INTERRUPT_NOT_HANDLED 0x00 724#define INTERRUPT_HANDLED 0x01 725 726 727/* Structure and flags for AcpiGetDeviceInfo */ 728 729#define ACPI_VALID_HID 0x1 730#define ACPI_VALID_UID 0x2 731#define ACPI_VALID_ADR 0x4 732#define ACPI_VALID_STA 0x8 733 734 735#define ACPI_COMMON_OBJ_INFO \ 736 ACPI_OBJECT_TYPE Type; /* ACPI object type */ \ 737 ACPI_NAME Name /* ACPI object Name */ 738 739 740typedef struct 741{ 742 ACPI_COMMON_OBJ_INFO; 743} ACPI_OBJ_INFO_HEADER; 744 745 746typedef struct 747{ 748 ACPI_COMMON_OBJ_INFO; 749 750 UINT32 Valid; /* Are the next bits legit? */ 751 NATIVE_CHAR HardwareId [9]; /* _HID value if any */ 752 NATIVE_CHAR UniqueId[9]; /* _UID value if any */ 753 ACPI_INTEGER Address; /* _ADR value if any */ 754 UINT32 CurrentStatus; /* _STA value */ 755} ACPI_DEVICE_INFO; 756 757 758/* Context structs for address space handlers */ 759 760typedef struct 761{ 762 UINT32 Seg; 763 UINT32 Bus; 764 UINT32 DevFunc; 765} PCI_HANDLER_CONTEXT; 766 767 768typedef struct 769{ 770 UINT64 MappedPhysicalAddress; 771 UINT8 *MappedLogicalAddress; 772 UINT32 MappedLength; 773} MEM_HANDLER_CONTEXT; 774 775 776/* 777 * C-state handler 778 */ 779 780typedef ACPI_STATUS (*ACPI_C_STATE_HANDLER) (ACPI_IO_ADDRESS, UINT32*); 781 782 783/* 784 * Definitions for Resource Attributes 785 */ 786 787/* 788 * Memory Attributes 789 */ 790#define READ_ONLY_MEMORY (UINT8) 0x00 791#define READ_WRITE_MEMORY (UINT8) 0x01 792 793#define NON_CACHEABLE_MEMORY (UINT8) 0x00 794#define CACHABLE_MEMORY (UINT8) 0x01 795#define WRITE_COMBINING_MEMORY (UINT8) 0x02 796#define PREFETCHABLE_MEMORY (UINT8) 0x03 797 798/* 799 * IO Attributes 800 * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. 801 * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. 802 */ 803#define NON_ISA_ONLY_RANGES (UINT8) 0x01 804#define ISA_ONLY_RANGES (UINT8) 0x02 805#define ENTIRE_RANGE (NON_ISA_ONLY_RANGES | ISA_ONLY_RANGES) 806 807/* 808 * IO Port Descriptor Decode 809 */ 810#define DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */ 811#define DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */ 812 813/* 814 * IRQ Attributes 815 */ 816#define EDGE_SENSITIVE (UINT8) 0x00 817#define LEVEL_SENSITIVE (UINT8) 0x01 818 819#define ACTIVE_HIGH (UINT8) 0x00 820#define ACTIVE_LOW (UINT8) 0x01 821 822#define EXCLUSIVE (UINT8) 0x00 823#define SHARED (UINT8) 0x01 824 825/* 826 * DMA Attributes 827 */ 828#define COMPATIBILITY (UINT8) 0x00 829#define TYPE_A (UINT8) 0x01 830#define TYPE_B (UINT8) 0x02 831#define TYPE_F (UINT8) 0x03 832 833#define NOT_BUS_MASTER (UINT8) 0x00 834#define BUS_MASTER (UINT8) 0x01 835 836#define TRANSFER_8 (UINT8) 0x00 837#define TRANSFER_8_16 (UINT8) 0x01 838#define TRANSFER_16 (UINT8) 0x02 839 840/* 841 * Start Dependent Functions Priority definitions 842 */ 843#define GOOD_CONFIGURATION (UINT8) 0x00 844#define ACCEPTABLE_CONFIGURATION (UINT8) 0x01 845#define SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02 846 847/* 848 * 16, 32 and 64-bit Address Descriptor resource types 849 */ 850#define MEMORY_RANGE (UINT8) 0x00 851#define IO_RANGE (UINT8) 0x01 852#define BUS_NUMBER_RANGE (UINT8) 0x02 853 854#define ADDRESS_NOT_FIXED (UINT8) 0x00 855#define ADDRESS_FIXED (UINT8) 0x01 856 857#define POS_DECODE (UINT8) 0x00 858#define SUB_DECODE (UINT8) 0x01 859 860#define PRODUCER (UINT8) 0x00 861#define CONSUMER (UINT8) 0x01 862 863 864/* 865 * Structures used to describe device resources 866 */ 867typedef struct 868{ 869 UINT32 EdgeLevel; 870 UINT32 ActiveHighLow; 871 UINT32 SharedExclusive; 872 UINT32 NumberOfInterrupts; 873 UINT32 Interrupts[1]; 874 875} IRQ_RESOURCE; 876 877typedef struct 878{ 879 UINT32 Type; 880 UINT32 BusMaster; 881 UINT32 Transfer; 882 UINT32 NumberOfChannels; 883 UINT32 Channels[1]; 884 885} DMA_RESOURCE; 886 887typedef struct 888{ 889 UINT32 CompatibilityPriority; 890 UINT32 PerformanceRobustness; 891 892} START_DEPENDENT_FUNCTIONS_RESOURCE; 893 894/* 895 * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not 896 * needed because it has no fields 897 */ 898 899typedef struct 900{ 901 UINT32 IoDecode; 902 UINT32 MinBaseAddress; 903 UINT32 MaxBaseAddress; 904 UINT32 Alignment; 905 UINT32 RangeLength; 906 907} IO_RESOURCE; 908 909typedef struct 910{ 911 UINT32 BaseAddress; 912 UINT32 RangeLength; 913 914} FIXED_IO_RESOURCE; 915 916typedef struct 917{ 918 UINT32 Length; 919 UINT8 Reserved[1]; 920 921} VENDOR_RESOURCE; 922 923typedef struct 924{ 925 UINT32 ReadWriteAttribute; 926 UINT32 MinBaseAddress; 927 UINT32 MaxBaseAddress; 928 UINT32 Alignment; 929 UINT32 RangeLength; 930 931} MEMORY24_RESOURCE; 932 933typedef struct 934{ 935 UINT32 ReadWriteAttribute; 936 UINT32 MinBaseAddress; 937 UINT32 MaxBaseAddress; 938 UINT32 Alignment; 939 UINT32 RangeLength; 940 941} MEMORY32_RESOURCE; 942 943typedef struct 944{ 945 UINT32 ReadWriteAttribute; 946 UINT32 RangeBaseAddress; 947 UINT32 RangeLength; 948 949} FIXED_MEMORY32_RESOURCE; 950 951typedef struct 952{ 953 UINT16 CacheAttribute; 954 UINT16 ReadWriteAttribute; 955 956} MEMORY_ATTRIBUTE; 957 958typedef struct 959{ 960 UINT16 RangeAttribute; 961 UINT16 Reserved; 962 963} IO_ATTRIBUTE; 964 965typedef struct 966{ 967 UINT16 Reserved1; 968 UINT16 Reserved2; 969 970} BUS_ATTRIBUTE; 971 972typedef union 973{ 974 MEMORY_ATTRIBUTE Memory; 975 IO_ATTRIBUTE Io; 976 BUS_ATTRIBUTE Bus; 977 978} ATTRIBUTE_DATA; 979 980typedef struct 981{ 982 UINT32 ResourceType; 983 UINT32 ProducerConsumer; 984 UINT32 Decode; 985 UINT32 MinAddressFixed; 986 UINT32 MaxAddressFixed; 987 ATTRIBUTE_DATA Attribute; 988 UINT32 Granularity; 989 UINT32 MinAddressRange; 990 UINT32 MaxAddressRange; 991 UINT32 AddressTranslationOffset; 992 UINT32 AddressLength; 993 UINT32 ResourceSourceIndex; 994 UINT32 ResourceSourceStringLength; 995 NATIVE_CHAR ResourceSource[1]; 996 997} ADDRESS16_RESOURCE; 998 999typedef struct 1000{ 1001 UINT32 ResourceType; 1002 UINT32 ProducerConsumer; 1003 UINT32 Decode; 1004 UINT32 MinAddressFixed; 1005 UINT32 MaxAddressFixed; 1006 ATTRIBUTE_DATA Attribute; 1007 UINT32 Granularity; 1008 UINT32 MinAddressRange; 1009 UINT32 MaxAddressRange; 1010 UINT32 AddressTranslationOffset; 1011 UINT32 AddressLength; 1012 UINT32 ResourceSourceIndex; 1013 UINT32 ResourceSourceStringLength; 1014 NATIVE_CHAR ResourceSource[1]; 1015 1016} ADDRESS32_RESOURCE; 1017 1018typedef struct 1019{ 1020 UINT32 ProducerConsumer; 1021 UINT32 EdgeLevel; 1022 UINT32 ActiveHighLow; 1023 UINT32 SharedExclusive; 1024 UINT32 NumberOfInterrupts; 1025 UINT32 Interrupts[1]; 1026 UINT32 ResourceSourceIndex; 1027 UINT32 ResourceSourceStringLength; 1028 NATIVE_CHAR ResourceSource[1]; 1029 1030} EXTENDED_IRQ_RESOURCE; 1031 1032typedef enum 1033{ 1034 Irq, 1035 Dma, 1036 StartDependentFunctions, 1037 EndDependentFunctions, 1038 Io, 1039 FixedIo, 1040 VendorSpecific, 1041 EndTag, 1042 Memory24, 1043 Memory32, 1044 FixedMemory32, 1045 Address16, 1046 Address32, 1047 ExtendedIrq 1048} RESOURCE_TYPE; 1049 1050typedef union 1051{ 1052 IRQ_RESOURCE Irq; 1053 DMA_RESOURCE Dma; 1054 START_DEPENDENT_FUNCTIONS_RESOURCE StartDependentFunctions; 1055 IO_RESOURCE Io; 1056 FIXED_IO_RESOURCE FixedIo; 1057 VENDOR_RESOURCE VendorSpecific; 1058 MEMORY24_RESOURCE Memory24; 1059 MEMORY32_RESOURCE Memory32; 1060 FIXED_MEMORY32_RESOURCE FixedMemory32; 1061 ADDRESS16_RESOURCE Address16; 1062 ADDRESS32_RESOURCE Address32; 1063 EXTENDED_IRQ_RESOURCE ExtendedIrq; 1064} RESOURCE_DATA; 1065 1066typedef struct _resource_tag 1067{ 1068 RESOURCE_TYPE Id; 1069 UINT32 Length; 1070 RESOURCE_DATA Data; 1071} RESOURCE; 1072 1073#define RESOURCE_LENGTH 12 1074#define RESOURCE_LENGTH_NO_DATA 8 1075 1076#define NEXT_RESOURCE(Res) (RESOURCE*)((UINT8*) Res + Res->length) 1077 1078/* 1079 * END: Definitions for Resource Attributes 1080 */ 1081 1082/* 1083 * Definitions for PCI Routing tables 1084 */ 1085typedef struct 1086{ 1087 ACPI_INTEGER Address; 1088 UINT32 Pin; 1089 UINT32 SourceIndex; 1090 NATIVE_CHAR Source[1]; 1091 1092} PRT_ENTRY; 1093 1094typedef struct _prt_tag 1095{ 1096 UINT32 Length; 1097 PRT_ENTRY Data; 1098 1099} PCI_ROUTING_TABLE; 1100 1101 1102/* 1103 * END: Definitions for PCI Routing tables 1104 */ 1105 1106#endif /* __ACTYPES_H__ */ 1107