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 */
60 /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
62 #define ACPI_NS_NO_UPSEARCH 0
63 #define ACPI_NS_SEARCH_PARENT 0x01
64 #define ACPI_NS_DONT_OPEN_SCOPE 0x02
65 #define ACPI_NS_NO_PEER_SEARCH 0x04
66 #define ACPI_NS_ERROR_IF_FOUND 0x08
68 #define ACPI_NS_WALK_UNLOCK TRUE
69 #define ACPI_NS_WALK_NO_UNLOCK FALSE
73 * nsinit - Namespace initialization
76 acpi_ns_initialize_objects (
80 acpi_ns_initialize_devices (
85 * nsload - Namespace loading
88 acpi_ns_load_namespace (
93 struct acpi_table_desc
*table_desc
,
94 struct acpi_namespace_node
*node
);
98 * nswalk - walk the namespace
101 acpi_ns_walk_namespace (
102 acpi_object_type type
,
103 acpi_handle start_object
,
105 u8 unlock_before_callback
,
106 acpi_walk_callback user_function
,
108 void **return_value
);
110 struct acpi_namespace_node
*
111 acpi_ns_get_next_node (
112 acpi_object_type type
,
113 struct acpi_namespace_node
*parent
,
114 struct acpi_namespace_node
*child
);
118 * nsparse - table parsing
121 acpi_ns_parse_table (
122 struct acpi_table_desc
*table_desc
,
123 struct acpi_namespace_node
*scope
);
126 acpi_ns_one_complete_parse (
128 struct acpi_table_desc
*table_desc
);
132 * nsaccess - Top-level namespace access
135 acpi_ns_root_initialize (
140 union acpi_generic_state
*scope_info
,
142 acpi_object_type type
,
143 acpi_interpreter_mode interpreter_mode
,
145 struct acpi_walk_state
*walk_state
,
146 struct acpi_namespace_node
**ret_node
);
150 * nsalloc - Named object allocation/deallocation
152 struct acpi_namespace_node
*
153 acpi_ns_create_node (
157 acpi_ns_delete_node (
158 struct acpi_namespace_node
*node
);
161 acpi_ns_delete_namespace_subtree (
162 struct acpi_namespace_node
*parent_handle
);
165 acpi_ns_delete_namespace_by_owner (
169 acpi_ns_detach_object (
170 struct acpi_namespace_node
*node
);
173 acpi_ns_delete_children (
174 struct acpi_namespace_node
*parent
);
177 acpi_ns_compare_names (
183 * nsdump - Namespace dump/print utilities
185 #ifdef ACPI_FUTURE_USAGE
187 acpi_ns_dump_tables (
188 acpi_handle search_base
,
190 #endif /* ACPI_FUTURE_USAGE */
198 acpi_ns_dump_pathname (
205 acpi_ns_print_pathname (
210 acpi_ns_dump_one_object (
211 acpi_handle obj_handle
,
214 void **return_value
);
216 #ifdef ACPI_FUTURE_USAGE
218 acpi_ns_dump_objects (
219 acpi_object_type type
,
223 acpi_handle start_handle
);
224 #endif /* ACPI_FUTURE_USAGE */
228 * nseval - Namespace evaluation functions
231 acpi_ns_evaluate_by_handle (
232 struct acpi_parameter_info
*info
);
235 acpi_ns_evaluate_by_name (
237 struct acpi_parameter_info
*info
);
240 acpi_ns_evaluate_relative (
242 struct acpi_parameter_info
*info
);
246 * nsnames - Name and Scope manipulation
249 acpi_ns_opens_scope (
250 acpi_object_type type
);
253 acpi_ns_get_external_pathname (
254 struct acpi_namespace_node
*node
);
257 acpi_ns_name_of_current_scope (
258 struct acpi_walk_state
*walk_state
);
261 acpi_ns_handle_to_pathname (
262 acpi_handle target_handle
,
263 struct acpi_buffer
*buffer
);
266 acpi_ns_pattern_match (
267 struct acpi_namespace_node
*obj_node
,
271 acpi_ns_get_node_by_path (
272 char *external_pathname
,
273 struct acpi_namespace_node
*in_prefix_node
,
275 struct acpi_namespace_node
**out_node
);
278 acpi_ns_get_pathname_length (
279 struct acpi_namespace_node
*node
);
283 * nsobject - Object management for namespace nodes
286 acpi_ns_attach_object (
287 struct acpi_namespace_node
*node
,
288 union acpi_operand_object
*object
,
289 acpi_object_type type
);
291 union acpi_operand_object
*
292 acpi_ns_get_attached_object (
293 struct acpi_namespace_node
*node
);
295 union acpi_operand_object
*
296 acpi_ns_get_secondary_object (
297 union acpi_operand_object
*obj_desc
);
300 acpi_ns_attach_data (
301 struct acpi_namespace_node
*node
,
302 acpi_object_handler handler
,
306 acpi_ns_detach_data (
307 struct acpi_namespace_node
*node
,
308 acpi_object_handler handler
);
311 acpi_ns_get_attached_data (
312 struct acpi_namespace_node
*node
,
313 acpi_object_handler handler
,
318 * nssearch - Namespace searching and entry
321 acpi_ns_search_and_enter (
323 struct acpi_walk_state
*walk_state
,
324 struct acpi_namespace_node
*node
,
325 acpi_interpreter_mode interpreter_mode
,
326 acpi_object_type type
,
328 struct acpi_namespace_node
**ret_node
);
331 acpi_ns_search_node (
333 struct acpi_namespace_node
*node
,
334 acpi_object_type type
,
335 struct acpi_namespace_node
**ret_node
);
338 acpi_ns_install_node (
339 struct acpi_walk_state
*walk_state
,
340 struct acpi_namespace_node
*parent_node
,
341 struct acpi_namespace_node
*node
,
342 acpi_object_type type
);
346 * nsutils - Utility functions
349 acpi_ns_valid_root_prefix (
354 struct acpi_namespace_node
*node
);
358 acpi_object_type type
);
361 acpi_ns_report_error (
366 acpi_status lookup_status
);
369 acpi_ns_report_method_error (
374 struct acpi_namespace_node
*node
,
376 acpi_status lookup_status
);
379 acpi_ns_print_node_pathname (
380 struct acpi_namespace_node
*node
,
384 acpi_ns_build_internal_name (
385 struct acpi_namestring_info
*info
);
388 acpi_ns_get_internal_name_length (
389 struct acpi_namestring_info
*info
);
392 acpi_ns_internalize_name (
394 char **converted_name
);
397 acpi_ns_externalize_name (
398 u32 internal_name_length
,
400 u32
*converted_name_length
,
401 char **converted_name
);
403 struct acpi_namespace_node
*
404 acpi_ns_map_handle_to_node (
408 acpi_ns_convert_entry_to_handle(
409 struct acpi_namespace_node
*node
);
415 struct acpi_namespace_node
*
416 acpi_ns_get_parent_node (
417 struct acpi_namespace_node
*node
);
420 struct acpi_namespace_node
*
421 acpi_ns_get_next_valid_node (
422 struct acpi_namespace_node
*node
);
424 #endif /* __ACNAMESP_H__ */