ACPICA: update Intel copyright
[deliverable/linux.git] / include / acpi / acnamesp.h
CommitLineData
1da177e4
LT
1/******************************************************************************
2 *
3 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
4 *
5 *****************************************************************************/
6
7/*
75a44ce0 8 * Copyright (C) 2000 - 2008, Intel Corp.
1da177e4
LT
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
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.
25 *
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.
29 *
30 * NO WARRANTY
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.
42 */
43
44#ifndef __ACNAMESP_H__
45#define __ACNAMESP_H__
46
1da177e4
LT
47/* To search the entire name space, pass this as search_base */
48
49#define ACPI_NS_ALL ((acpi_handle)0)
50
51/*
52 * Elements of acpi_ns_properties are bit significant
53 * and should be one-to-one with values of acpi_object_type
54 */
55#define ACPI_NS_NORMAL 0
4be44fcd
LB
56#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
57#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
1da177e4 58
1da177e4
LT
59/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
60
61#define ACPI_NS_NO_UPSEARCH 0
62#define ACPI_NS_SEARCH_PARENT 0x01
63#define ACPI_NS_DONT_OPEN_SCOPE 0x02
64#define ACPI_NS_NO_PEER_SEARCH 0x04
65#define ACPI_NS_ERROR_IF_FOUND 0x08
8313524a 66#define ACPI_NS_PREFIX_IS_SCOPE 0x10
958dd242 67#define ACPI_NS_EXTERNAL 0x20
d1fdda83 68#define ACPI_NS_TEMPORARY 0x40
1da177e4 69
d1fdda83
BM
70/* Flags for acpi_ns_walk_namespace */
71
72#define ACPI_NS_WALK_NO_UNLOCK 0
73#define ACPI_NS_WALK_UNLOCK 0x01
74#define ACPI_NS_WALK_TEMP_NODES 0x02
1da177e4 75
44f6c012
RM
76/*
77 * nsinit - Namespace initialization
78 */
4be44fcd 79acpi_status acpi_ns_initialize_objects(void);
1da177e4 80
4be44fcd 81acpi_status acpi_ns_initialize_devices(void);
1da177e4 82
44f6c012
RM
83/*
84 * nsload - Namespace loading
85 */
4be44fcd 86acpi_status acpi_ns_load_namespace(void);
1da177e4
LT
87
88acpi_status
f3d2e786 89acpi_ns_load_table(acpi_native_uint table_index,
4be44fcd 90 struct acpi_namespace_node *node);
1da177e4 91
44f6c012
RM
92/*
93 * nswalk - walk the namespace
94 */
1da177e4 95acpi_status
4be44fcd
LB
96acpi_ns_walk_namespace(acpi_object_type type,
97 acpi_handle start_object,
98 u32 max_depth,
d1fdda83 99 u32 flags,
4be44fcd
LB
100 acpi_walk_callback user_function,
101 void *context, void **return_value);
102
fd350943
LB
103struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type, struct acpi_namespace_node
104 *parent, struct acpi_namespace_node
4be44fcd 105 *child);
1da177e4 106
44f6c012
RM
107/*
108 * nsparse - table parsing
109 */
1da177e4 110acpi_status
f3d2e786
BM
111acpi_ns_parse_table(acpi_native_uint table_index,
112 struct acpi_namespace_node *start_node);
1da177e4
LT
113
114acpi_status
f3d2e786 115acpi_ns_one_complete_parse(acpi_native_uint pass_number,
7f4ac9f9
BM
116 acpi_native_uint table_index,
117 struct acpi_namespace_node *start_node);
1da177e4
LT
118
119/*
44f6c012 120 * nsaccess - Top-level namespace access
1da177e4 121 */
4be44fcd 122acpi_status acpi_ns_root_initialize(void);
1da177e4
LT
123
124acpi_status
4be44fcd
LB
125acpi_ns_lookup(union acpi_generic_state *scope_info,
126 char *name,
127 acpi_object_type type,
128 acpi_interpreter_mode interpreter_mode,
129 u32 flags,
130 struct acpi_walk_state *walk_state,
131 struct acpi_namespace_node **ret_node);
1da177e4
LT
132
133/*
44f6c012 134 * nsalloc - Named object allocation/deallocation
1da177e4 135 */
4be44fcd 136struct acpi_namespace_node *acpi_ns_create_node(u32 name);
1da177e4 137
4be44fcd 138void acpi_ns_delete_node(struct acpi_namespace_node *node);
1da177e4 139
44f6c012 140void
4be44fcd 141acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);
44f6c012 142
4be44fcd 143void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id);
1da177e4 144
4be44fcd 145void acpi_ns_detach_object(struct acpi_namespace_node *node);
1da177e4 146
4be44fcd 147void acpi_ns_delete_children(struct acpi_namespace_node *parent);
1da177e4 148
4be44fcd 149int acpi_ns_compare_names(char *name1, char *name2);
1da177e4
LT
150
151/*
44f6c012 152 * nsdump - Namespace dump/print utilities
1da177e4 153 */
44f6c012 154#ifdef ACPI_FUTURE_USAGE
4be44fcd
LB
155void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
156#endif /* ACPI_FUTURE_USAGE */
1da177e4 157
4be44fcd 158void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
1da177e4
LT
159
160void
4be44fcd 161acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
1da177e4 162
4be44fcd 163void acpi_ns_print_pathname(u32 num_segments, char *pathname);
1da177e4 164
1da177e4 165acpi_status
4be44fcd
LB
166acpi_ns_dump_one_object(acpi_handle obj_handle,
167 u32 level, void *context, void **return_value);
1da177e4 168
44f6c012 169#ifdef ACPI_FUTURE_USAGE
1da177e4 170void
4be44fcd
LB
171acpi_ns_dump_objects(acpi_object_type type,
172 u8 display_type,
173 u32 max_depth,
174 acpi_owner_id owner_id, acpi_handle start_handle);
175#endif /* ACPI_FUTURE_USAGE */
1da177e4
LT
176
177/*
44f6c012 178 * nseval - Namespace evaluation functions
1da177e4 179 */
4119532c 180acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
1da177e4
LT
181
182/*
44f6c012 183 * nsnames - Name and Scope manipulation
1da177e4 184 */
4be44fcd 185u32 acpi_ns_opens_scope(acpi_object_type type);
1da177e4 186
8313524a
BM
187void
188acpi_ns_build_external_path(struct acpi_namespace_node *node,
189 acpi_size size, char *name_buffer);
190
4be44fcd 191char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
1da177e4 192
4be44fcd 193char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
1da177e4
LT
194
195acpi_status
4be44fcd
LB
196acpi_ns_handle_to_pathname(acpi_handle target_handle,
197 struct acpi_buffer *buffer);
1da177e4
LT
198
199u8
4be44fcd 200acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
1da177e4
LT
201
202acpi_status
4119532c
BM
203acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
204 char *external_pathname,
205 u32 flags, struct acpi_namespace_node **out_node);
1da177e4 206
4be44fcd 207acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
1da177e4
LT
208
209/*
44f6c012 210 * nsobject - Object management for namespace nodes
1da177e4 211 */
1da177e4 212acpi_status
4be44fcd
LB
213acpi_ns_attach_object(struct acpi_namespace_node *node,
214 union acpi_operand_object *object, acpi_object_type type);
1da177e4 215
4be44fcd
LB
216union acpi_operand_object *acpi_ns_get_attached_object(struct
217 acpi_namespace_node
218 *node);
1da177e4 219
4be44fcd
LB
220union acpi_operand_object *acpi_ns_get_secondary_object(union
221 acpi_operand_object
222 *obj_desc);
1da177e4
LT
223
224acpi_status
4be44fcd
LB
225acpi_ns_attach_data(struct acpi_namespace_node *node,
226 acpi_object_handler handler, void *data);
1da177e4
LT
227
228acpi_status
4be44fcd
LB
229acpi_ns_detach_data(struct acpi_namespace_node *node,
230 acpi_object_handler handler);
1da177e4
LT
231
232acpi_status
4be44fcd
LB
233acpi_ns_get_attached_data(struct acpi_namespace_node *node,
234 acpi_object_handler handler, void **data);
1da177e4
LT
235
236/*
44f6c012 237 * nssearch - Namespace searching and entry
1da177e4 238 */
1da177e4 239acpi_status
4be44fcd
LB
240acpi_ns_search_and_enter(u32 entry_name,
241 struct acpi_walk_state *walk_state,
242 struct acpi_namespace_node *node,
243 acpi_interpreter_mode interpreter_mode,
244 acpi_object_type type,
245 u32 flags, struct acpi_namespace_node **ret_node);
1da177e4
LT
246
247acpi_status
4119532c
BM
248acpi_ns_search_one_scope(u32 entry_name,
249 struct acpi_namespace_node *node,
250 acpi_object_type type,
251 struct acpi_namespace_node **ret_node);
1da177e4
LT
252
253void
4be44fcd
LB
254acpi_ns_install_node(struct acpi_walk_state *walk_state,
255 struct acpi_namespace_node *parent_node,
256 struct acpi_namespace_node *node, acpi_object_type type);
1da177e4
LT
257
258/*
44f6c012 259 * nsutils - Utility functions
1da177e4 260 */
4be44fcd 261u8 acpi_ns_valid_root_prefix(char prefix);
1da177e4 262
4be44fcd 263acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
1da177e4 264
4be44fcd 265u32 acpi_ns_local(acpi_object_type type);
1da177e4
LT
266
267void
4be44fcd
LB
268acpi_ns_report_error(char *module_name,
269 u32 line_number,
4be44fcd 270 char *internal_name, acpi_status lookup_status);
1da177e4
LT
271
272void
4be44fcd
LB
273acpi_ns_report_method_error(char *module_name,
274 u32 line_number,
4be44fcd
LB
275 char *message,
276 struct acpi_namespace_node *node,
277 char *path, acpi_status lookup_status);
1da177e4 278
4be44fcd 279void acpi_ns_print_node_pathname(struct acpi_namespace_node *node, char *msg);
1da177e4 280
4be44fcd 281acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
1da177e4 282
4be44fcd 283void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
1da177e4 284
4be44fcd 285acpi_status acpi_ns_internalize_name(char *dotted_name, char **converted_name);
1da177e4
LT
286
287acpi_status
4be44fcd
LB
288acpi_ns_externalize_name(u32 internal_name_length,
289 char *internal_name,
290 u32 * converted_name_length, char **converted_name);
1da177e4 291
4be44fcd 292struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
1da177e4 293
4be44fcd 294acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node);
1da177e4 295
4be44fcd 296void acpi_ns_terminate(void);
1da177e4 297
4be44fcd
LB
298struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node
299 *node);
1da177e4 300
4be44fcd
LB
301struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct
302 acpi_namespace_node
303 *node);
1da177e4 304
4be44fcd 305#endif /* __ACNAMESP_H__ */
This page took 0.289571 seconds and 5 git commands to generate.