Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Name: acnamesp.h - Namespace subcomponent prototypes and defines |
| 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
| 8 | * Copyright (C) 2000 - 2005, R. Byron Moore |
| 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 | |
| 47 | |
| 48 | /* To search the entire name space, pass this as search_base */ |
| 49 | |
| 50 | #define ACPI_NS_ALL ((acpi_handle)0) |
| 51 | |
| 52 | /* |
| 53 | * Elements of acpi_ns_properties are bit significant |
| 54 | * and should be one-to-one with values of acpi_object_type |
| 55 | */ |
| 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 */ |
| 59 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */ |
| 61 | |
| 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 |
| 67 | |
| 68 | #define ACPI_NS_WALK_UNLOCK TRUE |
| 69 | #define ACPI_NS_WALK_NO_UNLOCK FALSE |
| 70 | |
| 71 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 72 | /* |
| 73 | * nsinit - Namespace initialization |
| 74 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | acpi_status |
| 76 | acpi_ns_initialize_objects ( |
| 77 | void); |
| 78 | |
| 79 | acpi_status |
| 80 | acpi_ns_initialize_devices ( |
| 81 | void); |
| 82 | |
| 83 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 84 | /* |
| 85 | * nsload - Namespace loading |
| 86 | */ |
| 87 | acpi_status |
| 88 | acpi_ns_load_namespace ( |
| 89 | void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 90 | |
| 91 | acpi_status |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 92 | acpi_ns_load_table ( |
| 93 | struct acpi_table_desc *table_desc, |
| 94 | struct acpi_namespace_node *node); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
| 96 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 97 | /* |
| 98 | * nswalk - walk the namespace |
| 99 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | acpi_status |
| 101 | acpi_ns_walk_namespace ( |
| 102 | acpi_object_type type, |
| 103 | acpi_handle start_object, |
| 104 | u32 max_depth, |
| 105 | u8 unlock_before_callback, |
| 106 | acpi_walk_callback user_function, |
| 107 | void *context, |
| 108 | void **return_value); |
| 109 | |
| 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); |
| 115 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 117 | /* |
| 118 | * nsparse - table parsing |
| 119 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | acpi_status |
| 121 | acpi_ns_parse_table ( |
| 122 | struct acpi_table_desc *table_desc, |
| 123 | struct acpi_namespace_node *scope); |
| 124 | |
| 125 | acpi_status |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 126 | acpi_ns_one_complete_parse ( |
| 127 | u32 pass_number, |
| 128 | struct acpi_table_desc *table_desc); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | |
| 130 | |
| 131 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 132 | * nsaccess - Top-level namespace access |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 134 | acpi_status |
| 135 | acpi_ns_root_initialize ( |
| 136 | void); |
| 137 | |
| 138 | acpi_status |
| 139 | acpi_ns_lookup ( |
| 140 | union acpi_generic_state *scope_info, |
| 141 | char *name, |
| 142 | acpi_object_type type, |
| 143 | acpi_interpreter_mode interpreter_mode, |
| 144 | u32 flags, |
| 145 | struct acpi_walk_state *walk_state, |
| 146 | struct acpi_namespace_node **ret_node); |
| 147 | |
| 148 | |
| 149 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 150 | * nsalloc - Named object allocation/deallocation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | struct acpi_namespace_node * |
| 153 | acpi_ns_create_node ( |
| 154 | u32 name); |
| 155 | |
| 156 | void |
| 157 | acpi_ns_delete_node ( |
| 158 | struct acpi_namespace_node *node); |
| 159 | |
| 160 | void |
| 161 | acpi_ns_delete_namespace_subtree ( |
| 162 | struct acpi_namespace_node *parent_handle); |
| 163 | |
| 164 | void |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 165 | acpi_ns_delete_namespace_by_owner ( |
| 166 | u16 table_id); |
| 167 | |
| 168 | void |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | acpi_ns_detach_object ( |
| 170 | struct acpi_namespace_node *node); |
| 171 | |
| 172 | void |
| 173 | acpi_ns_delete_children ( |
| 174 | struct acpi_namespace_node *parent); |
| 175 | |
| 176 | int |
| 177 | acpi_ns_compare_names ( |
| 178 | char *name1, |
| 179 | char *name2); |
| 180 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | |
| 182 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 183 | * nsdump - Namespace dump/print utilities |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 185 | #ifdef ACPI_FUTURE_USAGE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 186 | void |
| 187 | acpi_ns_dump_tables ( |
| 188 | acpi_handle search_base, |
| 189 | u32 max_depth); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 190 | #endif /* ACPI_FUTURE_USAGE */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | |
| 192 | void |
| 193 | acpi_ns_dump_entry ( |
| 194 | acpi_handle handle, |
| 195 | u32 debug_level); |
| 196 | |
| 197 | void |
| 198 | acpi_ns_dump_pathname ( |
| 199 | acpi_handle handle, |
| 200 | char *msg, |
| 201 | u32 level, |
| 202 | u32 component); |
| 203 | |
| 204 | void |
| 205 | acpi_ns_print_pathname ( |
| 206 | u32 num_segments, |
| 207 | char *pathname); |
| 208 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 209 | acpi_status |
| 210 | acpi_ns_dump_one_object ( |
| 211 | acpi_handle obj_handle, |
| 212 | u32 level, |
| 213 | void *context, |
| 214 | void **return_value); |
| 215 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 216 | #ifdef ACPI_FUTURE_USAGE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | void |
| 218 | acpi_ns_dump_objects ( |
| 219 | acpi_object_type type, |
| 220 | u8 display_type, |
| 221 | u32 max_depth, |
| 222 | u32 ownder_id, |
| 223 | acpi_handle start_handle); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 224 | #endif /* ACPI_FUTURE_USAGE */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | |
| 226 | |
| 227 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 228 | * nseval - Namespace evaluation functions |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | acpi_status |
| 231 | acpi_ns_evaluate_by_handle ( |
| 232 | struct acpi_parameter_info *info); |
| 233 | |
| 234 | acpi_status |
| 235 | acpi_ns_evaluate_by_name ( |
| 236 | char *pathname, |
| 237 | struct acpi_parameter_info *info); |
| 238 | |
| 239 | acpi_status |
| 240 | acpi_ns_evaluate_relative ( |
| 241 | char *pathname, |
| 242 | struct acpi_parameter_info *info); |
| 243 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | |
| 245 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 246 | * nsnames - Name and Scope manipulation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | u32 |
| 249 | acpi_ns_opens_scope ( |
| 250 | acpi_object_type type); |
| 251 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | char * |
| 253 | acpi_ns_get_external_pathname ( |
| 254 | struct acpi_namespace_node *node); |
| 255 | |
| 256 | char * |
| 257 | acpi_ns_name_of_current_scope ( |
| 258 | struct acpi_walk_state *walk_state); |
| 259 | |
| 260 | acpi_status |
| 261 | acpi_ns_handle_to_pathname ( |
| 262 | acpi_handle target_handle, |
| 263 | struct acpi_buffer *buffer); |
| 264 | |
| 265 | u8 |
| 266 | acpi_ns_pattern_match ( |
| 267 | struct acpi_namespace_node *obj_node, |
| 268 | char *search_for); |
| 269 | |
| 270 | acpi_status |
| 271 | acpi_ns_get_node_by_path ( |
| 272 | char *external_pathname, |
| 273 | struct acpi_namespace_node *in_prefix_node, |
| 274 | u32 flags, |
| 275 | struct acpi_namespace_node **out_node); |
| 276 | |
| 277 | acpi_size |
| 278 | acpi_ns_get_pathname_length ( |
| 279 | struct acpi_namespace_node *node); |
| 280 | |
| 281 | |
| 282 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 283 | * nsobject - Object management for namespace nodes |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | acpi_status |
| 286 | acpi_ns_attach_object ( |
| 287 | struct acpi_namespace_node *node, |
| 288 | union acpi_operand_object *object, |
| 289 | acpi_object_type type); |
| 290 | |
| 291 | union acpi_operand_object * |
| 292 | acpi_ns_get_attached_object ( |
| 293 | struct acpi_namespace_node *node); |
| 294 | |
| 295 | union acpi_operand_object * |
| 296 | acpi_ns_get_secondary_object ( |
| 297 | union acpi_operand_object *obj_desc); |
| 298 | |
| 299 | acpi_status |
| 300 | acpi_ns_attach_data ( |
| 301 | struct acpi_namespace_node *node, |
| 302 | acpi_object_handler handler, |
| 303 | void *data); |
| 304 | |
| 305 | acpi_status |
| 306 | acpi_ns_detach_data ( |
| 307 | struct acpi_namespace_node *node, |
| 308 | acpi_object_handler handler); |
| 309 | |
| 310 | acpi_status |
| 311 | acpi_ns_get_attached_data ( |
| 312 | struct acpi_namespace_node *node, |
| 313 | acpi_object_handler handler, |
| 314 | void **data); |
| 315 | |
| 316 | |
| 317 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 318 | * nssearch - Namespace searching and entry |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 320 | acpi_status |
| 321 | acpi_ns_search_and_enter ( |
| 322 | u32 entry_name, |
| 323 | struct acpi_walk_state *walk_state, |
| 324 | struct acpi_namespace_node *node, |
| 325 | acpi_interpreter_mode interpreter_mode, |
| 326 | acpi_object_type type, |
| 327 | u32 flags, |
| 328 | struct acpi_namespace_node **ret_node); |
| 329 | |
| 330 | acpi_status |
| 331 | acpi_ns_search_node ( |
| 332 | u32 entry_name, |
| 333 | struct acpi_namespace_node *node, |
| 334 | acpi_object_type type, |
| 335 | struct acpi_namespace_node **ret_node); |
| 336 | |
| 337 | void |
| 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); |
| 343 | |
| 344 | |
| 345 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 346 | * nsutils - Utility functions |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 347 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 348 | u8 |
| 349 | acpi_ns_valid_root_prefix ( |
| 350 | char prefix); |
| 351 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 352 | acpi_object_type |
| 353 | acpi_ns_get_type ( |
| 354 | struct acpi_namespace_node *node); |
| 355 | |
| 356 | u32 |
| 357 | acpi_ns_local ( |
| 358 | acpi_object_type type); |
| 359 | |
| 360 | void |
| 361 | acpi_ns_report_error ( |
| 362 | char *module_name, |
| 363 | u32 line_number, |
| 364 | u32 component_id, |
| 365 | char *internal_name, |
| 366 | acpi_status lookup_status); |
| 367 | |
| 368 | void |
| 369 | acpi_ns_report_method_error ( |
| 370 | char *module_name, |
| 371 | u32 line_number, |
| 372 | u32 component_id, |
| 373 | char *message, |
| 374 | struct acpi_namespace_node *node, |
| 375 | char *path, |
| 376 | acpi_status lookup_status); |
| 377 | |
| 378 | void |
| 379 | acpi_ns_print_node_pathname ( |
| 380 | struct acpi_namespace_node *node, |
| 381 | char *msg); |
| 382 | |
| 383 | acpi_status |
| 384 | acpi_ns_build_internal_name ( |
| 385 | struct acpi_namestring_info *info); |
| 386 | |
| 387 | void |
| 388 | acpi_ns_get_internal_name_length ( |
| 389 | struct acpi_namestring_info *info); |
| 390 | |
| 391 | acpi_status |
| 392 | acpi_ns_internalize_name ( |
| 393 | char *dotted_name, |
| 394 | char **converted_name); |
| 395 | |
| 396 | acpi_status |
| 397 | acpi_ns_externalize_name ( |
| 398 | u32 internal_name_length, |
| 399 | char *internal_name, |
| 400 | u32 *converted_name_length, |
| 401 | char **converted_name); |
| 402 | |
| 403 | struct acpi_namespace_node * |
| 404 | acpi_ns_map_handle_to_node ( |
| 405 | acpi_handle handle); |
| 406 | |
| 407 | acpi_handle |
| 408 | acpi_ns_convert_entry_to_handle( |
| 409 | struct acpi_namespace_node *node); |
| 410 | |
| 411 | void |
| 412 | acpi_ns_terminate ( |
| 413 | void); |
| 414 | |
| 415 | struct acpi_namespace_node * |
| 416 | acpi_ns_get_parent_node ( |
| 417 | struct acpi_namespace_node *node); |
| 418 | |
| 419 | |
| 420 | struct acpi_namespace_node * |
| 421 | acpi_ns_get_next_valid_node ( |
| 422 | struct acpi_namespace_node *node); |
| 423 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 424 | #endif /* __ACNAMESP_H__ */ |