mm/hmm.c: remove superfluous RCU protection around radix tree lookup
[linux/fpc-iii.git] / drivers / acpi / acpica / acnamesp.h
blob514aaf948ea900a584b0bb9293ac45b9f5759d04
1 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
2 /******************************************************************************
4 * Name: acnamesp.h - Namespace subcomponent prototypes and defines
6 * Copyright (C) 2000 - 2018, Intel Corp.
8 *****************************************************************************/
10 #ifndef __ACNAMESP_H__
11 #define __ACNAMESP_H__
13 /* To search the entire name space, pass this as search_base */
15 #define ACPI_NS_ALL ((acpi_handle)0)
18 * Elements of acpi_ns_properties are bit significant
19 * and should be one-to-one with values of acpi_object_type
21 #define ACPI_NS_NORMAL 0
22 #define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
23 #define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
25 /* Flags for acpi_ns_lookup, acpi_ns_search_and_enter */
27 #define ACPI_NS_NO_UPSEARCH 0
28 #define ACPI_NS_SEARCH_PARENT 0x01
29 #define ACPI_NS_DONT_OPEN_SCOPE 0x02
30 #define ACPI_NS_NO_PEER_SEARCH 0x04
31 #define ACPI_NS_ERROR_IF_FOUND 0x08
32 #define ACPI_NS_PREFIX_IS_SCOPE 0x10
33 #define ACPI_NS_EXTERNAL 0x20
34 #define ACPI_NS_TEMPORARY 0x40
35 #define ACPI_NS_OVERRIDE_IF_FOUND 0x80
37 /* Flags for acpi_ns_walk_namespace */
39 #define ACPI_NS_WALK_NO_UNLOCK 0
40 #define ACPI_NS_WALK_UNLOCK 0x01
41 #define ACPI_NS_WALK_TEMP_NODES 0x02
43 /* Object is not a package element */
45 #define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
46 #define ACPI_ALL_PACKAGE_ELEMENTS (ACPI_UINT32_MAX-1)
48 /* Always emit warning message, not dependent on node flags */
50 #define ACPI_WARN_ALWAYS 0
53 * nsinit - Namespace initialization
55 acpi_status acpi_ns_initialize_objects(void);
57 acpi_status acpi_ns_initialize_devices(u32 flags);
60 * nsload - Namespace loading
62 acpi_status acpi_ns_load_namespace(void);
64 acpi_status
65 acpi_ns_load_table(u32 table_index, struct acpi_namespace_node *node);
68 * nswalk - walk the namespace
70 acpi_status
71 acpi_ns_walk_namespace(acpi_object_type type,
72 acpi_handle start_object,
73 u32 max_depth,
74 u32 flags,
75 acpi_walk_callback descending_callback,
76 acpi_walk_callback ascending_callback,
77 void *context, void **return_value);
79 struct acpi_namespace_node *acpi_ns_get_next_node(struct acpi_namespace_node
80 *parent,
81 struct acpi_namespace_node
82 *child);
84 struct acpi_namespace_node *acpi_ns_get_next_node_typed(acpi_object_type type,
85 struct
86 acpi_namespace_node
87 *parent,
88 struct
89 acpi_namespace_node
90 *child);
93 * nsparse - table parsing
95 acpi_status
96 acpi_ns_parse_table(u32 table_index, struct acpi_namespace_node *start_node);
98 acpi_status
99 acpi_ns_execute_table(u32 table_index, struct acpi_namespace_node *start_node);
101 acpi_status
102 acpi_ns_one_complete_parse(u32 pass_number,
103 u32 table_index,
104 struct acpi_namespace_node *start_node);
107 * nsaccess - Top-level namespace access
109 acpi_status acpi_ns_root_initialize(void);
111 acpi_status
112 acpi_ns_lookup(union acpi_generic_state *scope_info,
113 char *name,
114 acpi_object_type type,
115 acpi_interpreter_mode interpreter_mode,
116 u32 flags,
117 struct acpi_walk_state *walk_state,
118 struct acpi_namespace_node **ret_node);
121 * nsalloc - Named object allocation/deallocation
123 struct acpi_namespace_node *acpi_ns_create_node(u32 name);
125 void acpi_ns_delete_node(struct acpi_namespace_node *node);
127 void acpi_ns_remove_node(struct acpi_namespace_node *node);
129 void
130 acpi_ns_delete_namespace_subtree(struct acpi_namespace_node *parent_handle);
132 void acpi_ns_delete_namespace_by_owner(acpi_owner_id owner_id);
134 void acpi_ns_detach_object(struct acpi_namespace_node *node);
136 void acpi_ns_delete_children(struct acpi_namespace_node *parent);
138 int acpi_ns_compare_names(char *name1, char *name2);
141 * nsconvert - Dynamic object conversion routines
143 acpi_status
144 acpi_ns_convert_to_integer(union acpi_operand_object *original_object,
145 union acpi_operand_object **return_object);
147 acpi_status
148 acpi_ns_convert_to_string(union acpi_operand_object *original_object,
149 union acpi_operand_object **return_object);
151 acpi_status
152 acpi_ns_convert_to_buffer(union acpi_operand_object *original_object,
153 union acpi_operand_object **return_object);
155 acpi_status
156 acpi_ns_convert_to_unicode(struct acpi_namespace_node *scope,
157 union acpi_operand_object *original_object,
158 union acpi_operand_object **return_object);
160 acpi_status
161 acpi_ns_convert_to_resource(struct acpi_namespace_node *scope,
162 union acpi_operand_object *original_object,
163 union acpi_operand_object **return_object);
165 acpi_status
166 acpi_ns_convert_to_reference(struct acpi_namespace_node *scope,
167 union acpi_operand_object *original_object,
168 union acpi_operand_object **return_object);
171 * nsdump - Namespace dump/print utilities
173 void acpi_ns_dump_tables(acpi_handle search_base, u32 max_depth);
175 void acpi_ns_dump_entry(acpi_handle handle, u32 debug_level);
177 void
178 acpi_ns_dump_pathname(acpi_handle handle,
179 const char *msg, u32 level, u32 component);
181 void acpi_ns_print_pathname(u32 num_segments, const char *pathname);
183 acpi_status
184 acpi_ns_dump_one_object(acpi_handle obj_handle,
185 u32 level, void *context, void **return_value);
187 void
188 acpi_ns_dump_objects(acpi_object_type type,
189 u8 display_type,
190 u32 max_depth,
191 acpi_owner_id owner_id, acpi_handle start_handle);
193 void
194 acpi_ns_dump_object_paths(acpi_object_type type,
195 u8 display_type,
196 u32 max_depth,
197 acpi_owner_id owner_id, acpi_handle start_handle);
200 * nseval - Namespace evaluation functions
202 acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
204 void acpi_ns_exec_module_code_list(void);
207 * nsarguments - Argument count/type checking for predefined/reserved names
209 void
210 acpi_ns_check_argument_count(char *pathname,
211 struct acpi_namespace_node *node,
212 u32 user_param_count,
213 const union acpi_predefined_info *info);
215 void
216 acpi_ns_check_acpi_compliance(char *pathname,
217 struct acpi_namespace_node *node,
218 const union acpi_predefined_info *predefined);
220 void acpi_ns_check_argument_types(struct acpi_evaluate_info *info);
223 * nspredef - Return value checking for predefined/reserved names
225 acpi_status
226 acpi_ns_check_return_value(struct acpi_namespace_node *node,
227 struct acpi_evaluate_info *info,
228 u32 user_param_count,
229 acpi_status return_status,
230 union acpi_operand_object **return_object);
232 acpi_status
233 acpi_ns_check_object_type(struct acpi_evaluate_info *info,
234 union acpi_operand_object **return_object_ptr,
235 u32 expected_btypes, u32 package_index);
238 * nsprepkg - Validation of predefined name packages
240 acpi_status
241 acpi_ns_check_package(struct acpi_evaluate_info *info,
242 union acpi_operand_object **return_object_ptr);
245 * nsnames - Name and Scope manipulation
247 u32 acpi_ns_opens_scope(acpi_object_type type);
249 char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
252 acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
253 char *full_path, u32 path_size, u8 no_trailing);
255 char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
256 u8 no_trailing);
258 char *acpi_ns_build_prefixed_pathname(union acpi_generic_state *prefix_scope,
259 const char *internal_path);
261 char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
263 acpi_status
264 acpi_ns_handle_to_name(acpi_handle target_handle, struct acpi_buffer *buffer);
266 acpi_status
267 acpi_ns_handle_to_pathname(acpi_handle target_handle,
268 struct acpi_buffer *buffer, u8 no_trailing);
271 acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
273 acpi_status
274 acpi_ns_get_node_unlocked(struct acpi_namespace_node *prefix_node,
275 const char *external_pathname,
276 u32 flags, struct acpi_namespace_node **out_node);
278 acpi_status
279 acpi_ns_get_node(struct acpi_namespace_node *prefix_node,
280 const char *external_pathname,
281 u32 flags, struct acpi_namespace_node **out_node);
283 acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node);
286 * nsobject - Object management for namespace nodes
288 acpi_status
289 acpi_ns_attach_object(struct acpi_namespace_node *node,
290 union acpi_operand_object *object, acpi_object_type type);
292 union acpi_operand_object *acpi_ns_get_attached_object(struct
293 acpi_namespace_node
294 *node);
296 union acpi_operand_object *acpi_ns_get_secondary_object(union
297 acpi_operand_object
298 *obj_desc);
300 acpi_status
301 acpi_ns_attach_data(struct acpi_namespace_node *node,
302 acpi_object_handler handler, void *data);
304 acpi_status
305 acpi_ns_detach_data(struct acpi_namespace_node *node,
306 acpi_object_handler handler);
308 acpi_status
309 acpi_ns_get_attached_data(struct acpi_namespace_node *node,
310 acpi_object_handler handler, void **data);
313 * nsrepair - General return object repair for all
314 * predefined methods/objects
316 acpi_status
317 acpi_ns_simple_repair(struct acpi_evaluate_info *info,
318 u32 expected_btypes,
319 u32 package_index,
320 union acpi_operand_object **return_object_ptr);
322 acpi_status
323 acpi_ns_wrap_with_package(struct acpi_evaluate_info *info,
324 union acpi_operand_object *original_object,
325 union acpi_operand_object **obj_desc_ptr);
327 acpi_status
328 acpi_ns_repair_null_element(struct acpi_evaluate_info *info,
329 u32 expected_btypes,
330 u32 package_index,
331 union acpi_operand_object **return_object_ptr);
333 void
334 acpi_ns_remove_null_elements(struct acpi_evaluate_info *info,
335 u8 package_type,
336 union acpi_operand_object *obj_desc);
339 * nsrepair2 - Return object repair for specific
340 * predefined methods/objects
342 acpi_status
343 acpi_ns_complex_repairs(struct acpi_evaluate_info *info,
344 struct acpi_namespace_node *node,
345 acpi_status validate_status,
346 union acpi_operand_object **return_object_ptr);
349 * nssearch - Namespace searching and entry
351 acpi_status
352 acpi_ns_search_and_enter(u32 entry_name,
353 struct acpi_walk_state *walk_state,
354 struct acpi_namespace_node *node,
355 acpi_interpreter_mode interpreter_mode,
356 acpi_object_type type,
357 u32 flags, struct acpi_namespace_node **ret_node);
359 acpi_status
360 acpi_ns_search_one_scope(u32 entry_name,
361 struct acpi_namespace_node *node,
362 acpi_object_type type,
363 struct acpi_namespace_node **ret_node);
365 void
366 acpi_ns_install_node(struct acpi_walk_state *walk_state,
367 struct acpi_namespace_node *parent_node,
368 struct acpi_namespace_node *node, acpi_object_type type);
371 * nsutils - Utility functions
373 acpi_object_type acpi_ns_get_type(struct acpi_namespace_node *node);
375 u32 acpi_ns_local(acpi_object_type type);
377 void
378 acpi_ns_print_node_pathname(struct acpi_namespace_node *node, const char *msg);
380 acpi_status acpi_ns_build_internal_name(struct acpi_namestring_info *info);
382 void acpi_ns_get_internal_name_length(struct acpi_namestring_info *info);
384 acpi_status
385 acpi_ns_internalize_name(const char *dotted_name, char **converted_name);
387 acpi_status
388 acpi_ns_externalize_name(u32 internal_name_length,
389 const char *internal_name,
390 u32 * converted_name_length, char **converted_name);
392 struct acpi_namespace_node *acpi_ns_validate_handle(acpi_handle handle);
394 void acpi_ns_terminate(void);
396 #endif /* __ACNAMESP_H__ */