2 /******************************************************************************
4 * Name: namesp.h - Namespace subcomponent prototypes and defines
6 *****************************************************************************/
9 * Copyright (C) 2000 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
26 #ifndef __NAMESPACE_H__
27 #define __NAMESPACE_H__
32 /* To search the entire name space, pass this as Search_base */
34 #define NS_ALL ((ACPI_HANDLE)0)
37 * Elements of Acpi_ns_properties are bit significant
38 * and should be one-to-one with values of ACPI_OBJECT_TYPE
41 #define NSP_NEWSCOPE 1 /* a definition of this type opens a name scope */
42 #define NSP_LOCAL 2 /* suppress search of enclosing scopes */
45 /* Definitions of the predefined namespace names */
47 #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
48 #define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */
49 #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
51 #define NS_ROOT_PATH "/"
52 #define NS_SYSTEM_BUS "_SB_"
55 /* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */
57 #define NS_NO_UPSEARCH 0
58 #define NS_SEARCH_PARENT 0x01
59 #define NS_DONT_OPEN_SCOPE 0x02
60 #define NS_NO_PEER_SEARCH 0x04
62 #define NS_WALK_UNLOCK TRUE
63 #define NS_WALK_NO_UNLOCK FALSE
67 acpi_ns_walk_namespace (
68 OBJECT_TYPE_INTERNAL type
,
69 ACPI_HANDLE start_object
,
71 u8 unlock_before_callback
,
72 WALK_CALLBACK user_function
,
78 acpi_ns_get_next_object (
79 OBJECT_TYPE_INTERNAL type
,
80 ACPI_NAMED_OBJECT
*parent
,
81 ACPI_NAMED_OBJECT
*child
);
85 acpi_ns_delete_namespace_by_owner (
89 acpi_ns_free_table_entry (
90 ACPI_NAMED_OBJECT
*entry
);
93 /* Namespace loading - nsload */
97 ACPI_TABLE_DESC
*table_desc
,
98 ACPI_NAME_TABLE
*scope
);
102 ACPI_TABLE_DESC
*table_desc
,
103 ACPI_NAMED_OBJECT
*entry
);
106 acpi_ns_load_table_by_type (
107 ACPI_TABLE_TYPE table_type
);
111 * Top-level namespace access - nsaccess
116 acpi_ns_root_initialize (
121 ACPI_GENERIC_STATE
*scope_info
,
123 OBJECT_TYPE_INTERNAL type
,
124 OPERATING_MODE interpreter_mode
,
126 ACPI_WALK_STATE
*walk_state
,
127 ACPI_NAMED_OBJECT
**ret_entry
);
131 * Table allocation/deallocation - nsalloc
135 acpi_ns_allocate_name_table (
139 acpi_ns_delete_namespace_subtree (
140 ACPI_NAMED_OBJECT
*parent_handle
);
143 acpi_ns_detach_object (
147 acpi_ns_delete_name_table (
148 ACPI_NAME_TABLE
*name_table
);
152 * Namespace modification - nsmodify
156 acpi_ns_unload_namespace (
160 acpi_ns_delete_subtree (
161 ACPI_HANDLE start_handle
);
165 * Namespace dump/print utilities - nsdump
169 acpi_ns_dump_tables (
170 ACPI_HANDLE search_base
,
179 acpi_ns_dump_pathname (
186 acpi_ns_dump_root_devices (
190 acpi_ns_dump_objects (
191 OBJECT_TYPE_INTERNAL type
,
194 ACPI_HANDLE start_handle
);
198 * Namespace evaluation functions - nseval
202 acpi_ns_evaluate_by_handle (
203 ACPI_NAMED_OBJECT
*object_nte
,
204 ACPI_OBJECT_INTERNAL
**params
,
205 ACPI_OBJECT_INTERNAL
**return_object
);
208 acpi_ns_evaluate_by_name (
210 ACPI_OBJECT_INTERNAL
**params
,
211 ACPI_OBJECT_INTERNAL
**return_object
);
214 acpi_ns_evaluate_relative (
215 ACPI_NAMED_OBJECT
*object_nte
,
217 ACPI_OBJECT_INTERNAL
**params
,
218 ACPI_OBJECT_INTERNAL
**return_object
);
221 acpi_ns_execute_control_method (
222 ACPI_NAMED_OBJECT
*method_entry
,
223 ACPI_OBJECT_INTERNAL
**params
,
224 ACPI_OBJECT_INTERNAL
**return_obj_desc
);
227 acpi_ns_get_object_value (
228 ACPI_NAMED_OBJECT
*object_entry
,
229 ACPI_OBJECT_INTERNAL
**return_obj_desc
);
233 * Parent/Child/Peer utility functions - nsfamily
237 acpi_ns_find_parent_name (
238 ACPI_NAMED_OBJECT
*entry_to_search
);
241 acpi_ns_exist_downstream_sibling (
242 ACPI_NAMED_OBJECT
*this_entry
);
246 * Scope manipulation - nsscope
250 acpi_ns_opens_scope (
251 OBJECT_TYPE_INTERNAL type
);
254 acpi_ns_name_of_scope (
255 ACPI_NAME_TABLE
*scope
);
258 acpi_ns_name_of_current_scope (
259 ACPI_WALK_STATE
*walk_state
);
262 acpi_ns_handle_to_pathname (
263 ACPI_HANDLE obj_handle
,
268 acpi_ns_pattern_match (
269 ACPI_NAMED_OBJECT
*obj_entry
,
273 acpi_ns_name_compare (
274 ACPI_HANDLE obj_handle
,
277 void **return_value
);
280 acpi_ns_low_find_names (
281 ACPI_NAMED_OBJECT
*this_entry
,
290 ACPI_HANDLE search_base
,
294 acpi_ns_get_named_object (
296 ACPI_NAME_TABLE
*in_scope
,
297 ACPI_NAMED_OBJECT
**out_nte
);
300 * Object management for NTEs - nsobject
304 acpi_ns_attach_method (
305 ACPI_HANDLE obj_handle
,
310 acpi_ns_attach_object (
311 ACPI_HANDLE obj_handle
,
313 OBJECT_TYPE_INTERNAL type
);
317 acpi_ns_compare_value (
318 ACPI_HANDLE obj_handle
,
323 acpi_ns_find_attached_object (
324 ACPI_OBJECT_INTERNAL
*obj_desc
,
325 ACPI_HANDLE search_base
,
330 * Namespace searching and entry - nssearch
334 acpi_ns_search_and_enter (
336 ACPI_WALK_STATE
*walk_state
,
337 ACPI_NAME_TABLE
*name_table
,
338 OPERATING_MODE interpreter_mode
,
339 OBJECT_TYPE_INTERNAL type
,
341 ACPI_NAMED_OBJECT
**ret_entry
);
344 acpi_ns_initialize_table (
345 ACPI_NAME_TABLE
*new_table
,
346 ACPI_NAME_TABLE
*parent_scope
,
347 ACPI_NAMED_OBJECT
*parent_entry
);
350 acpi_ns_search_one_scope (
352 ACPI_NAME_TABLE
*name_table
,
353 OBJECT_TYPE_INTERNAL type
,
354 ACPI_NAMED_OBJECT
**ret_entry
,
355 NS_SEARCH_DATA
*ret_info
);
359 * Utility functions - nsutils
363 acpi_ns_valid_root_prefix (
367 acpi_ns_valid_path_separator (
372 ACPI_HANDLE obj_handle
);
375 acpi_ns_get_attached_object (
376 ACPI_HANDLE obj_handle
);
380 OBJECT_TYPE_INTERNAL type
);
383 acpi_ns_internalize_name (
385 char **converted_name
);
388 acpi_ns_externalize_name (
389 u32 internal_name_length
,
391 u32
*converted_name_length
,
392 char **converted_name
);
396 ACPI_OBJECT_INTERNAL
*p_oD
);
403 acpi_ns_convert_handle_to_entry (
407 acpi_ns_convert_entry_to_handle(
408 ACPI_NAMED_OBJECT
*nte
);
415 acpi_ns_get_parent_entry (
416 ACPI_NAMED_OBJECT
*this_entry
);
420 acpi_ns_get_next_valid_entry (
421 ACPI_NAMED_OBJECT
*this_entry
);
424 #endif /* __NAMESPACE_H__ */