1 /******************************************************************************
3 * Name: acutils.h -- prototypes for the common (subsystem-wide) procedures
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 acpi_status (*ACPI_PKG_CALLBACK) (
33 acpi_operand_object *source_object,
34 acpi_generic_state *state,
39 acpi_ut_walk_package_tree (
40 acpi_operand_object *source_object,
42 ACPI_PKG_CALLBACK walk_callback,
46 typedef struct acpi_pkg_info
54 #define REF_INCREMENT (u16) 0
55 #define REF_DECREMENT (u16) 1
56 #define REF_FORCE_DELETE (u16) 2
58 /* Acpi_ut_dump_buffer */
60 #define DB_BYTE_DISPLAY 1
61 #define DB_WORD_DISPLAY 2
62 #define DB_DWORD_DISPLAY 4
63 #define DB_QWORD_DISPLAY 8
66 /* Global initialization interfaces */
69 acpi_ut_init_globals (
78 * Ut_init - miscellaneous initialization and shutdown
82 acpi_ut_hardware_initialize (
86 acpi_ut_subsystem_shutdown (
90 acpi_ut_validate_fadt (
94 * Ut_global - Global data structures and procedures
100 acpi_ut_get_mutex_name (
104 acpi_ut_get_type_name (
108 acpi_ut_get_region_name (
115 acpi_ut_hex_to_ascii_char (
116 acpi_integer integer,
120 acpi_ut_valid_object_type (
124 acpi_ut_allocate_owner_id (
129 * Ut_clib - Local implementations of C library functions
132 #ifndef ACPI_USE_SYSTEM_CLIBRARY
136 const NATIVE_CHAR *string);
140 NATIVE_CHAR *dst_string,
141 const NATIVE_CHAR *src_string);
145 NATIVE_CHAR *dst_string,
146 const NATIVE_CHAR *src_string,
151 const NATIVE_CHAR *string1,
152 const NATIVE_CHAR *string2,
157 const NATIVE_CHAR *string1,
158 const NATIVE_CHAR *string2);
162 NATIVE_CHAR *dst_string,
163 const NATIVE_CHAR *src_string);
167 NATIVE_CHAR *dst_string,
168 const NATIVE_CHAR *src_string,
173 const NATIVE_CHAR *string,
174 NATIVE_CHAR **terminator,
179 NATIVE_CHAR *string1,
180 NATIVE_CHAR *string2);
202 #endif /* ACPI_USE_SYSTEM_CLIBRARY */
205 * Ut_copy - Object construction and conversion interfaces
209 acpi_ut_build_simple_object(
210 acpi_operand_object *obj,
211 acpi_object *user_obj,
213 u32 *buffer_space_used);
216 acpi_ut_build_package_object (
217 acpi_operand_object *obj,
222 acpi_ut_copy_iobject_to_eobject (
223 acpi_operand_object *obj,
224 acpi_buffer *ret_buffer);
227 acpi_ut_copy_esimple_to_isimple(
228 acpi_object *user_obj,
229 acpi_operand_object **return_obj);
232 acpi_ut_copy_eobject_to_iobject (
234 acpi_operand_object **internal_obj);
237 acpi_ut_copy_isimple_to_isimple (
238 acpi_operand_object *source_obj,
239 acpi_operand_object *dest_obj);
242 acpi_ut_copy_ipackage_to_ipackage (
243 acpi_operand_object *source_obj,
244 acpi_operand_object *dest_obj,
245 acpi_walk_state *walk_state);
249 * Ut_create - Object creation
253 acpi_ut_update_object_reference (
254 acpi_operand_object *object,
259 * Ut_debug - Debug interfaces
263 acpi_ut_init_stack_ptr_trace (
267 acpi_ut_track_stack_ptr (
273 acpi_debug_print_info *dbg_info);
278 acpi_debug_print_info *dbg_info,
284 acpi_debug_print_info *dbg_info,
290 acpi_debug_print_info *dbg_info,
291 NATIVE_CHAR *string);
296 acpi_debug_print_info *dbg_info);
299 acpi_ut_status_exit (
301 acpi_debug_print_info *dbg_info,
307 acpi_debug_print_info *dbg_info,
313 acpi_debug_print_info *dbg_info,
317 acpi_ut_report_info (
318 NATIVE_CHAR *module_name,
323 acpi_ut_report_error (
324 NATIVE_CHAR *module_name,
329 acpi_ut_report_warning (
330 NATIVE_CHAR *module_name,
335 acpi_ut_dump_buffer (
342 acpi_ut_debug_print (
343 u32 requested_debug_level,
345 acpi_debug_print_info *dbg_info,
347 ...) ACPI_PRINTF_LIKE_FUNC;
350 acpi_ut_debug_print_raw (
351 u32 requested_debug_level,
353 acpi_debug_print_info *dbg_info,
355 ...) ACPI_PRINTF_LIKE_FUNC;
359 * Ut_delete - Object deletion
363 acpi_ut_delete_internal_obj (
364 acpi_operand_object *object);
367 acpi_ut_delete_internal_package_object (
368 acpi_operand_object *object);
371 acpi_ut_delete_internal_simple_object (
372 acpi_operand_object *object);
375 acpi_ut_delete_internal_object_list (
376 acpi_operand_object **obj_list);
380 * Ut_eval - object evaluation
383 /* Method name strings */
385 #define METHOD_NAME__HID "_HID"
386 #define METHOD_NAME__UID "_UID"
387 #define METHOD_NAME__ADR "_ADR"
388 #define METHOD_NAME__STA "_STA"
389 #define METHOD_NAME__REG "_REG"
390 #define METHOD_NAME__SEG "_SEG"
391 #define METHOD_NAME__BBN "_BBN"
392 #define METHOD_NAME__PRT "_PRT"
396 acpi_ut_evaluate_numeric_object (
397 NATIVE_CHAR *object_name,
398 acpi_namespace_node *device_node,
399 acpi_integer *address);
402 acpi_ut_execute_HID (
403 acpi_namespace_node *device_node,
404 acpi_device_id *hid);
407 acpi_ut_execute_STA (
408 acpi_namespace_node *device_node,
412 acpi_ut_execute_UID (
413 acpi_namespace_node *device_node,
414 acpi_device_id *uid);
418 * Ut_mutex - mutual exclusion interfaces
422 acpi_ut_mutex_initialize (
426 acpi_ut_mutex_terminate (
430 acpi_ut_create_mutex (
431 ACPI_MUTEX_HANDLE mutex_id);
434 acpi_ut_delete_mutex (
435 ACPI_MUTEX_HANDLE mutex_id);
438 acpi_ut_acquire_mutex (
439 ACPI_MUTEX_HANDLE mutex_id);
442 acpi_ut_release_mutex (
443 ACPI_MUTEX_HANDLE mutex_id);
447 * Ut_object - internal object create/delete/cache routines
450 acpi_operand_object *
451 acpi_ut_create_internal_object_dbg (
452 NATIVE_CHAR *module_name,
455 acpi_object_type8 type);
458 acpi_ut_allocate_object_desc_dbg (
459 NATIVE_CHAR *module_name,
463 #define acpi_ut_create_internal_object(t) acpi_ut_create_internal_object_dbg (_THIS_MODULE,__LINE__,_COMPONENT,t)
464 #define acpi_ut_allocate_object_desc() acpi_ut_allocate_object_desc_dbg (_THIS_MODULE,__LINE__,_COMPONENT)
467 acpi_ut_delete_object_desc (
468 acpi_operand_object *object);
471 acpi_ut_valid_internal_object (
476 * Ut_ref_cnt - Object reference count management
480 acpi_ut_add_reference (
481 acpi_operand_object *object);
484 acpi_ut_remove_reference (
485 acpi_operand_object *object);
488 * Ut_size - Object size routines
492 acpi_ut_get_simple_object_size (
493 acpi_operand_object *obj,
497 acpi_ut_get_package_object_size (
498 acpi_operand_object *obj,
502 acpi_ut_get_object_size(
503 acpi_operand_object *obj,
508 * Ut_state - Generic state creation/cache routines
512 acpi_ut_push_generic_state (
513 acpi_generic_state **list_head,
514 acpi_generic_state *state);
517 acpi_ut_pop_generic_state (
518 acpi_generic_state **list_head);
522 acpi_ut_create_generic_state (
526 acpi_ut_create_update_state (
527 acpi_operand_object *object,
531 acpi_ut_create_pkg_state (
532 void *internal_object,
533 void *external_object,
537 acpi_ut_create_update_state_and_push (
538 acpi_operand_object *object,
540 acpi_generic_state **state_list);
543 acpi_ut_create_pkg_state_and_push (
544 void *internal_object,
545 void *external_object,
547 acpi_generic_state **state_list);
550 acpi_ut_create_control_state (
554 acpi_ut_delete_generic_state (
555 acpi_generic_state *state);
558 acpi_ut_delete_generic_state_cache (
562 acpi_ut_delete_object_cache (
571 acpi_integer *in_dividend,
572 acpi_integer *in_divisor,
573 acpi_integer *out_quotient,
574 acpi_integer *out_remainder);
577 acpi_ut_short_divide (
578 acpi_integer *in_dividend,
580 acpi_integer *out_quotient,
584 acpi_ut_valid_acpi_name (
588 acpi_ut_valid_acpi_character (
589 NATIVE_CHAR character);
593 NATIVE_CHAR *src_string);
596 acpi_ut_resolve_package_references (
597 acpi_operand_object *obj_desc);
602 acpi_ut_display_init_pathname (
603 acpi_handle obj_handle,
610 * Utalloc - memory allocation and object caching
614 acpi_ut_acquire_from_cache (
618 acpi_ut_release_to_cache (
623 acpi_ut_delete_generic_cache (
627 /* Debug Memory allocation functions */
650 #ifdef ACPI_DBG_TRACK_ALLOCATIONS
652 acpi_ut_dump_allocation_info (
656 acpi_ut_dump_allocations (
658 NATIVE_CHAR *module);
662 #endif /* _ACUTILS_H */