File: /usr/src/linux/drivers/acpi/include/acglobal.h

1     /******************************************************************************
2      *
3      * Name: acglobal.h - Declarations for global variables
4      *       $Revision: 106 $
5      *
6      *****************************************************************************/
7     
8     /*
9      *  Copyright (C) 2000, 2001 R. Byron Moore
10      *
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.
15      *
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.
20      *
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
24      */
25     
26     #ifndef __ACGLOBAL_H__
27     #define __ACGLOBAL_H__
28     
29     
30     /*
31      * Ensure that the globals are actually defined only once.
32      *
33      * The use of these defines allows a single list of globals (here) in order
34      * to simplify maintenance of the code.
35      */
36     #ifdef DEFINE_ACPI_GLOBALS
37     #define ACPI_EXTERN
38     #else
39     #define ACPI_EXTERN extern
40     #endif
41     
42     
43     /*****************************************************************************
44      *
45      * Debug support
46      *
47      ****************************************************************************/
48     
49     /* Runtime configuration of debug print levels */
50     
51     extern      u32                         acpi_dbg_level;
52     extern      u32                         acpi_dbg_layer;
53     
54     /* Procedure nesting level for debug output */
55     
56     extern      u32                         acpi_gbl_nesting_level;
57     
58     
59     /*****************************************************************************
60      *
61      * ACPI Table globals
62      *
63      ****************************************************************************/
64     
65     /*
66      * Table pointers.
67      * Although these pointers are somewhat redundant with the global Acpi_table,
68      * they are convenient because they are typed pointers.
69      *
70      * These tables are single-table only; meaning that there can be at most one
71      * of each in the system.  Each global points to the actual table.
72      *
73      */
74     ACPI_EXTERN RSDP_DESCRIPTOR             *acpi_gbl_RSDP;
75     ACPI_EXTERN xsdt_descriptor             *acpi_gbl_XSDT;
76     ACPI_EXTERN FADT_DESCRIPTOR             *acpi_gbl_FADT;
77     ACPI_EXTERN acpi_table_header           *acpi_gbl_DSDT;
78     ACPI_EXTERN acpi_common_facs            *acpi_gbl_FACS;
79     
80     /*
81      * Since there may be multiple SSDTs and PSDTS, a single pointer is not
82      * sufficient; Therefore, there isn't one!
83      */
84     
85     
86     /*
87      * ACPI Table info arrays
88      */
89     extern      acpi_table_desc             acpi_gbl_acpi_tables[NUM_ACPI_TABLES];
90     extern      ACPI_TABLE_SUPPORT          acpi_gbl_acpi_table_data[NUM_ACPI_TABLES];
91     
92     /*
93      * Predefined mutex objects.  This array contains the
94      * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
95      * (The table maps local handles to the real OS handles)
96      */
97     ACPI_EXTERN ACPI_MUTEX_INFO             acpi_gbl_acpi_mutex_info [NUM_MTX];
98     
99     
100     /*****************************************************************************
101      *
102      * Miscellaneous globals
103      *
104      ****************************************************************************/
105     
106     
107     ACPI_EXTERN ACPI_MEMORY_LIST            acpi_gbl_memory_lists[ACPI_NUM_MEM_LISTS];
108     ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER  acpi_gbl_drv_notify;
109     ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER  acpi_gbl_sys_notify;
110     ACPI_EXTERN u8                         *acpi_gbl_gpe0enable_register_save;
111     ACPI_EXTERN u8                         *acpi_gbl_gpe1_enable_register_save;
112     ACPI_EXTERN acpi_walk_state            *acpi_gbl_breakpoint_walk;
113     ACPI_EXTERN acpi_handle                 acpi_gbl_global_lock_semaphore;
114     
115     ACPI_EXTERN u32                         acpi_gbl_global_lock_thread_count;
116     ACPI_EXTERN u32                         acpi_gbl_restore_acpi_chipset;
117     ACPI_EXTERN u32                         acpi_gbl_original_mode;
118     ACPI_EXTERN u32                         acpi_gbl_edge_level_save;
119     ACPI_EXTERN u32                         acpi_gbl_irq_enable_save;
120     ACPI_EXTERN u32                         acpi_gbl_rsdp_original_location;
121     ACPI_EXTERN u32                         acpi_gbl_ns_lookup_count;
122     ACPI_EXTERN u32                         acpi_gbl_ps_find_count;
123     ACPI_EXTERN u16                         acpi_gbl_pm1_enable_register_save;
124     ACPI_EXTERN u16                         acpi_gbl_next_table_owner_id;
125     ACPI_EXTERN u16                         acpi_gbl_next_method_owner_id;
126     ACPI_EXTERN u8                          acpi_gbl_debugger_configuration;
127     ACPI_EXTERN u8                          acpi_gbl_global_lock_acquired;
128     ACPI_EXTERN u8                          acpi_gbl_step_to_next_call;
129     ACPI_EXTERN u8                          acpi_gbl_acpi_hardware_present;
130     ACPI_EXTERN u8                          acpi_gbl_global_lock_present;
131     
132     extern u8                               acpi_gbl_shutdown;
133     extern u32                              acpi_gbl_system_flags;
134     extern u32                              acpi_gbl_startup_flags;
135     extern const u8                         acpi_gbl_decode_to8bit[8];
136     extern const NATIVE_CHAR                *acpi_gbl_db_sleep_states[ACPI_NUM_SLEEP_STATES];
137     
138     
139     /*****************************************************************************
140      *
141      * Namespace globals
142      *
143      ****************************************************************************/
144     
145     #define NUM_NS_TYPES                    INTERNAL_TYPE_INVALID+1
146     #define NUM_PREDEFINED_NAMES            9
147     
148     
149     ACPI_EXTERN acpi_namespace_node         acpi_gbl_root_node_struct;
150     ACPI_EXTERN acpi_namespace_node        *acpi_gbl_root_node;
151     
152     extern const u8                         acpi_gbl_ns_properties[NUM_NS_TYPES];
153     extern const predefined_names           acpi_gbl_pre_defined_names [NUM_PREDEFINED_NAMES];
154     
155     #ifdef ACPI_DEBUG
156     ACPI_EXTERN u32                         acpi_gbl_current_node_count;
157     ACPI_EXTERN u32                         acpi_gbl_current_node_size;
158     ACPI_EXTERN u32                         acpi_gbl_max_concurrent_node_count;
159     ACPI_EXTERN u32                         acpi_gbl_entry_stack_pointer;
160     ACPI_EXTERN u32                         acpi_gbl_lowest_stack_pointer;
161     ACPI_EXTERN u32                         acpi_gbl_deepest_nesting;
162     #endif
163     
164     /*****************************************************************************
165      *
166      * Interpreter globals
167      *
168      ****************************************************************************/
169     
170     
171     ACPI_EXTERN acpi_walk_list             *acpi_gbl_current_walk_list;
172     
173     /* Address Space handlers */
174     
175     ACPI_EXTERN ACPI_ADR_SPACE_INFO         acpi_gbl_address_spaces[ACPI_NUM_ADDRESS_SPACES];
176     
177     /* Control method single step flag */
178     
179     ACPI_EXTERN u8                          acpi_gbl_cm_single_step;
180     
181     
182     /*****************************************************************************
183      *
184      * Parser globals
185      *
186      ****************************************************************************/
187     
188     ACPI_EXTERN acpi_parse_object           *acpi_gbl_parsed_namespace_root;
189     
190     
191     /*****************************************************************************
192      *
193      * Event globals
194      *
195      ****************************************************************************/
196     
197     ACPI_EXTERN ACPI_FIXED_EVENT_INFO       acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
198     ACPI_EXTERN acpi_handle                 acpi_gbl_gpe_obj_handle;
199     ACPI_EXTERN u32                         acpi_gbl_gpe_register_count;
200     ACPI_EXTERN ACPI_GPE_REGISTERS         *acpi_gbl_gpe_registers;
201     ACPI_EXTERN acpi_gpe_level_info        *acpi_gbl_gpe_info;
202     
203     /*
204      * Gpe validation and translation table
205      * Indexed by the GPE number, returns GPE_INVALID if the GPE is not supported.
206      * Otherwise, returns a valid index into the global GPE table.
207      *
208      * This table is needed because the GPE numbers supported by block 1 do not
209      * have to be contiguous with the GPE numbers supported by block 0.
210      */
211     ACPI_EXTERN u8                          acpi_gbl_gpe_valid [ACPI_NUM_GPE];
212     
213     /* Acpi_event counter for debug only */
214     
215     #ifdef ACPI_DEBUG
216     ACPI_EXTERN u32                         acpi_gbl_event_count[ACPI_NUM_FIXED_EVENTS];
217     #endif
218     
219     
220     /*****************************************************************************
221      *
222      * Debugger globals
223      *
224      ****************************************************************************/
225     
226     #ifdef ENABLE_DEBUGGER
227     ACPI_EXTERN u8                          acpi_gbl_method_executing;
228     ACPI_EXTERN u8                          acpi_gbl_db_terminate_threads;
229     #endif
230     
231     
232     #endif /* __ACGLOBAL_H__ */
233