diff options
Diffstat (limited to 'include/acpi/acutils.h')
-rw-r--r-- | include/acpi/acutils.h | 274 |
1 files changed, 71 insertions, 203 deletions
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h index 0de26b8f1028..192d0bea3884 100644 --- a/include/acpi/acutils.h +++ b/include/acpi/acutils.h | |||
@@ -52,13 +52,6 @@ acpi_status (*acpi_pkg_callback) ( | |||
52 | union acpi_generic_state *state, | 52 | union acpi_generic_state *state, |
53 | void *context); | 53 | void *context); |
54 | 54 | ||
55 | acpi_status | ||
56 | acpi_ut_walk_package_tree ( | ||
57 | union acpi_operand_object *source_object, | ||
58 | void *target_object, | ||
59 | acpi_pkg_callback walk_callback, | ||
60 | void *context); | ||
61 | |||
62 | struct acpi_pkg_info | 55 | struct acpi_pkg_info |
63 | { | 56 | { |
64 | u8 *free_space; | 57 | u8 *free_space; |
@@ -79,37 +72,13 @@ struct acpi_pkg_info | |||
79 | #define DB_QWORD_DISPLAY 8 | 72 | #define DB_QWORD_DISPLAY 8 |
80 | 73 | ||
81 | 74 | ||
82 | /* Global initialization interfaces */ | ||
83 | |||
84 | void | ||
85 | acpi_ut_init_globals ( | ||
86 | void); | ||
87 | |||
88 | void | ||
89 | acpi_ut_terminate ( | ||
90 | void); | ||
91 | |||
92 | |||
93 | /* | 75 | /* |
94 | * ut_init - miscellaneous initialization and shutdown | 76 | * utglobal - Global data structures and procedures |
95 | */ | 77 | */ |
96 | |||
97 | acpi_status | ||
98 | acpi_ut_hardware_initialize ( | ||
99 | void); | ||
100 | |||
101 | void | 78 | void |
102 | acpi_ut_subsystem_shutdown ( | 79 | acpi_ut_init_globals ( |
103 | void); | ||
104 | |||
105 | acpi_status | ||
106 | acpi_ut_validate_fadt ( | ||
107 | void); | 80 | void); |
108 | 81 | ||
109 | /* | ||
110 | * ut_global - Global data structures and procedures | ||
111 | */ | ||
112 | |||
113 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) | 82 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) |
114 | 83 | ||
115 | char * | 84 | char * |
@@ -157,9 +126,24 @@ acpi_ut_allocate_owner_id ( | |||
157 | 126 | ||
158 | 127 | ||
159 | /* | 128 | /* |
160 | * ut_clib - Local implementations of C library functions | 129 | * utinit - miscellaneous initialization and shutdown |
161 | */ | 130 | */ |
131 | acpi_status | ||
132 | acpi_ut_hardware_initialize ( | ||
133 | void); | ||
162 | 134 | ||
135 | void | ||
136 | acpi_ut_subsystem_shutdown ( | ||
137 | void); | ||
138 | |||
139 | acpi_status | ||
140 | acpi_ut_validate_fadt ( | ||
141 | void); | ||
142 | |||
143 | |||
144 | /* | ||
145 | * utclib - Local implementations of C library functions | ||
146 | */ | ||
163 | #ifndef ACPI_USE_SYSTEM_CLIBRARY | 147 | #ifndef ACPI_USE_SYSTEM_CLIBRARY |
164 | 148 | ||
165 | acpi_size | 149 | acpi_size |
@@ -260,10 +244,10 @@ extern const u8 _acpi_ctype[]; | |||
260 | 244 | ||
261 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 245 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
262 | 246 | ||
247 | |||
263 | /* | 248 | /* |
264 | * ut_copy - Object construction and conversion interfaces | 249 | * utcopy - Object construction and conversion interfaces |
265 | */ | 250 | */ |
266 | |||
267 | acpi_status | 251 | acpi_status |
268 | acpi_ut_build_simple_object( | 252 | acpi_ut_build_simple_object( |
269 | union acpi_operand_object *obj, | 253 | union acpi_operand_object *obj, |
@@ -278,30 +262,11 @@ acpi_ut_build_package_object ( | |||
278 | u32 *space_used); | 262 | u32 *space_used); |
279 | 263 | ||
280 | acpi_status | 264 | acpi_status |
281 | acpi_ut_copy_ielement_to_eelement ( | ||
282 | u8 object_type, | ||
283 | union acpi_operand_object *source_object, | ||
284 | union acpi_generic_state *state, | ||
285 | void *context); | ||
286 | |||
287 | acpi_status | ||
288 | acpi_ut_copy_ielement_to_ielement ( | ||
289 | u8 object_type, | ||
290 | union acpi_operand_object *source_object, | ||
291 | union acpi_generic_state *state, | ||
292 | void *context); | ||
293 | |||
294 | acpi_status | ||
295 | acpi_ut_copy_iobject_to_eobject ( | 265 | acpi_ut_copy_iobject_to_eobject ( |
296 | union acpi_operand_object *obj, | 266 | union acpi_operand_object *obj, |
297 | struct acpi_buffer *ret_buffer); | 267 | struct acpi_buffer *ret_buffer); |
298 | 268 | ||
299 | acpi_status | 269 | acpi_status |
300 | acpi_ut_copy_esimple_to_isimple( | ||
301 | union acpi_object *user_obj, | ||
302 | union acpi_operand_object **return_obj); | ||
303 | |||
304 | acpi_status | ||
305 | acpi_ut_copy_eobject_to_iobject ( | 270 | acpi_ut_copy_eobject_to_iobject ( |
306 | union acpi_object *obj, | 271 | union acpi_object *obj, |
307 | union acpi_operand_object **internal_obj); | 272 | union acpi_operand_object **internal_obj); |
@@ -312,17 +277,6 @@ acpi_ut_copy_isimple_to_isimple ( | |||
312 | union acpi_operand_object *dest_obj); | 277 | union acpi_operand_object *dest_obj); |
313 | 278 | ||
314 | acpi_status | 279 | acpi_status |
315 | acpi_ut_copy_ipackage_to_ipackage ( | ||
316 | union acpi_operand_object *source_obj, | ||
317 | union acpi_operand_object *dest_obj, | ||
318 | struct acpi_walk_state *walk_state); | ||
319 | |||
320 | acpi_status | ||
321 | acpi_ut_copy_simple_object ( | ||
322 | union acpi_operand_object *source_desc, | ||
323 | union acpi_operand_object *dest_desc); | ||
324 | |||
325 | acpi_status | ||
326 | acpi_ut_copy_iobject_to_iobject ( | 280 | acpi_ut_copy_iobject_to_iobject ( |
327 | union acpi_operand_object *source_desc, | 281 | union acpi_operand_object *source_desc, |
328 | union acpi_operand_object **dest_desc, | 282 | union acpi_operand_object **dest_desc, |
@@ -330,9 +284,8 @@ acpi_ut_copy_iobject_to_iobject ( | |||
330 | 284 | ||
331 | 285 | ||
332 | /* | 286 | /* |
333 | * ut_create - Object creation | 287 | * utcreate - Object creation |
334 | */ | 288 | */ |
335 | |||
336 | acpi_status | 289 | acpi_status |
337 | acpi_ut_update_object_reference ( | 290 | acpi_ut_update_object_reference ( |
338 | union acpi_operand_object *object, | 291 | union acpi_operand_object *object, |
@@ -340,9 +293,8 @@ acpi_ut_update_object_reference ( | |||
340 | 293 | ||
341 | 294 | ||
342 | /* | 295 | /* |
343 | * ut_debug - Debug interfaces | 296 | * utdebug - Debug interfaces |
344 | */ | 297 | */ |
345 | |||
346 | void | 298 | void |
347 | acpi_ut_init_stack_ptr_trace ( | 299 | acpi_ut_init_stack_ptr_trace ( |
348 | void); | 300 | void); |
@@ -440,11 +392,14 @@ acpi_ut_debug_print_raw ( | |||
440 | 392 | ||
441 | 393 | ||
442 | /* | 394 | /* |
443 | * ut_delete - Object deletion | 395 | * utdelete - Object deletion and reference counts |
444 | */ | 396 | */ |
397 | void | ||
398 | acpi_ut_add_reference ( | ||
399 | union acpi_operand_object *object); | ||
445 | 400 | ||
446 | void | 401 | void |
447 | acpi_ut_delete_internal_obj ( | 402 | acpi_ut_remove_reference ( |
448 | union acpi_operand_object *object); | 403 | union acpi_operand_object *object); |
449 | 404 | ||
450 | void | 405 | void |
@@ -461,25 +416,8 @@ acpi_ut_delete_internal_object_list ( | |||
461 | 416 | ||
462 | 417 | ||
463 | /* | 418 | /* |
464 | * ut_eval - object evaluation | 419 | * uteval - object evaluation |
465 | */ | 420 | */ |
466 | |||
467 | /* Method name strings */ | ||
468 | |||
469 | #define METHOD_NAME__HID "_HID" | ||
470 | #define METHOD_NAME__CID "_CID" | ||
471 | #define METHOD_NAME__UID "_UID" | ||
472 | #define METHOD_NAME__ADR "_ADR" | ||
473 | #define METHOD_NAME__STA "_STA" | ||
474 | #define METHOD_NAME__REG "_REG" | ||
475 | #define METHOD_NAME__SEG "_SEG" | ||
476 | #define METHOD_NAME__BBN "_BBN" | ||
477 | #define METHOD_NAME__PRT "_PRT" | ||
478 | #define METHOD_NAME__CRS "_CRS" | ||
479 | #define METHOD_NAME__PRS "_PRS" | ||
480 | #define METHOD_NAME__PRW "_PRW" | ||
481 | |||
482 | |||
483 | acpi_status | 421 | acpi_status |
484 | acpi_ut_osi_implementation ( | 422 | acpi_ut_osi_implementation ( |
485 | struct acpi_walk_state *walk_state); | 423 | struct acpi_walk_state *walk_state); |
@@ -522,39 +460,10 @@ acpi_ut_execute_sxds ( | |||
522 | struct acpi_namespace_node *device_node, | 460 | struct acpi_namespace_node *device_node, |
523 | u8 *highest); | 461 | u8 *highest); |
524 | 462 | ||
525 | /* | ||
526 | * ut_mutex - mutual exclusion interfaces | ||
527 | */ | ||
528 | |||
529 | acpi_status | ||
530 | acpi_ut_mutex_initialize ( | ||
531 | void); | ||
532 | |||
533 | void | ||
534 | acpi_ut_mutex_terminate ( | ||
535 | void); | ||
536 | |||
537 | acpi_status | ||
538 | acpi_ut_create_mutex ( | ||
539 | acpi_mutex_handle mutex_id); | ||
540 | |||
541 | acpi_status | ||
542 | acpi_ut_delete_mutex ( | ||
543 | acpi_mutex_handle mutex_id); | ||
544 | |||
545 | acpi_status | ||
546 | acpi_ut_acquire_mutex ( | ||
547 | acpi_mutex_handle mutex_id); | ||
548 | |||
549 | acpi_status | ||
550 | acpi_ut_release_mutex ( | ||
551 | acpi_mutex_handle mutex_id); | ||
552 | |||
553 | 463 | ||
554 | /* | 464 | /* |
555 | * ut_object - internal object create/delete/cache routines | 465 | * utobject - internal object create/delete/cache routines |
556 | */ | 466 | */ |
557 | |||
558 | union acpi_operand_object * | 467 | union acpi_operand_object * |
559 | acpi_ut_create_internal_object_dbg ( | 468 | acpi_ut_create_internal_object_dbg ( |
560 | char *module_name, | 469 | char *module_name, |
@@ -587,50 +496,15 @@ union acpi_operand_object * | |||
587 | acpi_ut_create_string_object ( | 496 | acpi_ut_create_string_object ( |
588 | acpi_size string_size); | 497 | acpi_size string_size); |
589 | 498 | ||
590 | |||
591 | /* | ||
592 | * ut_ref_cnt - Object reference count management | ||
593 | */ | ||
594 | |||
595 | void | ||
596 | acpi_ut_add_reference ( | ||
597 | union acpi_operand_object *object); | ||
598 | |||
599 | void | ||
600 | acpi_ut_remove_reference ( | ||
601 | union acpi_operand_object *object); | ||
602 | |||
603 | /* | ||
604 | * ut_size - Object size routines | ||
605 | */ | ||
606 | |||
607 | acpi_status | ||
608 | acpi_ut_get_simple_object_size ( | ||
609 | union acpi_operand_object *obj, | ||
610 | acpi_size *obj_length); | ||
611 | |||
612 | acpi_status | ||
613 | acpi_ut_get_package_object_size ( | ||
614 | union acpi_operand_object *obj, | ||
615 | acpi_size *obj_length); | ||
616 | |||
617 | acpi_status | 499 | acpi_status |
618 | acpi_ut_get_object_size( | 500 | acpi_ut_get_object_size( |
619 | union acpi_operand_object *obj, | 501 | union acpi_operand_object *obj, |
620 | acpi_size *obj_length); | 502 | acpi_size *obj_length); |
621 | 503 | ||
622 | acpi_status | ||
623 | acpi_ut_get_element_length ( | ||
624 | u8 object_type, | ||
625 | union acpi_operand_object *source_object, | ||
626 | union acpi_generic_state *state, | ||
627 | void *context); | ||
628 | |||
629 | 504 | ||
630 | /* | 505 | /* |
631 | * ut_state - Generic state creation/cache routines | 506 | * utstate - Generic state creation/cache routines |
632 | */ | 507 | */ |
633 | |||
634 | void | 508 | void |
635 | acpi_ut_push_generic_state ( | 509 | acpi_ut_push_generic_state ( |
636 | union acpi_generic_state **list_head, | 510 | union acpi_generic_state **list_head, |
@@ -666,14 +540,14 @@ acpi_ut_create_update_state_and_push ( | |||
666 | u16 action, | 540 | u16 action, |
667 | union acpi_generic_state **state_list); | 541 | union acpi_generic_state **state_list); |
668 | 542 | ||
669 | #ifdef ACPI_FUTURE_USAGE | 543 | #ifdef ACPI_FUTURE_USAGE |
670 | acpi_status | 544 | acpi_status |
671 | acpi_ut_create_pkg_state_and_push ( | 545 | acpi_ut_create_pkg_state_and_push ( |
672 | void *internal_object, | 546 | void *internal_object, |
673 | void *external_object, | 547 | void *external_object, |
674 | u16 index, | 548 | u16 index, |
675 | union acpi_generic_state **state_list); | 549 | union acpi_generic_state **state_list); |
676 | #endif | 550 | #endif /* ACPI_FUTURE_USAGE */ |
677 | 551 | ||
678 | union acpi_generic_state * | 552 | union acpi_generic_state * |
679 | acpi_ut_create_control_state ( | 553 | acpi_ut_create_control_state ( |
@@ -693,15 +567,10 @@ acpi_ut_delete_object_cache ( | |||
693 | void); | 567 | void); |
694 | #endif | 568 | #endif |
695 | 569 | ||
570 | |||
696 | /* | 571 | /* |
697 | * utmisc | 572 | * utmath |
698 | */ | 573 | */ |
699 | |||
700 | void | ||
701 | acpi_ut_print_string ( | ||
702 | char *string, | ||
703 | u8 max_length); | ||
704 | |||
705 | acpi_status | 574 | acpi_status |
706 | acpi_ut_divide ( | 575 | acpi_ut_divide ( |
707 | acpi_integer in_dividend, | 576 | acpi_integer in_dividend, |
@@ -716,6 +585,25 @@ acpi_ut_short_divide ( | |||
716 | acpi_integer *out_quotient, | 585 | acpi_integer *out_quotient, |
717 | u32 *out_remainder); | 586 | u32 *out_remainder); |
718 | 587 | ||
588 | /* | ||
589 | * utmisc | ||
590 | */ | ||
591 | acpi_status | ||
592 | acpi_ut_walk_package_tree ( | ||
593 | union acpi_operand_object *source_object, | ||
594 | void *target_object, | ||
595 | acpi_pkg_callback walk_callback, | ||
596 | void *context); | ||
597 | |||
598 | char * | ||
599 | acpi_ut_strupr ( | ||
600 | char *src_string); | ||
601 | |||
602 | void | ||
603 | acpi_ut_print_string ( | ||
604 | char *string, | ||
605 | u8 max_length); | ||
606 | |||
719 | u8 | 607 | u8 |
720 | acpi_ut_valid_acpi_name ( | 608 | acpi_ut_valid_acpi_name ( |
721 | u32 name); | 609 | u32 name); |
@@ -734,11 +622,21 @@ acpi_ut_strtoul64 ( | |||
734 | 622 | ||
735 | #define ACPI_ANY_BASE 0 | 623 | #define ACPI_ANY_BASE 0 |
736 | 624 | ||
737 | #ifdef ACPI_FUTURE_USAGE | 625 | acpi_status |
738 | char * | 626 | acpi_ut_mutex_initialize ( |
739 | acpi_ut_strupr ( | 627 | void); |
740 | char *src_string); | 628 | |
741 | #endif | 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); | ||
742 | 640 | ||
743 | u8 * | 641 | u8 * |
744 | acpi_ut_get_resource_end_tag ( | 642 | acpi_ut_get_resource_end_tag ( |
@@ -768,9 +666,8 @@ acpi_ut_display_init_pathname ( | |||
768 | 666 | ||
769 | 667 | ||
770 | /* | 668 | /* |
771 | * Utalloc - memory allocation and object caching | 669 | * utalloc - memory allocation and object caching |
772 | */ | 670 | */ |
773 | |||
774 | void * | 671 | void * |
775 | acpi_ut_acquire_from_cache ( | 672 | acpi_ut_acquire_from_cache ( |
776 | u32 list_id); | 673 | u32 list_id); |
@@ -795,9 +692,6 @@ acpi_ut_initialize_buffer ( | |||
795 | struct acpi_buffer *buffer, | 692 | struct acpi_buffer *buffer, |
796 | acpi_size required_length); | 693 | acpi_size required_length); |
797 | 694 | ||
798 | |||
799 | /* Memory allocation functions */ | ||
800 | |||
801 | void * | 695 | void * |
802 | acpi_ut_allocate ( | 696 | acpi_ut_allocate ( |
803 | acpi_size size, | 697 | acpi_size size, |
@@ -812,9 +706,7 @@ acpi_ut_callocate ( | |||
812 | char *module, | 706 | char *module, |
813 | u32 line); | 707 | u32 line); |
814 | 708 | ||
815 | |||
816 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS | 709 | #ifdef ACPI_DBG_TRACK_ALLOCATIONS |
817 | |||
818 | void * | 710 | void * |
819 | acpi_ut_allocate_and_track ( | 711 | acpi_ut_allocate_and_track ( |
820 | acpi_size size, | 712 | acpi_size size, |
@@ -836,34 +728,11 @@ acpi_ut_free_and_track ( | |||
836 | char *module, | 728 | char *module, |
837 | u32 line); | 729 | u32 line); |
838 | 730 | ||
839 | struct acpi_debug_mem_block * | 731 | #ifdef ACPI_FUTURE_USAGE |
840 | acpi_ut_find_allocation ( | ||
841 | u32 list_id, | ||
842 | void *allocation); | ||
843 | |||
844 | acpi_status | ||
845 | acpi_ut_track_allocation ( | ||
846 | u32 list_id, | ||
847 | struct acpi_debug_mem_block *address, | ||
848 | acpi_size size, | ||
849 | u8 alloc_type, | ||
850 | u32 component, | ||
851 | char *module, | ||
852 | u32 line); | ||
853 | |||
854 | acpi_status | ||
855 | acpi_ut_remove_allocation ( | ||
856 | u32 list_id, | ||
857 | struct acpi_debug_mem_block *address, | ||
858 | u32 component, | ||
859 | char *module, | ||
860 | u32 line); | ||
861 | |||
862 | #ifdef ACPI_FUTURE_USAGE | ||
863 | void | 732 | void |
864 | acpi_ut_dump_allocation_info ( | 733 | acpi_ut_dump_allocation_info ( |
865 | void); | 734 | void); |
866 | #endif | 735 | #endif /* ACPI_FUTURE_USAGE */ |
867 | 736 | ||
868 | void | 737 | void |
869 | acpi_ut_dump_allocations ( | 738 | acpi_ut_dump_allocations ( |
@@ -871,5 +740,4 @@ acpi_ut_dump_allocations ( | |||
871 | char *module); | 740 | char *module); |
872 | #endif | 741 | #endif |
873 | 742 | ||
874 | |||
875 | #endif /* _ACUTILS_H */ | 743 | #endif /* _ACUTILS_H */ |