acnamesp.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. /******************************************************************************
  2. *
  3. * Name: acnamesp.h - Namespace subcomponent prototypes and defines
  4. *
  5. *****************************************************************************/
  6. /*
  7. * Copyright (C) 2000 - 2005, R. Byron Moore
  8. * All rights reserved.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions, and the following disclaimer,
  15. * without modification.
  16. * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  17. * substantially similar to the "NO WARRANTY" disclaimer below
  18. * ("Disclaimer") and any redistribution must be conditioned upon
  19. * including a substantially similar Disclaimer requirement for further
  20. * binary redistribution.
  21. * 3. Neither the names of the above-listed copyright holders nor the names
  22. * of any contributors may be used to endorse or promote products derived
  23. * from this software without specific prior written permission.
  24. *
  25. * Alternatively, this software may be distributed under the terms of the
  26. * GNU General Public License ("GPL") version 2 as published by the Free
  27. * Software Foundation.
  28. *
  29. * NO WARRANTY
  30. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  31. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  32. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  33. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  34. * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  35. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  36. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  37. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  38. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  39. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  40. * POSSIBILITY OF SUCH DAMAGES.
  41. */
  42. #ifndef __ACNAMESP_H__
  43. #define __ACNAMESP_H__
  44. /* To search the entire name space, pass this as search_base */
  45. #define ACPI_NS_ALL ((acpi_handle)0)
  46. /*
  47. * Elements of acpi_ns_properties are bit significant
  48. * and should be one-to-one with values of acpi_object_type
  49. */
  50. #define ACPI_NS_NORMAL 0
  51. #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
  52. #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
  53. /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
  54. #define ACPI_NS_NO_UPSEARCH 0
  55. #define ACPI_NS_SEARCH_PARENT 0x01
  56. #define ACPI_NS_DONT_OPEN_SCOPE 0x02
  57. #define ACPI_NS_NO_PEER_SEARCH 0x04
  58. #define ACPI_NS_ERROR_IF_FOUND 0x08
  59. #define ACPI_NS_WALK_UNLOCK TRUE
  60. #define ACPI_NS_WALK_NO_UNLOCK FALSE
  61. /*
  62. * nsinit - Namespace initialization
  63. */
  64. acpi_status
  65. acpi_ns_initialize_objects (
  66. void);
  67. acpi_status
  68. acpi_ns_initialize_devices (
  69. void);
  70. /*
  71. * nsload - Namespace loading
  72. */
  73. acpi_status
  74. acpi_ns_load_namespace (
  75. void);
  76. acpi_status
  77. acpi_ns_load_table (
  78. struct acpi_table_desc *table_desc,
  79. struct acpi_namespace_node *node);
  80. /*
  81. * nswalk - walk the namespace
  82. */
  83. acpi_status
  84. acpi_ns_walk_namespace (
  85. acpi_object_type type,
  86. acpi_handle start_object,
  87. u32 max_depth,
  88. u8 unlock_before_callback,
  89. acpi_walk_callback user_function,
  90. void *context,
  91. void **return_value);
  92. struct acpi_namespace_node *
  93. acpi_ns_get_next_node (
  94. acpi_object_type type,
  95. struct acpi_namespace_node *parent,
  96. struct acpi_namespace_node *child);
  97. /*
  98. * nsparse - table parsing
  99. */
  100. acpi_status
  101. acpi_ns_parse_table (
  102. struct acpi_table_desc *table_desc,
  103. struct acpi_namespace_node *scope);
  104. acpi_status
  105. acpi_ns_one_complete_parse (
  106. u32 pass_number,
  107. struct acpi_table_desc *table_desc);
  108. /*
  109. * nsaccess - Top-level namespace access
  110. */
  111. acpi_status
  112. acpi_ns_root_initialize (
  113. void);
  114. acpi_status
  115. acpi_ns_lookup (
  116. union acpi_generic_state *scope_info,
  117. char *name,
  118. acpi_object_type type,
  119. acpi_interpreter_mode interpreter_mode,
  120. u32 flags,
  121. struct acpi_walk_state *walk_state,
  122. struct acpi_namespace_node **ret_node);
  123. /*
  124. * nsalloc - Named object allocation/deallocation
  125. */
  126. struct acpi_namespace_node *
  127. acpi_ns_create_node (
  128. u32 name);
  129. void
  130. acpi_ns_delete_node (
  131. struct acpi_namespace_node *node);
  132. void
  133. acpi_ns_delete_namespace_subtree (
  134. struct acpi_namespace_node *parent_handle);
  135. void
  136. acpi_ns_delete_namespace_by_owner (
  137. u16 table_id);
  138. void
  139. acpi_ns_detach_object (
  140. struct acpi_namespace_node *node);
  141. void
  142. acpi_ns_delete_children (
  143. struct acpi_namespace_node *parent);
  144. int
  145. acpi_ns_compare_names (
  146. char *name1,
  147. char *name2);
  148. /*
  149. * nsdump - Namespace dump/print utilities
  150. */
  151. #ifdef ACPI_FUTURE_USAGE
  152. void
  153. acpi_ns_dump_tables (
  154. acpi_handle search_base,
  155. u32 max_depth);
  156. #endif /* ACPI_FUTURE_USAGE */
  157. void
  158. acpi_ns_dump_entry (
  159. acpi_handle handle,
  160. u32 debug_level);
  161. void
  162. acpi_ns_dump_pathname (
  163. acpi_handle handle,
  164. char *msg,
  165. u32 level,
  166. u32 component);
  167. void
  168. acpi_ns_print_pathname (
  169. u32 num_segments,
  170. char *pathname);
  171. acpi_status
  172. acpi_ns_dump_one_object (
  173. acpi_handle obj_handle,
  174. u32 level,
  175. void *context,
  176. void **return_value);
  177. #ifdef ACPI_FUTURE_USAGE
  178. void
  179. acpi_ns_dump_objects (
  180. acpi_object_type type,
  181. u8 display_type,
  182. u32 max_depth,
  183. u32 ownder_id,
  184. acpi_handle start_handle);
  185. #endif /* ACPI_FUTURE_USAGE */
  186. /*
  187. * nseval - Namespace evaluation functions
  188. */
  189. acpi_status
  190. acpi_ns_evaluate_by_handle (
  191. struct acpi_parameter_info *info);
  192. acpi_status
  193. acpi_ns_evaluate_by_name (
  194. char *pathname,
  195. struct acpi_parameter_info *info);
  196. acpi_status
  197. acpi_ns_evaluate_relative (
  198. char *pathname,
  199. struct acpi_parameter_info *info);
  200. /*
  201. * nsnames - Name and Scope manipulation
  202. */
  203. u32
  204. acpi_ns_opens_scope (
  205. acpi_object_type type);
  206. char *
  207. acpi_ns_get_external_pathname (
  208. struct acpi_namespace_node *node);
  209. char *
  210. acpi_ns_name_of_current_scope (
  211. struct acpi_walk_state *walk_state);
  212. acpi_status
  213. acpi_ns_handle_to_pathname (
  214. acpi_handle target_handle,
  215. struct acpi_buffer *buffer);
  216. u8
  217. acpi_ns_pattern_match (
  218. struct acpi_namespace_node *obj_node,
  219. char *search_for);
  220. acpi_status
  221. acpi_ns_get_node_by_path (
  222. char *external_pathname,
  223. struct acpi_namespace_node *in_prefix_node,
  224. u32 flags,
  225. struct acpi_namespace_node **out_node);
  226. acpi_size
  227. acpi_ns_get_pathname_length (
  228. struct acpi_namespace_node *node);
  229. /*
  230. * nsobject - Object management for namespace nodes
  231. */
  232. acpi_status
  233. acpi_ns_attach_object (
  234. struct acpi_namespace_node *node,
  235. union acpi_operand_object *object,
  236. acpi_object_type type);
  237. union acpi_operand_object *
  238. acpi_ns_get_attached_object (
  239. struct acpi_namespace_node *node);
  240. union acpi_operand_object *
  241. acpi_ns_get_secondary_object (
  242. union acpi_operand_object *obj_desc);
  243. acpi_status
  244. acpi_ns_attach_data (
  245. struct acpi_namespace_node *node,
  246. acpi_object_handler handler,
  247. void *data);
  248. acpi_status
  249. acpi_ns_detach_data (
  250. struct acpi_namespace_node *node,
  251. acpi_object_handler handler);
  252. acpi_status
  253. acpi_ns_get_attached_data (
  254. struct acpi_namespace_node *node,
  255. acpi_object_handler handler,
  256. void **data);
  257. /*
  258. * nssearch - Namespace searching and entry
  259. */
  260. acpi_status
  261. acpi_ns_search_and_enter (
  262. u32 entry_name,
  263. struct acpi_walk_state *walk_state,
  264. struct acpi_namespace_node *node,
  265. acpi_interpreter_mode interpreter_mode,
  266. acpi_object_type type,
  267. u32 flags,
  268. struct acpi_namespace_node **ret_node);
  269. acpi_status
  270. acpi_ns_search_node (
  271. u32 entry_name,
  272. struct acpi_namespace_node *node,
  273. acpi_object_type type,
  274. struct acpi_namespace_node **ret_node);
  275. void
  276. acpi_ns_install_node (
  277. struct acpi_walk_state *walk_state,
  278. struct acpi_namespace_node *parent_node,
  279. struct acpi_namespace_node *node,
  280. acpi_object_type type);
  281. /*
  282. * nsutils - Utility functions
  283. */
  284. u8
  285. acpi_ns_valid_root_prefix (
  286. char prefix);
  287. acpi_object_type
  288. acpi_ns_get_type (
  289. struct acpi_namespace_node *node);
  290. u32
  291. acpi_ns_local (
  292. acpi_object_type type);
  293. void
  294. acpi_ns_report_error (
  295. char *module_name,
  296. u32 line_number,
  297. u32 component_id,
  298. char *internal_name,
  299. acpi_status lookup_status);
  300. void
  301. acpi_ns_report_method_error (
  302. char *module_name,
  303. u32 line_number,
  304. u32 component_id,
  305. char *message,
  306. struct acpi_namespace_node *node,
  307. char *path,
  308. acpi_status lookup_status);
  309. void
  310. acpi_ns_print_node_pathname (
  311. struct acpi_namespace_node *node,
  312. char *msg);
  313. acpi_status
  314. acpi_ns_build_internal_name (
  315. struct acpi_namestring_info *info);
  316. void
  317. acpi_ns_get_internal_name_length (
  318. struct acpi_namestring_info *info);
  319. acpi_status
  320. acpi_ns_internalize_name (
  321. char *dotted_name,
  322. char **converted_name);
  323. acpi_status
  324. acpi_ns_externalize_name (
  325. u32 internal_name_length,
  326. char *internal_name,
  327. u32 *converted_name_length,
  328. char **converted_name);
  329. struct acpi_namespace_node *
  330. acpi_ns_map_handle_to_node (
  331. acpi_handle handle);
  332. acpi_handle
  333. acpi_ns_convert_entry_to_handle(
  334. struct acpi_namespace_node *node);
  335. void
  336. acpi_ns_terminate (
  337. void);
  338. struct acpi_namespace_node *
  339. acpi_ns_get_parent_node (
  340. struct acpi_namespace_node *node);
  341. struct acpi_namespace_node *
  342. acpi_ns_get_next_valid_node (
  343. struct acpi_namespace_node *node);
  344. #endif /* __ACNAMESP_H__ */