acnamesp.h 9.7 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);

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

R
Robert Moore 已提交
106 107 108
/*
 * nsparse - table parsing
 */
L
Linus Torvalds 已提交
109
acpi_status
110
acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);
L
Linus Torvalds 已提交
111 112

acpi_status
113 114
acpi_ns_one_complete_parse(u32 pass_number,
			   u32 table_index,
115
			   struct acpi_namespace_node *start_node);
L
Linus Torvalds 已提交
116 117

/*
R
Robert Moore 已提交
118
 * nsaccess - Top-level namespace access
L
Linus Torvalds 已提交
119
 */
L
Len Brown 已提交
120
acpi_status acpi_ns_root_initialize(void);
L
Linus Torvalds 已提交
121 122

acpi_status
L
Len Brown 已提交
123 124 125 126 127 128 129
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 已提交
130 131

/*
R
Robert Moore 已提交
132
 * nsalloc - Named object allocation/deallocation
L
Linus Torvalds 已提交
133
 */
L
Len Brown 已提交
134
struct acpi_namespace_node *acpi_ns_create_node(u32 name);
L
Linus Torvalds 已提交
135

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

R
Robert Moore 已提交
138
void
L
Len Brown 已提交
139
acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);
R
Robert Moore 已提交
140

L
Len Brown 已提交
141
void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id);
L
Linus Torvalds 已提交
142

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

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

L
Len Brown 已提交
147
int acpi_ns_compare_names(char *name1, char *name2);
L
Linus Torvalds 已提交
148 149

/*
R
Robert Moore 已提交
150
 * nsdump - Namespace dump/print utilities
L
Linus Torvalds 已提交
151
 */
R
Robert Moore 已提交
152
#ifdef	ACPI_FUTURE_USAGE
L
Len Brown 已提交
153 154
void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
#endif				/* ACPI_FUTURE_USAGE */
L
Linus Torvalds 已提交
155

L
Len Brown 已提交
156
void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
L
Linus Torvalds 已提交
157 158

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

L
Len Brown 已提交
161
void acpi_ns_print_pathname(u32 num_segments, char *pathname);
L
Linus Torvalds 已提交
162 163

acpi_status
L
Len Brown 已提交
164 165
acpi_ns_dump_one_object(acpi_handle obj_handle,
			u32 level, void *context, void **return_value);
L
Linus Torvalds 已提交
166

R
Robert Moore 已提交
167
#ifdef	ACPI_FUTURE_USAGE
L
Linus Torvalds 已提交
168
void
L
Len Brown 已提交
169 170 171 172 173
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 已提交
174 175

/*
R
Robert Moore 已提交
176
 * nseval - Namespace evaluation functions
L
Linus Torvalds 已提交
177
 */
B
Bob Moore 已提交
178
acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
L
Linus Torvalds 已提交
179

180 181 182 183 184
/*
 * nspredef - Support for predefined/reserved names
 */
acpi_status
acpi_ns_check_predefined_names(struct acpi_namespace_node *node,
185
			       union acpi_operand_object **return_object);
186 187 188 189 190 191 192 193 194 195

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,
			      const union acpi_predefined_info *info);

L
Linus Torvalds 已提交
196
/*
R
Robert Moore 已提交
197
 * nsnames - Name and Scope manipulation
L
Linus Torvalds 已提交
198
 */
L
Len Brown 已提交
199
u32 acpi_ns_opens_scope(acpi_object_type type);
L
Linus Torvalds 已提交
200

201
acpi_status
B
Bob Moore 已提交
202 203 204
acpi_ns_build_external_path(struct acpi_namespace_node *node,
			    acpi_size size, char *name_buffer);

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

L
Len Brown 已提交
207
char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
L
Linus Torvalds 已提交
208 209

acpi_status
L
Len Brown 已提交
210 211
acpi_ns_handle_to_pathname(acpi_handle target_handle,
			   struct acpi_buffer *buffer);
L
Linus Torvalds 已提交
212 213

u8
L
Len Brown 已提交
214
acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
L
Linus Torvalds 已提交
215 216

acpi_status
B
Bob Moore 已提交
217
acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
218
		 const char *external_pathname,
