1 /******************************************************************************
3 * Name: actypes.h - Common data types for the entire ACPI subsystem
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 /*! [Begin] no source code translation (keep the typedefs) */
32 * Data types - Fixed across all compilation models
34 * BOOLEAN Logical Boolean.
35 * 1 byte value containing a 0 for FALSE or a 1 for TRUE.
36 * Other values are undefined.
38 * INT8 8-bit (1 byte) signed value
39 * UINT8 8-bit (1 byte) unsigned value
40 * INT16 16-bit (2 byte) signed value
41 * UINT16 16-bit (2 byte) unsigned value
42 * INT32 32-bit (4 byte) signed value
43 * UINT32 32-bit (4 byte) unsigned value
44 * INT64 64-bit (8 byte) signed value
45 * UINT64 64-bit (8 byte) unsigned value
46 * NATIVE_INT 32-bit on IA-32, 64-bit on IA-64 signed value
47 * NATIVE_UINT 32-bit on IA-32, 64-bit on IA-64 unsigned value
48 * UCHAR Character. 1 byte unsigned value.
52 #error "define BITS_PER_LONG"
55 #if BITS_PER_LONG == 64
57 * 64-bit type definitions
59 typedef unsigned char UINT8;
60 typedef unsigned char BOOLEAN;
61 typedef unsigned char UCHAR;
62 typedef unsigned short UINT16;
64 typedef unsigned int UINT32;
65 typedef COMPILER_DEPENDENT_UINT64 UINT64;
67 typedef UINT64 NATIVE_UINT;
68 typedef long long NATIVE_INT;
70 typedef NATIVE_UINT ACPI_TBLPTR;
71 typedef UINT64 ACPI_IO_ADDRESS;
72 typedef UINT64 ACPI_PHYSICAL_ADDRESS;
74 #define ALIGNED_ADDRESS_BOUNDARY 0x00000008 /* No hardware alignment support in IA64 */
75 #define ACPI_USE_NATIVE_DIVIDE /* Native 64-bit integer support */
78 #elif BITS_PER_LONG == 16
80 * 16-bit type definitions
82 typedef unsigned char UINT8;
83 typedef unsigned char BOOLEAN;
84 typedef unsigned char UCHAR;
85 typedef unsigned int UINT16;
88 typedef unsigned long UINT32;
97 typedef UINT16 NATIVE_UINT;
98 typedef INT16 NATIVE_INT;
100 typedef UINT32 ACPI_TBLPTR;
101 typedef UINT32 ACPI_IO_ADDRESS;
102 typedef char *ACPI_PHYSICAL_ADDRESS;
104 #define ALIGNED_ADDRESS_BOUNDARY 0x00000002
105 #define _HW_ALIGNMENT_SUPPORT
106 #define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
109 * (16-bit only) internal integers must be 32-bits, so
110 * 64-bit integers cannot be supported
112 #define ACPI_NO_INTEGER64_SUPPORT
115 #elif BITS_PER_LONG == 32
117 * 32-bit type definitions (default)
119 typedef unsigned char UINT8;
120 typedef unsigned char BOOLEAN;
121 typedef unsigned char UCHAR;
122 typedef unsigned short UINT16;
124 typedef unsigned int UINT32;
125 typedef COMPILER_DEPENDENT_UINT64 UINT64;
127 typedef UINT32 NATIVE_UINT;
128 typedef INT32 NATIVE_INT;
130 typedef NATIVE_UINT ACPI_TBLPTR;
131 typedef UINT32 ACPI_IO_ADDRESS;
132 typedef UINT64 ACPI_PHYSICAL_ADDRESS;
134 #define ALIGNED_ADDRESS_BOUNDARY 0x00000004
135 #define _HW_ALIGNMENT_SUPPORT
138 #error "unknown BITS_PER_LONG"
144 * Miscellaneous common types
147 typedef UINT32 UINT32_BIT;
148 typedef NATIVE_UINT ACPI_PTRDIFF;
149 typedef char NATIVE_CHAR;
156 #define ACPI_UINT8_MAX (UINT8) 0xFF
157 #define ACPI_UINT16_MAX (UINT16) 0xFFFF
158 #define ACPI_UINT32_MAX (UINT32) 0xFFFFFFFF
159 #define ACPI_UINT64_MAX (UINT64) 0xFFFFFFFFFFFFFFFF
162 #ifdef DEFINE_ALTERNATE_TYPES
164 * Types used only in translated source
172 /*! [End] no source code translation !*/
182 #define FALSE (1 == 0)
187 #define TRUE (1 == 1)
190 #define NULL (void *) 0
198 typedef u32 acpi_status; /* All ACPI Exceptions */
199 typedef u32 acpi_name; /* 4-byte ACPI name */
200 typedef char* acpi_string; /* Null terminated ASCII string */
201 typedef void* acpi_handle; /* Actually a ptr to an Node */
219 * Acpi integer width. In ACPI version 1, integers are
220 * 32 bits. In ACPI version 2, integers are 64 bits.
221 * Note that this pertains to the ACPI integer type only, not
222 * other integers used in the implementation of the ACPI CA
225 #ifdef ACPI_NO_INTEGER64_SUPPORT
227 /* 32-bit integers only, no 64-bit support */
229 typedef u32 acpi_integer;
230 #define ACPI_INTEGER_MAX ACPI_UINT32_MAX
231 #define ACPI_INTEGER_BIT_SIZE 32
232 #define ACPI_MAX_BCD_VALUE 99999999
233 #define ACPI_MAX_BCD_DIGITS 8
234 #define ACPI_MAX_DECIMAL_DIGITS 10
236 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
241 /* 64-bit integers */
243 typedef u64 acpi_integer;
244 #define ACPI_INTEGER_MAX ACPI_UINT64_MAX
245 #define ACPI_INTEGER_BIT_SIZE 64
246 #define ACPI_MAX_BCD_VALUE 9999999999999999
247 #define ACPI_MAX_BCD_DIGITS 16
248 #define ACPI_MAX_DECIMAL_DIGITS 19
251 #define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */
257 * Constants with special meanings
260 #define ACPI_ROOT_OBJECT (acpi_handle)(-1)
264 * Initialization sequence
266 #define ACPI_FULL_INITIALIZATION 0x00
267 #define ACPI_NO_ADDRESS_SPACE_INIT 0x01
268 #define ACPI_NO_HARDWARE_INIT 0x02
269 #define ACPI_NO_EVENT_INIT 0x04
270 #define ACPI_NO_ACPI_ENABLE 0x08
271 #define ACPI_NO_DEVICE_INIT 0x10
272 #define ACPI_NO_OBJECT_INIT 0x20
275 * Initialization state
277 #define ACPI_INITIALIZED_OK 0x01
283 #define ACPI_STATE_UNKNOWN (u8) 0xFF
285 #define ACPI_STATE_S0 (u8) 0
286 #define ACPI_STATE_S1 (u8) 1
287 #define ACPI_STATE_S2 (u8) 2
288 #define ACPI_STATE_S3 (u8) 3
289 #define ACPI_STATE_S4 (u8) 4
290 #define ACPI_STATE_S5 (u8) 5
291 #define ACPI_S_STATES_MAX ACPI_STATE_S5
292 #define ACPI_S_STATE_COUNT 6
294 #define ACPI_STATE_D0 (u8) 0
295 #define ACPI_STATE_D1 (u8) 1
296 #define ACPI_STATE_D2 (u8) 2
297 #define ACPI_STATE_D3 (u8) 3
298 #define ACPI_D_STATES_MAX ACPI_STATE_D3
299 #define ACPI_D_STATE_COUNT 4
302 * Standard notify values
304 #define ACPI_NOTIFY_BUS_CHECK (u8) 0
305 #define ACPI_NOTIFY_DEVICE_CHECK (u8) 1
306 #define ACPI_NOTIFY_DEVICE_WAKE (u8) 2
307 #define ACPI_NOTIFY_EJECT_REQUEST (u8) 3
308 #define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (u8) 4
309 #define ACPI_NOTIFY_FREQUENCY_MISMATCH (u8) 5
310 #define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 6
311 #define ACPI_NOTIFY_POWER_FAULT (u8) 7
315 * Table types. These values are passed to the table related APIs
318 typedef u32 acpi_table_type;
320 #define ACPI_TABLE_RSDP (acpi_table_type) 0
321 #define ACPI_TABLE_DSDT (acpi_table_type) 1
322 #define ACPI_TABLE_FADT (acpi_table_type) 2
323 #define ACPI_TABLE_FACS (acpi_table_type) 3
324 #define ACPI_TABLE_PSDT (acpi_table_type) 4
325 #define ACPI_TABLE_SSDT (acpi_table_type) 5
326 #define ACPI_TABLE_XSDT (acpi_table_type) 6
327 #define ACPI_TABLE_MAX 6
328 #define NUM_ACPI_TABLES (ACPI_TABLE_MAX+1)
332 * Types associated with names. The first group of
333 * values correspond to the definition of the ACPI
334 * Object_type operator (See the ACPI Spec). Therefore,
335 * only add to the first group if the spec changes!
337 * Types must be kept in sync with the Acpi_ns_properties
338 * and Acpi_ns_type_names arrays
341 typedef u32 acpi_object_type;
342 typedef u8 acpi_object_type8;
345 #define ACPI_TYPE_ANY 0 /* 0x00 */
346 #define ACPI_TYPE_INTEGER 1 /* 0x01 Byte/Word/Dword/Zero/One/Ones */
347 #define ACPI_TYPE_STRING 2 /* 0x02 */
348 #define ACPI_TYPE_BUFFER 3 /* 0x03 */
349 #define ACPI_TYPE_PACKAGE 4 /* 0x04 Byte_const, multiple Data_term/Constant/Super_name */
350 #define ACPI_TYPE_FIELD_UNIT 5 /* 0x05 */
351 #define ACPI_TYPE_DEVICE 6 /* 0x06 Name, multiple Node */
352 #define ACPI_TYPE_EVENT 7 /* 0x07 */
353 #define ACPI_TYPE_METHOD 8 /* 0x08 Name, Byte_const, multiple Code */
354 #define ACPI_TYPE_MUTEX 9 /* 0x09 */
355 #define ACPI_TYPE_REGION 10 /* 0x0A */
356 #define ACPI_TYPE_POWER 11 /* 0x0B Name,Byte_const,Word_const,multi Node */
357 #define ACPI_TYPE_PROCESSOR 12 /* 0x0C Name,Byte_const,DWord_const,Byte_const,multi Nm_o */
358 #define ACPI_TYPE_THERMAL 13 /* 0x0D Name, multiple Node */
359 #define ACPI_TYPE_BUFFER_FIELD 14 /* 0x0E */
360 #define ACPI_TYPE_DDB_HANDLE 15 /* 0x0F */
361 #define ACPI_TYPE_DEBUG_OBJECT 16 /* 0x10 */
363 #define ACPI_TYPE_MAX 16
366 * This section contains object types that do not relate to the ACPI Object_type operator.
367 * They are used for various internal purposes only. If new predefined ACPI_TYPEs are
368 * added (via the ACPI specification), these internal types must move upwards.
369 * Also, values exceeding the largest official ACPI Object_type must not overlap with
370 * defined AML opcodes.
372 #define INTERNAL_TYPE_BEGIN 17
374 #define INTERNAL_TYPE_REGION_FIELD 17 /* 0x11 */
375 #define INTERNAL_TYPE_BANK_FIELD 18 /* 0x12 */
376 #define INTERNAL_TYPE_INDEX_FIELD 19 /* 0x13 */
377 #define INTERNAL_TYPE_REFERENCE 20 /* 0x14 Arg#, Local#, Name, Debug; used only in descriptors */
378 #define INTERNAL_TYPE_ALIAS 21 /* 0x15 */
379 #define INTERNAL_TYPE_NOTIFY 22 /* 0x16 */
380 #define INTERNAL_TYPE_ADDRESS_HANDLER 23 /* 0x17 */
381 #define INTERNAL_TYPE_RESOURCE 24 /* 0x18 */
382 #define INTERNAL_TYPE_RESOURCE_FIELD 25 /* 0x19 */
385 #define INTERNAL_TYPE_NODE_MAX 25
387 /* These are pseudo-types because there are never any namespace nodes with these types */
389 #define INTERNAL_TYPE_FIELD_DEFN 26 /* 0x1A Name, Byte_const, multiple Field_element */
390 #define INTERNAL_TYPE_BANK_FIELD_DEFN 27 /* 0x1B 2 Name,DWord_const,Byte_const,multi Field_element */
391 #define INTERNAL_TYPE_INDEX_FIELD_DEFN 28 /* 0x1C 2 Name, Byte_const, multiple Field_element */
392 #define INTERNAL_TYPE_IF 29 /* 0x1D */
393 #define INTERNAL_TYPE_ELSE 30 /* 0x1E */
394 #define INTERNAL_TYPE_WHILE 31 /* 0x1F */
395 #define INTERNAL_TYPE_SCOPE 32 /* 0x20 Name, multiple Node */
396 #define INTERNAL_TYPE_DEF_ANY 33 /* 0x21 type is Any, suppress search of enclosing scopes */
397 #define INTERNAL_TYPE_EXTRA 34 /* 0x22 */
399 #define INTERNAL_TYPE_MAX 34
401 #define INTERNAL_TYPE_INVALID 35
402 #define ACPI_TYPE_NOT_FOUND 0xFF
406 * Bitmapped ACPI types
407 * Used internally only
409 #define ACPI_BTYPE_ANY 0x00000000
410 #define ACPI_BTYPE_INTEGER 0x00000001
411 #define ACPI_BTYPE_STRING 0x00000002
412 #define ACPI_BTYPE_BUFFER 0x00000004
413 #define ACPI_BTYPE_PACKAGE 0x00000008
414 #define ACPI_BTYPE_FIELD_UNIT 0x00000010
415 #define ACPI_BTYPE_DEVICE 0x00000020
416 #define ACPI_BTYPE_EVENT 0x00000040
417 #define ACPI_BTYPE_METHOD 0x00000080
418 #define ACPI_BTYPE_MUTEX 0x00000100
419 #define ACPI_BTYPE_REGION 0x00000200
420 #define ACPI_BTYPE_POWER 0x00000400
421 #define ACPI_BTYPE_PROCESSOR 0x00000800
422 #define ACPI_BTYPE_THERMAL 0x00001000
423 #define ACPI_BTYPE_BUFFER_FIELD 0x00002000
424 #define ACPI_BTYPE_DDB_HANDLE 0x00004000
425 #define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
426 #define ACPI_BTYPE_REFERENCE 0x00010000
427 #define ACPI_BTYPE_RESOURCE 0x00020000
429 #define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
431 #define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
432 #define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
433 #define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
434 #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
435 #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
441 * Fixed & general purpose...
444 typedef u32 acpi_event_type;
446 #define ACPI_EVENT_FIXED (acpi_event_type) 0
447 #define ACPI_EVENT_GPE (acpi_event_type) 1
453 #define ACPI_EVENT_PMTIMER (acpi_event_type) 0
455 * There's no bus master event so index 1 is used for IRQ's that are not
456 * handled by the SCI handler
458 #define ACPI_EVENT_NOT_USED (acpi_event_type) 1
459 #define ACPI_EVENT_GLOBAL (acpi_event_type) 2
460 #define ACPI_EVENT_POWER_BUTTON (acpi_event_type) 3
461 #define ACPI_EVENT_SLEEP_BUTTON (acpi_event_type) 4
462 #define ACPI_EVENT_RTC (acpi_event_type) 5
463 #define ACPI_EVENT_GENERAL (acpi_event_type) 6
464 #define ACPI_EVENT_MAX 6
465 #define ACPI_NUM_FIXED_EVENTS (acpi_event_type) 7
467 #define ACPI_GPE_INVALID 0xFF
468 #define ACPI_GPE_MAX 0xFF
469 #define ACPI_NUM_GPE 256
471 #define ACPI_EVENT_LEVEL_TRIGGERED (acpi_event_type) 1
472 #define ACPI_EVENT_EDGE_TRIGGERED (acpi_event_type) 2
477 #define ACPI_EVENT_ENABLE 0x1
478 #define ACPI_EVENT_WAKE_ENABLE 0x2
480 #define ACPI_EVENT_DISABLE 0x1
481 #define ACPI_EVENT_WAKE_DISABLE 0x2
487 * The encoding of acpi_event_status is illustrated below.
488 * Note that a set bit (1) indicates the property is TRUE
489 * (e.g. if bit 0 is set then the event is enabled).
490 * +-------------+-+-+-+
491 * | Bits 31:3 |2|1|0|
492 * +-------------+-+-+-+
495 * | | +--- Enabled for wake?
497 * +----------- <Reserved>
499 typedef u32 acpi_event_status;
501 #define ACPI_EVENT_FLAG_DISABLED (acpi_event_status) 0x00
502 #define ACPI_EVENT_FLAG_ENABLED (acpi_event_status) 0x01
503 #define ACPI_EVENT_FLAG_WAKE_ENABLED (acpi_event_status) 0x02
504 #define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04
509 #define ACPI_SYSTEM_NOTIFY 0
510 #define ACPI_DEVICE_NOTIFY 1
511 #define ACPI_MAX_NOTIFY_HANDLER_TYPE 1
513 #define MAX_SYS_NOTIFY 0x7f
516 /* Address Space (Operation Region) Types */
518 typedef u8 ACPI_ADR_SPACE_TYPE;
520 #define ACPI_ADR_SPACE_SYSTEM_MEMORY (ACPI_ADR_SPACE_TYPE) 0
521 #define ACPI_ADR_SPACE_SYSTEM_IO (ACPI_ADR_SPACE_TYPE) 1
522 #define ACPI_ADR_SPACE_PCI_CONFIG (ACPI_ADR_SPACE_TYPE) 2
523 #define ACPI_ADR_SPACE_EC (ACPI_ADR_SPACE_TYPE) 3
524 #define ACPI_ADR_SPACE_SMBUS (ACPI_ADR_SPACE_TYPE) 4
525 #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
526 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
530 * External ACPI object definition
533 typedef union acpi_obj
535 acpi_object_type type; /* See definition of Acpi_ns_type for values */
538 acpi_object_type type;
539 acpi_integer value; /* The actual number */
544 acpi_object_type type;
545 u32 length; /* # of bytes in string, excluding trailing null */
546 NATIVE_CHAR *pointer; /* points to the string value */
551 acpi_object_type type;
552 u32 length; /* # of bytes in buffer */
553 u8 *pointer; /* points to the buffer */
558 acpi_object_type type;
560 acpi_handle handle; /* object reference */
565 acpi_object_type type;
566 u32 count; /* # of elements in package */
567 union acpi_obj *elements; /* Pointer to an array of ACPI_OBJECTs */
572 acpi_object_type type;
574 ACPI_IO_ADDRESS pblk_address;
580 acpi_object_type type;
585 } acpi_object, *PACPI_OBJECT;
589 * List of objects, used as a parameter list for control method evaluation
592 typedef struct acpi_obj_list
595 acpi_object *pointer;
597 } acpi_object_list, *PACPI_OBJECT_LIST;
601 * Miscellaneous common Data Structures used by the interfaces
606 u32 length; /* Length in bytes of the buffer */
607 void *pointer; /* pointer to buffer */
613 * Name_type for Acpi_get_name
616 #define ACPI_FULL_PATHNAME 0
617 #define ACPI_SINGLE_NAME 1
618 #define ACPI_NAME_TYPE_MAX 1
622 * Structure and flags for Acpi_get_system_info
625 #define SYS_MODE_UNKNOWN 0x0000
626 #define SYS_MODE_ACPI 0x0001
627 #define SYS_MODE_LEGACY 0x0002
628 #define SYS_MODES_MASK 0x0003
632 * ACPI Table Info. One per ACPI table _type_
634 typedef struct acpi_table_info
642 * System info returned by Acpi_get_system_info()
645 typedef struct _acpi_sys_info
649 u32 timer_resolution;
655 acpi_table_info table_info [NUM_ACPI_TABLES];
661 * Various handlers and callback procedures
665 u32 (*acpi_event_handler) (
669 void (*acpi_gpe_handler) (
673 void (*acpi_notify_handler) (
679 /* Address Spaces (Operation Regions */
681 #define ACPI_READ_ADR_SPACE 1
682 #define ACPI_WRITE_ADR_SPACE 2
685 acpi_status (*acpi_adr_space_handler) (
687 ACPI_PHYSICAL_ADDRESS address,
690 void *handler_context,
691 void *region_context);
693 #define ACPI_DEFAULT_HANDLER ((acpi_adr_space_handler) NULL)
697 acpi_status (*acpi_adr_space_setup) (
698 acpi_handle region_handle,
700 void *handler_context,
701 void **region_context);
703 #define ACPI_REGION_ACTIVATE 0
704 #define ACPI_REGION_DEACTIVATE 1
707 acpi_status (*acpi_walk_callback) (
708 acpi_handle obj_handle,
711 void **return_value);
714 /* Interrupt handler return values */
716 #define INTERRUPT_NOT_HANDLED 0x00
717 #define INTERRUPT_HANDLED 0x01
720 /* Structure and flags for Acpi_get_device_info */
722 #define ACPI_VALID_HID 0x1
723 #define ACPI_VALID_UID 0x2
724 #define ACPI_VALID_ADR 0x4
725 #define ACPI_VALID_STA 0x8
728 #define ACPI_COMMON_OBJ_INFO \
729 acpi_object_type type; /* ACPI object type */ \
730 acpi_name name /* ACPI object Name */
735 ACPI_COMMON_OBJ_INFO;
736 } acpi_obj_info_header;
741 ACPI_COMMON_OBJ_INFO;
743 u32 valid; /* Are the next bits legit? */
744 NATIVE_CHAR hardware_id[9]; /* _HID value if any */
745 NATIVE_CHAR unique_id[9]; /* _UID value if any */
746 acpi_integer address; /* _ADR value if any */
747 u32 current_status; /* _STA value */
751 /* Context structs for address space handlers */
764 ACPI_PHYSICAL_ADDRESS mapped_physical_address;
765 u8 *mapped_logical_address;
767 } acpi_mem_space_context;
772 #define ACPI_NUM_SLEEP_STATES 7
776 * Definitions for Resource Attributes
782 #define READ_ONLY_MEMORY (u8) 0x00
783 #define READ_WRITE_MEMORY (u8) 0x01
785 #define NON_CACHEABLE_MEMORY (u8) 0x00
786 #define CACHABLE_MEMORY (u8) 0x01
787 #define WRITE_COMBINING_MEMORY (u8) 0x02
788 #define PREFETCHABLE_MEMORY (u8) 0x03
792 * The ISA IO ranges are: n000-n0FFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
793 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cD0-n_fFFh.
795 #define NON_ISA_ONLY_RANGES (u8) 0x01
796 #define ISA_ONLY_RANGES (u8) 0x02
797 #define ENTIRE_RANGE (NON_ISA_ONLY_RANGES | ISA_ONLY_RANGES)
800 * IO Port Descriptor Decode
802 #define DECODE_10 (u8) 0x00 /* 10-bit IO address decode */
803 #define DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
808 #define EDGE_SENSITIVE (u8) 0x00
809 #define LEVEL_SENSITIVE (u8) 0x01
811 #define ACTIVE_HIGH (u8) 0x00
812 #define ACTIVE_LOW (u8) 0x01
814 #define EXCLUSIVE (u8) 0x00
815 #define SHARED (u8) 0x01
820 #define COMPATIBILITY (u8) 0x00
821 #define TYPE_A (u8) 0x01
822 #define TYPE_B (u8) 0x02
823 #define TYPE_F (u8) 0x03
825 #define NOT_BUS_MASTER (u8) 0x00
826 #define BUS_MASTER (u8) 0x01
828 #define TRANSFER_8 (u8) 0x00
829 #define TRANSFER_8_16 (u8) 0x01
830 #define TRANSFER_16 (u8) 0x02
833 * Start Dependent Functions Priority definitions
835 #define GOOD_CONFIGURATION (u8) 0x00
836 #define ACCEPTABLE_CONFIGURATION (u8) 0x01
837 #define SUB_OPTIMAL_CONFIGURATION (u8) 0x02
840 * 16, 32 and 64-bit Address Descriptor resource types
842 #define MEMORY_RANGE (u8) 0x00
843 #define IO_RANGE (u8) 0x01
844 #define BUS_NUMBER_RANGE (u8) 0x02
846 #define ADDRESS_NOT_FIXED (u8) 0x00
847 #define ADDRESS_FIXED (u8) 0x01
849 #define POS_DECODE (u8) 0x00
850 #define SUB_DECODE (u8) 0x01
852 #define PRODUCER (u8) 0x00
853 #define CONSUMER (u8) 0x01
857 * Structures used to describe device resources
863 u32 shared_exclusive;
864 u32 number_of_interrupts;
874 u32 number_of_channels;
881 u32 compatibility_priority;
882 u32 performance_robustness;
884 } acpi_resource_start_dpf;
887 * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
888 * needed because it has no fields
894 u32 min_base_address;
895 u32 max_base_address;
906 } acpi_resource_fixed_io;
913 } acpi_resource_vendor;
917 u32 read_write_attribute;
918 u32 min_base_address;
919 u32 max_base_address;
923 } acpi_resource_mem24;
927 u32 read_write_attribute;
928 u32 min_base_address;
929 u32 max_base_address;
933 } acpi_resource_mem32;
937 u32 read_write_attribute;
938 u32 range_base_address;
941 } acpi_resource_fixed_mem32;
946 u16 read_write_attribute;
948 } acpi_memory_attribute;
962 } acpi_bus_attribute;
966 acpi_memory_attribute memory;
967 acpi_io_attribute io;
968 acpi_bus_attribute bus;
970 } acpi_resource_attribute;
976 NATIVE_CHAR *string_ptr;
978 } acpi_resource_source;
983 u32 producer_consumer;
985 u32 min_address_fixed;
986 u32 max_address_fixed;
987 acpi_resource_attribute attribute;
989 u32 min_address_range;
990 u32 max_address_range;
991 u32 address_translation_offset;
993 acpi_resource_source resource_source;
995 } acpi_resource_address16;
1000 u32 producer_consumer;
1002 u32 min_address_fixed;
1003 u32 max_address_fixed;
1004 acpi_resource_attribute attribute;
1006 u32 min_address_range;
1007 u32 max_address_range;
1008 u32 address_translation_offset;
1010 acpi_resource_source resource_source;
1012 } acpi_resource_address32;
1017 u32 producer_consumer;
1019 u32 min_address_fixed;
1020 u32 max_address_fixed;
1021 acpi_resource_attribute attribute;
1023 u64 min_address_range;
1024 u64 max_address_range;
1025 u64 address_translation_offset;
1027 acpi_resource_source resource_source;
1029 } acpi_resource_address64;
1033 u32 producer_consumer;
1035 u32 active_high_low;
1036 u32 shared_exclusive;
1037 u32 number_of_interrupts;
1038 acpi_resource_source resource_source;
1041 } acpi_resource_ext_irq;
1044 /* ACPI_RESOURCE_TYPEs */
1046 #define ACPI_RSTYPE_IRQ 0
1047 #define ACPI_RSTYPE_DMA 1
1048 #define ACPI_RSTYPE_START_DPF 2
1049 #define ACPI_RSTYPE_END_DPF 3
1050 #define ACPI_RSTYPE_IO 4
1051 #define ACPI_RSTYPE_FIXED_IO 5
1052 #define ACPI_RSTYPE_VENDOR 6
1053 #define ACPI_RSTYPE_END_TAG 7
1054 #define ACPI_RSTYPE_MEM24 8
1055 #define ACPI_RSTYPE_MEM32 9
1056 #define ACPI_RSTYPE_FIXED_MEM32 10
1057 #define ACPI_RSTYPE_ADDRESS16 11
1058 #define ACPI_RSTYPE_ADDRESS32 12
1059 #define ACPI_RSTYPE_ADDRESS64 13
1060 #define ACPI_RSTYPE_EXT_IRQ 14
1062 typedef u32 acpi_resource_type;
1066 acpi_resource_irq irq;
1067 acpi_resource_dma dma;
1068 acpi_resource_start_dpf start_dpf;
1069 acpi_resource_io io;
1070 acpi_resource_fixed_io fixed_io;
1071 acpi_resource_vendor vendor_specific;
1072 acpi_resource_mem24 memory24;
1073 acpi_resource_mem32 memory32;
1074 acpi_resource_fixed_mem32 fixed_memory32;
1075 acpi_resource_address16 address16;
1076 acpi_resource_address32 address32;
1077 acpi_resource_address64 address64;
1078 acpi_resource_ext_irq extended_irq;
1080 } acpi_resource_data;
1082 typedef struct acpi_resource
1084 acpi_resource_type id;
1086 acpi_resource_data data;
1090 #define ACPI_RESOURCE_LENGTH 12
1091 #define ACPI_RESOURCE_LENGTH_NO_DATA 8 /* Id + Length fields */
1093 #define SIZEOF_RESOURCE(type) (ACPI_RESOURCE_LENGTH_NO_DATA + sizeof (type))
1095 #define NEXT_RESOURCE(res) (acpi_resource *)((u8 *) res + res->length)
1099 * END: Definitions for Resource Attributes
1103 typedef struct pci_routing_table
1107 acpi_integer address; /* here for 64-bit alignment */
1109 NATIVE_CHAR source[4]; /* pad to 64 bits so sizeof() works in all cases */
1111 } pci_routing_table;
1115 * END: Definitions for PCI Routing tables
1118 #endif /* __ACTYPES_H__ */