acnamesp.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:9k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /******************************************************************************
  2.  *
  3.  * Name: acnamesp.h - Namespace subcomponent prototypes and defines
  4.  *       $Revision: 110 $
  5.  *
  6.  *****************************************************************************/
  7. /*
  8.  *  Copyright (C) 2000, 2001 R. Byron Moore
  9.  *
  10.  *  This program is free software; you can redistribute it and/or modify
  11.  *  it under the terms of the GNU General Public License as published by
  12.  *  the Free Software Foundation; either version 2 of the License, or
  13.  *  (at your option) any later version.
  14.  *
  15.  *  This program is distributed in the hope that it will be useful,
  16.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  *  GNU General Public License for more details.
  19.  *
  20.  *  You should have received a copy of the GNU General Public License
  21.  *  along with this program; if not, write to the Free Software
  22.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  23.  */
  24. #ifndef __ACNAMESP_H__
  25. #define __ACNAMESP_H__
  26. /* To search the entire name space, pass this as Search_base */
  27. #define NS_ALL                  ((acpi_handle)0)
  28. /*
  29.  * Elements of Acpi_ns_properties are bit significant
  30.  * and should be one-to-one with values of acpi_object_type
  31.  */
  32. #define NSP_NORMAL              0
  33. #define NSP_NEWSCOPE            1   /* a definition of this type opens a name scope */
  34. #define NSP_LOCAL               2   /* suppress search of enclosing scopes */
  35. /* Definitions of the predefined namespace names  */
  36. #define ACPI_UNKNOWN_NAME       (u32) 0x3F3F3F3F     /* Unknown name is  "????" */
  37. #define ACPI_ROOT_NAME          (u32) 0x2F202020     /* Root name is     "/   " */
  38. #define ACPI_SYS_BUS_NAME       (u32) 0x5F53425F     /* Sys bus name is  "_SB_" */
  39. #define NS_ROOT_PATH            "/"
  40. #define NS_SYSTEM_BUS           "_SB_"
  41. /* Flags for Acpi_ns_lookup, Acpi_ns_search_and_enter */
  42. #define NS_NO_UPSEARCH          0
  43. #define NS_SEARCH_PARENT        0x01
  44. #define NS_DONT_OPEN_SCOPE      0x02
  45. #define NS_NO_PEER_SEARCH       0x04
  46. #define NS_ERROR_IF_FOUND       0x08
  47. #define NS_WALK_UNLOCK          TRUE
  48. #define NS_WALK_NO_UNLOCK       FALSE
  49. acpi_status
  50. acpi_ns_load_namespace (
  51. void);
  52. acpi_status
  53. acpi_ns_initialize_objects (
  54. void);
  55. acpi_status
  56. acpi_ns_initialize_devices (
  57. void);
  58. /* Namespace init - nsxfinit */
  59. acpi_status
  60. acpi_ns_init_one_device (
  61. acpi_handle             obj_handle,
  62. u32                     nesting_level,
  63. void                    *context,
  64. void                    **return_value);
  65. acpi_status
  66. acpi_ns_init_one_object (
  67. acpi_handle             obj_handle,
  68. u32                     level,
  69. void                    *context,
  70. void                    **return_value);
  71. acpi_status
  72. acpi_ns_walk_namespace (
  73. acpi_object_type8       type,
  74. acpi_handle             start_object,
  75. u32                     max_depth,
  76. u8                      unlock_before_callback,
  77. acpi_walk_callback      user_function,
  78. void                    *context,
  79. void                    **return_value);
  80. acpi_namespace_node *
  81. acpi_ns_get_next_node (
  82. acpi_object_type8       type,
  83. acpi_namespace_node     *parent,
  84. acpi_namespace_node     *child);
  85. acpi_status
  86. acpi_ns_delete_namespace_by_owner (
  87. u16                     table_id);
  88. /* Namespace loading - nsload */
  89. acpi_status
  90. acpi_ns_one_complete_parse (
  91. u32                     pass_number,
  92. acpi_table_desc         *table_desc);
  93. acpi_status
  94. acpi_ns_parse_table (
  95. acpi_table_desc         *table_desc,
  96. acpi_namespace_node     *scope);
  97. acpi_status
  98. acpi_ns_load_table (
  99. acpi_table_desc         *table_desc,
  100. acpi_namespace_node     *node);
  101. acpi_status
  102. acpi_ns_load_table_by_type (
  103. acpi_table_type         table_type);
  104. /*
  105.  * Top-level namespace access - nsaccess
  106.  */
  107. acpi_status
  108. acpi_ns_root_initialize (
  109. void);
  110. acpi_status
  111. acpi_ns_lookup (
  112. acpi_generic_state      *scope_info,
  113. NATIVE_CHAR             *name,
  114. acpi_object_type8       type,
  115. operating_mode          interpreter_mode,
  116. u32                     flags,
  117. acpi_walk_state         *walk_state,
  118. acpi_namespace_node     **ret_node);
  119. /*
  120.  * Named object allocation/deallocation - nsalloc
  121.  */
  122. acpi_namespace_node *
  123. acpi_ns_create_node (
  124. u32                     name);
  125. void
  126. acpi_ns_delete_node (
  127. acpi_namespace_node     *node);
  128. acpi_status
  129. acpi_ns_delete_namespace_subtree (
  130. acpi_namespace_node     *parent_handle);
  131. void
  132. acpi_ns_detach_object (
  133. acpi_namespace_node     *node);
  134. void
  135. acpi_ns_delete_children (
  136. acpi_namespace_node     *parent);
  137. /*
  138.  * Namespace modification - nsmodify
  139.  */
  140. acpi_status
  141. acpi_ns_unload_namespace (
  142. acpi_handle             handle);
  143. acpi_status
  144. acpi_ns_delete_subtree (
  145. acpi_handle             start_handle);
  146. /*
  147.  * Namespace dump/print utilities - nsdump
  148.  */
  149. void
  150. acpi_ns_dump_tables (
  151. acpi_handle             search_base,
  152. u32                     max_depth);
  153. void
  154. acpi_ns_dump_entry (
  155. acpi_handle             handle,
  156. u32                     debug_level);
  157. acpi_status
  158. acpi_ns_dump_pathname (
  159. acpi_handle             handle,
  160. NATIVE_CHAR             *msg,
  161. u32                     level,
  162. u32                     component);
  163. void
  164. acpi_ns_dump_root_devices (
  165. void);
  166. void
  167. acpi_ns_dump_objects (
  168. acpi_object_type8       type,
  169. u8                      display_type,
  170. u32                     max_depth,
  171. u32                     ownder_id,
  172. acpi_handle             start_handle);
  173. /*
  174.  * Namespace evaluation functions - nseval
  175.  */
  176. acpi_status
  177. acpi_ns_evaluate_by_handle (
  178. acpi_namespace_node     *prefix_node,
  179. acpi_operand_object     **params,
  180. acpi_operand_object     **return_object);
  181. acpi_status
  182. acpi_ns_evaluate_by_name (
  183. NATIVE_CHAR             *pathname,
  184. acpi_operand_object     **params,
  185. acpi_operand_object     **return_object);
  186. acpi_status
  187. acpi_ns_evaluate_relative (
  188. acpi_namespace_node     *prefix_node,
  189. NATIVE_CHAR             *pathname,
  190. acpi_operand_object     **params,
  191. acpi_operand_object     **return_object);
  192. acpi_status
  193. acpi_ns_execute_control_method (
  194. acpi_namespace_node     *method_node,
  195. acpi_operand_object     **params,
  196. acpi_operand_object     **return_obj_desc);
  197. acpi_status
  198. acpi_ns_get_object_value (
  199. acpi_namespace_node     *object_node,
  200. acpi_operand_object     **return_obj_desc);
  201. /*
  202.  * Parent/Child/Peer utility functions - nsfamily
  203.  */
  204. acpi_name
  205. acpi_ns_find_parent_name (
  206. acpi_namespace_node     *node_to_search);
  207. u8
  208. acpi_ns_exist_downstream_sibling (
  209. acpi_namespace_node     *this_node);
  210. /*
  211.  * Scope manipulation - nsscope
  212.  */
  213. u32
  214. acpi_ns_opens_scope (
  215. acpi_object_type8       type);
  216. NATIVE_CHAR *
  217. acpi_ns_get_table_pathname (
  218. acpi_namespace_node     *node);
  219. NATIVE_CHAR *
  220. acpi_ns_name_of_current_scope (
  221. acpi_walk_state         *walk_state);
  222. acpi_status
  223. acpi_ns_handle_to_pathname (
  224. acpi_handle             obj_handle,
  225. u32                     *buf_size,
  226. NATIVE_CHAR             *user_buffer);
  227. u8
  228. acpi_ns_pattern_match (
  229. acpi_namespace_node     *obj_node,
  230. NATIVE_CHAR             *search_for);
  231. acpi_status
  232. acpi_ns_get_node (
  233. NATIVE_CHAR             *pathname,
  234. acpi_namespace_node     *in_prefix_node,
  235. acpi_namespace_node     **out_node);
  236. u32
  237. acpi_ns_get_pathname_length (
  238. acpi_namespace_node     *node);
  239. /*
  240.  * Object management for NTEs - nsobject
  241.  */
  242. acpi_status
  243. acpi_ns_attach_object (
  244. acpi_namespace_node     *node,
  245. acpi_operand_object     *object,
  246. acpi_object_type8       type);
  247. /*
  248.  * Namespace searching and entry - nssearch
  249.  */
  250. acpi_status
  251. acpi_ns_search_and_enter (
  252. u32                     entry_name,
  253. acpi_walk_state         *walk_state,
  254. acpi_namespace_node     *node,
  255. operating_mode          interpreter_mode,
  256. acpi_object_type8       type,
  257. u32                     flags,
  258. acpi_namespace_node     **ret_node);
  259. acpi_status
  260. acpi_ns_search_node (
  261. u32                     entry_name,
  262. acpi_namespace_node     *node,
  263. acpi_object_type8       type,
  264. acpi_namespace_node     **ret_node);
  265. void
  266. acpi_ns_install_node (
  267. acpi_walk_state         *walk_state,
  268. acpi_namespace_node     *parent_node,   /* Parent */
  269. acpi_namespace_node     *node,      /* New Child*/
  270. acpi_object_type8       type);
  271. /*
  272.  * Utility functions - nsutils
  273.  */
  274. u8
  275. acpi_ns_valid_root_prefix (
  276. NATIVE_CHAR             prefix);
  277. u8
  278. acpi_ns_valid_path_separator (
  279. NATIVE_CHAR             sep);
  280. acpi_object_type8
  281. acpi_ns_get_type (
  282. acpi_namespace_node     *node);
  283. void *
  284. acpi_ns_get_attached_object (
  285. acpi_namespace_node     *node);
  286. u32
  287. acpi_ns_local (
  288. acpi_object_type8       type);
  289. acpi_status
  290. acpi_ns_build_internal_name (
  291. acpi_namestring_info    *info);
  292. acpi_status
  293. acpi_ns_get_internal_name_length (
  294. acpi_namestring_info    *info);
  295. acpi_status
  296. acpi_ns_internalize_name (
  297. NATIVE_CHAR             *dotted_name,
  298. NATIVE_CHAR             **converted_name);
  299. acpi_status
  300. acpi_ns_externalize_name (
  301. u32                     internal_name_length,
  302. NATIVE_CHAR             *internal_name,
  303. u32                     *converted_name_length,
  304. NATIVE_CHAR             **converted_name);
  305. acpi_namespace_node *
  306. acpi_ns_map_handle_to_node (
  307. acpi_handle             handle);
  308. acpi_handle
  309. acpi_ns_convert_entry_to_handle(
  310. acpi_namespace_node     *node);
  311. void
  312. acpi_ns_terminate (
  313. void);
  314. acpi_namespace_node *
  315. acpi_ns_get_parent_object (
  316. acpi_namespace_node     *node);
  317. acpi_namespace_node *
  318. acpi_ns_get_next_valid_node (
  319. acpi_namespace_node     *node);
  320. #endif /* __ACNAMESP_H__ */