1 /******************************************************************************
3 * Name: aclocal.h - Internal data types used across the ACPI subsystem
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2005, R. Byron Moore
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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.
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.
48 #define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
50 typedef void * acpi_mutex
;
51 typedef u32 acpi_mutex_handle
;
54 /* Total number of aml opcodes defined */
56 #define AML_NUM_OPCODES 0x7F
59 /* Forward declarations */
61 struct acpi_walk_state
;
62 struct acpi_obj_mutex
;
63 union acpi_parse_object
;
66 /*****************************************************************************
68 * Mutex typedefs and structs
70 ****************************************************************************/
74 * Predefined handles for the mutex objects used within the subsystem
75 * All mutex objects are automatically created by acpi_ut_mutex_initialize.
77 * The acquire/release ordering protocol is implied via this list. Mutexes
78 * with a lower value must be acquired before mutexes with a higher value.
80 * NOTE: any changes here must be reflected in the acpi_gbl_mutex_names table also!
82 #define ACPI_MTX_EXECUTE 0
83 #define ACPI_MTX_INTERPRETER 1
84 #define ACPI_MTX_PARSER 2
85 #define ACPI_MTX_DISPATCHER 3
86 #define ACPI_MTX_TABLES 4
87 #define ACPI_MTX_OP_REGIONS 5
88 #define ACPI_MTX_NAMESPACE 6
89 #define ACPI_MTX_EVENTS 7
90 #define ACPI_MTX_HARDWARE 8
91 #define ACPI_MTX_CACHES 9
92 #define ACPI_MTX_MEMORY 10
93 #define ACPI_MTX_DEBUG_CMD_COMPLETE 11
94 #define ACPI_MTX_DEBUG_CMD_READY 12
97 #define NUM_MUTEX MAX_MUTEX+1
100 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
101 #ifdef DEFINE_ACPI_GLOBALS
103 /* Names for the mutexes used in the subsystem */
105 static char *acpi_gbl_mutex_names
[] =
108 "ACPI_MTX_Interpreter",
110 "ACPI_MTX_Dispatcher",
112 "ACPI_MTX_op_regions",
113 "ACPI_MTX_Namespace",
118 "ACPI_MTX_debug_cmd_complete",
119 "ACPI_MTX_debug_cmd_ready",
126 /* Owner IDs are used to track namespace nodes for selective deletion */
128 typedef u8 acpi_owner_id
;
129 #define ACPI_OWNER_ID_MAX 0xFF
131 /* This Thread ID means that the mutex is not in use (unlocked) */
133 #define ACPI_MUTEX_NOT_ACQUIRED (u32) -1
135 /* Table for the global mutexes */
137 struct acpi_mutex_info
145 /* Lock flag parameter for various interfaces */
147 #define ACPI_MTX_DO_NOT_LOCK 0
148 #define ACPI_MTX_LOCK 1
151 /* Field access granularities */
153 #define ACPI_FIELD_BYTE_GRANULARITY 1
154 #define ACPI_FIELD_WORD_GRANULARITY 2
155 #define ACPI_FIELD_DWORD_GRANULARITY 4
156 #define ACPI_FIELD_QWORD_GRANULARITY 8
159 /*****************************************************************************
161 * Namespace typedefs and structs
163 ****************************************************************************/
165 /* Operational modes of the AML interpreter/scanner */
169 ACPI_IMODE_LOAD_PASS1
= 0x01,
170 ACPI_IMODE_LOAD_PASS2
= 0x02,
171 ACPI_IMODE_EXECUTE
= 0x0E
173 } acpi_interpreter_mode
;
177 * The Node describes a named object that appears in the AML
178 * An acpi_node is used to store Nodes.
180 * data_type is used to differentiate between internal descriptors, and MUST
181 * be the first byte in this structure.
183 union acpi_name_union
189 struct acpi_namespace_node
191 u8 descriptor
; /* Used to differentiate object descriptor types */
192 u8 type
; /* Type associated with this name */
193 u16 reference_count
; /* Current count of references and children */
194 union acpi_name_union name
; /* ACPI Name, always 4 chars per ACPI spec */
195 union acpi_operand_object
*object
; /* Pointer to attached ACPI object (optional) */
196 struct acpi_namespace_node
*child
; /* First child */
197 struct acpi_namespace_node
*peer
; /* Next peer*/
198 u8 owner_id
; /* Who created this node */
201 /* Fields used by the ASL compiler only */
203 #ifdef ACPI_ASL_COMPILER
205 union acpi_parse_object
*op
;
210 #define ACPI_ENTRY_NOT_FOUND NULL
215 #define ANOBJ_RESERVED 0x01
216 #define ANOBJ_END_OF_PEER_LIST 0x02
217 #define ANOBJ_DATA_WIDTH_32 0x04 /* Parent table is 64-bits */
218 #define ANOBJ_METHOD_ARG 0x08
219 #define ANOBJ_METHOD_LOCAL 0x10
220 #define ANOBJ_METHOD_NO_RETVAL 0x20
221 #define ANOBJ_METHOD_SOME_NO_RETVAL 0x40
222 #define ANOBJ_IS_BIT_OFFSET 0x80
225 * ACPI Table Descriptor. One per ACPI table
227 struct acpi_table_desc
229 struct acpi_table_desc
*prev
;
230 struct acpi_table_desc
*next
;
231 struct acpi_table_desc
*installed_desc
;
232 struct acpi_table_header
*pointer
;
234 u64 physical_address
;
237 acpi_owner_id owner_id
;
240 u8 loaded_into_namespace
;
243 struct acpi_table_list
245 struct acpi_table_desc
*next
;
250 struct acpi_find_context
258 struct acpi_ns_search_data
260 struct acpi_namespace_node
*node
;
265 * Predefined Namespace items
267 struct acpi_predefined_names
275 /* Object types used during package copies */
278 #define ACPI_COPY_TYPE_SIMPLE 0
279 #define ACPI_COPY_TYPE_PACKAGE 1
281 /* Info structure used to convert external<->internal namestrings */
283 struct acpi_namestring_info
286 char *next_external_char
;
295 /* Field creation info */
297 struct acpi_create_field_info
299 struct acpi_namespace_node
*region_node
;
300 struct acpi_namespace_node
*field_node
;
301 struct acpi_namespace_node
*register_node
;
302 struct acpi_namespace_node
*data_register_node
;
304 u32 field_bit_position
;
305 u32 field_bit_length
;
312 /*****************************************************************************
314 * Event typedefs and structs
316 ****************************************************************************/
318 /* Dispatch info for each GPE -- either a method or handler, cannot be both */
320 struct acpi_handler_info
322 acpi_event_handler address
; /* Address of handler, if any */
323 void *context
; /* Context to be passed to handler */
324 struct acpi_namespace_node
*method_node
; /* Method node for this GPE level (saved) */
327 union acpi_gpe_dispatch_info
329 struct acpi_namespace_node
*method_node
; /* Method node for this GPE level */
330 struct acpi_handler_info
*handler
;
334 * Information about a GPE, one per each GPE in an array.
335 * NOTE: Important to keep this struct as small as possible.
337 struct acpi_gpe_event_info
339 union acpi_gpe_dispatch_info dispatch
; /* Either Method or Handler */
340 struct acpi_gpe_register_info
*register_info
; /* Backpointer to register info */
341 u8 flags
; /* Misc info about this GPE */
342 u8 register_bit
; /* This GPE bit within the register */
345 /* Information about a GPE register pair, one per each status/enable pair in an array */
347 struct acpi_gpe_register_info
349 struct acpi_generic_address status_address
; /* Address of status reg */
350 struct acpi_generic_address enable_address
; /* Address of enable reg */
351 u8 enable_for_wake
; /* GPEs to keep enabled when sleeping */
352 u8 enable_for_run
; /* GPEs to keep enabled when running */
353 u8 base_gpe_number
; /* Base GPE number for this register */
357 * Information about a GPE register block, one per each installed block --
358 * GPE0, GPE1, and one per each installed GPE Block Device.
360 struct acpi_gpe_block_info
362 struct acpi_namespace_node
*node
;
363 struct acpi_gpe_block_info
*previous
;
364 struct acpi_gpe_block_info
*next
;
365 struct acpi_gpe_xrupt_info
*xrupt_block
; /* Backpointer to interrupt block */
366 struct acpi_gpe_register_info
*register_info
; /* One per GPE register pair */
367 struct acpi_gpe_event_info
*event_info
; /* One for each GPE */
368 struct acpi_generic_address block_address
; /* Base address of the block */
369 u32 register_count
; /* Number of register pairs in block */
370 u8 block_base_number
;/* Base GPE number for this block */
373 /* Information about GPE interrupt handlers, one per each interrupt level used for GPEs */
375 struct acpi_gpe_xrupt_info
377 struct acpi_gpe_xrupt_info
*previous
;
378 struct acpi_gpe_xrupt_info
*next
;
379 struct acpi_gpe_block_info
*gpe_block_list_head
; /* List of GPE blocks for this xrupt */
380 u32 interrupt_number
; /* System interrupt number */
384 struct acpi_gpe_walk_info
386 struct acpi_namespace_node
*gpe_device
;
387 struct acpi_gpe_block_info
*gpe_block
;
391 typedef acpi_status (*ACPI_GPE_CALLBACK
) (
392 struct acpi_gpe_xrupt_info
*gpe_xrupt_info
,
393 struct acpi_gpe_block_info
*gpe_block
);
396 /* Information about each particular fixed event */
398 struct acpi_fixed_event_handler
400 acpi_event_handler handler
; /* Address of handler. */
401 void *context
; /* Context to be passed to handler */
404 struct acpi_fixed_event_info
406 u8 status_register_id
;
407 u8 enable_register_id
;
412 /* Information used during field processing */
414 struct acpi_field_info
422 /*****************************************************************************
424 * Generic "state" object for stacks
426 ****************************************************************************/
428 #define ACPI_CONTROL_NORMAL 0xC0
429 #define ACPI_CONTROL_CONDITIONAL_EXECUTING 0xC1
430 #define ACPI_CONTROL_PREDICATE_EXECUTING 0xC2
431 #define ACPI_CONTROL_PREDICATE_FALSE 0xC3
432 #define ACPI_CONTROL_PREDICATE_TRUE 0xC4
435 #define ACPI_STATE_COMMON /* Two 32-bit fields and a pointer */\
436 u8 data_type; /* To differentiate various internal objs */\
443 struct acpi_common_state
450 * Update state - used to traverse complex objects such as packages
452 struct acpi_update_state
455 union acpi_operand_object
*object
;
460 * Pkg state - used to traverse nested package structures
462 struct acpi_pkg_state
465 union acpi_operand_object
*source_object
;
466 union acpi_operand_object
*dest_object
;
467 struct acpi_walk_state
*walk_state
;
468 void *this_target_obj
;
475 * Control state - one per if/else and while constructs.
476 * Allows nesting of these constructs
478 struct acpi_control_state
481 union acpi_parse_object
*predicate_op
;
482 u8
*aml_predicate_start
; /* Start of if/while predicate */
483 u8
*package_end
; /* End of if/while block */
489 * Scope state - current scope during namespace lookups
491 struct acpi_scope_state
494 struct acpi_namespace_node
*node
;
498 struct acpi_pscope_state
501 union acpi_parse_object
*op
; /* Current op being parsed */
502 u8
*arg_end
; /* Current argument end */
503 u8
*pkg_end
; /* Current package end */
504 u32 arg_list
; /* Next argument to parse */
505 u32 arg_count
; /* Number of fixed arguments */
510 * Thread state - one per thread across multiple walk states. Multiple walk
511 * states are created when there are nested control methods executing.
513 struct acpi_thread_state
516 struct acpi_walk_state
*walk_state_list
; /* Head of list of walk_states for this thread */
517 union acpi_operand_object
*acquired_mutex_list
; /* List of all currently acquired mutexes */
518 u32 thread_id
; /* Running thread ID */
519 u8 current_sync_level
; /* Mutex Sync (nested acquire) level */
524 * Result values - used to accumulate the results of nested
527 struct acpi_result_values
530 union acpi_operand_object
*obj_desc
[ACPI_OBJ_NUM_OPERANDS
];
537 acpi_status (*acpi_parse_downwards
) (
538 struct acpi_walk_state
*walk_state
,
539 union acpi_parse_object
**out_op
);
542 acpi_status (*acpi_parse_upwards
) (
543 struct acpi_walk_state
*walk_state
);
547 * Notify info - used to pass info to the deferred notify
548 * handler/dispatcher.
550 struct acpi_notify_info
553 struct acpi_namespace_node
*node
;
554 union acpi_operand_object
*handler_obj
;
558 /* Generic state is union of structs above */
560 union acpi_generic_state
562 struct acpi_common_state common
;
563 struct acpi_control_state control
;
564 struct acpi_update_state update
;
565 struct acpi_scope_state scope
;
566 struct acpi_pscope_state parse_scope
;
567 struct acpi_pkg_state pkg
;
568 struct acpi_thread_state thread
;
569 struct acpi_result_values results
;
570 struct acpi_notify_info notify
;
574 /*****************************************************************************
576 * Interpreter typedefs and structs
578 ****************************************************************************/
581 acpi_status (*ACPI_EXECUTE_OP
) (
582 struct acpi_walk_state
*walk_state
);
585 /*****************************************************************************
587 * Parser typedefs and structs
589 ****************************************************************************/
592 * AML opcode, name, and argument layout
594 struct acpi_opcode_info
596 #if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
597 char *name
; /* Opcode name (disassembler/debug only) */
599 u32 parse_args
; /* Grammar/Parse time arguments */
600 u32 runtime_args
; /* Interpret time arguments */
601 u32 flags
; /* Misc flags */
602 u8 object_type
; /* Corresponding internal object type */
603 u8
class; /* Opcode class */
604 u8 type
; /* Opcode type */
607 union acpi_parse_value
609 acpi_integer integer
; /* Integer constant (Up to 64 bits) */
610 struct uint64_struct integer64
; /* Structure overlay for 2 32-bit Dwords */
611 u32 size
; /* bytelist or field size */
612 char *string
; /* NULL terminated string */
613 u8
*buffer
; /* buffer or string */
614 char *name
; /* NULL terminated string */
615 union acpi_parse_object
*arg
; /* arguments and contained ops */
618 #define ACPI_PARSE_COMMON \
619 u8 data_type; /* To differentiate various internal objs */\
620 u8 flags; /* Type of Op */\
621 u16 aml_opcode; /* AML opcode */\
622 u32 aml_offset; /* Offset of declaration in AML */\
623 union acpi_parse_object *parent; /* Parent op */\
624 union acpi_parse_object *next; /* Next op */\
625 ACPI_DISASM_ONLY_MEMBERS (\
626 u8 disasm_flags; /* Used during AML disassembly */\
627 u8 disasm_opcode; /* Subtype used for disassembly */\
628 char aml_op_name[16]) /* Op name (debug only) */\
629 /* NON-DEBUG members below: */\
630 struct acpi_namespace_node *node; /* For use by interpreter */\
631 union acpi_parse_value value; /* Value or args associated with the opcode */\
634 #define ACPI_DASM_BUFFER 0x00
635 #define ACPI_DASM_RESOURCE 0x01
636 #define ACPI_DASM_STRING 0x02
637 #define ACPI_DASM_UNICODE 0x03
638 #define ACPI_DASM_EISAID 0x04
639 #define ACPI_DASM_MATCHOP 0x05
642 * generic operation (for example: If, While, Store)
644 struct acpi_parse_obj_common
651 * Extended Op for named ops (Scope, Method, etc.), deferred ops (Methods and op_regions),
654 struct acpi_parse_obj_named
658 u8
*data
; /* AML body or bytelist data */
659 u32 length
; /* AML length */
660 u32 name
; /* 4-byte name or zero if no name */
664 /* The parse node is the fundamental element of the parse tree */
666 struct acpi_parse_obj_asl
669 union acpi_parse_object
*child
;
670 union acpi_parse_object
*parent_method
;
678 u32 logical_line_number
;
679 u32 logical_byte_offset
;
681 u32 end_logical_line
;
684 u32 aml_subtree_length
;
685 u32 final_aml_length
;
686 u32 final_aml_offset
;
689 u8 aml_opcode_length
;
690 u8 aml_pkg_len_bytes
;
692 char parse_op_name
[12];
695 union acpi_parse_object
697 struct acpi_parse_obj_common common
;
698 struct acpi_parse_obj_named named
;
699 struct acpi_parse_obj_asl asl
;
704 * Parse state - one state per parser invocation and each control
707 struct acpi_parse_state
710 u8
*aml_start
; /* First AML byte */
711 u8
*aml
; /* Next AML byte */
712 u8
*aml_end
; /* (last + 1) AML byte */
713 u8
*pkg_start
; /* Current package begin */
714 u8
*pkg_end
; /* Current package end */
715 union acpi_parse_object
*start_op
; /* Root of parse tree */
716 struct acpi_namespace_node
*start_node
;
717 union acpi_generic_state
*scope
; /* Current scope */
718 union acpi_parse_object
*start_scope
;
722 /* Parse object flags */
724 #define ACPI_PARSEOP_GENERIC 0x01
725 #define ACPI_PARSEOP_NAMED 0x02
726 #define ACPI_PARSEOP_DEFERRED 0x04
727 #define ACPI_PARSEOP_BYTELIST 0x08
728 #define ACPI_PARSEOP_IN_CACHE 0x80
730 /* Parse object disasm_flags */
732 #define ACPI_PARSEOP_IGNORE 0x01
733 #define ACPI_PARSEOP_PARAMLIST 0x02
734 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
735 #define ACPI_PARSEOP_SPECIAL 0x10
738 /*****************************************************************************
740 * Hardware (ACPI registers) and PNP
742 ****************************************************************************/
744 #define PCI_ROOT_HID_STRING "PNP0A03"
745 #define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
747 struct acpi_bit_register_info
757 * These are the full ACPI registers
759 #define ACPI_REGISTER_PM1_STATUS 0x01
760 #define ACPI_REGISTER_PM1_ENABLE 0x02
761 #define ACPI_REGISTER_PM1_CONTROL 0x03
762 #define ACPI_REGISTER_PM1A_CONTROL 0x04
763 #define ACPI_REGISTER_PM1B_CONTROL 0x05
764 #define ACPI_REGISTER_PM2_CONTROL 0x06
765 #define ACPI_REGISTER_PM_TIMER 0x07
766 #define ACPI_REGISTER_PROCESSOR_BLOCK 0x08
767 #define ACPI_REGISTER_SMI_COMMAND_BLOCK 0x09
770 /* Masks used to access the bit_registers */
772 #define ACPI_BITMASK_TIMER_STATUS 0x0001
773 #define ACPI_BITMASK_BUS_MASTER_STATUS 0x0010
774 #define ACPI_BITMASK_GLOBAL_LOCK_STATUS 0x0020
775 #define ACPI_BITMASK_POWER_BUTTON_STATUS 0x0100
776 #define ACPI_BITMASK_SLEEP_BUTTON_STATUS 0x0200
777 #define ACPI_BITMASK_RT_CLOCK_STATUS 0x0400
778 #define ACPI_BITMASK_PCIEXP_WAKE_STATUS 0x4000 /* ACPI 3.0 */
779 #define ACPI_BITMASK_WAKE_STATUS 0x8000
781 #define ACPI_BITMASK_ALL_FIXED_STATUS (ACPI_BITMASK_TIMER_STATUS | \
782 ACPI_BITMASK_BUS_MASTER_STATUS | \
783 ACPI_BITMASK_GLOBAL_LOCK_STATUS | \
784 ACPI_BITMASK_POWER_BUTTON_STATUS | \
785 ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
786 ACPI_BITMASK_RT_CLOCK_STATUS | \
787 ACPI_BITMASK_WAKE_STATUS)
789 #define ACPI_BITMASK_TIMER_ENABLE 0x0001
790 #define ACPI_BITMASK_GLOBAL_LOCK_ENABLE 0x0020
791 #define ACPI_BITMASK_POWER_BUTTON_ENABLE 0x0100
792 #define ACPI_BITMASK_SLEEP_BUTTON_ENABLE 0x0200
793 #define ACPI_BITMASK_RT_CLOCK_ENABLE 0x0400
794 #define ACPI_BITMASK_PCIEXP_WAKE_DISABLE 0x4000 /* ACPI 3.0 */
796 #define ACPI_BITMASK_SCI_ENABLE 0x0001
797 #define ACPI_BITMASK_BUS_MASTER_RLD 0x0002
798 #define ACPI_BITMASK_GLOBAL_LOCK_RELEASE 0x0004
799 #define ACPI_BITMASK_SLEEP_TYPE_X 0x1C00
800 #define ACPI_BITMASK_SLEEP_ENABLE 0x2000
802 #define ACPI_BITMASK_ARB_DISABLE 0x0001
805 /* Raw bit position of each bit_register */
807 #define ACPI_BITPOSITION_TIMER_STATUS 0x00
808 #define ACPI_BITPOSITION_BUS_MASTER_STATUS 0x04
809 #define ACPI_BITPOSITION_GLOBAL_LOCK_STATUS 0x05
810 #define ACPI_BITPOSITION_POWER_BUTTON_STATUS 0x08
811 #define ACPI_BITPOSITION_SLEEP_BUTTON_STATUS 0x09
812 #define ACPI_BITPOSITION_RT_CLOCK_STATUS 0x0A
813 #define ACPI_BITPOSITION_PCIEXP_WAKE_STATUS 0x0E /* ACPI 3.0 */
814 #define ACPI_BITPOSITION_WAKE_STATUS 0x0F
816 #define ACPI_BITPOSITION_TIMER_ENABLE 0x00
817 #define ACPI_BITPOSITION_GLOBAL_LOCK_ENABLE 0x05
818 #define ACPI_BITPOSITION_POWER_BUTTON_ENABLE 0x08
819 #define ACPI_BITPOSITION_SLEEP_BUTTON_ENABLE 0x09
820 #define ACPI_BITPOSITION_RT_CLOCK_ENABLE 0x0A
821 #define ACPI_BITPOSITION_PCIEXP_WAKE_DISABLE 0x0E /* ACPI 3.0 */
823 #define ACPI_BITPOSITION_SCI_ENABLE 0x00
824 #define ACPI_BITPOSITION_BUS_MASTER_RLD 0x01
825 #define ACPI_BITPOSITION_GLOBAL_LOCK_RELEASE 0x02
826 #define ACPI_BITPOSITION_SLEEP_TYPE_X 0x0A
827 #define ACPI_BITPOSITION_SLEEP_ENABLE 0x0D
829 #define ACPI_BITPOSITION_ARB_DISABLE 0x00
832 /*****************************************************************************
834 * Resource descriptors
836 ****************************************************************************/
838 /* resource_type values */
840 #define ACPI_RESOURCE_TYPE_MEMORY_RANGE 0
841 #define ACPI_RESOURCE_TYPE_IO_RANGE 1
842 #define ACPI_RESOURCE_TYPE_BUS_NUMBER_RANGE 2
844 /* Resource descriptor types and masks */
846 #define ACPI_RDESC_TYPE_LARGE 0x80
847 #define ACPI_RDESC_TYPE_SMALL 0x00
849 #define ACPI_RDESC_TYPE_MASK 0x80
850 #define ACPI_RDESC_SMALL_MASK 0x78 /* Only bits 6:3 contain the type */
854 * Small resource descriptor types
855 * Note: The 3 length bits (2:0) must be zero
857 #define ACPI_RDESC_TYPE_IRQ_FORMAT 0x20
858 #define ACPI_RDESC_TYPE_DMA_FORMAT 0x28
859 #define ACPI_RDESC_TYPE_START_DEPENDENT 0x30
860 #define ACPI_RDESC_TYPE_END_DEPENDENT 0x38
861 #define ACPI_RDESC_TYPE_IO_PORT 0x40
862 #define ACPI_RDESC_TYPE_FIXED_IO_PORT 0x48
863 #define ACPI_RDESC_TYPE_SMALL_VENDOR 0x70
864 #define ACPI_RDESC_TYPE_END_TAG 0x78
867 * Large resource descriptor types
869 #define ACPI_RDESC_TYPE_MEMORY_24 0x81
870 #define ACPI_RDESC_TYPE_GENERAL_REGISTER 0x82
871 #define ACPI_RDESC_TYPE_LARGE_VENDOR 0x84
872 #define ACPI_RDESC_TYPE_MEMORY_32 0x85
873 #define ACPI_RDESC_TYPE_FIXED_MEMORY_32 0x86
874 #define ACPI_RDESC_TYPE_DWORD_ADDRESS_SPACE 0x87
875 #define ACPI_RDESC_TYPE_WORD_ADDRESS_SPACE 0x88
876 #define ACPI_RDESC_TYPE_EXTENDED_XRUPT 0x89
877 #define ACPI_RDESC_TYPE_QWORD_ADDRESS_SPACE 0x8A
878 #define ACPI_RDESC_TYPE_EXTENDED_ADDRESS_SPACE 0x8B
881 /*****************************************************************************
885 ****************************************************************************/
887 #define ACPI_ASCII_ZERO 0x30
890 /*****************************************************************************
894 ****************************************************************************/
896 struct acpi_db_method_info
898 acpi_handle thread_gate
;
906 struct acpi_integrity_info
913 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
914 #define ACPI_DB_CONSOLE_OUTPUT 0x02
915 #define ACPI_DB_DUPLICATE_OUTPUT 0x03
918 /*****************************************************************************
922 ****************************************************************************/
924 /* Entry for a memory allocation (debug only) */
926 #define ACPI_MEM_MALLOC 0
927 #define ACPI_MEM_CALLOC 1
928 #define ACPI_MAX_MODULE_NAME 16
930 #define ACPI_COMMON_DEBUG_MEM_HEADER \
931 struct acpi_debug_mem_block *previous; \
932 struct acpi_debug_mem_block *next; \
936 char module[ACPI_MAX_MODULE_NAME]; \
939 struct acpi_debug_mem_header
941 ACPI_COMMON_DEBUG_MEM_HEADER
944 struct acpi_debug_mem_block
946 ACPI_COMMON_DEBUG_MEM_HEADER
951 #define ACPI_MEM_LIST_GLOBAL 0
952 #define ACPI_MEM_LIST_NSNODE 1
953 #define ACPI_MEM_LIST_MAX 1
954 #define ACPI_NUM_MEM_LISTS 2
957 struct acpi_memory_list
966 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
968 /* Statistics for debug memory tracking only */
972 u32 current_total_size
;
978 #endif /* __ACLOCAL_H__ */