1 /****************************************************************************** 2 * 3 * Name: actypes.h - Common data types for the entire ACPI subsystem 4 * 5 *****************************************************************************/ 6 7 /* 8 * Copyright (C) 2000 - 2007, R. Byron Moore 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:struct_defs -- 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 * Architecture-specific ACPICA Subsystem Data Types 74 * 75 * The goal of these types is to provide source code portability across 76 * 16-bit, 32-bit, and 64-bit targets. 77 * 78 * 1) The following types are of fixed size for all targets (16/32/64): 79 * 80 * BOOLEAN Logical boolean 81 * 82 * UINT8 8-bit (1 byte) unsigned value 83 * UINT16 16-bit (2 byte) unsigned value 84 * UINT32 32-bit (4 byte) unsigned value 85 * UINT64 64-bit (8 byte) unsigned value 86 * 87 * INT16 16-bit (2 byte) signed value 88 * INT32 32-bit (4 byte) signed value 89 * INT64 64-bit (8 byte) signed value 90 * 91 * COMPILER_DEPENDENT_UINT64/INT64 - These types are defined in the 92 * compiler-dependent header(s) and were introduced because there is no common 93 * 64-bit integer type across the various compilation models, as shown in 94 * the table below. 95 * 96 * Datatype LP64 ILP64 LLP64 ILP32 LP32 16bit 97 * char 8 8 8 8 8 8 98 * short 16 16 16 16 16 16 99 * _int32 32 100 * int 32 64 32 32 16 16 101 * long 64 64 32 32 32 32 102 * long long 64 64 103 * pointer 64 64 64 32 32 32 104 * 105 * Note: ILP64 and LP32 are currently not supported. 106 * 107 * 108 * 2) These types represent the native word size of the target mode of the 109 * processor, and may be 16-bit, 32-bit, or 64-bit as required. They are 110 * usually used for memory allocation, efficient loop counters, and array 111 * indexes. The types are similar to the size_t type in the C library and are 112 * required because there is no C type that consistently represents the native 113 * data width. 114 * 115 * ACPI_SIZE 16/32/64-bit unsigned value 116 * ACPI_NATIVE_UINT 16/32/64-bit unsigned value 117 * ACPI_NATIVE_INT 16/32/64-bit signed value 118 * 119 */ 120 121 /******************************************************************************* 122 * 123 * Common types for all compilers, all targets 124 * 125 ******************************************************************************/ 126 127 typedef unsigned char BOOLEAN; 128 typedef unsigned char UINT8; 129 typedef unsigned short UINT16; 130 typedef COMPILER_DEPENDENT_UINT64 UINT64; 131 typedef COMPILER_DEPENDENT_INT64 INT64; 132 133 /*! [End] no source code translation !*/ 134 135 /******************************************************************************* 136 * 137 * Types specific to 64-bit targets 138 * 139 ******************************************************************************/ 140 141 #if ACPI_MACHINE_WIDTH == 64 142 143 /*! [Begin] no source code translation (keep the typedefs as-is) */ 144 145 typedef unsigned int UINT32; 146 typedef int INT32; 147 148 /*! [End] no source code translation !*/ 149 150 typedef uint64_t acpi_native_uint; 151 typedef int64_t acpi_native_int; 152 153 typedef u64 acpi_io_address; 154 typedef u64 acpi_physical_address; 155 156 #define ACPI_MAX_PTR ACPI_UINT64_MAX 157 #define ACPI_SIZE_MAX ACPI_UINT64_MAX 158 159 #define ACPI_USE_NATIVE_DIVIDE /* Has native 64-bit integer support */ 160 161 /* 162 * In the case of the Itanium Processor Family (IPF), the hardware does not 163 * support misaligned memory transfers. Set the MISALIGNMENT_NOT_SUPPORTED flag 164 * to indicate that special precautions must be taken to avoid alignment faults. 165 * (IA64 or ia64 is currently used by existing compilers to indicate IPF.) 166 * 167 * Note: Em64_t and other X86-64 processors support misaligned transfers, 168 * so there is no need to define this flag. 169 */ 170 #if defined (__IA64__) || defined (__ia64__) 171 #define ACPI_MISALIGNMENT_NOT_SUPPORTED 172 #endif 173 174 /******************************************************************************* 175 * 176 * Types specific to 32-bit targets 177 * 178 ******************************************************************************/ 179 180 #elif ACPI_MACHINE_WIDTH == 32 181 182 /*! [Begin] no source code translation (keep the typedefs as-is) */ 183 184 typedef unsigned int UINT32; 185 typedef int INT32; 186 187 /*! [End] no source code translation !*/ 188 189 typedef uint32_t acpi_native_uint; 190 typedef int32_t acpi_native_int; 191 192 typedef u32 acpi_io_address; 193 typedef u32 acpi_physical_address; 194 195 #define ACPI_MAX_PTR ACPI_UINT32_MAX 196 #define ACPI_SIZE_MAX ACPI_UINT32_MAX 197 198 #else 199 200 /* ACPI_MACHINE_WIDTH must be either 64 or 32 */ 201 202 #error unknown ACPI_MACHINE_WIDTH 203 #endif 204 205 /* Variable-width type, used instead of clib size_t */ 206 207 typedef acpi_native_uint acpi_size; 208 209 /******************************************************************************* 210 * 211 * OS-dependent and compiler-dependent types 212 * 213 * If the defaults below are not appropriate for the host system, they can 214 * be defined in the compiler-specific or OS-specific header, and this will 215 * take precedence. 216 * 217 ******************************************************************************/ 218 219 /* Value returned by acpi_os_get_thread_id */ 220 221 #ifndef acpi_thread_id 222 #define acpi_thread_id acpi_native_uint 223 #endif 224 225 /* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 226 227 #ifndef acpi_uintptr_t 228 #define acpi_uintptr_t void * 229 #endif 230 231 /* 232 * ACPI_PRINTF_LIKE is used to tag functions as "printf-like" because 233 * some compilers can catch printf format string problems 234 */ 235 #ifndef ACPI_PRINTF_LIKE 236 #define ACPI_PRINTF_LIKE(c) 237 #endif 238 239 /* 240 * Some compilers complain about unused variables. Sometimes we don't want to 241 * use all the variables (for example, _acpi_module_name). This allows us 242 * to to tell the compiler in a per-variable manner that a variable 243 * is unused 244 */ 245 #ifndef ACPI_UNUSED_VAR 246 #define ACPI_UNUSED_VAR 247 #endif 248 249 /* 250 * All ACPICA functions that are available to the rest of the kernel are 251 * tagged with this macro which can be defined as appropriate for the host. 252 */ 253 #ifndef ACPI_EXPORT_SYMBOL 254 #define ACPI_EXPORT_SYMBOL(symbol) 255 #endif 256 257 /******************************************************************************* 258 * 259 * Independent types 260 * 261 ******************************************************************************/ 262 263 /* Logical defines and NULL */ 264 265 #ifdef FALSE 266 #undef FALSE 267 #endif 268 #define FALSE (1 == 0) 269 270 #ifdef TRUE 271 #undef TRUE 272 #endif 273 #define TRUE (1 == 1) 274 275 #ifndef NULL 276 #define NULL (void *) 0 277 #endif 278 279 /* 280 * Mescellaneous types 281 */ 282 typedef u32 acpi_status; /* All ACPI Exceptions */ 283 typedef u32 acpi_name; /* 4-byte ACPI name */ 284 typedef void *acpi_handle; /* Actually a ptr to a NS Node */ 285 286 struct uint64_struct { 287 u32 lo; 288 u32 hi; 289 }; 290 291 union uint64_overlay { 292 u64 full; 293 struct uint64_struct part; 294 }; 295 296 struct uint32_struct { 297 u32 lo; 298 u32 hi; 299 }; 300 301 /* Synchronization objects */ 302 303 #define acpi_mutex void * 304 #define acpi_semaphore void * 305 306 /* 307 * Acpi integer width. In ACPI version 1, integers are 308 * 32 bits. In ACPI version 2, integers are 64 bits. 309 * Note that this pertains to the ACPI integer type only, not 310 * other integers used in the implementation of the ACPI CA 311 * subsystem. 312 */ 313 #ifdef ACPI_NO_INTEGER64_SUPPORT 314 315 /* 32-bit integers only, no 64-bit support */ 316 317 typedef u32 acpi_integer; 318 #define ACPI_INTEGER_MAX ACPI_UINT32_MAX 319 #define ACPI_INTEGER_BIT_SIZE 32 320 #define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */ 321 322 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */ 323 324 #else 325 326 /* 64-bit integers */ 327 328 typedef unsigned long long acpi_integer; 329 #define ACPI_INTEGER_MAX ACPI_UINT64_MAX 330 #define ACPI_INTEGER_BIT_SIZE 64 331 #define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ 332 333 #if ACPI_MACHINE_WIDTH == 64 334 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ 335 #endif 336 #endif 337 338 #define ACPI_MAX64_DECIMAL_DIGITS 20 339 #define ACPI_MAX32_DECIMAL_DIGITS 10 340 #define ACPI_MAX16_DECIMAL_DIGITS 5 341 #define ACPI_MAX8_DECIMAL_DIGITS 3 342 343 /* 344 * Constants with special meanings 345 */ 346 #define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR) 347 348 /* 349 * Initialization sequence 350 */ 351 #define ACPI_FULL_INITIALIZATION 0x00 352 #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 353 #define ACPI_NO_HARDWARE_INIT 0x02 354 #define ACPI_NO_EVENT_INIT 0x04 355 #define ACPI_NO_HANDLER_INIT 0x08 356 #define ACPI_NO_ACPI_ENABLE 0x10 357 #define ACPI_NO_DEVICE_INIT 0x20 358 #define ACPI_NO_OBJECT_INIT 0x40 359 360 /* 361 * Initialization state 362 */ 363 #define ACPI_SUBSYSTEM_INITIALIZE 0x01 364 #define ACPI_INITIALIZED_OK 0x02 365 366 /* 367 * Power state values 368 */ 369 #define ACPI_STATE_UNKNOWN (u8) 0xFF 370 371 #define ACPI_STATE_S0 (u8) 0 372 #define ACPI_STATE_S1 (u8) 1 373 #define ACPI_STATE_S2 (u8) 2 374 #define ACPI_STATE_S3 (u8) 3 375 #define ACPI_STATE_S4 (u8) 4 376 #define ACPI_STATE_S5 (u8) 5 377 #define ACPI_S_STATES_MAX ACPI_STATE_S5 378 #define ACPI_S_STATE_COUNT 6 379 380 #define ACPI_STATE_D0 (u8) 0 381 #define ACPI_STATE_D1 (u8) 1 382 #define ACPI_STATE_D2 (u8) 2 383 #define ACPI_STATE_D3 (u8) 3 384 #define ACPI_D_STATES_MAX ACPI_STATE_D3 385 #define ACPI_D_STATE_COUNT 4 386 387 #define ACPI_STATE_C0 (u8) 0 388 #define ACPI_STATE_C1 (u8) 1 389 #define ACPI_STATE_C2 (u8) 2 390 #define ACPI_STATE_C3 (u8) 3 391 #define ACPI_C_STATES_MAX ACPI_STATE_C3 392 #define ACPI_C_STATE_COUNT 4 393 394 /* 395 * Sleep type invalid value 396 */ 397 #define ACPI_SLEEP_TYPE_MAX 0x7 398 #define ACPI_SLEEP_TYPE_INVALID 0xFF 399 400 /* 401 * Standard notify values 402 */ 403 #define ACPI_NOTIFY_BUS_CHECK (u8) 0 404 #define ACPI_NOTIFY_DEVICE_CHECK (u8) 1 405 #define ACPI_NOTIFY_DEVICE_WAKE (u8) 2 406 #define ACPI_NOTIFY_EJECT_REQUEST (u8) 3 407 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (u8) 4 408 #define ACPI_NOTIFY_FREQUENCY_MISMATCH (u8) 5 409 #define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 6 410 #define ACPI_NOTIFY_POWER_FAULT (u8) 7 411 412 /* 413 * Types associated with ACPI names and objects. The first group of 414 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition 415 * of the ACPI object_type() operator (See the ACPI Spec). Therefore, 416 * only add to the first group if the spec changes. 417 * 418 * NOTE: Types must be kept in sync with the global acpi_ns_properties 419 * and acpi_ns_type_names arrays. 420 */ 421 typedef u32 acpi_object_type; 422 423 #define ACPI_TYPE_ANY 0x00 424 #define ACPI_TYPE_INTEGER 0x01 /* Byte/Word/Dword/Zero/One/Ones */ 425 #define ACPI_TYPE_STRING 0x02 426 #define ACPI_TYPE_BUFFER 0x03 427 #define ACPI_TYPE_PACKAGE 0x04 /* byte_const, multiple data_term/Constant/super_name */ 428 #define ACPI_TYPE_FIELD_UNIT 0x05 429 #define ACPI_TYPE_DEVICE 0x06 /* Name, multiple Node */ 430 #define ACPI_TYPE_EVENT 0x07 431 #define ACPI_TYPE_METHOD 0x08 /* Name, byte_const, multiple Code */ 432 #define ACPI_TYPE_MUTEX 0x09 433 #define ACPI_TYPE_REGION 0x0A 434 #define ACPI_TYPE_POWER 0x0B /* Name,byte_const,word_const,multi Node */ 435 #define ACPI_TYPE_PROCESSOR 0x0C /* Name,byte_const,Dword_const,byte_const,multi nm_o */ 436 #define ACPI_TYPE_THERMAL 0x0D /* Name, multiple Node */ 437 #define ACPI_TYPE_BUFFER_FIELD 0x0E 438 #define ACPI_TYPE_DDB_HANDLE 0x0F 439 #define ACPI_TYPE_DEBUG_OBJECT 0x10 440 441 #define ACPI_TYPE_EXTERNAL_MAX 0x10 442 443 /* 444 * These are object types that do not map directly to the ACPI 445 * object_type() operator. They are used for various internal purposes only. 446 * If new predefined ACPI_TYPEs are added (via the ACPI specification), these 447 * internal types must move upwards. (There is code that depends on these 448 * values being contiguous with the external types above.) 449 */ 450 #define ACPI_TYPE_LOCAL_REGION_FIELD 0x11 451 #define ACPI_TYPE_LOCAL_BANK_FIELD 0x12 452 #define ACPI_TYPE_LOCAL_INDEX_FIELD 0x13 453 #define ACPI_TYPE_LOCAL_REFERENCE 0x14 /* Arg#, Local#, Name, Debug, ref_of, Index */ 454 #define ACPI_TYPE_LOCAL_ALIAS 0x15 455 #define ACPI_TYPE_LOCAL_METHOD_ALIAS 0x16 456 #define ACPI_TYPE_LOCAL_NOTIFY 0x17 457 #define ACPI_TYPE_LOCAL_ADDRESS_HANDLER 0x18 458 #define ACPI_TYPE_LOCAL_RESOURCE 0x19 459 #define ACPI_TYPE_LOCAL_RESOURCE_FIELD 0x1A 460 #define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple object_list Nodes */ 461 462 #define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */ 463 464 /* 465 * These are special object types that never appear in 466 * a Namespace node, only in an union acpi_operand_object 467 */ 468 #define ACPI_TYPE_LOCAL_EXTRA 0x1C 469 #define ACPI_TYPE_LOCAL_DATA 0x1D 470 471 #define ACPI_TYPE_LOCAL_MAX 0x1D 472 473 /* All types above here are invalid */ 474 475 #define ACPI_TYPE_INVALID 0x1E 476 #define ACPI_TYPE_NOT_FOUND 0xFF 477 478 /* 479 * All I/O 480 */ 481 #define ACPI_READ 0 482 #define ACPI_WRITE 1 483 #define ACPI_IO_MASK 1 484 485 /* 486 * Event Types: Fixed & General Purpose 487 */ 488 typedef u32 acpi_event_type; 489 490 /* 491 * Fixed events 492 */ 493 #define ACPI_EVENT_PMTIMER 0 494 #define ACPI_EVENT_GLOBAL 1 495 #define ACPI_EVENT_POWER_BUTTON 2 496 #define ACPI_EVENT_SLEEP_BUTTON 3 497 #define ACPI_EVENT_RTC 4 498 #define ACPI_EVENT_MAX 4 499 #define ACPI_NUM_FIXED_EVENTS ACPI_EVENT_MAX + 1 500 501 /* 502 * Event Status - Per event 503 * ------------- 504 * The encoding of acpi_event_status is illustrated below. 505 * Note that a set bit (1) indicates the property is TRUE 506 * (e.g. if bit 0 is set then the event is enabled). 507 * +-------------+-+-+-+ 508 * | Bits 31:3 |2|1|0| 509 * +-------------+-+-+-+ 510 * | | | | 511 * | | | +- Enabled? 512 * | | +--- Enabled for wake? 513 * | +----- Set? 514 * +----------- <Reserved> 515 */ 516 typedef u32 acpi_event_status; 517 518 #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00 519 #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01 520 #define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02 521 #define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 522 523 /* Notify types */ 524 525 #define ACPI_SYSTEM_NOTIFY 0x1 526 #define ACPI_DEVICE_NOTIFY 0x2 527 #define ACPI_ALL_NOTIFY 0x3 528 #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 529 530 #define ACPI_MAX_SYS_NOTIFY 0x7f 531 532 /* Address Space (Operation Region) Types */ 533 534 typedef u8 acpi_adr_space_type; 535 536 #define ACPI_ADR_SPACE_SYSTEM_MEMORY (acpi_adr_space_type) 0 537 #define ACPI_ADR_SPACE_SYSTEM_IO (acpi_adr_space_type) 1 538 #define ACPI_ADR_SPACE_PCI_CONFIG (acpi_adr_space_type) 2 539 #define ACPI_ADR_SPACE_EC (acpi_adr_space_type) 3 540 #define ACPI_ADR_SPACE_SMBUS (acpi_adr_space_type) 4 541 #define ACPI_ADR_SPACE_CMOS (acpi_adr_space_type) 5 542 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (acpi_adr_space_type) 6 543 #define ACPI_ADR_SPACE_DATA_TABLE (acpi_adr_space_type) 7 544 #define ACPI_ADR_SPACE_FIXED_HARDWARE (acpi_adr_space_type) 127 545 546 /* 547 * bit_register IDs 548 * These are bitfields defined within the full ACPI registers 549 */ 550 #define ACPI_BITREG_TIMER_STATUS 0x00 551 #define ACPI_BITREG_BUS_MASTER_STATUS 0x01 552 #define ACPI_BITREG_GLOBAL_LOCK_STATUS 0x02 553 #define ACPI_BITREG_POWER_BUTTON_STATUS 0x03 554 #define ACPI_BITREG_SLEEP_BUTTON_STATUS 0x04 555 #define ACPI_BITREG_RT_CLOCK_STATUS 0x05 556 #define ACPI_BITREG_WAKE_STATUS 0x06 557 #define ACPI_BITREG_PCIEXP_WAKE_STATUS 0x07 558 559 #define ACPI_BITREG_TIMER_ENABLE 0x08 560 #define ACPI_BITREG_GLOBAL_LOCK_ENABLE 0x09 561 #define ACPI_BITREG_POWER_BUTTON_ENABLE 0x0A 562 #define ACPI_BITREG_SLEEP_BUTTON_ENABLE 0x0B 563 #define ACPI_BITREG_RT_CLOCK_ENABLE 0x0C 564 #define ACPI_BITREG_WAKE_ENABLE 0x0D 565 #define ACPI_BITREG_PCIEXP_WAKE_DISABLE 0x0E 566 567 #define ACPI_BITREG_SCI_ENABLE 0x0F 568 #define ACPI_BITREG_BUS_MASTER_RLD 0x10 569 #define ACPI_BITREG_GLOBAL_LOCK_RELEASE 0x11 570 #define ACPI_BITREG_SLEEP_TYPE_A 0x12 571 #define ACPI_BITREG_SLEEP_TYPE_B 0x13 572 #define ACPI_BITREG_SLEEP_ENABLE 0x14 573 574 #define ACPI_BITREG_ARB_DISABLE 0x15 575 576 #define ACPI_BITREG_MAX 0x15 577 #define ACPI_NUM_BITREG ACPI_BITREG_MAX + 1 578 579 /* 580 * External ACPI object definition 581 */ 582 union acpi_object { 583 acpi_object_type type; /* See definition of acpi_ns_type for values */ 584 struct { 585 acpi_object_type type; 586 acpi_integer value; /* The actual number */ 587 } integer; 588 589 struct { 590 acpi_object_type type; 591 u32 length; /* # of bytes in string, excluding trailing null */ 592 char *pointer; /* points to the string value */ 593 } string; 594 595 struct { 596 acpi_object_type type; 597 u32 length; /* # of bytes in buffer */ 598 u8 *pointer; /* points to the buffer */ 599 } buffer; 600 601 struct { 602 acpi_object_type type; 603 u32 fill1; 604 acpi_handle handle; /* object reference */ 605 } reference; 606 607 struct { 608 acpi_object_type type; 609 u32 count; /* # of elements in package */ 610 union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ 611 } package; 612 613 struct { 614 acpi_object_type type; 615 u32 proc_id; 616 acpi_io_address pblk_address; 617 u32 pblk_length; 618 } processor; 619 620 struct { 621 acpi_object_type type; 622 u32 system_level; 623 u32 resource_order; 624 } power_resource; 625 }; 626 627 /* 628 * List of objects, used as a parameter list for control method evaluation 629 */ 630 struct acpi_object_list { 631 u32 count; 632 union acpi_object *pointer; 633 }; 634 635 /* 636 * Miscellaneous common Data Structures used by the interfaces 637 */ 638 #define ACPI_NO_BUFFER 0 639 #define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) 640 #define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) 641 642 struct acpi_buffer { 643 acpi_size length; /* Length in bytes of the buffer */ 644 void *pointer; /* pointer to buffer */ 645 }; 646 647 /* 648 * Memory Attributes 649 */ 650 #define ACPI_READ_ONLY_MEMORY (u8) 0x00 651 #define ACPI_READ_WRITE_MEMORY (u8) 0x01 652 653 #define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00 654 #define ACPI_CACHABLE_MEMORY (u8) 0x01 655 #define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 656 #define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 657 658 /* 659 * IO Attributes 660 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 661 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 662 */ 663 #define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01 664 #define ACPI_ISA_ONLY_RANGES (u8) 0x02 665 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) 666 667 /* Type of translation - 1=Sparse, 0=Dense */ 668 669 #define ACPI_SPARSE_TRANSLATION (u8) 0x01 670 671 /* 672 * IO Port Descriptor Decode 673 */ 674 #define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */ 675 #define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */ 676 677 /* 678 * IRQ Attributes 679 */ 680 #define ACPI_LEVEL_SENSITIVE (u8) 0x00 681 #define ACPI_EDGE_SENSITIVE (u8) 0x01 682 683 #define ACPI_ACTIVE_HIGH (u8) 0x00 684 #define ACPI_ACTIVE_LOW (u8) 0x01 685 686 #define ACPI_EXCLUSIVE (u8) 0x00 687 #define ACPI_SHARED (u8) 0x01 688 689 /* 690 * DMA Attributes 691 */ 692 #define ACPI_COMPATIBILITY (u8) 0x00 693 #define ACPI_TYPE_A (u8) 0x01 694 #define ACPI_TYPE_B (u8) 0x02 695 #define ACPI_TYPE_F (u8) 0x03 696 697 #define ACPI_NOT_BUS_MASTER (u8) 0x00 698 #define ACPI_BUS_MASTER (u8) 0x01 699 700 #define ACPI_TRANSFER_8 (u8) 0x00 701 #define ACPI_TRANSFER_8_16 (u8) 0x01 702 #define ACPI_TRANSFER_16 (u8) 0x02 703 704 /* 705 * Start Dependent Functions Priority definitions 706 */ 707 #define ACPI_GOOD_CONFIGURATION (u8) 0x00 708 #define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01 709 #define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02 710 711 /* 712 * 16, 32 and 64-bit Address Descriptor resource types 713 */ 714 #define ACPI_MEMORY_RANGE (u8) 0x00 715 #define ACPI_IO_RANGE (u8) 0x01 716 #define ACPI_BUS_NUMBER_RANGE (u8) 0x02 717 718 #define ACPI_ADDRESS_NOT_FIXED (u8) 0x00 719 #define ACPI_ADDRESS_FIXED (u8) 0x01 720 721 #define ACPI_POS_DECODE (u8) 0x00 722 #define ACPI_SUB_DECODE (u8) 0x01 723 724 #define ACPI_PRODUCER (u8) 0x00 725 #define ACPI_CONSUMER (u8) 0x01 726 727 #endif /* __ACTYPES_H__ */ 728