1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2004, 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.
44 #ifndef __ACNAMESP_H__
45 #define __ACNAMESP_H__
48 /* To search the entire name space, pass this as search_base */
50 #define ACPI_NS_ALL ((acpi_handle)0)
53 * Elements of acpi_ns_properties are bit significant
54 * and should be one-to-one with values of acpi_object_type
56 #define ACPI_NS_NORMAL 0
57 #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
58 #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
61 /* Definitions of the predefined namespace names */
63 #define ACPI_UNKNOWN_NAME (u32) 0x3F3F3F3F /* Unknown name is "????" */
64 #define ACPI_ROOT_NAME (u32) 0x5F5F5F5C /* Root name is "\___" */
65 #define ACPI_SYS_BUS_NAME (u32) 0x5F53425F /* Sys bus name is "_SB_" */
67 #define ACPI_NS_ROOT_PATH "\\"
68 #define ACPI_NS_SYSTEM_BUS "_SB_"
71 /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
73 #define ACPI_NS_NO_UPSEARCH 0
74 #define ACPI_NS_SEARCH_PARENT 0x01
75 #define ACPI_NS_DONT_OPEN_SCOPE 0x02
76 #define ACPI_NS_NO_PEER_SEARCH 0x04
77 #define ACPI_NS_ERROR_IF_FOUND 0x08
79 #define ACPI_NS_WALK_UNLOCK TRUE
80 #define ACPI_NS_WALK_NO_UNLOCK FALSE
84 acpi_ns_load_namespace (
88 acpi_ns_initialize_objects (
92 acpi_ns_initialize_devices (
96 /* Namespace init - nsxfinit */
99 acpi_ns_init_one_device (
100 acpi_handle obj_handle,
103 void **return_value);
106 acpi_ns_init_one_object (
107 acpi_handle obj_handle,
110 void **return_value);
114 acpi_ns_walk_namespace (
115 acpi_object_type type,
116 acpi_handle start_object,
118 u8 unlock_before_callback,
119 acpi_walk_callback user_function,
121 void **return_value);
123 struct acpi_namespace_node *
124 acpi_ns_get_next_node (
125 acpi_object_type type,
126 struct acpi_namespace_node *parent,
127 struct acpi_namespace_node *child);
130 acpi_ns_delete_namespace_by_owner (
134 /* Namespace loading - nsload */
137 acpi_ns_one_complete_parse (
139 struct acpi_table_desc *table_desc);
142 acpi_ns_parse_table (
143 struct acpi_table_desc *table_desc,
144 struct acpi_namespace_node *scope);
148 struct acpi_table_desc *table_desc,
149 struct acpi_namespace_node *node);
152 acpi_ns_load_table_by_type (
153 acpi_table_type table_type);
157 * Top-level namespace access - nsaccess
161 acpi_ns_root_initialize (
166 union acpi_generic_state *scope_info,
168 acpi_object_type type,
169 acpi_interpreter_mode interpreter_mode,
171 struct acpi_walk_state *walk_state,
172 struct acpi_namespace_node **ret_node);
176 * Named object allocation/deallocation - nsalloc
179 struct acpi_namespace_node *
180 acpi_ns_create_node (
184 acpi_ns_delete_node (
185 struct acpi_namespace_node *node);
188 acpi_ns_delete_namespace_subtree (
189 struct acpi_namespace_node *parent_handle);
192 acpi_ns_detach_object (
193 struct acpi_namespace_node *node);
196 acpi_ns_delete_children (
197 struct acpi_namespace_node *parent);
200 acpi_ns_compare_names (
205 acpi_ns_remove_reference (
206 struct acpi_namespace_node *node);
210 * Namespace modification - nsmodify
214 acpi_ns_unload_namespace (
218 acpi_ns_delete_subtree (
219 acpi_handle start_handle);
223 * Namespace dump/print utilities - nsdump
227 acpi_ns_dump_tables (
228 acpi_handle search_base,
237 acpi_ns_dump_pathname (
244 acpi_ns_print_pathname (
249 acpi_ns_dump_one_device (
250 acpi_handle obj_handle,
253 void **return_value);
256 acpi_ns_dump_root_devices (
260 acpi_ns_dump_one_object (
261 acpi_handle obj_handle,
264 void **return_value);
267 acpi_ns_dump_objects (
268 acpi_object_type type,
272 acpi_handle start_handle);
276 * Namespace evaluation functions - nseval
280 acpi_ns_evaluate_by_handle (
281 struct acpi_parameter_info *info);
284 acpi_ns_evaluate_by_name (
286 struct acpi_parameter_info *info);
289 acpi_ns_evaluate_relative (
291 struct acpi_parameter_info *info);
294 acpi_ns_execute_control_method (
295 struct acpi_parameter_info *info);
298 acpi_ns_get_object_value (
299 struct acpi_parameter_info *info);
303 * Parent/Child/Peer utility functions
307 acpi_ns_find_parent_name (
308 struct acpi_namespace_node *node_to_search);
312 * Name and Scope manipulation - nsnames
316 acpi_ns_opens_scope (
317 acpi_object_type type);
320 acpi_ns_build_external_path (
321 struct acpi_namespace_node *node,
326 acpi_ns_get_external_pathname (
327 struct acpi_namespace_node *node);
330 acpi_ns_name_of_current_scope (
331 struct acpi_walk_state *walk_state);
334 acpi_ns_handle_to_pathname (
335 acpi_handle target_handle,
336 struct acpi_buffer *buffer);
339 acpi_ns_pattern_match (
340 struct acpi_namespace_node *obj_node,
344 acpi_ns_get_node_by_path (
345 char *external_pathname,
346 struct acpi_namespace_node *in_prefix_node,
348 struct acpi_namespace_node **out_node);
351 acpi_ns_get_pathname_length (
352 struct acpi_namespace_node *node);
356 * Object management for namespace nodes - nsobject
360 acpi_ns_attach_object (
361 struct acpi_namespace_node *node,
362 union acpi_operand_object *object,
363 acpi_object_type type);
365 union acpi_operand_object *
366 acpi_ns_get_attached_object (
367 struct acpi_namespace_node *node);
369 union acpi_operand_object *
370 acpi_ns_get_secondary_object (
371 union acpi_operand_object *obj_desc);
374 acpi_ns_attach_data (
375 struct acpi_namespace_node *node,
376 acpi_object_handler handler,
380 acpi_ns_detach_data (
381 struct acpi_namespace_node *node,
382 acpi_object_handler handler);
385 acpi_ns_get_attached_data (
386 struct acpi_namespace_node *node,
387 acpi_object_handler handler,
392 * Namespace searching and entry - nssearch
396 acpi_ns_search_and_enter (
398 struct acpi_walk_state *walk_state,
399 struct acpi_namespace_node *node,
400 acpi_interpreter_mode interpreter_mode,
401 acpi_object_type type,
403 struct acpi_namespace_node **ret_node);
406 acpi_ns_search_node (
408 struct acpi_namespace_node *node,
409 acpi_object_type type,
410 struct acpi_namespace_node **ret_node);
413 acpi_ns_install_node (
414 struct acpi_walk_state *walk_state,
415 struct acpi_namespace_node *parent_node,
416 struct acpi_namespace_node *node,
417 acpi_object_type type);
421 * Utility functions - nsutils
425 acpi_ns_valid_root_prefix (
429 acpi_ns_valid_path_separator (
434 struct acpi_namespace_node *node);
438 acpi_object_type type);
441 acpi_ns_report_error (
446 acpi_status lookup_status);
449 acpi_ns_report_method_error (
454 struct acpi_namespace_node *node,
456 acpi_status lookup_status);
459 acpi_ns_print_node_pathname (
460 struct acpi_namespace_node *node,
464 acpi_ns_build_internal_name (
465 struct acpi_namestring_info *info);
468 acpi_ns_get_internal_name_length (
469 struct acpi_namestring_info *info);
472 acpi_ns_internalize_name (
474 char **converted_name);
477 acpi_ns_externalize_name (
478 u32 internal_name_length,
480 u32 *converted_name_length,
481 char **converted_name);
483 struct acpi_namespace_node *
484 acpi_ns_map_handle_to_node (
488 acpi_ns_convert_entry_to_handle(
489 struct acpi_namespace_node *node);
495 struct acpi_namespace_node *
496 acpi_ns_get_parent_node (
497 struct acpi_namespace_node *node);
500 struct acpi_namespace_node *
501 acpi_ns_get_next_valid_node (
502 struct acpi_namespace_node *node);
505 #endif /* __ACNAMESP_H__ */