B
Bob Moore 已提交
219
		 u32 flags, struct acpi_namespace_node **out_node);
L
Linus Torvalds 已提交
220

L
Len Brown 已提交
221
acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
L
Linus Torvalds 已提交
222 223

/*
R
Robert Moore 已提交
224
 * nsobject - Object management for namespace nodes
L
Linus Torvalds 已提交
225 226
 */
acpi_status
L
Len Brown 已提交
227 228
acpi_ns_attach_object(struct acpi_namespace_node *node,
		      union acpi_operand_object *object, acpi_object_type type);
L
Linus Torvalds 已提交
229

L
Len Brown 已提交
230 231 232
union acpi_operand_object *acpi_ns_get_attached_object(struct
						       acpi_namespace_node
						       *node);
L
Linus Torvalds 已提交
233

L
Len Brown 已提交
234 235 236
union acpi_operand_object *acpi_ns_get_secondary_object(union
							acpi_operand_object
							*obj_desc);
L
Linus Torvalds 已提交
237 238

acpi_status
L
Len Brown 已提交
239 240
acpi_ns_attach_data(struct acpi_namespace_node *node,
		    acpi_object_handler handler, void *data);
L
Linus Torvalds 已提交
241 242

acpi_status
L
Len Brown 已提交
243 244
acpi_ns_detach_data(struct acpi_namespace_node *node,
		    acpi_object_handler handler);
L
Linus Torvalds 已提交
245 246

acpi_status
L
Len Brown 已提交
247 248
acpi_ns_get_attached_data(struct acpi_namespace_node *node,
			  acpi_object_handler handler, void **data);
L
Linus Torvalds 已提交
249 250

/*
R
Robert Moore 已提交
251
 * nssearch - Namespace searching and entry
L
Linus Torvalds 已提交
252 253
 */
acpi_status
L
Len Brown 已提交
254 255 256 257 258 259
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 已提交
260 261

acpi_status
B
Bob Moore 已提交
262 263 264 265
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 已提交
266 267

void
L
Len Brown 已提交
268 269 270
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 已提交
271 272

/*
R
Robert Moore 已提交
273
 * nsutils - Utility functions
L
Linus Torvalds 已提交
274
 */
L
Len Brown 已提交
275
u8 acpi_ns_valid_root_prefix(char prefix);
L
Linus Torvalds 已提交
276

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

L
Len Brown 已提交
279
u32 acpi_ns_local(acpi_object_type type);
L
Linus Torvalds 已提交
280 281

void
282
acpi_ns_report_error(const char *module_name,
L
Len Brown 已提交
283
		     u32 line_number,
284
		     const char *internal_name, acpi_status lookup_status);
L
Linus Torvalds 已提交
285 286

void
287
acpi_ns_report_method_error(const char *module_name,
L
Len Brown 已提交
288
			    u32 line_number,
289
			    const char *message,
L
Len Brown 已提交
290
			    struct acpi_namespace_node *node,
291
			    const char *path, acpi_status lookup_status);
L
Linus Torvalds 已提交
292

293 294
void
acpi_ns_print_node_pathname(struct acpi_namespace_node *node, const char *msg);
L
Linus Torvalds 已提交
295

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

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

300 301
acpi_status
acpi_ns_internalize_name(const char *dotted_name, char **converted_name);
L
Linus Torvalds 已提交
302 303

acpi_status
L
Len Brown 已提交
304
acpi_ns_externalize_name(u32 internal_name_length,
305
			 const char *internal_name,
L
Len Brown 已提交
306
			 u32 * converted_name_length, char **converted_name);
L
Linus Torvalds 已提交
307

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

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

L
Len Brown 已提交
312
void acpi_ns_terminate(void);
L
Linus Torvalds 已提交
313

L
Len Brown 已提交
314 315
struct acpi_namespace_node *acpi_ns_get_parent_node(struct acpi_namespace_node
						    *node);
L
Linus Torvalds 已提交
316

L
Len Brown 已提交
317 318 319
struct acpi_namespace_node *acpi_ns_get_next_valid_node(struct
							acpi_namespace_node
							*node);
L
Linus Torvalds 已提交
320

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