Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures |
| 4 | * |
| 5 | *****************************************************************************/ |
| 6 | |
| 7 | /* |
| 8 | * Copyright (C) 2000 - 2005, R. Byron Moore |
| 9 | * All rights reserved. |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or without |
| 12 | * modification, are permitted provided that the following conditions |
| 13 | * are met: |
| 14 | * 1. Redistributions of source code must retain the above copyright |
| 15 | * notice, this list of conditions, and the following disclaimer, |
| 16 | * without modification. |
| 17 | * 2. Redistributions in binary form must reproduce at minimum a disclaimer |
| 18 | * substantially similar to the "NO WARRANTY" disclaimer below |
| 19 | * ("Disclaimer") and any redistribution must be conditioned upon |
| 20 | * including a substantially similar Disclaimer requirement for further |
| 21 | * binary redistribution. |
| 22 | * 3. Neither the names of the above-listed copyright holders nor the names |
| 23 | * of any contributors may be used to endorse or promote products derived |
| 24 | * from this software without specific prior written permission. |
| 25 | * |
| 26 | * Alternatively, this software may be distributed under the terms of the |
| 27 | * GNU General Public License ("GPL") version 2 as published by the Free |
| 28 | * Software Foundation. |
| 29 | * |
| 30 | * NO WARRANTY |
| 31 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 32 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 33 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR |
| 34 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 35 | * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 36 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
| 37 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 38 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 39 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 40 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ |
| 43 | |
| 44 | #ifndef _ACUTILS_H |
| 45 | #define _ACUTILS_H |
| 46 | |
| 47 | |
| 48 | typedef |
| 49 | acpi_status (*acpi_pkg_callback) ( |
| 50 | u8 object_type, |
| 51 | union acpi_operand_object *source_object, |
| 52 | union acpi_generic_state *state, |
| 53 | void *context); |
| 54 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | struct acpi_pkg_info |
| 56 | { |
| 57 | u8 *free_space; |
| 58 | acpi_size length; |
| 59 | u32 object_space; |
| 60 | u32 num_packages; |
| 61 | }; |
| 62 | |
| 63 | #define REF_INCREMENT (u16) 0 |
| 64 | #define REF_DECREMENT (u16) 1 |
| 65 | #define REF_FORCE_DELETE (u16) 2 |
| 66 | |
| 67 | /* acpi_ut_dump_buffer */ |
| 68 | |
| 69 | #define DB_BYTE_DISPLAY 1 |
| 70 | #define DB_WORD_DISPLAY 2 |
| 71 | #define DB_DWORD_DISPLAY 4 |
| 72 | #define DB_QWORD_DISPLAY 8 |
| 73 | |
| 74 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 75 | /* |
| 76 | * utglobal - Global data structures and procedures |
| 77 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | void |
| 79 | acpi_ut_init_globals ( |
| 80 | void); |
| 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
| 83 | |
| 84 | char * |
| 85 | acpi_ut_get_mutex_name ( |
| 86 | u32 mutex_id); |
| 87 | |
| 88 | #endif |
| 89 | |
| 90 | char * |
| 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 | |
| 102 | char * |
| 103 | acpi_ut_get_object_type_name ( |
| 104 | union acpi_operand_object *obj_desc); |
| 105 | |
| 106 | char * |
| 107 | acpi_ut_get_region_name ( |
| 108 | u8 space_id); |
| 109 | |
| 110 | char * |
| 111 | acpi_ut_get_event_name ( |
| 112 | u32 event_id); |
| 113 | |
| 114 | char |
| 115 | acpi_ut_hex_to_ascii_char ( |
| 116 | acpi_integer integer, |
| 117 | u32 position); |
| 118 | |
| 119 | u8 |
| 120 | acpi_ut_valid_object_type ( |
| 121 | acpi_object_type type); |
| 122 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 123 | |
| 124 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 125 | * utinit - miscellaneous initialization and shutdown |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 127 | acpi_status |
| 128 | acpi_ut_hardware_initialize ( |
| 129 | void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 130 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 131 | void |
| 132 | acpi_ut_subsystem_shutdown ( |
| 133 | void); |
| 134 | |
| 135 | acpi_status |
| 136 | acpi_ut_validate_fadt ( |
| 137 | void); |
| 138 | |
| 139 | |
| 140 | /* |
| 141 | * utclib - Local implementations of C library functions |
| 142 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | #ifndef ACPI_USE_SYSTEM_CLIBRARY |
| 144 | |
| 145 | acpi_size |
| 146 | acpi_ut_strlen ( |
| 147 | const char *string); |
| 148 | |
| 149 | char * |
| 150 | acpi_ut_strcpy ( |
| 151 | char *dst_string, |
| 152 | const char *src_string); |
| 153 | |
| 154 | char * |
| 155 | acpi_ut_strncpy ( |
| 156 | char *dst_string, |
| 157 | const char *src_string, |
| 158 | acpi_size count); |
| 159 | |
| 160 | int |
| 161 | acpi_ut_memcmp ( |
| 162 | const char *buffer1, |
| 163 | const char *buffer2, |
| 164 | acpi_size count); |
| 165 | |
| 166 | int |
| 167 | acpi_ut_strncmp ( |
| 168 | const char *string1, |
| 169 | const char *string2, |
| 170 | acpi_size count); |
| 171 | |
| 172 | int |
| 173 | acpi_ut_strcmp ( |
| 174 | const char *string1, |
| 175 | const char *string2); |
| 176 | |
| 177 | char * |
| 178 | acpi_ut_strcat ( |
| 179 | char *dst_string, |
| 180 | const char *src_string); |
| 181 | |
| 182 | char * |
| 183 | acpi_ut_strncat ( |
| 184 | char *dst_string, |
| 185 | const char *src_string, |
| 186 | acpi_size count); |
| 187 | |
| 188 | u32 |
| 189 | acpi_ut_strtoul ( |
| 190 | const char *string, |
| 191 | char **terminator, |
| 192 | u32 base); |
| 193 | |
| 194 | char * |
| 195 | acpi_ut_strstr ( |
| 196 | char *string1, |
| 197 | char *string2); |
| 198 | |
| 199 | void * |
| 200 | acpi_ut_memcpy ( |
| 201 | void *dest, |
| 202 | const void *src, |
| 203 | acpi_size count); |
| 204 | |
| 205 | void * |
| 206 | acpi_ut_memset ( |
| 207 | void *dest, |
| 208 | acpi_native_uint value, |
| 209 | acpi_size count); |
| 210 | |
| 211 | int |
| 212 | acpi_ut_to_upper ( |
| 213 | int c); |
| 214 | |
| 215 | int |
| 216 | acpi_ut_to_lower ( |
| 217 | int c); |
| 218 | |
| 219 | extern const u8 _acpi_ctype[]; |
| 220 | |
| 221 | #define _ACPI_XA 0x00 /* extra alphabetic - not supported */ |
| 222 | #define _ACPI_XS 0x40 /* extra space */ |
| 223 | #define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */ |
| 224 | #define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */ |
| 225 | #define _ACPI_DI 0x04 /* '0'-'9' */ |
| 226 | #define _ACPI_LO 0x02 /* 'a'-'z' */ |
| 227 | #define _ACPI_PU 0x10 /* punctuation */ |
| 228 | #define _ACPI_SP 0x08 /* space */ |
| 229 | #define _ACPI_UP 0x01 /* 'A'-'Z' */ |
| 230 | #define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */ |
| 231 | |
| 232 | #define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI)) |
| 233 | #define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP)) |
| 234 | #define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD)) |
| 235 | #define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP)) |
| 236 | #define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO)) |
| 237 | #define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU)) |
| 238 | #define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP)) |
| 239 | #define ACPI_IS_ASCII(c) ((c) < 0x80) |
| 240 | |
| 241 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
| 242 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 244 | /* |
| 245 | * utcopy - Object construction and conversion interfaces |
| 246 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | acpi_status |
| 248 | acpi_ut_build_simple_object( |
| 249 | union acpi_operand_object *obj, |
| 250 | union acpi_object *user_obj, |
| 251 | u8 *data_space, |
| 252 | u32 *buffer_space_used); |
| 253 | |
| 254 | acpi_status |
| 255 | acpi_ut_build_package_object ( |
| 256 | union acpi_operand_object *obj, |
| 257 | u8 *buffer, |
| 258 | u32 *space_used); |
| 259 | |
| 260 | acpi_status |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | acpi_ut_copy_iobject_to_eobject ( |
| 262 | union acpi_operand_object *obj, |
| 263 | struct acpi_buffer *ret_buffer); |
| 264 | |
| 265 | acpi_status |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | acpi_ut_copy_eobject_to_iobject ( |
| 267 | union acpi_object *obj, |
| 268 | union acpi_operand_object **internal_obj); |
| 269 | |
| 270 | acpi_status |
| 271 | acpi_ut_copy_isimple_to_isimple ( |
| 272 | union acpi_operand_object *source_obj, |
| 273 | union acpi_operand_object *dest_obj); |
| 274 | |
| 275 | acpi_status |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | acpi_ut_copy_iobject_to_iobject ( |
| 277 | union acpi_operand_object *source_desc, |
| 278 | union acpi_operand_object **dest_desc, |
| 279 | struct acpi_walk_state *walk_state); |
| 280 | |
| 281 | |
| 282 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 283 | * utcreate - Object creation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 284 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | acpi_status |
| 286 | acpi_ut_update_object_reference ( |
| 287 | union acpi_operand_object *object, |
| 288 | u16 action); |
| 289 | |
| 290 | |
| 291 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 292 | * utdebug - Debug interfaces |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 294 | void |
| 295 | acpi_ut_init_stack_ptr_trace ( |
| 296 | void); |
| 297 | |
| 298 | void |
| 299 | acpi_ut_track_stack_ptr ( |
| 300 | void); |
| 301 | |
| 302 | void |
| 303 | acpi_ut_trace ( |
| 304 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 305 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 306 | char *module_name, |
| 307 | u32 component_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 308 | |
| 309 | void |
| 310 | acpi_ut_trace_ptr ( |
| 311 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 312 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 313 | char *module_name, |
| 314 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 315 | void *pointer); |
| 316 | |
| 317 | void |
| 318 | acpi_ut_trace_u32 ( |
| 319 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 320 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 321 | char *module_name, |
| 322 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | u32 integer); |
| 324 | |
| 325 | void |
| 326 | acpi_ut_trace_str ( |
| 327 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 328 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 329 | char *module_name, |
| 330 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 331 | char *string); |
| 332 | |
| 333 | void |
| 334 | acpi_ut_exit ( |
| 335 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 336 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 337 | char *module_name, |
| 338 | u32 component_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | |
| 340 | void |
| 341 | acpi_ut_status_exit ( |
| 342 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 343 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 344 | char *module_name, |
| 345 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 346 | acpi_status status); |
| 347 | |
| 348 | void |
| 349 | acpi_ut_value_exit ( |
| 350 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 351 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 352 | char *module_name, |
| 353 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 354 | acpi_integer value); |
| 355 | |
| 356 | void |
| 357 | acpi_ut_ptr_exit ( |
| 358 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 359 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 360 | char *module_name, |
| 361 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 362 | u8 *ptr); |
| 363 | |
| 364 | void |
| 365 | acpi_ut_report_info ( |
| 366 | char *module_name, |
| 367 | u32 line_number, |
| 368 | u32 component_id); |
| 369 | |
| 370 | void |
| 371 | acpi_ut_report_error ( |
| 372 | char *module_name, |
| 373 | u32 line_number, |
| 374 | u32 component_id); |
| 375 | |
| 376 | void |
| 377 | acpi_ut_report_warning ( |
| 378 | char *module_name, |
| 379 | u32 line_number, |
| 380 | u32 component_id); |
| 381 | |
| 382 | void |
| 383 | acpi_ut_dump_buffer ( |
| 384 | u8 *buffer, |
| 385 | u32 count, |
| 386 | u32 display, |
| 387 | u32 component_id); |
| 388 | |
| 389 | void ACPI_INTERNAL_VAR_XFACE |
| 390 | acpi_ut_debug_print ( |
| 391 | u32 requested_debug_level, |
| 392 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 393 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 394 | char *module_name, |
| 395 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 396 | char *format, |
| 397 | ...) ACPI_PRINTF_LIKE_FUNC; |
| 398 | |
| 399 | void ACPI_INTERNAL_VAR_XFACE |
| 400 | acpi_ut_debug_print_raw ( |
| 401 | u32 requested_debug_level, |
| 402 | u32 line_number, |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 403 | const char *function_name, |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 404 | char *module_name, |
| 405 | u32 component_id, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 406 | char *format, |
| 407 | ...) ACPI_PRINTF_LIKE_FUNC; |
| 408 | |
| 409 | |
| 410 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 411 | * utdelete - Object deletion and reference counts |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 412 | */ |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 413 | void |
| 414 | acpi_ut_add_reference ( |
| 415 | union acpi_operand_object *object); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 416 | |
| 417 | void |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 418 | acpi_ut_remove_reference ( |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 419 | union acpi_operand_object *object); |
| 420 | |
| 421 | void |
| 422 | acpi_ut_delete_internal_package_object ( |
| 423 | union acpi_operand_object *object); |
| 424 | |
| 425 | void |
| 426 | acpi_ut_delete_internal_simple_object ( |
| 427 | union acpi_operand_object *object); |
| 428 | |
| 429 | void |
| 430 | acpi_ut_delete_internal_object_list ( |
| 431 | union acpi_operand_object **obj_list); |
| 432 | |
| 433 | |
| 434 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 435 | * uteval - object evaluation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 436 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 437 | acpi_status |
| 438 | acpi_ut_osi_implementation ( |
| 439 | struct acpi_walk_state *walk_state); |
| 440 | |
| 441 | acpi_status |
| 442 | acpi_ut_evaluate_object ( |
| 443 | struct acpi_namespace_node *prefix_node, |
| 444 | char *path, |
| 445 | u32 expected_return_btypes, |
| 446 | union acpi_operand_object **return_desc); |
| 447 | |
| 448 | acpi_status |
| 449 | acpi_ut_evaluate_numeric_object ( |
| 450 | char *object_name, |
| 451 | struct acpi_namespace_node *device_node, |
| 452 | acpi_integer *address); |
| 453 | |
| 454 | acpi_status |
| 455 | acpi_ut_execute_HID ( |
| 456 | struct acpi_namespace_node *device_node, |
| 457 | struct acpi_device_id *hid); |
| 458 | |
| 459 | acpi_status |
| 460 | acpi_ut_execute_CID ( |
| 461 | struct acpi_namespace_node *device_node, |
| 462 | struct acpi_compatible_id_list **return_cid_list); |
| 463 | |
| 464 | acpi_status |
| 465 | acpi_ut_execute_STA ( |
| 466 | struct acpi_namespace_node *device_node, |
| 467 | u32 *status_flags); |
| 468 | |
| 469 | acpi_status |
| 470 | acpi_ut_execute_UID ( |
| 471 | struct acpi_namespace_node *device_node, |
| 472 | struct acpi_device_id *uid); |
| 473 | |
| 474 | acpi_status |
| 475 | acpi_ut_execute_sxds ( |
| 476 | struct acpi_namespace_node *device_node, |
| 477 | u8 *highest); |
| 478 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | |
| 480 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 481 | * utobject - internal object create/delete/cache routines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 482 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 483 | union acpi_operand_object * |
| 484 | acpi_ut_create_internal_object_dbg ( |
| 485 | char *module_name, |
| 486 | u32 line_number, |
| 487 | u32 component_id, |
| 488 | acpi_object_type type); |
| 489 | |
| 490 | void * |
| 491 | acpi_ut_allocate_object_desc_dbg ( |
| 492 | char *module_name, |
| 493 | u32 line_number, |
| 494 | u32 component_id); |
| 495 | |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 496 | #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_acpi_module_name,__LINE__,_COMPONENT,t) |
| 497 | #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_acpi_module_name,__LINE__,_COMPONENT) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 498 | |
| 499 | void |
| 500 | acpi_ut_delete_object_desc ( |
| 501 | union acpi_operand_object *object); |
| 502 | |
| 503 | u8 |
| 504 | acpi_ut_valid_internal_object ( |
| 505 | void *object); |
| 506 | |
| 507 | union acpi_operand_object * |
| 508 | acpi_ut_create_buffer_object ( |
| 509 | acpi_size buffer_size); |
| 510 | |
| 511 | union acpi_operand_object * |
| 512 | acpi_ut_create_string_object ( |
| 513 | acpi_size string_size); |
| 514 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 515 | acpi_status |
| 516 | acpi_ut_get_object_size( |
| 517 | union acpi_operand_object *obj, |
| 518 | acpi_size *obj_length); |
| 519 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 520 | |
| 521 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 522 | * utstate - Generic state creation/cache routines |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 523 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | void |
| 525 | acpi_ut_push_generic_state ( |
| 526 | union acpi_generic_state **list_head, |
| 527 | union acpi_generic_state *state); |
| 528 | |
| 529 | union acpi_generic_state * |
| 530 | acpi_ut_pop_generic_state ( |
| 531 | union acpi_generic_state **list_head); |
| 532 | |
| 533 | |
| 534 | union acpi_generic_state * |
| 535 | acpi_ut_create_generic_state ( |
| 536 | void); |
| 537 | |
| 538 | struct acpi_thread_state * |
| 539 | acpi_ut_create_thread_state ( |
| 540 | void); |
| 541 | |
| 542 | union acpi_generic_state * |
| 543 | acpi_ut_create_update_state ( |
| 544 | union acpi_operand_object *object, |
| 545 | u16 action); |
| 546 | |
| 547 | union acpi_generic_state * |
| 548 | acpi_ut_create_pkg_state ( |
| 549 | void *internal_object, |
| 550 | void *external_object, |
| 551 | u16 index); |
| 552 | |
| 553 | acpi_status |
| 554 | acpi_ut_create_update_state_and_push ( |
| 555 | union acpi_operand_object *object, |
| 556 | u16 action, |
| 557 | union acpi_generic_state **state_list); |
| 558 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 559 | #ifdef ACPI_FUTURE_USAGE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 560 | acpi_status |
| 561 | acpi_ut_create_pkg_state_and_push ( |
| 562 | void *internal_object, |
| 563 | void *external_object, |
| 564 | u16 index, |
| 565 | union acpi_generic_state **state_list); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 566 | #endif /* ACPI_FUTURE_USAGE */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | |
| 568 | union acpi_generic_state * |
| 569 | acpi_ut_create_control_state ( |
| 570 | void); |
| 571 | |
| 572 | void |
| 573 | acpi_ut_delete_generic_state ( |
| 574 | union acpi_generic_state *state); |
| 575 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 576 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 577 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 578 | * utmath |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 579 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 580 | acpi_status |
| 581 | acpi_ut_divide ( |
| 582 | acpi_integer in_dividend, |
| 583 | acpi_integer in_divisor, |
| 584 | acpi_integer *out_quotient, |
| 585 | acpi_integer *out_remainder); |
| 586 | |
| 587 | acpi_status |
| 588 | acpi_ut_short_divide ( |
| 589 | acpi_integer in_dividend, |
| 590 | u32 divisor, |
| 591 | acpi_integer *out_quotient, |
| 592 | u32 *out_remainder); |
| 593 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 594 | /* |
| 595 | * utmisc |
| 596 | */ |
| 597 | acpi_status |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 598 | acpi_ut_allocate_owner_id ( |
| 599 | acpi_owner_id *owner_id); |
| 600 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 601 | void |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 602 | acpi_ut_release_owner_id ( |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 603 | acpi_owner_id *owner_id); |
Robert Moore | f9f4601 | 2005-07-08 00:00:00 -0400 | [diff] [blame] | 604 | |
| 605 | acpi_status |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 606 | acpi_ut_walk_package_tree ( |
| 607 | union acpi_operand_object *source_object, |
| 608 | void *target_object, |
| 609 | acpi_pkg_callback walk_callback, |
| 610 | void *context); |
| 611 | |
Robert Moore | 0c9938c | 2005-07-29 15:15:00 -0700 | [diff] [blame] | 612 | void |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 613 | acpi_ut_strupr ( |
| 614 | char *src_string); |
| 615 | |
| 616 | void |
| 617 | acpi_ut_print_string ( |
| 618 | char *string, |
| 619 | u8 max_length); |
| 620 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 621 | u8 |
| 622 | acpi_ut_valid_acpi_name ( |
| 623 | u32 name); |
| 624 | |
| 625 | u8 |
| 626 | acpi_ut_valid_acpi_character ( |
| 627 | char character); |
| 628 | |
| 629 | acpi_status |
| 630 | acpi_ut_strtoul64 ( |
| 631 | char *string, |
| 632 | u32 base, |
| 633 | acpi_integer *ret_integer); |
| 634 | |
| 635 | /* Values for Base above (16=Hex, 10=Decimal) */ |
| 636 | |
| 637 | #define ACPI_ANY_BASE 0 |
| 638 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 639 | u8 * |
| 640 | acpi_ut_get_resource_end_tag ( |
| 641 | union acpi_operand_object *obj_desc); |
| 642 | |
| 643 | u8 |
| 644 | acpi_ut_generate_checksum ( |
| 645 | u8 *buffer, |
| 646 | u32 length); |
| 647 | |
| 648 | u32 |
| 649 | acpi_ut_dword_byte_swap ( |
| 650 | u32 value); |
| 651 | |
| 652 | void |
| 653 | acpi_ut_set_integer_width ( |
| 654 | u8 revision); |
| 655 | |
| 656 | #ifdef ACPI_DEBUG_OUTPUT |
| 657 | void |
| 658 | acpi_ut_display_init_pathname ( |
| 659 | u8 type, |
| 660 | struct acpi_namespace_node *obj_handle, |
| 661 | char *path); |
| 662 | |
| 663 | #endif |
| 664 | |
| 665 | |
| 666 | /* |
Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 667 | * utmutex - mutex support |
| 668 | */ |
| 669 | acpi_status |
| 670 | acpi_ut_mutex_initialize ( |
| 671 | void); |
| 672 | |
| 673 | void |
| 674 | acpi_ut_mutex_terminate ( |
| 675 | void); |
| 676 | |
| 677 | acpi_status |
| 678 | acpi_ut_acquire_mutex ( |
| 679 | acpi_mutex_handle mutex_id); |
| 680 | |
| 681 | acpi_status |
| 682 | acpi_ut_release_mutex ( |
| 683 | acpi_mutex_handle mutex_id); |
| 684 | |
| 685 | |
| 686 | /* |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 687 | * utalloc - memory allocation and object caching |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 688 | */ |
Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 689 | acpi_status |
| 690 | acpi_ut_create_caches ( |
| 691 | void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 692 | |
Robert Moore | 73459f7 | 2005-06-24 00:00:00 -0400 | [diff] [blame] | 693 | acpi_status |
| 694 | acpi_ut_delete_caches ( |
| 695 | void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 | |
| 697 | acpi_status |
| 698 | acpi_ut_validate_buffer ( |
| 699 | struct acpi_buffer *buffer); |
| 700 | |
| 701 | acpi_status |
| 702 | acpi_ut_initialize_buffer ( |
| 703 | struct acpi_buffer *buffer, |
| 704 | acpi_size required_length); |
| 705 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 706 | void * |
| 707 | acpi_ut_allocate ( |
| 708 | acpi_size size, |
| 709 | u32 component, |
| 710 | char *module, |
| 711 | u32 line); |
| 712 | |
| 713 | void * |
| 714 | acpi_ut_callocate ( |
| 715 | acpi_size size, |
| 716 | u32 component, |
| 717 | char *module, |
| 718 | u32 line); |
| 719 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 720 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 721 | void * |
| 722 | acpi_ut_allocate_and_track ( |
| 723 | acpi_size size, |
| 724 | u32 component, |
| 725 | char *module, |
| 726 | u32 line); |
| 727 | |
| 728 | void * |
| 729 | acpi_ut_callocate_and_track ( |
| 730 | acpi_size size, |
| 731 | u32 component, |
| 732 | char *module, |
| 733 | u32 line); |
| 734 | |
| 735 | void |
| 736 | acpi_ut_free_and_track ( |
| 737 | void *address, |
| 738 | u32 component, |
| 739 | char *module, |
| 740 | u32 line); |
| 741 | |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 742 | #ifdef ACPI_FUTURE_USAGE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 743 | void |
| 744 | acpi_ut_dump_allocation_info ( |
| 745 | void); |
Robert Moore | 44f6c01 | 2005-04-18 22:49:35 -0400 | [diff] [blame] | 746 | #endif /* ACPI_FUTURE_USAGE */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 747 | |
| 748 | void |
| 749 | acpi_ut_dump_allocations ( |
| 750 | u32 component, |
| 751 | char *module); |
| 752 | #endif |
| 753 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 754 | #endif /* _ACUTILS_H */ |