acnamesp.h 10.0 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3 4 5 6 7
/******************************************************************************
 *
 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
 *
 *****************************************************************************/

/*
L
Len Brown 已提交
8
 * Copyright (C) 2000 - 2008, Intel Corp.
L
Linus Torvalds 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 */

#ifndef __ACNAMESP_H__
#define __ACNAMESP_H__

/* To search the entire name space, pass this as search_base */

#define ACPI_NS_ALL                 ((acpi_handle)0)

/*
 * Elements of acpi_ns_properties are bit significant
 * and should be one-to-one with values of acpi_object_type
 */
#define ACPI_NS_NORMAL              0
L
Len Brown 已提交
56 57
#define ACPI_NS_NEWSCOPE            1	/* a definition of this type opens a name scope */
#define ACPI_NS_LOCAL               2	/* suppress search of enclosing scopes */
L
Linus Torvalds 已提交
58 59 60 61 62 63 64 65

/* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */

#define ACPI_NS_NO_UPSEARCH         0
#define ACPI_NS_SEARCH_PARENT       0x01
#define ACPI_NS_DONT_OPEN_SCOPE     0x02
#define ACPI_NS_NO_PEER_SEARCH      0x04
#define ACPI_NS_ERROR_IF_FOUND      0x08
B
Bob Moore 已提交
66
#define ACPI_NS_PREFIX_IS_SCOPE     0x10
B
Bob Moore 已提交
67
#define ACPI_NS_EXTERNAL            0x20
68
#define ACPI_NS_TEMPORARY           0x40
L
Linus Torvalds 已提交
69

70 71 72 73 74
/* Flags for acpi_ns_walk_namespace */

#define ACPI_NS_WALK_NO_UNLOCK      0
#define ACPI_NS_WALK_UNLOCK         0x01
#define ACPI_NS_WALK_TEMP_NODES     0x02
L
Linus Torvalds 已提交
75

R
Robert Moore 已提交
76 77 78
/*
 * nsinit - Namespace initialization
 */
L
Len Brown 已提交
79
acpi_status acpi_ns_initialize_objects(void);
L
Linus Torvalds 已提交
80

L
Len Brown 已提交
81
acpi_status acpi_ns_initialize_devices(void);
L
Linus Torvalds 已提交
82

R
Robert Moore 已提交
83 84 85
/*
 * nsload -  Namespace loading
 */
L
Len Brown 已提交
86
acpi_status acpi_ns_load_namespace(void);
L
Linus Torvalds 已提交
87 88

acpi_status
89
acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
90

R
Robert Moore 已提交
91 92 93
/*
 * nswalk - walk the namespace
 */
L
Linus Torvalds 已提交
94
acpi_status
L
Len Brown 已提交
95 96 97
acpi_ns_walk_namespace(acpi_object_type type,
		       acpi_handle start_object,
		       u32 max_depth,
98
		       u32 flags,
L
Len Brown 已提交
99 100 101
		       acpi_walk_callback user_function,
		       void *context, void **return_value);

102 103 104
struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
						  *parent,
						  struct acpi_namespace_node
L
Len Brown 已提交
105
						  *child);
L
Linus Torvalds 已提交
106

107 108 109 110 111 112 113 114
struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type,
							struct
							acpi_namespace_node
							*parent,
							struct
							acpi_namespace_node
							*child);

R
Robert Moore 已提交
115 116 117
/*
 * nsparse - table parsing
 */
L
Linus Torvalds 已提交
118
acpi_status
119
acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);
L
Linus Torvalds 已提交
120 121

acpi_status
122 123
acpi_ns_one_complete_parse(u32 pass_number,
			   u32 table_index,
124
			   struct acpi_namespace_node *start_node);
L
Linus Torvalds 已提交
125 126

/*
R
Robert Moore 已提交
127
 * nsaccess - Top-level namespace access
L
Linus Torvalds 已提交
128
 */
L
Len Brown 已提交
129
acpi_status acpi_ns_root_initialize(void);
L
Linus Torvalds 已提交
130 131

acpi_status
L
Len Brown 已提交
132 133 134 135 136 137 138
acpi_ns_lookup(union acpi_generic_state *scope_info,
	       char *name,
	       acpi_object_type type,
	       acpi_interpreter_mode interpreter_mode,
	       u32 flags,
	       struct acpi_walk_state *walk_state,
	       struct acpi_namespace_node **ret_node);
L
Linus Torvalds 已提交
139 140

/*
R
Robert Moore 已提交
141
 * nsalloc - Named object allocation/deallocation
L
Linus Torvalds 已提交
142
 */
L
Len Brown 已提交
143
struct acpi_namespace_node *acpi_ns_create_node(u32 name);
L
Linus Torvalds 已提交
144

