diff options
Diffstat (limited to 'include/acpi/acutils.h')
| -rw-r--r-- | include/acpi/acutils.h | 718 |
1 files changed, 229 insertions, 489 deletions
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 192d0bea3884..c1086452696e 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
| @@ -44,20 +44,17 @@ | |||
| 44 | #ifndef _ACUTILS_H | 44 | #ifndef _ACUTILS_H |
| 45 | #define _ACUTILS_H | 45 | #define _ACUTILS_H |
| 46 | 46 | ||
| 47 | |||
| 48 | typedef | 47 | typedef |
| 49 | acpi_status (*acpi_pkg_callback) ( | 48 | acpi_status(*acpi_pkg_callback) (u8 object_type, |
| 50 | u8 object_type, | 49 | union acpi_operand_object * source_object, |
| 51 | union acpi_operand_object *source_object, | 50 | union acpi_generic_state * state, |
| 52 | union acpi_generic_state *state, | 51 | void *context); |
| 53 | void *context); | 52 | |
| 54 | 53 | struct acpi_pkg_info { | |
| 55 | struct acpi_pkg_info | 54 | u8 *free_space; |
| 56 | { | 55 | acpi_size length; |
| 57 | u8 *free_space; | 56 | u32 object_space; |
| 58 | acpi_size length; | 57 | u32 num_packages; |
| 59 | u32 object_space; | ||
| 60 | u32 num_packages; | ||
| 61 | }; | 58 | }; |
| 62 | 59 | ||
| 63 | #define REF_INCREMENT (u16) 0 | 60 | #define REF_INCREMENT (u16) 0 |
| @@ -71,167 +68,89 @@ struct acpi_pkg_info | |||
| 71 | #define DB_DWORD_DISPLAY 4 | 68 | #define DB_DWORD_DISPLAY 4 |
| 72 | #define DB_QWORD_DISPLAY 8 | 69 | #define DB_QWORD_DISPLAY 8 |
| 73 | 70 | ||
| 74 | |||
| 75 | /* | 71 | /* |
| 76 | * utglobal - Global data structures and procedures | 72 | * utglobal - Global data structures and procedures |
| 77 | */ | 73 | */ |
| 78 | void | 74 | void acpi_ut_init_globals(void); |
| 79 | acpi_ut_init_globals ( | ||
| 80 | void); | ||
| 81 | 75 | ||
| 82 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 76 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
| 83 | 77 | ||
| 84 | char * | 78 | char *acpi_ut_get_mutex_name(u32 mutex_id); |
| 85 | acpi_ut_get_mutex_name ( | ||
| 86 | u32 mutex_id); | ||
| 87 | 79 | ||
| 88 | #endif | 80 | #endif |
| 89 | 81 | ||
| 90 | char * | 82 | char *acpi_ut_get_type_name(acpi_object_type type); |
| 91 | acpi_ut_get_type_name ( | ||
| 92 | acpi_object_type type); | ||
| 93 | |||
| 94 | char * | ||
| 95 | acpi_ut_get_node_name ( | ||
| 96 | void *object); | ||
| 97 | |||
| 98 | char * | ||
| 99 | acpi_ut_get_descriptor_name ( | ||
| 100 | void *object); | ||
| 101 | 83 | ||
| 102 | char * | 84 | char *acpi_ut_get_node_name(void *object); |
| 103 | acpi_ut_get_object_type_name ( | ||
| 104 | union acpi_operand_object *obj_desc); | ||
| 105 | 85 | ||
| 106 | char * | 86 | char *acpi_ut_get_descriptor_name(void *object); |
| 107 | acpi_ut_get_region_name ( | ||
| 108 | u8 space_id); | ||
| 109 | 87 | ||
| 110 | char * | 88 | char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc); |
| 111 | acpi_ut_get_event_name ( | ||
| 112 | u32 event_id); | ||
| 113 | 89 | ||
| 114 | char | 90 | char *acpi_ut_get_region_name(u8 space_id); |
| 115 | acpi_ut_hex_to_ascii_char ( | ||
| 116 | acpi_integer integer, | ||
| 117 | u32 position); | ||
| 118 | 91 | ||
| 119 | u8 | 92 | char *acpi_ut_get_event_name(u32 event_id); |
| 120 | acpi_ut_valid_object_type ( | ||
| 121 | acpi_object_type type); | ||
| 122 | 93 | ||
| 123 | acpi_owner_id | 94 | char acpi_ut_hex_to_ascii_char(acpi_integer integer, u32 position); |
| 124 | acpi_ut_allocate_owner_id ( | ||
| 125 | u32 id_type); | ||
| 126 | 95 | ||
| 96 | u8 acpi_ut_valid_object_type(acpi_object_type type); | ||
| 127 | 97 | ||
| 128 | /* | 98 | /* |
| 129 | * utinit - miscellaneous initialization and shutdown | 99 | * utinit - miscellaneous initialization and shutdown |
| 130 | */ | 100 | */ |
| 131 | acpi_status | 101 | acpi_status acpi_ut_hardware_initialize(void); |
| 132 | acpi_ut_hardware_initialize ( | ||
| 133 | void); | ||
| 134 | 102 | ||
| 135 | void | 103 | void acpi_ut_subsystem_shutdown(void); |
| 136 | acpi_ut_subsystem_shutdown ( | ||
| 137 | void); | ||
| 138 | |||
| 139 | acpi_status | ||
| 140 | acpi_ut_validate_fadt ( | ||
| 141 | void); | ||
| 142 | 104 | ||
| 105 | acpi_status acpi_ut_validate_fadt(void); | ||
| 143 | 106 | ||
| 144 | /* | 107 | /* |
| 145 | * utclib - Local implementations of C library functions | 108 | * utclib - Local implementations of C library functions |
| 146 | */ | 109 | */ |
| 147 | #ifndef ACPI_USE_SYSTEM_CLIBRARY | 110 | #ifndef ACPI_USE_SYSTEM_CLIBRARY |
| 148 | 111 | ||
| 149 | acpi_size | 112 | acpi_size acpi_ut_strlen(const char *string); |
| 150 | acpi_ut_strlen ( | 113 | |
| 151 | const char *string); | 114 | char *acpi_ut_strcpy(char *dst_string, const char *src_string); |
| 152 | 115 | ||
| 153 | char * | 116 | char *acpi_ut_strncpy(char *dst_string, |
| 154 | acpi_ut_strcpy ( | 117 | const char *src_string, acpi_size count); |
| 155 | char *dst_string, | 118 | |
| 156 | const char *src_string); | 119 | int acpi_ut_memcmp(const char *buffer1, const char *buffer2, acpi_size count); |
| 157 | 120 | ||
| 158 | char * | 121 | int acpi_ut_strncmp(const char *string1, const char *string2, acpi_size count); |
| 159 | acpi_ut_strncpy ( | 122 | |
| 160 | char *dst_string, | 123 | int acpi_ut_strcmp(const char *string1, const char *string2); |
| 161 | const char *src_string, | 124 | |
| 162 | acpi_size count); | 125 | char *acpi_ut_strcat(char *dst_string, const char *src_string); |
| 163 | 126 | ||
| 164 | int | 127 | char *acpi_ut_strncat(char *dst_string, |
| 165 | acpi_ut_memcmp ( | 128 | const char *src_string, acpi_size count); |
| 166 | const char *buffer1, | 129 | |
| 167 | const char *buffer2, | 130 | u32 acpi_ut_strtoul(const char *string, char **terminator, u32 base); |
| 168 | acpi_size count); | 131 | |
| 169 | 132 | char *acpi_ut_strstr(char *string1, char *string2); | |
| 170 | int | 133 | |
| 171 | acpi_ut_strncmp ( | 134 | void *acpi_ut_memcpy(void *dest, const void *src, acpi_size count); |
| 172 | const char *string1, | 135 | |
| 173 | const char *string2, | 136 | void *acpi_ut_memset(void *dest, acpi_native_uint value, acpi_size count); |
| 174 | acpi_size count); | 137 | |
| 175 | 138 | int acpi_ut_to_upper(int c); | |
| 176 | int | 139 | |
| 177 | acpi_ut_strcmp ( | 140 | int acpi_ut_to_lower(int c); |
| 178 | const char *string1, | ||
| 179 | const char *string2); | ||
| 180 | |||
| 181 | char * | ||
| 182 | acpi_ut_strcat ( | ||
| 183 | char *dst_string, | ||
| 184 | const char *src_string); | ||
| 185 | |||
| 186 | char * | ||
| 187 | acpi_ut_strncat ( | ||
| 188 | char *dst_string, | ||
| 189 | const char *src_string, | ||
| 190 | acpi_size count); | ||
| 191 | |||
| 192 | u32 | ||
| 193 | acpi_ut_strtoul ( | ||
| 194 | const char *string, | ||
| 195 | char **terminator, | ||
| 196 | u32 base); | ||
| 197 | |||
| 198 | char * | ||
| 199 | acpi_ut_strstr ( | ||
| 200 | char *string1, | ||
| 201 | char *string2); | ||
| 202 | |||
| 203 | void * | ||
| 204 | acpi_ut_memcpy ( | ||
| 205 | void *dest, | ||
| 206 | const void *src, | ||
| 207 | acpi_size count); | ||
| 208 | |||
| 209 | void * | ||
| 210 | acpi_ut_memset ( | ||
| 211 | void *dest, | ||
| 212 | acpi_native_uint value, | ||
| 213 | acpi_size count); | ||
| 214 | |||
| 215 | int | ||
| 216 | acpi_ut_to_upper ( | ||
| 217 | int c); | ||
| 218 | |||
| 219 | int | ||
| 220 | acpi_ut_to_lower ( | ||
| 221 | int c); | ||
| 222 | 141 | ||
| 223 | extern const u8 _acpi_ctype[]; | 142 | extern const u8 _acpi_ctype[]; |
| 224 | 143 | ||
| 225 | #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ | 144 | #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ |
| 226 | #define _ACPI_XS 0x40 /* extra space */ | 145 | #define _ACPI_XS 0x40 /* extra space */ |
| 227 | #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ | 146 | #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ |
| 228 | #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ | 147 | #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ |
| 229 | #define _ACPI_DI 0x04 /* '0'-'9' */ | 148 | #define _ACPI_DI 0x04 /* '0'-'9' */ |
| 230 | #define _ACPI_LO 0x02 /* 'a'-'z' */ | 149 | #define _ACPI_LO 0x02 /* 'a'-'z' */ |
| 231 | #define _ACPI_PU 0x10 /* punctuation */ | 150 | #define _ACPI_PU 0x10 /* punctuation */ |
| 232 | #define _ACPI_SP 0x08 /* space */ | 151 | #define _ACPI_SP 0x08 /* space */ |
| 233 | #define _ACPI_UP 0x01 /* 'A'-'Z' */ | 152 | #define _ACPI_UP 0x01 /* 'A'-'Z' */ |
| 234 | #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ | 153 | #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ |
| 235 | 154 | ||
| 236 | #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) | 155 | #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) |
| 237 | #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) | 156 | #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) |
| @@ -242,502 +161,323 @@ extern const u8 _acpi_ctype[]; | |||
| 242 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) | 161 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) |
| 243 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | 162 | #define ACPI_IS_ASCII(c) ((c) < 0x80) |
| 244 | 163 | ||
| 245 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 164 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
| 246 | |||
| 247 | 165 | ||
| 248 | /* | 166 | /* |
| 249 | * utcopy - Object construction and conversion interfaces | 167 | * utcopy - Object construction and conversion interfaces |
| 250 | */ | 168 | */ |
| 251 | acpi_status | 169 | acpi_status |
| 252 | acpi_ut_build_simple_object( | 170 | acpi_ut_build_simple_object(union acpi_operand_object *obj, |
| 253 | union acpi_operand_object *obj, | 171 | union acpi_object *user_obj, |
| 254 | union acpi_object *user_obj, | 172 | u8 * data_space, u32 * buffer_space_used); |
| 255 | u8 *data_space, | ||
| 256 | u32 *buffer_space_used); | ||
| 257 | 173 | ||
| 258 | acpi_status | 174 | acpi_status |
| 259 | acpi_ut_build_package_object ( | 175 | acpi_ut_build_package_object(union acpi_operand_object *obj, |
| 260 | union acpi_operand_object *obj, | 176 | u8 * buffer, u32 * space_used); |
| 261 | u8 *buffer, | ||
| 262 | u32 *space_used); | ||
| 263 | 177 | ||
| 264 | acpi_status | 178 | acpi_status |
| 265 | acpi_ut_copy_iobject_to_eobject ( | 179 | acpi_ut_copy_iobject_to_eobject(union acpi_operand_object *obj, |
| 266 | union acpi_operand_object *obj, | 180 | struct acpi_buffer *ret_buffer); |
| 267 | struct acpi_buffer *ret_buffer); | ||
| 268 | 181 | ||
| 269 | acpi_status | 182 | acpi_status |
| 270 | acpi_ut_copy_eobject_to_iobject ( | 183 | acpi_ut_copy_eobject_to_iobject(union acpi_object *obj, |
| 271 | union acpi_object *obj, | 184 | union acpi_operand_object **internal_obj); |
| 272 | union acpi_operand_object **internal_obj); | ||
| 273 | 185 | ||
| 274 | acpi_status | 186 | acpi_status |
| 275 | acpi_ut_copy_isimple_to_isimple ( | 187 | acpi_ut_copy_isimple_to_isimple(union acpi_operand_object *source_obj, |
| 276 | union acpi_operand_object *source_obj, | 188 | union acpi_operand_object *dest_obj); |
| 277 | union acpi_operand_object *dest_obj); | ||
| 278 | 189 | ||
| 279 | acpi_status | 190 | acpi_status |
| 280 | acpi_ut_copy_iobject_to_iobject ( | 191 | acpi_ut_copy_iobject_to_iobject(union acpi_operand_object *source_desc, |
| 281 | union acpi_operand_object *source_desc, | 192 | union acpi_operand_object **dest_desc, |
| 282 | union acpi_operand_object **dest_desc, | 193 | struct acpi_walk_state *walk_state); |
| 283 | struct acpi_walk_state *walk_state); | ||
| 284 | |||
| 285 | 194 | ||
| 286 | /* | 195 | /* |
| 287 | * utcreate - Object creation | 196 | * utcreate - Object creation |
| 288 | */ | 197 | */ |
| 289 | acpi_status | 198 | acpi_status |
| 290 | acpi_ut_update_object_reference ( | 199 | acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action); |
| 291 | union acpi_operand_object *object, | ||
| 292 | u16 action); | ||
| 293 | |||
| 294 | 200 | ||
| 295 | /* | 201 | /* |
| 296 | * utdebug - Debug interfaces | 202 | * utdebug - Debug interfaces |
| 297 | */ | 203 | */ |
| 298 | void | 204 | void acpi_ut_init_stack_ptr_trace(void); |
| 299 | acpi_ut_init_stack_ptr_trace ( | ||
| 300 | void); | ||
| 301 | 205 | ||
| 302 | void | 206 | void acpi_ut_track_stack_ptr(void); |
| 303 | acpi_ut_track_stack_ptr ( | ||
| 304 | void); | ||
| 305 | 207 | ||
| 306 | void | 208 | void |
| 307 | acpi_ut_trace ( | 209 | acpi_ut_trace(u32 line_number, |
| 308 | u32 line_number, | 210 | const char *function_name, char *module_name, u32 component_id); |
| 309 | struct acpi_debug_print_info *dbg_info); | ||
| 310 | 211 | ||
| 311 | void | 212 | void |
| 312 | acpi_ut_trace_ptr ( | 213 | acpi_ut_trace_ptr(u32 line_number, |
| 313 | u32 line_number, | 214 | const char *function_name, |
| 314 | struct acpi_debug_print_info *dbg_info, | 215 | char *module_name, u32 component_id, void *pointer); |
| 315 | void *pointer); | ||
| 316 | 216 | ||
| 317 | void | 217 | void |
| 318 | acpi_ut_trace_u32 ( | 218 | acpi_ut_trace_u32(u32 line_number, |
| 319 | u32 line_number, | 219 | const char *function_name, |
| 320 | struct acpi_debug_print_info *dbg_info, | 220 | char *module_name, u32 component_id, u32 integer); |
| 321 | u32 integer); | ||
| 322 | 221 | ||
| 323 | void | 222 | void |
| 324 | acpi_ut_trace_str ( | 223 | acpi_ut_trace_str(u32 line_number, |
| 325 | u32 line_number, | 224 | const char *function_name, |
| 326 | struct acpi_debug_print_info *dbg_info, | 225 | char *module_name, u32 component_id, char *string); |
| 327 | char *string); | ||
| 328 | 226 | ||
| 329 | void | 227 | void |
| 330 | acpi_ut_exit ( | 228 | acpi_ut_exit(u32 line_number, |
| 331 | u32 line_number, | 229 | const char *function_name, char *module_name, u32 component_id); |
| 332 | struct acpi_debug_print_info *dbg_info); | ||
| 333 | 230 | ||
| 334 | void | 231 | void |
| 335 | acpi_ut_status_exit ( | 232 | acpi_ut_status_exit(u32 line_number, |
| 336 | u32 line_number, | 233 | const char *function_name, |
| 337 | struct acpi_debug_print_info *dbg_info, | 234 | char *module_name, u32 component_id, acpi_status status); |
| 338 | acpi_status status); | ||
| 339 | 235 | ||
| 340 | void | 236 | void |
| 341 | acpi_ut_value_exit ( | 237 | acpi_ut_value_exit(u32 line_number, |
| 342 | u32 line_number, | 238 | const char *function_name, |
| 343 | struct acpi_debug_print_info *dbg_info, | 239 | char *module_name, u32 component_id, acpi_integer value); |
| 344 | acpi_integer value); | ||
| 345 | 240 | ||
| 346 | void | 241 | void |
| 347 | acpi_ut_ptr_exit ( | 242 | acpi_ut_ptr_exit(u32 line_number, |
| 348 | u32 line_number, | 243 | const char *function_name, |
| 349 | struct acpi_debug_print_info *dbg_info, | 244 | char *module_name, u32 component_id, u8 * ptr); |
| 350 | u8 *ptr); | ||
| 351 | 245 | ||
| 352 | void | 246 | void acpi_ut_report_info(char *module_name, u32 line_number, u32 component_id); |
| 353 | acpi_ut_report_info ( | ||
| 354 | char *module_name, | ||
| 355 | u32 line_number, | ||
| 356 | u32 component_id); | ||
| 357 | 247 | ||
| 358 | void | 248 | void acpi_ut_report_error(char *module_name, u32 line_number, u32 component_id); |
| 359 | acpi_ut_report_error ( | ||
| 360 | char *module_name, | ||
| 361 | u32 line_number, | ||
| 362 | u32 component_id); | ||
| 363 | 249 | ||
| 364 | void | 250 | void |
| 365 | acpi_ut_report_warning ( | 251 | acpi_ut_report_warning(char *module_name, u32 line_number, u32 component_id); |
| 366 | char *module_name, | ||
| 367 | u32 line_number, | ||
| 368 | u32 component_id); | ||
| 369 | 252 | ||
| 370 | void | 253 | void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); |
| 371 | acpi_ut_dump_buffer ( | ||
| 372 | u8 *buffer, | ||
| 373 | u32 count, | ||
| 374 | u32 display, | ||
| 375 | u32 component_id); | ||
| 376 | 254 | ||
| 377 | void ACPI_INTERNAL_VAR_XFACE | 255 | void ACPI_INTERNAL_VAR_XFACE |
| 378 | acpi_ut_debug_print ( | 256 | acpi_ut_debug_print(u32 requested_debug_level, |
| 379 | u32 requested_debug_level, | 257 | u32 line_number, |
| 380 | u32 line_number, | 258 | const char *function_name, |
| 381 | struct acpi_debug_print_info *dbg_info, | 259 | char *module_name, |
| 382 | char *format, | 260 | u32 component_id, char *format, ...) ACPI_PRINTF_LIKE_FUNC; |
| 383 | ...) ACPI_PRINTF_LIKE_FUNC; | ||
| 384 | 261 | ||
| 385 | void ACPI_INTERNAL_VAR_XFACE | 262 | void ACPI_INTERNAL_VAR_XFACE |
| 386 | acpi_ut_debug_print_raw ( | 263 | acpi_ut_debug_print_raw(u32 requested_debug_level, |
| 387 | u32 requested_debug_level, | 264 | u32 line_number, |
| 388 | u32 line_number, | 265 | const char *function_name, |
| 389 | struct acpi_debug_print_info *dbg_info, | 266 | char *module_name, |
| 390 | char *format, | 267 | u32 component_id, |
| 391 | ...) ACPI_PRINTF_LIKE_FUNC; | 268 | char *format, ...) ACPI_PRINTF_LIKE_FUNC; |
| 392 | |||
| 393 | 269 | ||
| 394 | /* | 270 | /* |
| 395 | * utdelete - Object deletion and reference counts | 271 | * utdelete - Object deletion and reference counts |
| 396 | */ | 272 | */ |
| 397 | void | 273 | void acpi_ut_add_reference(union acpi_operand_object *object); |
| 398 | acpi_ut_add_reference ( | ||
| 399 | union acpi_operand_object *object); | ||
| 400 | 274 | ||
| 401 | void | 275 | void acpi_ut_remove_reference(union acpi_operand_object *object); |
| 402 | acpi_ut_remove_reference ( | ||
| 403 | union acpi_operand_object *object); | ||
| 404 | 276 | ||
| 405 | void | 277 | void acpi_ut_delete_internal_package_object(union acpi_operand_object *object); |
| 406 | acpi_ut_delete_internal_package_object ( | ||
| 407 | union acpi_operand_object *object); | ||
| 408 | 278 | ||
| 409 | void | 279 | void acpi_ut_delete_internal_simple_object(union acpi_operand_object *object); |
| 410 | acpi_ut_delete_internal_simple_object ( | ||
| 411 | union acpi_operand_object *object); | ||
| 412 | |||
| 413 | void | ||
| 414 | acpi_ut_delete_internal_object_list ( | ||
| 415 | union acpi_operand_object **obj_list); | ||
| 416 | 280 | ||
| 281 | void acpi_ut_delete_internal_object_list(union acpi_operand_object **obj_list); | ||
| 417 | 282 | ||
| 418 | /* | 283 | /* |
| 419 | * uteval - object evaluation | 284 | * uteval - object evaluation |
| 420 | */ | 285 | */ |
| 421 | acpi_status | 286 | acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state); |
| 422 | acpi_ut_osi_implementation ( | ||
| 423 | struct acpi_walk_state *walk_state); | ||
| 424 | 287 | ||
| 425 | acpi_status | 288 | acpi_status |
| 426 | acpi_ut_evaluate_object ( | 289 | acpi_ut_evaluate_object(struct acpi_namespace_node *prefix_node, |
| 427 | struct acpi_namespace_node *prefix_node, | 290 | char *path, |
| 428 | char *path, | 291 | u32 expected_return_btypes, |
| 429 | u32 expected_return_btypes, | 292 | union acpi_operand_object **return_desc); |
| 430 | union acpi_operand_object **return_desc); | ||
| 431 | 293 | ||
| 432 | acpi_status | 294 | acpi_status |
| 433 | acpi_ut_evaluate_numeric_object ( | 295 | acpi_ut_evaluate_numeric_object(char *object_name, |
| 434 | char *object_name, | 296 | struct acpi_namespace_node *device_node, |
| 435 | struct acpi_namespace_node *device_node, | 297 | acpi_integer * address); |
| 436 | acpi_integer *address); | ||
| 437 | 298 | ||
| 438 | acpi_status | 299 | acpi_status |
| 439 | acpi_ut_execute_HID ( | 300 | acpi_ut_execute_HID(struct acpi_namespace_node *device_node, |
| 440 | struct acpi_namespace_node *device_node, | 301 | struct acpi_device_id *hid); |
| 441 | struct acpi_device_id *hid); | ||
| 442 | 302 | ||
| 443 | acpi_status | 303 | acpi_status |
| 444 | acpi_ut_execute_CID ( | 304 | acpi_ut_execute_CID(struct acpi_namespace_node *device_node, |
| 445 | struct acpi_namespace_node *device_node, | 305 | struct acpi_compatible_id_list **return_cid_list); |
| 446 | struct acpi_compatible_id_list **return_cid_list); | ||
| 447 | 306 | ||
| 448 | acpi_status | 307 | acpi_status |
| 449 | acpi_ut_execute_STA ( | 308 | acpi_ut_execute_STA(struct acpi_namespace_node *device_node, |
| 450 | struct acpi_namespace_node *device_node, | 309 | u32 * status_flags); |
| 451 | u32 *status_flags); | ||
| 452 | 310 | ||
| 453 | acpi_status | 311 | acpi_status |
| 454 | acpi_ut_execute_UID ( | 312 | acpi_ut_execute_UID(struct acpi_namespace_node *device_node, |
| 455 | struct acpi_namespace_node *device_node, | 313 | struct acpi_device_id *uid); |
| 456 | struct acpi_device_id *uid); | ||
| 457 | 314 | ||
| 458 | acpi_status | 315 | acpi_status |
| 459 | acpi_ut_execute_sxds ( | 316 | acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest); |
| 460 | struct acpi_namespace_node *device_node, | ||
| 461 | u8 *highest); | ||
| 462 | |||
| 463 | 317 | ||
| 464 | /* | 318 | /* |
| 465 | * utobject - internal object create/delete/cache routines | 319 | * utobject - internal object create/delete/cache routines |
| 466 | */ | 320 | */ |
| 467 | union acpi_operand_object * | 321 | union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, |
| 468 | acpi_ut_create_internal_object_dbg ( | 322 | u32 line_number, |
| 469 | char *module_name, | 323 | u32 component_id, |
| 470 | u32 line_number, | 324 | acpi_object_type |
| 471 | u32 component_id, | 325 | type); |
| 472 | acpi_object_type type); | ||
| 473 | |||
| 474 | void * | ||
| 475 | acpi_ut_allocate_object_desc_dbg ( | ||
| 476 | char *module_name, | ||
| 477 | u32 line_number, | ||
| 478 | u32 component_id); | ||
| 479 | |||
| 480 | #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t) | ||
| 481 | #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT) | ||
| 482 | 326 | ||
| 483 | void | 327 | void *acpi_ut_allocate_object_desc_dbg(char *module_name, |
| 484 | acpi_ut_delete_object_desc ( | 328 | u32 line_number, u32 component_id); |
| 485 | union acpi_operand_object *object); | ||
| 486 | 329 | ||
| 487 | u8 | 330 | #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) |
| 488 | acpi_ut_valid_internal_object ( | 331 | #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) |
| 489 | void *object); | ||
| 490 | 332 | ||
| 491 | union acpi_operand_object * | 333 | void acpi_ut_delete_object_desc(union acpi_operand_object *object); |
| 492 | acpi_ut_create_buffer_object ( | ||
| 493 | acpi_size buffer_size); | ||
| 494 | 334 | ||
| 495 | union acpi_operand_object * | 335 | u8 acpi_ut_valid_internal_object(void *object); |
| 496 | acpi_ut_create_string_object ( | ||
| 497 | acpi_size string_size); | ||
| 498 | 336 | ||
| 499 | acpi_status | 337 | union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); |
| 500 | acpi_ut_get_object_size( | ||
| 501 | union acpi_operand_object *obj, | ||
| 502 | acpi_size *obj_length); | ||
| 503 | 338 | ||
| 339 | union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); | ||
| 340 | |||
| 341 | acpi_status | ||
| 342 | acpi_ut_get_object_size(union acpi_operand_object *obj, acpi_size * obj_length); | ||
| 504 | 343 | ||
| 505 | /* | 344 | /* |
| 506 | * utstate - Generic state creation/cache routines | 345 | * utstate - Generic state creation/cache routines |
| 507 | */ | 346 | */ |
| 508 | void | 347 | void |
| 509 | acpi_ut_push_generic_state ( | 348 | acpi_ut_push_generic_state(union acpi_generic_state **list_head, |
| 510 | union acpi_generic_state **list_head, | 349 | union acpi_generic_state *state); |
| 511 | union acpi_generic_state *state); | ||
| 512 | 350 | ||
| 513 | union acpi_generic_state * | 351 | union acpi_generic_state *acpi_ut_pop_generic_state(union acpi_generic_state |
| 514 | acpi_ut_pop_generic_state ( | 352 | **list_head); |
| 515 | union acpi_generic_state **list_head); | ||
| 516 | 353 | ||
| 354 | union acpi_generic_state *acpi_ut_create_generic_state(void); | ||
| 517 | 355 | ||
| 518 | union acpi_generic_state * | 356 | struct acpi_thread_state *acpi_ut_create_thread_state(void); |
| 519 | acpi_ut_create_generic_state ( | ||
| 520 | void); | ||
| 521 | 357 | ||
| 522 | struct acpi_thread_state * | 358 | union acpi_generic_state *acpi_ut_create_update_state(union acpi_operand_object |
| 523 | acpi_ut_create_thread_state ( | 359 | *object, u16 action); |
| 524 | void); | ||
| 525 | 360 | ||
| 526 | union acpi_generic_state * | 361 | union acpi_generic_state *acpi_ut_create_pkg_state(void *internal_object, |
| 527 | acpi_ut_create_update_state ( | 362 | void *external_object, |
| 528 | union acpi_operand_object *object, | 363 | u16 index); |
| 529 | u16 action); | ||
| 530 | |||
| 531 | union acpi_generic_state * | ||
| 532 | acpi_ut_create_pkg_state ( | ||
| 533 | void *internal_object, | ||
| 534 | void *external_object, | ||
| 535 | u16 index); | ||
| 536 | 364 | ||
| 537 | acpi_status | 365 | acpi_status |
| 538 | acpi_ut_create_update_state_and_push ( | 366 | acpi_ut_create_update_state_and_push(union acpi_operand_object *object, |
| 539 | union acpi_operand_object *object, | 367 | u16 action, |
| 540 | u16 action, | 368 | union acpi_generic_state **state_list); |
| 541 | union acpi_generic_state **state_list); | ||
| 542 | 369 | ||
| 543 | #ifdef ACPI_FUTURE_USAGE | 370 | #ifdef ACPI_FUTURE_USAGE |
| 544 | acpi_status | 371 | acpi_status |
| 545 | acpi_ut_create_pkg_state_and_push ( | 372 | acpi_ut_create_pkg_state_and_push(void *internal_object, |
| 546 | void *internal_object, | 373 | void *external_object, |
| 547 | void *external_object, | 374 | u16 index, |
| 548 | u16 index, | 375 | union acpi_generic_state **state_list); |
| 549 | union acpi_generic_state **state_list); | 376 | #endif /* ACPI_FUTURE_USAGE */ |
| 550 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 551 | 377 | ||
| 552 | union acpi_generic_state * | 378 | union acpi_generic_state *acpi_ut_create_control_state(void); |
| 553 | acpi_ut_create_control_state ( | ||
| 554 | void); | ||
| 555 | |||
| 556 | void | ||
| 557 | acpi_ut_delete_generic_state ( | ||
| 558 | union acpi_generic_state *state); | ||
| 559 | |||
| 560 | #ifdef ACPI_ENABLE_OBJECT_CACHE | ||
| 561 | void | ||
| 562 | acpi_ut_delete_generic_state_cache ( | ||
| 563 | void); | ||
| 564 | |||
| 565 | void | ||
| 566 | acpi_ut_delete_object_cache ( | ||
| 567 | void); | ||
| 568 | #endif | ||
| 569 | 379 | ||
| 380 | void acpi_ut_delete_generic_state(union acpi_generic_state *state); | ||
| 570 | 381 | ||
| 571 | /* | 382 | /* |
| 572 | * utmath | 383 | * utmath |
| 573 | */ | 384 | */ |
| 574 | acpi_status | 385 | acpi_status |
| 575 | acpi_ut_divide ( | 386 | acpi_ut_divide(acpi_integer in_dividend, |
| 576 | acpi_integer in_dividend, | 387 | acpi_integer in_divisor, |
| 577 | acpi_integer in_divisor, | 388 | acpi_integer * out_quotient, acpi_integer * out_remainder); |
| 578 | acpi_integer *out_quotient, | ||
| 579 | acpi_integer *out_remainder); | ||
| 580 | 389 | ||
| 581 | acpi_status | 390 | acpi_status |
| 582 | acpi_ut_short_divide ( | 391 | acpi_ut_short_divide(acpi_integer in_dividend, |
| 583 | acpi_integer in_dividend, | 392 | u32 divisor, |
| 584 | u32 divisor, | 393 | acpi_integer * out_quotient, u32 * out_remainder); |
| 585 | acpi_integer *out_quotient, | ||
| 586 | u32 *out_remainder); | ||
| 587 | 394 | ||
| 588 | /* | 395 | /* |
| 589 | * utmisc | 396 | * utmisc |
| 590 | */ | 397 | */ |
| 398 | acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); | ||
| 399 | |||
| 400 | void acpi_ut_release_owner_id(acpi_owner_id * owner_id); | ||
| 401 | |||
| 591 | acpi_status | 402 | acpi_status |
| 592 | acpi_ut_walk_package_tree ( | 403 | acpi_ut_walk_package_tree(union acpi_operand_object *source_object, |
| 593 | union acpi_operand_object *source_object, | 404 | void *target_object, |
| 594 | void *target_object, | 405 | acpi_pkg_callback walk_callback, void *context); |
| 595 | acpi_pkg_callback walk_callback, | ||
| 596 | void *context); | ||
| 597 | 406 | ||
| 598 | char * | 407 | void acpi_ut_strupr(char *src_string); |
| 599 | acpi_ut_strupr ( | ||
| 600 | char *src_string); | ||
| 601 | 408 | ||
| 602 | void | 409 | void acpi_ut_print_string(char *string, u8 max_length); |
| 603 | acpi_ut_print_string ( | ||
| 604 | char *string, | ||
| 605 | u8 max_length); | ||
| 606 | 410 | ||
| 607 | u8 | 411 | u8 acpi_ut_valid_acpi_name(u32 name); |
| 608 | acpi_ut_valid_acpi_name ( | ||
| 609 | u32 name); | ||
| 610 | 412 | ||
| 611 | u8 | 413 | u8 acpi_ut_valid_acpi_character(char character); |
| 612 | acpi_ut_valid_acpi_character ( | ||
| 613 | char character); | ||
| 614 | 414 | ||
| 615 | acpi_status | 415 | acpi_status |
| 616 | acpi_ut_strtoul64 ( | 416 | acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); |
| 617 | char *string, | ||
| 618 | u32 base, | ||
| 619 | acpi_integer *ret_integer); | ||
| 620 | 417 | ||
| 621 | /* Values for Base above (16=Hex, 10=Decimal) */ | 418 | /* Values for Base above (16=Hex, 10=Decimal) */ |
| 622 | 419 | ||
| 623 | #define ACPI_ANY_BASE 0 | 420 | #define ACPI_ANY_BASE 0 |
| 624 | 421 | ||
| 625 | acpi_status | 422 | u8 *acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc); |
| 626 | acpi_ut_mutex_initialize ( | ||
| 627 | void); | ||
| 628 | |||
| 629 | void | ||
| 630 | acpi_ut_mutex_terminate ( | ||
| 631 | void); | ||
| 632 | |||
| 633 | acpi_status | ||
| 634 | acpi_ut_acquire_mutex ( | ||
| 635 | acpi_mutex_handle mutex_id); | ||
| 636 | |||
| 637 | acpi_status | ||
| 638 | acpi_ut_release_mutex ( | ||
| 639 | acpi_mutex_handle mutex_id); | ||
| 640 | |||
| 641 | u8 * | ||
| 642 | acpi_ut_get_resource_end_tag ( | ||
| 643 | union acpi_operand_object *obj_desc); | ||
| 644 | 423 | ||
| 645 | u8 | 424 | u8 acpi_ut_generate_checksum(u8 * buffer, u32 length); |
| 646 | acpi_ut_generate_checksum ( | ||
| 647 | u8 *buffer, | ||
| 648 | u32 length); | ||
| 649 | 425 | ||
| 650 | u32 | 426 | u32 acpi_ut_dword_byte_swap(u32 value); |
| 651 | acpi_ut_dword_byte_swap ( | ||
| 652 | u32 value); | ||
| 653 | 427 | ||
| 654 | void | 428 | void acpi_ut_set_integer_width(u8 revision); |
| 655 | acpi_ut_set_integer_width ( | ||
| 656 | u8 revision); | ||
| 657 | 429 | ||
| 658 | #ifdef ACPI_DEBUG_OUTPUT | 430 | #ifdef ACPI_DEBUG_OUTPUT |
| 659 | void | 431 | void |
| 660 | acpi_ut_display_init_pathname ( | 432 | acpi_ut_display_init_pathname(u8 type, |
| 661 | u8 type, | 433 | struct acpi_namespace_node *obj_handle, |
| 662 | struct acpi_namespace_node *obj_handle, | 434 | char *path); |
| 663 | char *path); | ||
| 664 | 435 | ||
| 665 | #endif | 436 | #endif |
| 666 | 437 | ||
| 438 | /* | ||
| 439 | * utmutex - mutex support | ||
| 440 | */ | ||
| 441 | acpi_status acpi_ut_mutex_initialize(void); | ||
| 442 | |||
| 443 | void acpi_ut_mutex_terminate(void); | ||
| 444 | |||
| 445 | acpi_status acpi_ut_acquire_mutex(acpi_mutex_handle mutex_id); | ||
| 446 | |||
| 447 | acpi_status acpi_ut_release_mutex(acpi_mutex_handle mutex_id); | ||
| 667 | 448 | ||
| 668 | /* | 449 | /* |
| 669 | * utalloc - memory allocation and object caching | 450 | * utalloc - memory allocation and object caching |
| 670 | */ | 451 | */ |
| 671 | void * | 452 | acpi_status acpi_ut_create_caches(void); |
| 672 | acpi_ut_acquire_from_cache ( | ||
| 673 | u32 list_id); | ||
| 674 | 453 | ||
| 675 | void | 454 | acpi_status acpi_ut_delete_caches(void); |
| 676 | acpi_ut_release_to_cache ( | ||
| 677 | u32 list_id, | ||
| 678 | void *object); | ||
| 679 | 455 | ||
| 680 | #ifdef ACPI_ENABLE_OBJECT_CACHE | 456 | acpi_status acpi_ut_validate_buffer(struct acpi_buffer *buffer); |
| 681 | void | ||
| 682 | acpi_ut_delete_generic_cache ( | ||
| 683 | u32 list_id); | ||
| 684 | #endif | ||
| 685 | 457 | ||
| 686 | acpi_status | 458 | acpi_status |
| 687 | acpi_ut_validate_buffer ( | 459 | acpi_ut_initialize_buffer(struct acpi_buffer *buffer, |
| 688 | struct acpi_buffer *buffer); | 460 | acpi_size required_length); |
| 689 | 461 | ||
| 690 | acpi_status | 462 | void *acpi_ut_allocate(acpi_size size, u32 component, char *module, u32 line); |
| 691 | acpi_ut_initialize_buffer ( | 463 | |
| 692 | struct acpi_buffer *buffer, | 464 | void *acpi_ut_callocate(acpi_size size, u32 component, char *module, u32 line); |
| 693 | acpi_size required_length); | ||
| 694 | |||
| 695 | void * | ||
| 696 | acpi_ut_allocate ( | ||
| 697 | acpi_size size, | ||
| 698 | u32 component, | ||
| 699 | char *module, | ||
| 700 | u32 line); | ||
| 701 | |||
| 702 | void * | ||
| 703 | acpi_ut_callocate ( | ||
| 704 | acpi_size size, | ||
| 705 | u32 component, | ||
| 706 | char *module, | ||
| 707 | u32 line); | ||
| 708 | 465 | ||
| 709 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 466 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
| 710 | void * | 467 | void *acpi_ut_allocate_and_track(acpi_size size, |
| 711 | acpi_ut_allocate_and_track ( | 468 | u32 component, char *module, u32 line); |
| 712 | acpi_size size, | 469 | |
| 713 | u32 component, | 470 | void *acpi_ut_callocate_and_track(acpi_size size, |
| 714 | char *module, | 471 | u32 component, char *module, u32 line); |
| 715 | u32 line); | ||
| 716 | |||
| 717 | void * | ||
| 718 | acpi_ut_callocate_and_track ( | ||
| 719 | acpi_size size, | ||
| 720 | u32 component, | ||
| 721 | char *module, | ||
| 722 | u32 line); | ||
| 723 | 472 | ||
| 724 | void | 473 | void |
| 725 | acpi_ut_free_and_track ( | 474 | acpi_ut_free_and_track(void *address, u32 component, char *module, u32 line); |
| 726 | void *address, | ||
| 727 | u32 component, | ||
| 728 | char *module, | ||
| 729 | u32 line); | ||
| 730 | 475 | ||
| 731 | #ifdef ACPI_FUTURE_USAGE | 476 | #ifdef ACPI_FUTURE_USAGE |
| 732 | void | 477 | void acpi_ut_dump_allocation_info(void); |
| 733 | acpi_ut_dump_allocation_info ( | 478 | #endif /* ACPI_FUTURE_USAGE */ |
| 734 | void); | ||
| 735 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 736 | 479 | ||
| 737 | void | 480 | void acpi_ut_dump_allocations(u32 component, char *module); |
| 738 | acpi_ut_dump_allocations ( | ||
| 739 | u32 component, | ||
| 740 | char *module); | ||
| 741 | #endif | 481 | #endif |
| 742 | 482 | ||
| 743 | #endif /* _ACUTILS_H */ | 483 | #endif /* _ACUTILS_H */ |
