1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
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
26 #ifndef __ACNAMESP_H__
27 #define __ACNAMESP_H__
30 /* To search the entire name space, pass this as Search_base */
32 #define NS_ALL ((acpi_handle)0)
35 * Elements of Acpi_ns_properties are bit significant
36 * and should be one-to-one with values of acpi_object_type
39 #define NSP_NEWSCOPE 1 /* a definition of this type opens a name scope */
40 #define NSP_LOCAL 2 /* suppress search of enclosing scopes */
43 /* Definitions of the predefined namespace names */
45 #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
46 #define ACPI_ROOT_NAME (u32) 0x2F202020 /* Root name is "/ " */
47 #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
49 #define NS_ROOT_PATH "/"
50 #define NS_SYSTEM_BUS "_SB_"
53 /* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */
55 #define NS_NO_UPSEARCH 0
56 #define NS_SEARCH_PARENT 0x01
57 #define NS_DONT_OPEN_SCOPE 0x02
58 #define NS_NO_PEER_SEARCH 0x04
59 #define NS_ERROR_IF_FOUND 0x08
61 #define NS_WALK_UNLOCK TRUE
62 #define NS_WALK_NO_UNLOCK FALSE
66 acpi_ns_load_namespace (
70 acpi_ns_initialize_objects (
74 acpi_ns_initialize_devices (
78 /* Namespace init - nsxfinit */
81 acpi_ns_init_one_device (
82 acpi_handle obj_handle,
88 acpi_ns_init_one_object (
89 acpi_handle obj_handle,
96 acpi_ns_walk_namespace (
97 acpi_object_type8 type,
98 acpi_handle start_object,
100 u8 unlock_before_callback,
101 acpi_walk_callback user_function,
103 void **return_value);
105 acpi_namespace_node *
106 acpi_ns_get_next_node (
107 acpi_object_type8 type,
108 acpi_namespace_node *parent,
109 acpi_namespace_node *child);
112 acpi_ns_delete_namespace_by_owner (
116 /* Namespace loading - nsload */
119 acpi_ns_one_complete_parse (
121 acpi_table_desc *table_desc);
124 acpi_ns_parse_table (
125 acpi_table_desc *table_desc,
126 acpi_namespace_node *scope);
130 acpi_table_desc *table_desc,
131 acpi_namespace_node *node);
134 acpi_ns_load_table_by_type (
135 acpi_table_type table_type);
139 * Top-level namespace access - nsaccess
144 acpi_ns_root_initialize (
149 acpi_generic_state *scope_info,
151 acpi_object_type8 type,
152 operating_mode interpreter_mode,
154 acpi_walk_state *walk_state,
155 acpi_namespace_node **ret_node);
159 * Named object allocation/deallocation - nsalloc
163 acpi_namespace_node *
164 acpi_ns_create_node (
168 acpi_ns_delete_node (
169 acpi_namespace_node *node);
172 acpi_ns_delete_namespace_subtree (
173 acpi_namespace_node *parent_handle);
176 acpi_ns_detach_object (
177 acpi_namespace_node *node);
180 acpi_ns_delete_children (
181 acpi_namespace_node *parent);
185 * Namespace modification - nsmodify
189 acpi_ns_unload_namespace (
193 acpi_ns_delete_subtree (
194 acpi_handle start_handle);
198 * Namespace dump/print utilities - nsdump
202 acpi_ns_dump_tables (
203 acpi_handle search_base,
212 acpi_ns_dump_pathname (
219 acpi_ns_dump_root_devices (
223 acpi_ns_dump_objects (
224 acpi_object_type8 type,
228 acpi_handle start_handle);
232 * Namespace evaluation functions - nseval
236 acpi_ns_evaluate_by_handle (
237 acpi_namespace_node *prefix_node,
238 acpi_operand_object **params,
239 acpi_operand_object **return_object);
242 acpi_ns_evaluate_by_name (
243 NATIVE_CHAR *pathname,
244 acpi_operand_object **params,
245 acpi_operand_object **return_object);
248 acpi_ns_evaluate_relative (
249 acpi_namespace_node *prefix_node,
250 NATIVE_CHAR *pathname,
251 acpi_operand_object **params,
252 acpi_operand_object **return_object);
255 acpi_ns_execute_control_method (
256 acpi_namespace_node *method_node,
257 acpi_operand_object **params,
258 acpi_operand_object **return_obj_desc);
261 acpi_ns_get_object_value (
262 acpi_namespace_node *object_node,
263 acpi_operand_object **return_obj_desc);
267 * Parent/Child/Peer utility functions - nsfamily
271 acpi_ns_find_parent_name (
272 acpi_namespace_node *node_to_search);
275 acpi_ns_exist_downstream_sibling (
276 acpi_namespace_node *this_node);
280 * Scope manipulation - nsscope
284 acpi_ns_opens_scope (
285 acpi_object_type8 type);
288 acpi_ns_get_table_pathname (
289 acpi_namespace_node *node);
292 acpi_ns_name_of_current_scope (
293 acpi_walk_state *walk_state);
296 acpi_ns_handle_to_pathname (
297 acpi_handle obj_handle,
299 NATIVE_CHAR *user_buffer);
302 acpi_ns_pattern_match (
303 acpi_namespace_node *obj_node,
304 NATIVE_CHAR *search_for);
308 NATIVE_CHAR *pathname,
309 acpi_namespace_node *in_prefix_node,
310 acpi_namespace_node **out_node);
313 acpi_ns_get_pathname_length (
314 acpi_namespace_node *node);
318 * Object management for NTEs - nsobject
322 acpi_ns_attach_object (
323 acpi_namespace_node *node,
324 acpi_operand_object *object,
325 acpi_object_type8 type);
329 * Namespace searching and entry - nssearch
333 acpi_ns_search_and_enter (
335 acpi_walk_state *walk_state,
336 acpi_namespace_node *node,
337 operating_mode interpreter_mode,
338 acpi_object_type8 type,
340 acpi_namespace_node **ret_node);
343 acpi_ns_search_node (
345 acpi_namespace_node *node,
346 acpi_object_type8 type,
347 acpi_namespace_node **ret_node);
350 acpi_ns_install_node (
351 acpi_walk_state *walk_state,
352 acpi_namespace_node *parent_node, /* Parent */
353 acpi_namespace_node *node, /* New Child*/
354 acpi_object_type8 type);
358 * Utility functions - nsutils
362 acpi_ns_valid_root_prefix (
366 acpi_ns_valid_path_separator (
371 acpi_namespace_node *node);
374 acpi_ns_get_attached_object (
375 acpi_namespace_node *node);
379 acpi_object_type8 type);
382 acpi_ns_build_internal_name (
383 acpi_namestring_info *info);
386 acpi_ns_get_internal_name_length (
387 acpi_namestring_info *info);
390 acpi_ns_internalize_name (
391 NATIVE_CHAR *dotted_name,
392 NATIVE_CHAR **converted_name);
395 acpi_ns_externalize_name (
396 u32 internal_name_length,
397 NATIVE_CHAR *internal_name,
398 u32 *converted_name_length,
399 NATIVE_CHAR **converted_name);
401 acpi_namespace_node *
402 acpi_ns_map_handle_to_node (
406 acpi_ns_convert_entry_to_handle(
407 acpi_namespace_node *node);
413 acpi_namespace_node *
414 acpi_ns_get_parent_object (
415 acpi_namespace_node *node);
418 acpi_namespace_node *
419 acpi_ns_get_next_valid_node (
420 acpi_namespace_node *node);
423 #endif /* __ACNAMESP_H__ */