1 /******************************************************************************
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
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.
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
213 #ifdef ACPI_FUTURE_USAGE
215 acpi_ns_unload_namespace (
219 acpi_ns_delete_subtree (
220 acpi_handle start_handle
);
225 * Namespace dump/print utilities - nsdump
228 #ifdef ACPI_FUTURE_USAGE
230 acpi_ns_dump_tables (
231 acpi_handle search_base
,
241 acpi_ns_dump_pathname (
248 acpi_ns_print_pathname (
252 #ifdef ACPI_FUTURE_USAGE
254 acpi_ns_dump_one_device (
255 acpi_handle obj_handle
,
258 void **return_value
);
261 acpi_ns_dump_root_devices (
263 #endif /* ACPI_FUTURE_USAGE */
266 acpi_ns_dump_one_object (
267 acpi_handle obj_handle
,
270 void **return_value
);
272 #ifdef ACPI_FUTURE_USAGE
274 acpi_ns_dump_objects (
275 acpi_object_type type
,
279 acpi_handle start_handle
);
284 * Namespace evaluation functions - nseval
288 acpi_ns_evaluate_by_handle (
289 struct acpi_parameter_info
*info
);
292 acpi_ns_evaluate_by_name (
294 struct acpi_parameter_info
*info
);
297 acpi_ns_evaluate_relative (
299 struct acpi_parameter_info
*info
);
302 acpi_ns_execute_control_method (
303 struct acpi_parameter_info
*info
);
306 acpi_ns_get_object_value (
307 struct acpi_parameter_info
*info
);
311 * Parent/Child/Peer utility functions
314 #ifdef ACPI_FUTURE_USAGE
316 acpi_ns_find_parent_name (
317 struct acpi_namespace_node
*node_to_search
);
322 * Name and Scope manipulation - nsnames
326 acpi_ns_opens_scope (
327 acpi_object_type type
);
330 acpi_ns_build_external_path (
331 struct acpi_namespace_node
*node
,
336 acpi_ns_get_external_pathname (
337 struct acpi_namespace_node
*node
);
340 acpi_ns_name_of_current_scope (
341 struct acpi_walk_state
*walk_state
);
344 acpi_ns_handle_to_pathname (
345 acpi_handle target_handle
,
346 struct acpi_buffer
*buffer
);
349 acpi_ns_pattern_match (
350 struct acpi_namespace_node
*obj_node
,
354 acpi_ns_get_node_by_path (
355 char *external_pathname
,
356 struct acpi_namespace_node
*in_prefix_node
,
358 struct acpi_namespace_node
**out_node
);
361 acpi_ns_get_pathname_length (
362 struct acpi_namespace_node
*node
);
366 * Object management for namespace nodes - nsobject
370 acpi_ns_attach_object (
371 struct acpi_namespace_node
*node
,
372 union acpi_operand_object
*object
,
373 acpi_object_type type
);
375 union acpi_operand_object
*
376 acpi_ns_get_attached_object (
377 struct acpi_namespace_node
*node
);
379 union acpi_operand_object
*
380 acpi_ns_get_secondary_object (
381 union acpi_operand_object
*obj_desc
);
384 acpi_ns_attach_data (
385 struct acpi_namespace_node
*node
,
386 acpi_object_handler handler
,
390 acpi_ns_detach_data (
391 struct acpi_namespace_node
*node
,
392 acpi_object_handler handler
);
395 acpi_ns_get_attached_data (
396 struct acpi_namespace_node
*node
,
397 acpi_object_handler handler
,
402 * Namespace searching and entry - nssearch
406 acpi_ns_search_and_enter (
408 struct acpi_walk_state
*walk_state
,
409 struct acpi_namespace_node
*node
,
410 acpi_interpreter_mode interpreter_mode
,
411 acpi_object_type type
,
413 struct acpi_namespace_node
**ret_node
);
416 acpi_ns_search_node (
418 struct acpi_namespace_node
*node
,
419 acpi_object_type type
,
420 struct acpi_namespace_node
**ret_node
);
423 acpi_ns_install_node (
424 struct acpi_walk_state
*walk_state
,
425 struct acpi_namespace_node
*parent_node
,
426 struct acpi_namespace_node
*node
,
427 acpi_object_type type
);
431 * Utility functions - nsutils
435 acpi_ns_valid_root_prefix (
439 acpi_ns_valid_path_separator (
444 struct acpi_namespace_node
*node
);
448 acpi_object_type type
);
451 acpi_ns_report_error (
456 acpi_status lookup_status
);
459 acpi_ns_report_method_error (
464 struct acpi_namespace_node
*node
,
466 acpi_status lookup_status
);
469 acpi_ns_print_node_pathname (
470 struct acpi_namespace_node
*node
,
474 acpi_ns_build_internal_name (
475 struct acpi_namestring_info
*info
);
478 acpi_ns_get_internal_name_length (
479 struct acpi_namestring_info
*info
);
482 acpi_ns_internalize_name (
484 char **converted_name
);
487 acpi_ns_externalize_name (
488 u32 internal_name_length
,
490 u32
*converted_name_length
,
491 char **converted_name
);
493 struct acpi_namespace_node
*
494 acpi_ns_map_handle_to_node (
498 acpi_ns_convert_entry_to_handle(
499 struct acpi_namespace_node
*node
);
505 struct acpi_namespace_node
*
506 acpi_ns_get_parent_node (
507 struct acpi_namespace_node
*node
);
510 struct acpi_namespace_node
*
511 acpi_ns_get_next_valid_node (
512 struct acpi_namespace_node
*node
);
515 #endif /* __ACNAMESP_H__ */