L
Len Brown 已提交
145
void acpi_ns_delete_node(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
146

R
Robert Moore 已提交
147
void
L
Len Brown 已提交
148
acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);
R
Robert Moore 已提交
149

L
Len Brown 已提交
150
void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id);
L
Linus Torvalds 已提交
151

L
Len Brown 已提交
152
void acpi_ns_detach_object(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
153

L
Len Brown 已提交
154
void acpi_ns_delete_children(struct acpi_namespace_node *parent);
L
Linus Torvalds 已提交
155

L
Len Brown 已提交
156
int acpi_ns_compare_names(char *name1, char *name2);
L
Linus Torvalds 已提交
157 158

/*
R
Robert Moore 已提交
159
 * nsdump - Namespace dump/print utilities
L
Linus Torvalds 已提交
160
 */
R
Robert Moore 已提交
161
#ifdef	ACPI_FUTURE_USAGE
L
Len Brown 已提交
162 163
void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
#endif				/* ACPI_FUTURE_USAGE */
L
Linus Torvalds 已提交
164

L
Len Brown 已提交
165
void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
L
Linus Torvalds 已提交
166 167

void
L
Len Brown 已提交
168
acpi_ns_dump_pathname(acpi_handle handle, char *msg, u32 level, u32 component);
L
Linus Torvalds 已提交
169

L
Len Brown 已提交
170
void acpi_ns_print_pathname(u32 num_segments, char *pathname);
L
Linus Torvalds 已提交
171 172

acpi_status
L
Len Brown 已提交
173 174
acpi_ns_dump_one_object(acpi_handle obj_handle,
			u32 level, void *context, void **return_value);
L
Linus Torvalds 已提交
175

R
Robert Moore 已提交
176
#ifdef	ACPI_FUTURE_USAGE
L
Linus Torvalds 已提交
177
void
L
Len Brown 已提交
178 179 180 181 182
acpi_ns_dump_objects(acpi_object_type type,
		     u8 display_type,
		     u32 max_depth,
		     acpi_owner_id owner_id, acpi_handle start_handle);
#endif				/* ACPI_FUTURE_USAGE */
L
Linus Torvalds 已提交
183 184

/*
R
Robert Moore 已提交
185
 * nseval - Namespace evaluation functions
L
Linus Torvalds 已提交
186
 */
B
Bob Moore 已提交
187
acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
L
Linus Torvalds 已提交
188

189 190 191 192 193
/*
 * nspredef - Support for predefined/reserved names
 */
acpi_status
acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
194 195
			       u32 user_param_count,
			       acpi_status return_status,
196
			       union acpi_operand_object **return_object);
197 198 199 200 201 202 203 204

const union acpi_predefined_info *acpi_ns_check_for_predefined_name(struct
								    acpi_namespace_node
								    *node);

void
acpi_ns_check_parameter_count(char *pathname,
			      struct acpi_namespace_node *node,
205
			      u32 user_param_count,
206 207
			      const union acpi_predefined_info *info);

L
Linus Torvalds 已提交
208
/*
R
Robert Moore 已提交
209
 * nsnames - Name and Scope manipulation
L
Linus Torvalds 已提交
210
 */
L
Len Brown 已提交
211
u32 acpi_ns_opens_scope(acpi_object_type type);
L
Linus Torvalds 已提交
212

213
acpi_status
B
Bob Moore 已提交
214 215 216
acpi_ns_build_external_path(struct acpi_namespace_node *node,
			    acpi_size size, char *name_buffer);

L
Len Brown 已提交
217
char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
218

L
Len Brown 已提交
219
char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
L
Linus Torvalds 已提交
220 221

acpi_status
L
Len Brown 已提交
222 223
acpi_ns_handle_to_pathname(acpi_handle target_handle,
			   struct acpi_buffer *buffer);
L
Linus Torvalds 已提交
224 225

u8
L
Len Brown 已提交
226
acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
L
Linus Torvalds 已提交
227 228

acpi_status
B
Bob Moore 已提交
229
acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
230
		 const char *external_pathname,
B
Bob Moore 已提交
231
		 u32 flags, struct acpi_namespace_node **out_node);
L
Linus Torvalds 已提交
232

L
Len Brown 已提交
233
acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
234 235

/*
R
Robert Moore 已提交
236
 * nsobject - Object management for namespace nodes
L
Linus Torvalds 已提交
237 238
 */
acpi_status
L
Len Brown 已提交
239 240
acpi_ns_attach_object(struct acpi_namespace_node *node,
		      union acpi_operand_object *object, acpi_object_type type);
L
Linus Torvalds 已提交
241

