Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
0002 /******************************************************************************
0003  *
0004  * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
0005  *
0006  * Copyright (C) 2000 - 2022, Intel Corp.
0007  *
0008  *****************************************************************************/
0009 
0010 #ifndef _ACUTILS_H
0011 #define _ACUTILS_H
0012 
0013 extern const u8 acpi_gbl_resource_aml_sizes[];
0014 extern const u8 acpi_gbl_resource_aml_serial_bus_sizes[];
0015 
0016 /* Strings used by the disassembler and debugger resource dump routines */
0017 
0018 #if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
0019 
0020 extern const char *acpi_gbl_bm_decode[];
0021 extern const char *acpi_gbl_config_decode[];
0022 extern const char *acpi_gbl_consume_decode[];
0023 extern const char *acpi_gbl_dec_decode[];
0024 extern const char *acpi_gbl_he_decode[];
0025 extern const char *acpi_gbl_io_decode[];
0026 extern const char *acpi_gbl_ll_decode[];
0027 extern const char *acpi_gbl_max_decode[];
0028 extern const char *acpi_gbl_mem_decode[];
0029 extern const char *acpi_gbl_min_decode[];
0030 extern const char *acpi_gbl_mtp_decode[];
0031 extern const char *acpi_gbl_phy_decode[];
0032 extern const char *acpi_gbl_rng_decode[];
0033 extern const char *acpi_gbl_rw_decode[];
0034 extern const char *acpi_gbl_shr_decode[];
0035 extern const char *acpi_gbl_siz_decode[];
0036 extern const char *acpi_gbl_trs_decode[];
0037 extern const char *acpi_gbl_ttp_decode[];
0038 extern const char *acpi_gbl_typ_decode[];
0039 extern const char *acpi_gbl_ppc_decode[];
0040 extern const char *acpi_gbl_ior_decode[];
0041 extern const char *acpi_gbl_dts_decode[];
0042 extern const char *acpi_gbl_ct_decode[];
0043 extern const char *acpi_gbl_sbt_decode[];
0044 extern const char *acpi_gbl_am_decode[];
0045 extern const char *acpi_gbl_sm_decode[];
0046 extern const char *acpi_gbl_wm_decode[];
0047 extern const char *acpi_gbl_cph_decode[];
0048 extern const char *acpi_gbl_cpo_decode[];
0049 extern const char *acpi_gbl_dp_decode[];
0050 extern const char *acpi_gbl_ed_decode[];
0051 extern const char *acpi_gbl_bpb_decode[];
0052 extern const char *acpi_gbl_sb_decode[];
0053 extern const char *acpi_gbl_fc_decode[];
0054 extern const char *acpi_gbl_pt_decode[];
0055 extern const char *acpi_gbl_ptyp_decode[];
0056 #endif
0057 
0058 /*
0059  * For the iASL compiler case, the output is redirected to stderr so that
0060  * any of the various ACPI errors and warnings do not appear in the output
0061  * files, for either the compiler or disassembler portions of the tool.
0062  */
0063 #ifdef ACPI_ASL_COMPILER
0064 
0065 #include <stdio.h>
0066 
0067 #define ACPI_MSG_REDIRECT_BEGIN \
0068     FILE                            *output_file = acpi_gbl_output_file; \
0069     acpi_os_redirect_output (stderr);
0070 
0071 #define ACPI_MSG_REDIRECT_END \
0072     acpi_os_redirect_output (output_file);
0073 
0074 #else
0075 /*
0076  * non-iASL case - no redirection, nothing to do
0077  */
0078 #define ACPI_MSG_REDIRECT_BEGIN
0079 #define ACPI_MSG_REDIRECT_END
0080 #endif
0081 
0082 /*
0083  * Common error message prefixes
0084  */
0085 #ifndef ACPI_MSG_ERROR
0086 #define ACPI_MSG_ERROR          "ACPI Error: "
0087 #endif
0088 #ifndef ACPI_MSG_WARNING
0089 #define ACPI_MSG_WARNING        "ACPI Warning: "
0090 #endif
0091 #ifndef ACPI_MSG_INFO
0092 #define ACPI_MSG_INFO           "ACPI: "
0093 #endif
0094 
0095 #ifndef ACPI_MSG_BIOS_ERROR
0096 #define ACPI_MSG_BIOS_ERROR     "Firmware Error (ACPI): "
0097 #endif
0098 #ifndef ACPI_MSG_BIOS_WARNING
0099 #define ACPI_MSG_BIOS_WARNING   "Firmware Warning (ACPI): "
0100 #endif
0101 
0102 /*
0103  * Common message suffix
0104  */
0105 #define ACPI_MSG_SUFFIX \
0106     acpi_os_printf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, module_name, line_number)
0107 
0108 /* Flags to indicate implicit or explicit string-to-integer conversion */
0109 
0110 #define ACPI_IMPLICIT_CONVERSION        TRUE
0111 #define ACPI_NO_IMPLICIT_CONVERSION     FALSE
0112 
0113 /* Types for Resource descriptor entries */
0114 
0115 #define ACPI_INVALID_RESOURCE           0
0116 #define ACPI_FIXED_LENGTH               1
0117 #define ACPI_VARIABLE_LENGTH            2
0118 #define ACPI_SMALL_VARIABLE_LENGTH      3
0119 
0120 typedef
0121 acpi_status (*acpi_walk_aml_callback) (u8 *aml,
0122                        u32 length,
0123                        u32 offset,
0124                        u8 resource_index, void **context);
0125 
0126 typedef
0127 acpi_status (*acpi_pkg_callback) (u8 object_type,
0128                   union acpi_operand_object * source_object,
0129                   union acpi_generic_state * state,
0130                   void *context);
0131 
0132 struct acpi_pkg_info {
0133     u8 *free_space;
0134     acpi_size length;
0135     u32 object_space;
0136     u32 num_packages;
0137 };
0138 
0139 /* Object reference counts */
0140 
0141 #define REF_INCREMENT       (u16) 0
0142 #define REF_DECREMENT       (u16) 1
0143 
0144 /* acpi_ut_dump_buffer */
0145 
0146 #define DB_BYTE_DISPLAY      0x01
0147 #define DB_WORD_DISPLAY      0x02
0148 #define DB_DWORD_DISPLAY     0x04
0149 #define DB_QWORD_DISPLAY     0x08
0150 #define DB_DISPLAY_DATA_ONLY 0x10
0151 
0152 /*
0153  * utascii - ASCII utilities
0154  */
0155 u8 acpi_ut_valid_nameseg(char *signature);
0156 
0157 u8 acpi_ut_valid_name_char(char character, u32 position);
0158 
0159 void acpi_ut_check_and_repair_ascii(u8 *name, char *repaired_name, u32 count);
0160 
0161 /*
0162  * utnonansi - Non-ANSI C library functions
0163  */
0164 void acpi_ut_strupr(char *src_string);
0165 
0166 void acpi_ut_strlwr(char *src_string);
0167 
0168 int acpi_ut_stricmp(char *string1, char *string2);
0169 
0170 /*
0171  * utstrsuppt - string-to-integer conversion support functions
0172  */
0173 acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value);
0174 
0175 acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr);
0176 
0177 acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr);
0178 
0179 char acpi_ut_remove_whitespace(char **string);
0180 
0181 char acpi_ut_remove_leading_zeros(char **string);
0182 
0183 u8 acpi_ut_detect_hex_prefix(char **string);
0184 
0185 void acpi_ut_remove_hex_prefix(char **string);
0186 
0187 u8 acpi_ut_detect_octal_prefix(char **string);
0188 
0189 /*
0190  * utstrtoul64 - string-to-integer conversion functions
0191  */
0192 acpi_status acpi_ut_strtoul64(char *string, u64 *ret_integer);
0193 
0194 u64 acpi_ut_explicit_strtoul64(char *string);
0195 
0196 u64 acpi_ut_implicit_strtoul64(char *string);
0197 
0198 /*
0199  * utglobal - Global data structures and procedures
0200  */
0201 acpi_status acpi_ut_init_globals(void);
0202 
0203 const char *acpi_ut_get_mutex_name(u32 mutex_id);
0204 
0205 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
0206 
0207 const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type);
0208 #endif
0209 
0210 const char *acpi_ut_get_type_name(acpi_object_type type);
0211 
0212 const char *acpi_ut_get_node_name(void *object);
0213 
0214 const char *acpi_ut_get_descriptor_name(void *object);
0215 
0216 const char *acpi_ut_get_reference_name(union acpi_operand_object *object);
0217 
0218 const char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc);
0219 
0220 const char *acpi_ut_get_region_name(u8 space_id);
0221 
0222 const char *acpi_ut_get_event_name(u32 event_id);
0223 
0224 const char *acpi_ut_get_argument_type_name(u32 arg_type);
0225 
0226 char acpi_ut_hex_to_ascii_char(u64 integer, u32 position);
0227 
0228 acpi_status acpi_ut_ascii_to_hex_byte(char *two_ascii_chars, u8 *return_byte);
0229 
0230 u8 acpi_ut_ascii_char_to_hex(int hex_char);
0231 
0232 u8 acpi_ut_valid_object_type(acpi_object_type type);
0233 
0234 /*
0235  * utinit - miscellaneous initialization and shutdown
0236  */
0237 acpi_status acpi_ut_hardware_initialize(void);
0238 
0239 void acpi_ut_subsystem_shutdown(void);
0240 
0241 /*
0242  * utcopy - Object construction and conversion interfaces
0243  */
0244 acpi_status
0245 acpi_ut_build_simple_object(union acpi_operand_object *obj,
0246                 union acpi_object *user_obj,
0247                 u8 *data_space, u32 *buffer_space_used);
0248 
0249 acpi_status
0250 acpi_ut_build_package_object(union acpi_operand_object *obj,
0251                  u8 *buffer, u32 *space_used);
0252 
0253 acpi_status
0254 acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj,
0255                 struct acpi_buffer *ret_buffer);
0256 
0257 acpi_status
0258 acpi_ut_copy_eobject_to_iobject(union acpi_object *obj,
0259                 union acpi_operand_object **internal_obj);
0260 
0261 acpi_status
0262 acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj,
0263                 union acpi_operand_object *dest_obj);
0264 
0265 acpi_status
0266 acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc,
0267                 union acpi_operand_object **dest_desc,
0268                 struct acpi_walk_state *walk_state);
0269 
0270 /*
0271  * utcreate - Object creation
0272  */
0273 acpi_status
0274 acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action);
0275 
0276 /*
0277  * utdebug - Debug interfaces
0278  */
0279 void acpi_ut_init_stack_ptr_trace(void);
0280 
0281 void acpi_ut_track_stack_ptr(void);
0282 
0283 void
0284 acpi_ut_trace(u32 line_number,
0285           const char *function_name,
0286           const char *module_name, u32 component_id);
0287 
0288 void
0289 acpi_ut_trace_ptr(u32 line_number,
0290           const char *function_name,
0291           const char *module_name,
0292           u32 component_id, const void *pointer);
0293 
0294 void
0295 acpi_ut_trace_u32(u32 line_number,
0296           const char *function_name,
0297           const char *module_name, u32 component_id, u32 integer);
0298 
0299 void
0300 acpi_ut_trace_str(u32 line_number,
0301           const char *function_name,
0302           const char *module_name,
0303           u32 component_id, const char *string);
0304 
0305 void
0306 acpi_ut_exit(u32 line_number,
0307          const char *function_name,
0308          const char *module_name, u32 component_id);
0309 
0310 void
0311 acpi_ut_status_exit(u32 line_number,
0312             const char *function_name,
0313             const char *module_name,
0314             u32 component_id, acpi_status status);
0315 
0316 void
0317 acpi_ut_value_exit(u32 line_number,
0318            const char *function_name,
0319            const char *module_name, u32 component_id, u64 value);
0320 
0321 void
0322 acpi_ut_ptr_exit(u32 line_number,
0323          const char *function_name,
0324          const char *module_name, u32 component_id, u8 *ptr);
0325 
0326 void
0327 acpi_ut_str_exit(u32 line_number,
0328          const char *function_name,
0329          const char *module_name, u32 component_id, const char *string);
0330 
0331 void
0332 acpi_ut_debug_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id);
0333 
0334 void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 offset);
0335 
0336 #ifdef ACPI_APPLICATION
0337 void
0338 acpi_ut_dump_buffer_to_file(ACPI_FILE file,
0339                 u8 *buffer,
0340                 u32 count, u32 display, u32 base_offset);
0341 #endif
0342 
0343 void acpi_ut_report_error(char *module_name, u32 line_number);
0344 
0345 void acpi_ut_report_info(char *module_name, u32 line_number);
0346 
0347 void acpi_ut_report_warning(char *module_name, u32 line_number);
0348 
0349 /*
0350  * utdelete - Object deletion and reference counts
0351  */
0352 void acpi_ut_add_reference(union acpi_operand_object *object);
0353 
0354 void acpi_ut_remove_reference(union acpi_operand_object *object);
0355 
0356 void acpi_ut_delete_internal_package_object(union acpi_operand_object *object);
0357 
0358 void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object);
0359 
0360 void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list);
0361 
0362 /*
0363  * uteval - object evaluation
0364  */
0365 acpi_status
0366 acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node,
0367             const char *path,
0368             u32 expected_return_btypes,
0369             union acpi_operand_object **return_desc);
0370 
0371 acpi_status
0372 acpi_ut_evaluate_numeric_object(const char *object_name,
0373                 struct acpi_namespace_node *device_node,
0374                 u64 *value);
0375 
0376 acpi_status
0377 acpi_ut_execute_STA(struct acpi_namespace_node *device_node, u32 *status_flags);
0378 
0379 acpi_status
0380 acpi_ut_execute_power_methods(struct acpi_namespace_node *device_node,
0381                   const char **method_names,
0382                   u8 method_count, u8 *out_values);
0383 
0384 /*
0385  * utids - device ID support
0386  */
0387 acpi_status
0388 acpi_ut_execute_HID(struct acpi_namespace_node *device_node,
0389             struct acpi_pnp_device_id ** return_id);
0390 
0391 acpi_status
0392 acpi_ut_execute_UID(struct acpi_namespace_node *device_node,
0393             struct acpi_pnp_device_id ** return_id);
0394 
0395 acpi_status
0396 acpi_ut_execute_CID(struct acpi_namespace_node *device_node,
0397             struct acpi_pnp_device_id_list ** return_cid_list);
0398 
0399 acpi_status
0400 acpi_ut_execute_CLS(struct acpi_namespace_node *device_node,
0401             struct acpi_pnp_device_id **return_id);
0402 
0403 /*
0404  * utlock - reader/writer locks
0405  */
0406 acpi_status acpi_ut_create_rw_lock(struct acpi_rw_lock *lock);
0407 
0408 void acpi_ut_delete_rw_lock(struct acpi_rw_lock *lock);
0409 
0410 acpi_status acpi_ut_acquire_read_lock(struct acpi_rw_lock *lock);
0411 
0412 acpi_status acpi_ut_release_read_lock(struct acpi_rw_lock *lock);
0413 
0414 acpi_status acpi_ut_acquire_write_lock(struct acpi_rw_lock *lock);
0415 
0416 void acpi_ut_release_write_lock(struct acpi_rw_lock *lock);
0417 
0418 /*
0419  * utobject - internal object create/delete/cache routines
0420  */
0421 union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char
0422                                   *module_name,
0423                                   u32 line_number,
0424                                   u32 component_id,
0425                                   acpi_object_type
0426                                   type);
0427 
0428 void *acpi_ut_allocate_object_desc_dbg(const char *module_name,
0429                        u32 line_number, u32 component_id);
0430 
0431 #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t)
0432 #define acpi_ut_allocate_object_desc()  acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT)
0433 
0434 void acpi_ut_delete_object_desc(union acpi_operand_object *object);
0435 
0436 u8 acpi_ut_valid_internal_object(void *object);
0437 
0438 union acpi_operand_object *acpi_ut_create_package_object(u32 count);
0439 
0440 union acpi_operand_object *acpi_ut_create_integer_object(u64 value);
0441 
0442 union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);
0443 
0444 union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
0445 
0446 acpi_status
0447 acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size *obj_length);
0448 
0449 /*
0450  * utosi - Support for the _OSI predefined control method
0451  */
0452 acpi_status acpi_ut_initialize_interfaces(void);
0453 
0454 acpi_status acpi_ut_interface_terminate(void);
0455 
0456 acpi_status acpi_ut_install_interface(acpi_string interface_name);
0457 
0458 acpi_status acpi_ut_remove_interface(acpi_string interface_name);
0459 
0460 acpi_status acpi_ut_update_interfaces(u8 action);
0461 
0462 struct acpi_interface_info *acpi_ut_get_interface(acpi_string interface_name);
0463 
0464 acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state);
0465 
0466 /*
0467  * utpredef - support for predefined names
0468  */
0469 const union acpi_predefined_info *acpi_ut_get_next_predefined_method(const union
0470                                      acpi_predefined_info
0471                                      *this_name);
0472 
0473 const union acpi_predefined_info *acpi_ut_match_predefined_method(char *name);
0474 
0475 void acpi_ut_get_expected_return_types(char *buffer, u32 expected_btypes);
0476 
0477 #if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP)
0478 const union acpi_predefined_info *acpi_ut_match_resource_name(char *name);
0479 
0480 void
0481 acpi_ut_display_predefined_method(char *buffer,
0482                   const union acpi_predefined_info *this_name,
0483                   u8 multi_line);
0484 
0485 u32 acpi_ut_get_resource_bit_width(char *buffer, u16 types);
0486 #endif
0487 
0488 /*
0489  * utstate - Generic state creation/cache routines
0490  */
0491 void
0492 acpi_ut_push_generic_state(union acpi_generic_state **list_head,
0493                union acpi_generic_state *state);
0494 
0495 union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state
0496                             **list_head);
0497 
0498 union acpi_generic_state *acpi_ut_create_generic_state(void);
0499 
0500 struct acpi_thread_state *acpi_ut_create_thread_state(void);
0501 
0502 union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object
0503                               *object, u16 action);
0504 
0505 union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object,
0506                            void *external_object,
0507                            u32 index);
0508 
0509 acpi_status
0510 acpi_ut_create_update_state_and_push(union acpi_operand_object *object,
0511                      u16 action,
0512                      union acpi_generic_state **state_list);
0513 
0514 union acpi_generic_state *acpi_ut_create_control_state(void);
0515 
0516 void acpi_ut_delete_generic_state(union acpi_generic_state *state);
0517 
0518 /*
0519  * utmath
0520  */
0521 acpi_status
0522 acpi_ut_divide(u64 in_dividend,
0523            u64 in_divisor, u64 *out_quotient, u64 *out_remainder);
0524 
0525 acpi_status
0526 acpi_ut_short_divide(u64 in_dividend,
0527              u32 divisor, u64 *out_quotient, u32 *out_remainder);
0528 
0529 acpi_status
0530 acpi_ut_short_multiply(u64 in_multiplicand, u32 multiplier, u64 *outproduct);
0531 
0532 acpi_status acpi_ut_short_shift_left(u64 operand, u32 count, u64 *out_result);
0533 
0534 acpi_status acpi_ut_short_shift_right(u64 operand, u32 count, u64 *out_result);
0535 
0536 /*
0537  * utmisc
0538  */
0539 const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
0540                                  status);
0541 
0542 u8 acpi_ut_is_pci_root_bridge(char *id);
0543 
0544 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
0545 u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
0546 #endif
0547 
0548 acpi_status
0549 acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
0550               void *target_object,
0551               acpi_pkg_callback walk_callback, void *context);
0552 
0553 /* Values for Base above (16=Hex, 10=Decimal) */
0554 
0555 #define ACPI_ANY_BASE        0
0556 
0557 u32 acpi_ut_dword_byte_swap(u32 value);
0558 
0559 void acpi_ut_set_integer_width(u8 revision);
0560 
0561 #ifdef ACPI_DEBUG_OUTPUT
0562 void
0563 acpi_ut_display_init_pathname(u8 type,
0564                   struct acpi_namespace_node *obj_handle,
0565                   const char *path);
0566 #endif
0567 
0568 /*
0569  * utownerid - Support for Table/Method Owner IDs
0570  */
0571 acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id);
0572 
0573 void acpi_ut_release_owner_id(acpi_owner_id *owner_id);
0574 
0575 /*
0576  * utresrc
0577  */
0578 acpi_status
0579 acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
0580                u8 *aml,
0581                acpi_size aml_length,
0582                acpi_walk_aml_callback user_function,
0583                void **context);
0584 
0585 acpi_status
0586 acpi_ut_validate_resource(struct acpi_walk_state *walk_state,
0587               void *aml, u8 *return_index);
0588 
0589 u32 acpi_ut_get_descriptor_length(void *aml);
0590 
0591 u16 acpi_ut_get_resource_length(void *aml);
0592 
0593 u8 acpi_ut_get_resource_header_length(void *aml);
0594 
0595 u8 acpi_ut_get_resource_type(void *aml);
0596 
0597 acpi_status
0598 acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag);
0599 
0600 /*
0601  * utstring - String and character utilities
0602  */
0603 void acpi_ut_print_string(char *string, u16 max_length);
0604 
0605 #if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
0606 void ut_convert_backslashes(char *pathname);
0607 #endif
0608 
0609 void acpi_ut_repair_name(char *name);
0610 
0611 #if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) || defined (ACPI_DEBUG_OUTPUT)
0612 u8 acpi_ut_safe_strcpy(char *dest, acpi_size dest_size, char *source);
0613 
0614 void acpi_ut_safe_strncpy(char *dest, char *source, acpi_size dest_size);
0615 
0616 u8 acpi_ut_safe_strcat(char *dest, acpi_size dest_size, char *source);
0617 
0618 u8
0619 acpi_ut_safe_strncat(char *dest,
0620              acpi_size dest_size,
0621              char *source, acpi_size max_transfer_length);
0622 #endif
0623 
0624 /*
0625  * utmutex - mutex support
0626  */
0627 acpi_status acpi_ut_mutex_initialize(void);
0628 
0629 void acpi_ut_mutex_terminate(void);
0630 
0631 acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id);
0632 
0633 acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id);
0634 
0635 /*
0636  * utalloc - memory allocation and object caching
0637  */
0638 acpi_status acpi_ut_create_caches(void);
0639 
0640 acpi_status acpi_ut_delete_caches(void);
0641 
0642 acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer);
0643 
0644 acpi_status
0645 acpi_ut_initialize_buffer(struct acpi_buffer *buffer,
0646               acpi_size required_length);
0647 
0648 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
0649 void *acpi_ut_allocate_and_track(acpi_size size,
0650                  u32 component, const char *module, u32 line);
0651 
0652 void *acpi_ut_allocate_zeroed_and_track(acpi_size size,
0653                     u32 component,
0654                     const char *module, u32 line);
0655 
0656 void
0657 acpi_ut_free_and_track(void *address,
0658                u32 component, const char *module, u32 line);
0659 
0660 void acpi_ut_dump_allocation_info(void);
0661 
0662 void acpi_ut_dump_allocations(u32 component, const char *module);
0663 
0664 acpi_status
0665 acpi_ut_create_list(const char *list_name,
0666             u16 object_size, struct acpi_memory_list **return_cache);
0667 
0668 #endif              /* ACPI_DBG_TRACK_ALLOCATIONS */
0669 
0670 /*
0671  * utaddress - address range check
0672  */
0673 acpi_status
0674 acpi_ut_add_address_range(acpi_adr_space_type space_id,
0675               acpi_physical_address address,
0676               u32 length, struct acpi_namespace_node *region_node);
0677 
0678 void
0679 acpi_ut_remove_address_range(acpi_adr_space_type space_id,
0680                  struct acpi_namespace_node *region_node);
0681 
0682 u32
0683 acpi_ut_check_address_range(acpi_adr_space_type space_id,
0684                 acpi_physical_address address, u32 length, u8 warn);
0685 
0686 void acpi_ut_delete_address_lists(void);
0687 
0688 /*
0689  * utxferror - various error/warning output functions
0690  */
0691 ACPI_PRINTF_LIKE(5)
0692 void ACPI_INTERNAL_VAR_XFACE
0693 acpi_ut_predefined_warning(const char *module_name,
0694                u32 line_number,
0695                char *pathname,
0696                u16 node_flags, const char *format, ...);
0697 
0698 ACPI_PRINTF_LIKE(5)
0699 void ACPI_INTERNAL_VAR_XFACE
0700 acpi_ut_predefined_info(const char *module_name,
0701             u32 line_number,
0702             char *pathname,
0703             u16 node_flags, const char *format, ...);
0704 
0705 ACPI_PRINTF_LIKE(5)
0706 void ACPI_INTERNAL_VAR_XFACE
0707 acpi_ut_predefined_bios_error(const char *module_name,
0708                   u32 line_number,
0709                   char *pathname,
0710                   u16 node_flags, const char *format, ...);
0711 
0712 void
0713 acpi_ut_prefixed_namespace_error(const char *module_name,
0714                  u32 line_number,
0715                  union acpi_generic_state *prefix_scope,
0716                  const char *internal_name,
0717                  acpi_status lookup_status);
0718 
0719 void
0720 acpi_ut_method_error(const char *module_name,
0721              u32 line_number,
0722              const char *message,
0723              struct acpi_namespace_node *node,
0724              const char *path, acpi_status lookup_status);
0725 
0726 /*
0727  * Utility functions for ACPI names and IDs
0728  */
0729 const struct ah_predefined_name *acpi_ah_match_predefined_name(char *nameseg);
0730 
0731 const struct ah_device_id *acpi_ah_match_hardware_id(char *hid);
0732 
0733 const char *acpi_ah_match_uuid(u8 *data);
0734 
0735 /*
0736  * utuuid -- UUID support functions
0737  */
0738 #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
0739 void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer);
0740 
0741 acpi_status acpi_ut_convert_uuid_to_string(char *uuid_buffer, char *out_string);
0742 #endif
0743 
0744 #endif              /* _ACUTILS_H */