actypes.h revision 250838
1/****************************************************************************** 2 * 3 * Name: actypes.h - Common data types for the entire ACPI subsystem 4 * 5 *****************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2013, Intel Corp. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions, and the following disclaimer, 16 * without modification. 17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18 * substantially similar to the "NO WARRANTY" disclaimer below 19 * ("Disclaimer") and any redistribution must be conditioned upon 20 * including a substantially similar Disclaimer requirement for further 21 * binary redistribution. 22 * 3. Neither the names of the above-listed copyright holders nor the names 23 * of any contributors may be used to endorse or promote products derived 24 * from this software without specific prior written permission. 25 * 26 * Alternatively, this software may be distributed under the terms of the 27 * GNU General Public License ("GPL") version 2 as published by the Free 28 * Software Foundation. 29 * 30 * NO WARRANTY 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41 * POSSIBILITY OF SUCH DAMAGES. 42 */ 43 44#ifndef __ACTYPES_H__ 45#define __ACTYPES_H__ 46 47/* acpisrc:StructDefs -- for acpisrc conversion */ 48 49/* 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 51 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of 52 * 12/2006. 53 */ 54#ifndef ACPI_MACHINE_WIDTH 55#error ACPI_MACHINE_WIDTH not defined 56#endif 57 58/*! [Begin] no source code translation */ 59 60/* 61 * Data type ranges 62 * Note: These macros are designed to be compiler independent as well as 63 * working around problems that some 32-bit compilers have with 64-bit 64 * constants. 65 */ 66#define ACPI_UINT8_MAX (UINT8) (~((UINT8) 0)) /* 0xFF */ 67#define ACPI_UINT16_MAX (UINT16)(~((UINT16) 0)) /* 0xFFFF */ 68#define ACPI_UINT32_MAX (UINT32)(~((UINT32) 0)) /* 0xFFFFFFFF */ 69#define ACPI_UINT64_MAX (UINT64)(~((UINT64) 0)) /* 0xFFFFFFFFFFFFFFFF */ 70#define ACPI_ASCII_MAX 0x7F 71 72 73/* 74 * Architecture-specific ACPICA Subsystem Data Types 75 * 76 * The goal of these types is to provide source code portability across 77 * 16-bit, 32-bit, and 64-bit targets. 78 * 79 * 1) The following types are of fixed size for all targets (16/32/64): 80 * 81 * BOOLEAN Logical boolean 82 * 83 * UINT8 8-bit (1 byte) unsigned value 84 * UINT16 16-bit (2 byte) unsigned value 85 * UINT32 32-bit (4 byte) unsigned value 86 * UINT64 64-bit (8 byte) unsigned value 87 * 88 * INT16 16-bit (2 byte) signed value 89 * INT32 32-bit (4 byte) signed value 90 * INT64 64-bit (8 byte) signed value 91 * 92 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the 93 * compiler-dependent header(s) and were introduced because there is no common 94 * 64-bit integer type across the various compilation models, as shown in 95 * the table below. 96 * 97 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit 98 * char 8 8 8 8 8 8 99 * short 16 16 16 16 16 16 100 * _int32 32 101 * int 32 64 32 32 16 16 102 * long 64 64 32 32 32 32 103 * long long 64 64 104 * pointer 64 64 64 32 32 32 105 * 106 * Note: ILP64 and LP32 are currently not supported. 107 * 108 * 109 * 2) These types represent the native word size of the target mode of the 110 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are 111 * usually used for memory allocation, efficient loop counters, and array 112 * indexes. The types are similar to the size_t type in the C library and are 113 * required because there is no C type that consistently represents the native 114 * data width. ACPI_SIZE is needed because there is no guarantee that a 115 * kernel-level C library is present. 116 * 117 * ACPI_SIZE 16/32/64-bit unsigned value 118 * ACPI_NATIVE_INT 16/32/64-bit signed value 119 */ 120 121/******************************************************************************* 122 * 123 * Common types for all compilers, all targets 124 * 125 ******************************************************************************/ 126 127typedef unsigned char BOOLEAN; 128typedef unsigned char UINT8; 129typedef unsigned short UINT16; 130typedef COMPILER_DEPENDENT_UINT64 UINT64; 131typedef COMPILER_DEPENDENT_INT64 INT64; 132 133/*! [End] no source code translation !*/ 134 135/* 136 * Value returned by AcpiOsGetThreadId. There is no standard "thread_id" 137 * across operating systems or even the various UNIX systems. Since ACPICA 138 * only needs the thread ID as a unique thread identifier, we use a UINT64 139 * as the only common data type - it will accommodate any type of pointer or 140 * any type of integer. It is up to the host-dependent OSL to cast the 141 * native thread ID type to a UINT64 (in AcpiOsGetThreadId). 142 */ 143#define ACPI_THREAD_ID UINT64 144 145 146/******************************************************************************* 147 * 148 * Types specific to 64-bit targets 149 * 150 ******************************************************************************/ 151 152#if ACPI_MACHINE_WIDTH == 64 153 154/*! [Begin] no source code translation (keep the typedefs as-is) */ 155 156typedef unsigned int UINT32; 157typedef int INT32; 158 159/*! [End] no source code translation !*/ 160 161 162typedef INT64 ACPI_NATIVE_INT; 163typedef UINT64 ACPI_SIZE; 164typedef UINT64 ACPI_IO_ADDRESS; 165typedef UINT64 ACPI_PHYSICAL_ADDRESS; 166 167#define ACPI_MAX_PTR ACPI_UINT64_MAX 168#define ACPI_SIZE_MAX ACPI_UINT64_MAX 169#define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ 170 171/* 172 * In the case of the Itanium Processor Family (IPF), the hardware does not 173 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 174 * to indicate that special precautions must be taken to avoid alignment faults. 175 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 176 * 177 * Note: EM64T and other X86-64 processors support misaligned transfers, 178 * so there is no need to define this flag. 179 */ 180#if defined (__IA64__) || defined (__ia64__) 181#define ACPI_MISALIGNMENT_NOT_SUPPORTED 182#endif 183 184 185/******************************************************************************* 186 * 187 * Types specific to 32-bit targets 188 * 189 ******************************************************************************/ 190 191#elif ACPI_MACHINE_WIDTH == 32 192 193/*! [Begin] no source code translation (keep the typedefs as-is) */ 194 195typedef unsigned int UINT32; 196typedef int INT32; 197 198/*! [End] no source code translation !*/ 199 200 201typedef INT32 ACPI_NATIVE_INT; 202typedef UINT32 ACPI_SIZE; 203typedef UINT32 ACPI_IO_ADDRESS; 204typedef UINT32 ACPI_PHYSICAL_ADDRESS; 205 206#define ACPI_MAX_PTR ACPI_UINT32_MAX 207#define ACPI_SIZE_MAX ACPI_UINT32_MAX 208 209#else 210 211/* ACPI_MACHINE_WIDTH must be either 64 or 32 */ 212 213#error unknown ACPI_MACHINE_WIDTH 214#endif 215 216 217/******************************************************************************* 218 * 219 * OS-dependent types 220 * 221 * If the defaults below are not appropriate for the host system, they can 222 * be defined in the OS-specific header, and this will take precedence. 223 * 224 ******************************************************************************/ 225 226/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */ 227 228#ifndef ACPI_CPU_FLAGS 229#define ACPI_CPU_FLAGS ACPI_SIZE 230#endif 231 232/* Object returned from AcpiOsCreateCache */ 233 234#ifndef ACPI_CACHE_T 235#ifdef ACPI_USE_LOCAL_CACHE 236#define ACPI_CACHE_T ACPI_MEMORY_LIST 237#else 238#define ACPI_CACHE_T void * 239#endif 240#endif 241 242/* 243 * Synchronization objects - Mutexes, Semaphores, and SpinLocks 244 */ 245#if (ACPI_MUTEX_TYPE == ACPI_BINARY_SEMAPHORE) 246/* 247 * These macros are used if the host OS does not support a mutex object. 248 * Map the OSL Mutex interfaces to binary semaphores. 249 */ 250#define ACPI_MUTEX ACPI_SEMAPHORE 251#define AcpiOsCreateMutex(OutHandle) AcpiOsCreateSemaphore (1, 1, OutHandle) 252#define AcpiOsDeleteMutex(Handle) (void) AcpiOsDeleteSemaphore (Handle) 253#define AcpiOsAcquireMutex(Handle,Time) AcpiOsWaitSemaphore (Handle, 1, Time) 254#define AcpiOsReleaseMutex(Handle) (void) AcpiOsSignalSemaphore (Handle, 1) 255#endif 256 257/* Configurable types for synchronization objects */ 258 259#ifndef ACPI_SPINLOCK 260#define ACPI_SPINLOCK void * 261#endif 262 263#ifndef ACPI_SEMAPHORE 264#define ACPI_SEMAPHORE void * 265#endif 266 267#ifndef ACPI_MUTEX 268#define ACPI_MUTEX void * 269#endif 270 271 272/******************************************************************************* 273 * 274 * Compiler-dependent types 275 * 276 * If the defaults below are not appropriate for the host compiler, they can 277 * be defined in the compiler-specific header, and this will take precedence. 278 * 279 ******************************************************************************/ 280 281/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 282 283#ifndef ACPI_UINTPTR_T 284#define ACPI_UINTPTR_T void * 285#endif 286 287/* 288 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because 289 * some compilers can catch printf format string problems 290 */ 291#ifndef ACPI_PRINTF_LIKE 292#define ACPI_PRINTF_LIKE(c) 293#endif 294 295/* 296 * Some compilers complain about unused variables. Sometimes we don't want to 297 * use all the variables (for example, _AcpiModuleName). This allows us 298 * to tell the compiler in a per-variable manner that a variable 299 * is unused 300 */ 301#ifndef ACPI_UNUSED_VAR 302#define ACPI_UNUSED_VAR 303#endif 304 305/* 306 * All ACPICA functions that are available to the rest of the kernel are 307 * tagged with this macro which can be defined as appropriate for the host. 308 */ 309#ifndef ACPI_EXPORT_SYMBOL 310#define ACPI_EXPORT_SYMBOL(Symbol) 311#endif 312 313/* 314 * Compiler/Clibrary-dependent debug initialization. Used for ACPICA 315 * utilities only. 316 */ 317#ifndef ACPI_DEBUG_INITIALIZE 318#define ACPI_DEBUG_INITIALIZE() 319#endif 320 321 322/****************************************************************************** 323 * 324 * ACPI Specification constants (Do not change unless the specification changes) 325 * 326 *****************************************************************************/ 327 328/* Number of distinct FADT-based GPE register blocks (GPE0 and GPE1) */ 329 330#define ACPI_MAX_GPE_BLOCKS 2 331 332/* Default ACPI register widths */ 333 334#define ACPI_GPE_REGISTER_WIDTH 8 335#define ACPI_PM1_REGISTER_WIDTH 16 336#define ACPI_PM2_REGISTER_WIDTH 8 337#define ACPI_PM_TIMER_WIDTH 32 338 339/* Names within the namespace are 4 bytes long */ 340 341#define ACPI_NAME_SIZE 4 342#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ 343#define ACPI_PATH_SEPARATOR '.' 344 345/* Sizes for ACPI table headers */ 346 347#define ACPI_OEM_ID_SIZE 6 348#define ACPI_OEM_TABLE_ID_SIZE 8 349 350/* ACPI/PNP hardware IDs */ 351 352#define PCI_ROOT_HID_STRING "PNP0A03" 353#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08" 354 355/* PM Timer ticks per second (HZ) */ 356 357#define ACPI_PM_TIMER_FREQUENCY 3579545 358 359 360/******************************************************************************* 361 * 362 * Independent types 363 * 364 ******************************************************************************/ 365 366/* Logical defines and NULL */ 367 368#ifdef FALSE 369#undef FALSE 370#endif 371#define FALSE (1 == 0) 372 373#ifdef TRUE 374#undef TRUE 375#endif 376#define TRUE (1 == 1) 377 378#ifndef NULL 379#define NULL (void *) 0 380#endif 381 382 383/* 384 * Miscellaneous types 385 */ 386typedef UINT32 ACPI_STATUS; /* All ACPI Exceptions */ 387typedef UINT32 ACPI_NAME; /* 4-byte ACPI name */ 388typedef char * ACPI_STRING; /* Null terminated ASCII string */ 389typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */ 390 391 392/* Time constants for timer calculations */ 393 394#define ACPI_MSEC_PER_SEC 1000L 395 396#define ACPI_USEC_PER_MSEC 1000L 397#define ACPI_USEC_PER_SEC 1000000L 398 399#define ACPI_100NSEC_PER_USEC 10L 400#define ACPI_100NSEC_PER_MSEC 10000L 401#define ACPI_100NSEC_PER_SEC 10000000L 402 403#define ACPI_NSEC_PER_USEC 1000L 404#define ACPI_NSEC_PER_MSEC 1000000L 405#define ACPI_NSEC_PER_SEC 1000000000L 406 407 408/* Owner IDs are used to track namespace nodes for selective deletion */ 409 410typedef UINT8 ACPI_OWNER_ID; 411#define ACPI_OWNER_ID_MAX 0xFF 412 413 414#define ACPI_INTEGER_BIT_SIZE 64 415#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 416#define ACPI_MAX64_DECIMAL_DIGITS 20 417#define ACPI_MAX32_DECIMAL_DIGITS 10 418#define ACPI_MAX16_DECIMAL_DIGITS 5 419#define ACPI_MAX8_DECIMAL_DIGITS 3 420 421/* 422 * Constants with special meanings 423 */ 424#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (ACPI_HANDLE, NULL, ACPI_MAX_PTR) 425#define ACPI_WAIT_FOREVER 0xFFFF /* UINT16, as per ACPI spec */ 426#define ACPI_DO_NOT_WAIT 0 427 428/* 429 * Obsolete: Acpi integer width. In ACPI version 1 (1996), integers are 32 bits. 430 * In ACPI version 2 (2000) and later, integers are 64 bits. Note that this 431 * pertains to the ACPI integer type only, not to other integers used in the 432 * implementation of the ACPICA subsystem. 433 * 434 * 01/2010: This type is obsolete and has been removed from the entire ACPICA 435 * code base. It remains here for compatibility with device drivers that use 436 * the type. However, it will be removed in the future. 437 */ 438typedef UINT64 ACPI_INTEGER; 439#define ACPI_INTEGER_MAX ACPI_UINT64_MAX 440 441 442/******************************************************************************* 443 * 444 * Commonly used macros 445 * 446 ******************************************************************************/ 447 448/* Data manipulation */ 449 450#define ACPI_LOBYTE(Integer) ((UINT8) (UINT16)(Integer)) 451#define ACPI_HIBYTE(Integer) ((UINT8) (((UINT16)(Integer)) >> 8)) 452#define ACPI_LOWORD(Integer) ((UINT16) (UINT32)(Integer)) 453#define ACPI_HIWORD(Integer) ((UINT16)(((UINT32)(Integer)) >> 16)) 454#define ACPI_LODWORD(Integer64) ((UINT32) (UINT64)(Integer64)) 455#define ACPI_HIDWORD(Integer64) ((UINT32)(((UINT64)(Integer64)) >> 32)) 456 457#define ACPI_SET_BIT(target,bit) ((target) |= (bit)) 458#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) 459#define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) 460#define ACPI_MAX(a,b) (((a)>(b))?(a):(b)) 461 462/* Size calculation */ 463 464#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) 465 466/* Pointer manipulation */ 467 468#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p)) 469#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p)) 470#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b))) 471#define ACPI_PTR_DIFF(a, b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b))) 472 473/* Pointer/Integer type conversions */ 474 475#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i) 476#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) 477#define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) 478#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 479#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 480 481/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */ 482 483#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 484#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) 485#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) 486#else 487#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) 488#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) 489#endif 490 491 492/******************************************************************************* 493 * 494 * Miscellaneous constants 495 * 496 ******************************************************************************/ 497 498/* 499 * Initialization sequence 500 */ 501#define ACPI_FULL_INITIALIZATION 0x00 502#define ACPI_NO_ADDRESS_SPACE_INIT 0x01 503#define ACPI_NO_HARDWARE_INIT 0x02 504#define ACPI_NO_EVENT_INIT 0x04 505#define ACPI_NO_HANDLER_INIT 0x08 506#define ACPI_NO_ACPI_ENABLE 0x10 507#define ACPI_NO_DEVICE_INIT 0x20 508#define ACPI_NO_OBJECT_INIT 0x40 509 510/* 511 * Initialization state 512 */ 513#define ACPI_SUBSYSTEM_INITIALIZE 0x01 514#define ACPI_INITIALIZED_OK 0x02 515 516/* 517 * Power state values 518 */ 519#define ACPI_STATE_UNKNOWN (UINT8) 0xFF 520 521#define ACPI_STATE_S0 (UINT8) 0 522#define ACPI_STATE_S1 (UINT8) 1 523#define ACPI_STATE_S2 (UINT8) 2 524#define ACPI_STATE_S3 (UINT8) 3 525#define ACPI_STATE_S4 (UINT8) 4 526#define ACPI_STATE_S5 (UINT8) 5 527#define ACPI_S_STATES_MAX ACPI_STATE_S5 528#define ACPI_S_STATE_COUNT 6 529 530#define ACPI_STATE_D0 (UINT8) 0 531#define ACPI_STATE_D1 (UINT8) 1 532#define ACPI_STATE_D2 (UINT8) 2 533#define ACPI_STATE_D3 (UINT8) 3 534#define ACPI_D_STATES_MAX ACPI_STATE_D3 535#define ACPI_D_STATE_COUNT 4 536 537#define ACPI_STATE_C0 (UINT8) 0 538#define ACPI_STATE_C1 (UINT8) 1 539#define ACPI_STATE_C2 (UINT8) 2 540#define ACPI_STATE_C3 (UINT8) 3 541#define ACPI_C_STATES_MAX ACPI_STATE_C3 542#define ACPI_C_STATE_COUNT 4 543 544/* 545 * Sleep type invalid value 546 */ 547#define ACPI_SLEEP_TYPE_MAX 0x7 548#define ACPI_SLEEP_TYPE_INVALID 0xFF 549 550/* 551 * Standard notify values 552 */ 553#define ACPI_NOTIFY_BUS_CHECK (UINT8) 0x00 554#define ACPI_NOTIFY_DEVICE_CHECK (UINT8) 0x01 555#define ACPI_NOTIFY_DEVICE_WAKE (UINT8) 0x02 556#define ACPI_NOTIFY_EJECT_REQUEST (UINT8) 0x03 557#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (UINT8) 0x04 558#define ACPI_NOTIFY_FREQUENCY_MISMATCH (UINT8) 0x05 559#define ACPI_NOTIFY_BUS_MODE_MISMATCH (UINT8) 0x06 560#define ACPI_NOTIFY_POWER_FAULT (UINT8) 0x07 561#define ACPI_NOTIFY_CAPABILITIES_CHECK (UINT8) 0x08 562#define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09 563#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A 564#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B 565#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C 566 567#define ACPI_NOTIFY_MAX 0x0C 568 569/* 570 * Types associated with ACPI names and objects. The first group of 571 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition 572 * of the ACPI ObjectType() operator (See the ACPI Spec). Therefore, 573 * only add to the first group if the spec changes. 574 * 575 * NOTE: Types must be kept in sync with the global AcpiNsProperties 576 * and AcpiNsTypeNames arrays. 577 */ 578typedef UINT32 ACPI_OBJECT_TYPE; 579 580#define ACPI_TYPE_ANY 0x00 581#define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ 582#define ACPI_TYPE_STRING 0x02 583#define ACPI_TYPE_BUFFER 0x03 584#define ACPI_TYPE_PACKAGE 0x04 /* ByteConst, multiple DataTerm/Constant/SuperName */ 585#define ACPI_TYPE_FIELD_UNIT 0x05 586#define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ 587#define ACPI_TYPE_EVENT 0x07 588#define ACPI_TYPE_METHOD 0x08 /* Name, ByteConst, multiple Code */ 589#define ACPI_TYPE_MUTEX 0x09 590#define ACPI_TYPE_REGION 0x0A 591#define ACPI_TYPE_POWER 0x0B /* Name,ByteConst,WordConst,multi Node */ 592#define ACPI_TYPE_PROCESSOR 0x0C /* Name,ByteConst,DWordConst,ByteConst,multi NmO */ 593#define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ 594#define ACPI_TYPE_BUFFER_FIELD 0x0E 595#define ACPI_TYPE_DDB_HANDLE 0x0F 596#define ACPI_TYPE_DEBUG_OBJECT 0x10 597 598#define ACPI_TYPE_EXTERNAL_MAX 0x10 599 600/* 601 * These are object types that do not map directly to the ACPI 602 * ObjectType() operator. They are used for various internal purposes only. 603 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these 604 * internal types must move upwards. (There is code that depends on these 605 * values being contiguous with the external types above.) 606 */ 607#define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 608#define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 609#define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 610#define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, RefOf, Index */ 611#define ACPI_TYPE_LOCAL_ALIAS 0x15 612#define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 613#define ACPI_TYPE_LOCAL_NOTIFY 0x17 614#define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 615#define ACPI_TYPE_LOCAL_RESOURCE 0x19 616#define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A 617#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */ 618 619#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ 620 621/* 622 * These are special object types that never appear in 623 * a Namespace node, only in an object of ACPI_OPERAND_OBJECT 624 */ 625#define ACPI_TYPE_LOCAL_EXTRA 0x1C 626#define ACPI_TYPE_LOCAL_DATA 0x1D 627 628#define ACPI_TYPE_LOCAL_MAX 0x1D 629 630/* All types above here are invalid */ 631 632#define ACPI_TYPE_INVALID 0x1E 633#define ACPI_TYPE_NOT_FOUND 0xFF 634 635#define ACPI_NUM_NS_TYPES (ACPI_TYPE_INVALID + 1) 636 637 638/* 639 * All I/O 640 */ 641#define ACPI_READ 0 642#define ACPI_WRITE 1 643#define ACPI_IO_MASK 1 644 645/* 646 * Event Types: Fixed & General Purpose 647 */ 648typedef UINT32 ACPI_EVENT_TYPE; 649 650/* 651 * Fixed events 652 */ 653#define ACPI_EVENT_PMTIMER 0 654#define ACPI_EVENT_GLOBAL 1 655#define ACPI_EVENT_POWER_BUTTON 2 656#define ACPI_EVENT_SLEEP_BUTTON 3 657#define ACPI_EVENT_RTC 4 658#define ACPI_EVENT_MAX 4 659#define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 660 661/* 662 * Event Status - Per event 663 * ------------- 664 * The encoding of ACPI_EVENT_STATUS is illustrated below. 665 * Note that a set bit (1) indicates the property is TRUE 666 * (e.g. if bit 0 is set then the event is enabled). 667 * +-------------+-+-+-+ 668 * | Bits 31:3 |2|1|0| 669 * +-------------+-+-+-+ 670 * | | | | 671 * | | | +- Enabled? 672 * | | +--- Enabled for wake? 673 * | +----- Set? 674 * +----------- <Reserved> 675 */ 676typedef UINT32 ACPI_EVENT_STATUS; 677 678#define ACPI_EVENT_FLAG_DISABLED (ACPI_EVENT_STATUS) 0x00 679#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01 680#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02 681#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04 682 683/* 684 * General Purpose Events (GPE) 685 */ 686#define ACPI_GPE_INVALID 0xFF 687#define ACPI_GPE_MAX 0xFF 688#define ACPI_NUM_GPE 256 689 690/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */ 691 692#define ACPI_GPE_ENABLE 0 693#define ACPI_GPE_DISABLE 1 694#define ACPI_GPE_CONDITIONAL_ENABLE 2 695 696/* 697 * GPE info flags - Per GPE 698 * +-------+-+-+---+ 699 * | 7:4 |3|2|1:0| 700 * +-------+-+-+---+ 701 * | | | | 702 * | | | +-- Type of dispatch:to method, handler, notify, or none 703 * | | +----- Interrupt type: edge or level triggered 704 * | +------- Is a Wake GPE 705 * +------------ <Reserved> 706 */ 707#define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00 708#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01 709#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02 710#define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03 711#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03 712 713#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04 714#define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00 715#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04 716 717#define ACPI_GPE_CAN_WAKE (UINT8) 0x08 718 719/* 720 * Flags for GPE and Lock interfaces 721 */ 722#define ACPI_NOT_ISR 0x1 723#define ACPI_ISR 0x0 724 725 726/* Notify types */ 727 728#define ACPI_SYSTEM_NOTIFY 0x1 729#define ACPI_DEVICE_NOTIFY 0x2 730#define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) 731#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 732#define ACPI_NUM_NOTIFY_TYPES 2 733 734#define ACPI_MAX_SYS_NOTIFY 0x7F 735#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF 736 737#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */ 738#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */ 739 740 741/* Address Space (Operation Region) Types */ 742 743typedef UINT8 ACPI_ADR_SPACE_TYPE; 744 745#define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0 746#define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1 747#define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2 748#define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3 749#define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4 750#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 751#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 752#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 753#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8 754#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9 755#define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10 756 757#define ACPI_NUM_PREDEFINED_REGIONS 11 758 759/* 760 * Special Address Spaces 761 * 762 * Note: A Data Table region is a special type of operation region 763 * that has its own AML opcode. However, internally, the AML 764 * interpreter simply creates an operation region with an an address 765 * space type of ACPI_ADR_SPACE_DATA_TABLE. 766 */ 767#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */ 768#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F 769 770/* Values for _REG connection code */ 771 772#define ACPI_REG_DISCONNECT 0 773#define ACPI_REG_CONNECT 1 774 775/* 776 * BitRegister IDs 777 * 778 * These values are intended to be used by the hardware interfaces 779 * and are mapped to individual bitfields defined within the ACPI 780 * registers. See the AcpiGbl_BitRegisterInfo global table in utglobal.c 781 * for this mapping. 782 */ 783 784/* PM1 Status register */ 785 786#define ACPI_BITREG_TIMER_STATUS 0x00 787#define ACPI_BITREG_BUS_MASTER_STATUS 0x01 788#define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 789#define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 790#define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 791#define ACPI_BITREG_RT_CLOCK_STATUS 0x05 792#define ACPI_BITREG_WAKE_STATUS 0x06 793#define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 794 795/* PM1 Enable register */ 796 797#define ACPI_BITREG_TIMER_ENABLE 0x08 798#define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09 799#define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A 800#define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B 801#define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C 802#define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0D 803 804/* PM1 Control register */ 805 806#define ACPI_BITREG_SCI_ENABLE 0x0E 807#define ACPI_BITREG_BUS_MASTER_RLD 0x0F 808#define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x10 809#define ACPI_BITREG_SLEEP_TYPE 0x11 810#define ACPI_BITREG_SLEEP_ENABLE 0x12 811 812/* PM2 Control register */ 813 814#define ACPI_BITREG_ARB_DISABLE 0x13 815 816#define ACPI_BITREG_MAX 0x13 817#define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 818 819 820/* Status register values. A 1 clears a status bit. 0 = no effect */ 821 822#define ACPI_CLEAR_STATUS 1 823 824/* Enable and Control register values */ 825 826#define ACPI_ENABLE_EVENT 1 827#define ACPI_DISABLE_EVENT 0 828 829 830/* Sleep function dispatch */ 831 832typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) ( 833 UINT8 SleepState); 834 835typedef struct acpi_sleep_functions 836{ 837 ACPI_SLEEP_FUNCTION LegacyFunction; 838 ACPI_SLEEP_FUNCTION ExtendedFunction; 839 840} ACPI_SLEEP_FUNCTIONS; 841 842 843/* 844 * External ACPI object definition 845 */ 846 847/* 848 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element 849 * or an unresolved named reference. 850 */ 851typedef union acpi_object 852{ 853 ACPI_OBJECT_TYPE Type; /* See definition of AcpiNsType for values */ 854 struct 855 { 856 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_INTEGER */ 857 UINT64 Value; /* The actual number */ 858 } Integer; 859 860 struct 861 { 862 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_STRING */ 863 UINT32 Length; /* # of bytes in string, excluding trailing null */ 864 char *Pointer; /* points to the string value */ 865 } String; 866 867 struct 868 { 869 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_BUFFER */ 870 UINT32 Length; /* # of bytes in buffer */ 871 UINT8 *Pointer; /* points to the buffer */ 872 } Buffer; 873 874 struct 875 { 876 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PACKAGE */ 877 UINT32 Count; /* # of elements in package */ 878 union acpi_object *Elements; /* Pointer to an array of ACPI_OBJECTs */ 879 } Package; 880 881 struct 882 { 883 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_LOCAL_REFERENCE */ 884 ACPI_OBJECT_TYPE ActualType; /* Type associated with the Handle */ 885 ACPI_HANDLE Handle; /* object reference */ 886 } Reference; 887 888 struct 889 { 890 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_PROCESSOR */ 891 UINT32 ProcId; 892 ACPI_IO_ADDRESS PblkAddress; 893 UINT32 PblkLength; 894 } Processor; 895 896 struct 897 { 898 ACPI_OBJECT_TYPE Type; /* ACPI_TYPE_POWER */ 899 UINT32 SystemLevel; 900 UINT32 ResourceOrder; 901 } PowerResource; 902 903} ACPI_OBJECT; 904 905 906/* 907 * List of objects, used as a parameter list for control method evaluation 908 */ 909typedef struct acpi_object_list 910{ 911 UINT32 Count; 912 ACPI_OBJECT *Pointer; 913 914} ACPI_OBJECT_LIST; 915 916 917/* 918 * Miscellaneous common Data Structures used by the interfaces 919 */ 920#define ACPI_NO_BUFFER 0 921#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) 922#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) 923 924typedef struct acpi_buffer 925{ 926 ACPI_SIZE Length; /* Length in bytes of the buffer */ 927 void *Pointer; /* pointer to buffer */ 928 929} ACPI_BUFFER; 930 931/* Free a buffer created in an ACPI_BUFFER via ACPI_ALLOCATE_LOCAL_BUFFER */ 932 933#define ACPI_FREE_BUFFER(b) ACPI_FREE(b.Pointer) 934 935 936/* 937 * NameType for AcpiGetName 938 */ 939#define ACPI_FULL_PATHNAME 0 940#define ACPI_SINGLE_NAME 1 941#define ACPI_NAME_TYPE_MAX 1 942 943 944/* 945 * Predefined Namespace items 946 */ 947typedef struct acpi_predefined_names 948{ 949 char *Name; 950 UINT8 Type; 951 char *Val; 952 953} ACPI_PREDEFINED_NAMES; 954 955 956/* 957 * Structure and flags for AcpiGetSystemInfo 958 */ 959#define ACPI_SYS_MODE_UNKNOWN 0x0000 960#define ACPI_SYS_MODE_ACPI 0x0001 961#define ACPI_SYS_MODE_LEGACY 0x0002 962#define ACPI_SYS_MODES_MASK 0x0003 963 964 965/* 966 * System info returned by AcpiGetSystemInfo() 967 */ 968typedef struct acpi_system_info 969{ 970 UINT32 AcpiCaVersion; 971 UINT32 Flags; 972 UINT32 TimerResolution; 973 UINT32 Reserved1; 974 UINT32 Reserved2; 975 UINT32 DebugLevel; 976 UINT32 DebugLayer; 977 978} ACPI_SYSTEM_INFO; 979 980 981/* 982 * System statistics returned by AcpiGetStatistics() 983 */ 984typedef struct acpi_statistics 985{ 986 UINT32 SciCount; 987 UINT32 GpeCount; 988 UINT32 FixedEventCount[ACPI_NUM_FIXED_EVENTS]; 989 UINT32 MethodCount; 990 991} ACPI_STATISTICS; 992 993 994/* Table Event Types */ 995 996#define ACPI_TABLE_EVENT_LOAD 0x0 997#define ACPI_TABLE_EVENT_UNLOAD 0x1 998#define ACPI_NUM_TABLE_EVENTS 2 999 1000 1001/* 1002 * Types specific to the OS service interfaces 1003 */ 1004typedef UINT32 1005(ACPI_SYSTEM_XFACE *ACPI_OSD_HANDLER) ( 1006 void *Context); 1007 1008typedef void 1009(ACPI_SYSTEM_XFACE *ACPI_OSD_EXEC_CALLBACK) ( 1010 void *Context); 1011 1012/* 1013 * Various handlers and callback procedures 1014 */ 1015typedef 1016void (*ACPI_GBL_EVENT_HANDLER) ( 1017 UINT32 EventType, 1018 ACPI_HANDLE Device, 1019 UINT32 EventNumber, 1020 void *Context); 1021 1022#define ACPI_EVENT_TYPE_GPE 0 1023#define ACPI_EVENT_TYPE_FIXED 1 1024 1025typedef 1026UINT32 (*ACPI_EVENT_HANDLER) ( 1027 void *Context); 1028 1029typedef 1030UINT32 (*ACPI_GPE_HANDLER) ( 1031 ACPI_HANDLE GpeDevice, 1032 UINT32 GpeNumber, 1033 void *Context); 1034 1035typedef 1036void (*ACPI_NOTIFY_HANDLER) ( 1037 ACPI_HANDLE Device, 1038 UINT32 Value, 1039 void *Context); 1040 1041typedef 1042void (*ACPI_OBJECT_HANDLER) ( 1043 ACPI_HANDLE Object, 1044 void *Data); 1045 1046typedef 1047ACPI_STATUS (*ACPI_INIT_HANDLER) ( 1048 ACPI_HANDLE Object, 1049 UINT32 Function); 1050 1051#define ACPI_INIT_DEVICE_INI 1 1052 1053typedef 1054ACPI_STATUS (*ACPI_EXCEPTION_HANDLER) ( 1055 ACPI_STATUS AmlStatus, 1056 ACPI_NAME Name, 1057 UINT16 Opcode, 1058 UINT32 AmlOffset, 1059 void *Context); 1060 1061/* Table Event handler (Load, LoadTable, etc.) and types */ 1062 1063typedef 1064ACPI_STATUS (*ACPI_TABLE_HANDLER) ( 1065 UINT32 Event, 1066 void *Table, 1067 void *Context); 1068 1069#define ACPI_TABLE_LOAD 0x0 1070#define ACPI_TABLE_UNLOAD 0x1 1071#define ACPI_NUM_TABLE_EVENTS 2 1072 1073 1074/* Address Spaces (For Operation Regions) */ 1075 1076typedef 1077ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( 1078 UINT32 Function, 1079 ACPI_PHYSICAL_ADDRESS Address, 1080 UINT32 BitWidth, 1081 UINT64 *Value, 1082 void *HandlerContext, 1083 void *RegionContext); 1084 1085#define ACPI_DEFAULT_HANDLER NULL 1086 1087/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ 1088 1089typedef struct acpi_connection_info 1090{ 1091 UINT8 *Connection; 1092 UINT16 Length; 1093 UINT8 AccessLength; 1094 1095} ACPI_CONNECTION_INFO; 1096 1097 1098typedef 1099ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( 1100 ACPI_HANDLE RegionHandle, 1101 UINT32 Function, 1102 void *HandlerContext, 1103 void **RegionContext); 1104 1105#define ACPI_REGION_ACTIVATE 0 1106#define ACPI_REGION_DEACTIVATE 1 1107 1108typedef 1109ACPI_STATUS (*ACPI_WALK_CALLBACK) ( 1110 ACPI_HANDLE Object, 1111 UINT32 NestingLevel, 1112 void *Context, 1113 void **ReturnValue); 1114 1115typedef 1116UINT32 (*ACPI_INTERFACE_HANDLER) ( 1117 ACPI_STRING InterfaceName, 1118 UINT32 Supported); 1119 1120 1121/* Interrupt handler return values */ 1122 1123#define ACPI_INTERRUPT_NOT_HANDLED 0x00 1124#define ACPI_INTERRUPT_HANDLED 0x01 1125 1126/* GPE handler return values */ 1127 1128#define ACPI_REENABLE_GPE 0x80 1129 1130 1131/* Length of 32-bit EISAID values when converted back to a string */ 1132 1133#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */ 1134 1135/* Length of UUID (string) values */ 1136 1137#define ACPI_UUID_LENGTH 16 1138 1139 1140/* Structures used for device/processor HID, UID, CID, and SUB */ 1141 1142typedef struct acpi_pnp_device_id 1143{ 1144 UINT32 Length; /* Length of string + null */ 1145 char *String; 1146 1147} ACPI_PNP_DEVICE_ID; 1148 1149typedef struct acpi_pnp_device_id_list 1150{ 1151 UINT32 Count; /* Number of IDs in Ids array */ 1152 UINT32 ListSize; /* Size of list, including ID strings */ 1153 ACPI_PNP_DEVICE_ID Ids[1]; /* ID array */ 1154 1155} ACPI_PNP_DEVICE_ID_LIST; 1156 1157/* 1158 * Structure returned from AcpiGetObjectInfo. 1159 * Optimized for both 32- and 64-bit builds 1160 */ 1161typedef struct acpi_device_info 1162{ 1163 UINT32 InfoSize; /* Size of info, including ID strings */ 1164 UINT32 Name; /* ACPI object Name */ 1165 ACPI_OBJECT_TYPE Type; /* ACPI object Type */ 1166 UINT8 ParamCount; /* If a method, required parameter count */ 1167 UINT8 Valid; /* Indicates which optional fields are valid */ 1168 UINT8 Flags; /* Miscellaneous info */ 1169 UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */ 1170 UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ 1171 UINT32 CurrentStatus; /* _STA value */ 1172 UINT64 Address; /* _ADR value */ 1173 ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ 1174 ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ 1175 ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */ 1176 ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */ 1177 1178} ACPI_DEVICE_INFO; 1179 1180/* Values for Flags field above (AcpiGetObjectInfo) */ 1181 1182#define ACPI_PCI_ROOT_BRIDGE 0x01 1183 1184/* Flags for Valid field above (AcpiGetObjectInfo) */ 1185 1186#define ACPI_VALID_STA 0x01 1187#define ACPI_VALID_ADR 0x02 1188#define ACPI_VALID_HID 0x04 1189#define ACPI_VALID_UID 0x08 1190#define ACPI_VALID_SUB 0x10 1191#define ACPI_VALID_CID 0x20 1192#define ACPI_VALID_SXDS 0x40 1193#define ACPI_VALID_SXWS 0x80 1194 1195/* Flags for _STA return value (CurrentStatus above) */ 1196 1197#define ACPI_STA_DEVICE_PRESENT 0x01 1198#define ACPI_STA_DEVICE_ENABLED 0x02 1199#define ACPI_STA_DEVICE_UI 0x04 1200#define ACPI_STA_DEVICE_FUNCTIONING 0x08 1201#define ACPI_STA_DEVICE_OK 0x08 /* Synonym */ 1202#define ACPI_STA_BATTERY_PRESENT 0x10 1203 1204 1205/* Context structs for address space handlers */ 1206 1207typedef struct acpi_pci_id 1208{ 1209 UINT16 Segment; 1210 UINT16 Bus; 1211 UINT16 Device; 1212 UINT16 Function; 1213 1214} ACPI_PCI_ID; 1215 1216typedef struct acpi_mem_space_context 1217{ 1218 UINT32 Length; 1219 ACPI_PHYSICAL_ADDRESS Address; 1220 ACPI_PHYSICAL_ADDRESS MappedPhysicalAddress; 1221 UINT8 *MappedLogicalAddress; 1222 ACPI_SIZE MappedLength; 1223 1224} ACPI_MEM_SPACE_CONTEXT; 1225 1226 1227/* 1228 * ACPI_MEMORY_LIST is used only if the ACPICA local cache is enabled 1229 */ 1230typedef struct acpi_memory_list 1231{ 1232 char *ListName; 1233 void *ListHead; 1234 UINT16 ObjectSize; 1235 UINT16 MaxDepth; 1236 UINT16 CurrentDepth; 1237 1238#ifdef ACPI_DBG_TRACK_ALLOCATIONS 1239 1240 /* Statistics for debug memory tracking only */ 1241 1242 UINT32 TotalAllocated; 1243 UINT32 TotalFreed; 1244 UINT32 MaxOccupied; 1245 UINT32 TotalSize; 1246 UINT32 CurrentTotalSize; 1247 UINT32 Requests; 1248 UINT32 Hits; 1249#endif 1250 1251} ACPI_MEMORY_LIST; 1252 1253 1254#endif /* __ACTYPES_H__ */ 1255