L
Len Brown 已提交
242 243 244
union acpi_operand_object *acpi_ns_get_attached_object(struct
						       acpi_namespace_node
						       *node);
L
Linus Torvalds 已提交
245

L
Len Brown 已提交
246 247 248
union acpi_operand_object *acpi_ns_get_secondary_object(union
							acpi_operand_object
							*obj_desc);
L
Linus Torvalds 已提交
249 250

acpi_status
L
Len Brown 已提交
251 252
acpi_ns_attach_data(struct acpi_namespace_node *node,
		    acpi_object_handler handler, void *data);
L
Linus Torvalds 已提交
253 254

acpi_status
L
Len Brown 已提交
255 256
acpi_ns_detach_data(struct acpi_namespace_node *node,
		    acpi_object_handler handler);
L
Linus Torvalds 已提交
257 258

acpi_status
L
Len Brown 已提交
259 260
acpi_ns_get_attached_data(struct acpi_namespace_node *node,
			  acpi_object_handler handler, void **data);
L
Linus Torvalds 已提交
261 262

/*
R
Robert Moore 已提交
263
 * nssearch - Namespace searching and entry
L
Linus Torvalds 已提交
264 265
 */
acpi_status
L
Len Brown 已提交
266 267 268 269 270 271
acpi_ns_search_and_enter(u32 entry_name,
			 struct acpi_walk_state *walk_state,
			 struct acpi_namespace_node *node,
			 acpi_interpreter_mode interpreter_mode,
			 acpi_object_type type,
			 u32 flags, struct acpi_namespace_node **ret_node);
L
Linus Torvalds 已提交
272 273

acpi_status
B
Bob Moore 已提交
274 275 276 277
acpi_ns_search_one_scope(u32 entry_name,
			 struct acpi_namespace_node *node,
			 acpi_object_type type,
			 struct acpi_namespace_node **ret_node);
L
Linus Torvalds 已提交
278 279

void
L
Len Brown 已提交
280 281 282
acpi_ns_install_node(struct acpi_walk_state *walk_state,
		     struct acpi_namespace_node *parent_node,
		     struct acpi_namespace_node *node, acpi_object_type type);
L
Linus Torvalds 已提交
283 284

/*
R
Robert Moore 已提交
285
 * nsutils - Utility functions
L
Linus Torvalds 已提交
286
 */
L
Len Brown 已提交
287
u8 acpi_ns_valid_root_prefix(char prefix);
L
Linus Torvalds 已提交
288

L
Len Brown 已提交
289
acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
290

L
Len Brown 已提交
291
u32 acpi_ns_local(acpi_object_type type);
L
Linus Torvalds 已提交
292 293

void
294
acpi_ns_report_error(const char *module_name,
L
Len Brown 已提交
295
		     u32 line_number,
296
		     const char *internal_name, acpi_status lookup_status);
L
Linus Torvalds 已提交
297 298

void
299
acpi_ns_report_method_error(const char *module_name,
L
Len Brown 已提交
300
			    u32 line_number,
301
			    const char *message,
L
Len Brown 已提交
302
			    struct acpi_namespace_node *node,
303
			    const char *path, acpi_status lookup_status);
L
Linus Torvalds 已提交
304

305 306
void
acpi_ns_print_node_pathname(struct acpi_namespace_node *node, const char *msg);
L
Linus Torvalds 已提交
307

L
Len Brown 已提交
308
acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
L
Linus Torvalds 已提交
309

L
Len Brown 已提交
310
void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
L
Linus Torvalds 已提交
311

312 313
acpi_status
acpi_ns_internalize_name(const char *dotted_name, char **converted_name);
L
Linus Torvalds 已提交
314 315

acpi_status
L
Len Brown 已提交
316
acpi_ns_externalize_name(u32 internal_name_length,
317
			 const char *internal_name,
L
Len Brown 已提交
318
			 u32 * converted_name_length, char **converted_name);
L
Linus Torvalds 已提交
319

L
Len Brown 已提交
320
struct acpi_namespace_node *acpi_ns_map_handle_to_node(acpi_handle handle);
L
Linus Torvalds 已提交
321

L
Len Brown 已提交
322
acpi_handle acpi_ns_convert_entry_to_handle(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
323

L
Len Brown 已提交
324
void acpi_ns_terminate(void);
L
Linus Torvalds 已提交
325

L
Len Brown 已提交
326 327
struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node
						    *node);
L
Linus Torvalds 已提交
328

L
Len Brown 已提交
329 330 331
struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct
							acpi_namespace_node
							*node);
L
Linus Torvalds 已提交
332

L
Len Brown 已提交
333
#endif				/* __ACNAMESP_H__ */