diff options
Diffstat (limited to 'drivers/acpi/utilities/utglobal.c')
-rw-r--r-- | drivers/acpi/utilities/utglobal.c | 108 |
1 files changed, 9 insertions, 99 deletions
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c index 4146019b543f..0e4161c81076 100644 --- a/drivers/acpi/utilities/utglobal.c +++ b/drivers/acpi/utilities/utglobal.c | |||
@@ -738,73 +738,6 @@ acpi_ut_valid_object_type ( | |||
738 | 738 | ||
739 | /******************************************************************************* | 739 | /******************************************************************************* |
740 | * | 740 | * |
741 | * FUNCTION: acpi_ut_allocate_owner_id | ||
742 | * | ||
743 | * PARAMETERS: id_type - Type of ID (method or table) | ||
744 | * | ||
745 | * DESCRIPTION: Allocate a table or method owner id | ||
746 | * | ||
747 | * NOTE: this algorithm has a wraparound problem at 64_k method invocations, and | ||
748 | * should be revisited (TBD) | ||
749 | * | ||
750 | ******************************************************************************/ | ||
751 | |||
752 | acpi_owner_id | ||
753 | acpi_ut_allocate_owner_id ( | ||
754 | u32 id_type) | ||
755 | { | ||
756 | acpi_owner_id owner_id = 0xFFFF; | ||
757 | |||
758 | |||
759 | ACPI_FUNCTION_TRACE ("ut_allocate_owner_id"); | ||
760 | |||
761 | |||
762 | if (ACPI_FAILURE (acpi_ut_acquire_mutex (ACPI_MTX_CACHES))) | ||
763 | { | ||
764 | return (0); | ||
765 | } | ||
766 | |||
767 | switch (id_type) | ||
768 | { | ||
769 | case ACPI_OWNER_TYPE_TABLE: | ||
770 | |||
771 | owner_id = acpi_gbl_next_table_owner_id; | ||
772 | acpi_gbl_next_table_owner_id++; | ||
773 | |||
774 | /* Check for wraparound */ | ||
775 | |||
776 | if (acpi_gbl_next_table_owner_id == ACPI_FIRST_METHOD_ID) | ||
777 | { | ||
778 | acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID; | ||
779 | ACPI_REPORT_WARNING (("Table owner ID wraparound\n")); | ||
780 | } | ||
781 | break; | ||
782 | |||
783 | |||
784 | case ACPI_OWNER_TYPE_METHOD: | ||
785 | |||
786 | owner_id = acpi_gbl_next_method_owner_id; | ||
787 | acpi_gbl_next_method_owner_id++; | ||
788 | |||
789 | if (acpi_gbl_next_method_owner_id == ACPI_FIRST_TABLE_ID) | ||
790 | { | ||
791 | /* Check for wraparound */ | ||
792 | |||
793 | acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID; | ||
794 | } | ||
795 | break; | ||
796 | |||
797 | default: | ||
798 | break; | ||
799 | } | ||
800 | |||
801 | (void) acpi_ut_release_mutex (ACPI_MTX_CACHES); | ||
802 | return_VALUE (owner_id); | ||
803 | } | ||
804 | |||
805 | |||
806 | /******************************************************************************* | ||
807 | * | ||
808 | * FUNCTION: acpi_ut_init_globals | 741 | * FUNCTION: acpi_ut_init_globals |
809 | * | 742 | * |
810 | * PARAMETERS: None | 743 | * PARAMETERS: None |
@@ -820,42 +753,20 @@ void | |||
820 | acpi_ut_init_globals ( | 753 | acpi_ut_init_globals ( |
821 | void) | 754 | void) |
822 | { | 755 | { |
756 | acpi_status status; | ||
823 | u32 i; | 757 | u32 i; |
824 | 758 | ||
825 | 759 | ||
826 | ACPI_FUNCTION_TRACE ("ut_init_globals"); | 760 | ACPI_FUNCTION_TRACE ("ut_init_globals"); |
827 | 761 | ||
828 | 762 | ||
829 | /* Memory allocation and cache lists */ | 763 | /* Create all memory caches */ |
830 | |||
831 | ACPI_MEMSET (acpi_gbl_memory_lists, 0, sizeof (struct acpi_memory_list) * ACPI_NUM_MEM_LISTS); | ||
832 | 764 | ||
833 | acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].link_offset = (u16) ACPI_PTR_DIFF (&(((union acpi_generic_state *) NULL)->common.next), NULL); | 765 | status = acpi_ut_create_caches (); |
834 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].link_offset = (u16) ACPI_PTR_DIFF (&(((union acpi_parse_object *) NULL)->common.next), NULL); | 766 | if (ACPI_FAILURE (status)) |
835 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].link_offset = (u16) ACPI_PTR_DIFF (&(((union acpi_parse_object *) NULL)->common.next), NULL); | 767 | { |
836 | acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].link_offset = (u16) ACPI_PTR_DIFF (&(((union acpi_operand_object *) NULL)->cache.next), NULL); | 768 | return; |
837 | acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].link_offset = (u16) ACPI_PTR_DIFF (&(((struct acpi_walk_state *) NULL)->next), NULL); | 769 | } |
838 | |||
839 | acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].object_size = sizeof (struct acpi_namespace_node); | ||
840 | acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].object_size = sizeof (union acpi_generic_state); | ||
841 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].object_size = sizeof (struct acpi_parse_obj_common); | ||
842 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].object_size = sizeof (struct acpi_parse_obj_named); | ||
843 | acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].object_size = sizeof (union acpi_operand_object); | ||
844 | acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].object_size = sizeof (struct acpi_walk_state); | ||
845 | |||
846 | acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].max_cache_depth = ACPI_MAX_STATE_CACHE_DEPTH; | ||
847 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].max_cache_depth = ACPI_MAX_PARSE_CACHE_DEPTH; | ||
848 | acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].max_cache_depth = ACPI_MAX_EXTPARSE_CACHE_DEPTH; | ||
849 | acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].max_cache_depth = ACPI_MAX_OBJECT_CACHE_DEPTH; | ||
850 | acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].max_cache_depth = ACPI_MAX_WALK_CACHE_DEPTH; | ||
851 | |||
852 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_GLOBAL].list_name = "Global Memory Allocation"); | ||
853 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_NSNODE].list_name = "Namespace Nodes"); | ||
854 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_STATE].list_name = "State Object Cache"); | ||
855 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE].list_name = "Parse Node Cache"); | ||
856 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_PSNODE_EXT].list_name = "Extended Parse Node Cache"); | ||
857 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_OPERAND].list_name = "Operand Object Cache"); | ||
858 | ACPI_MEM_TRACKING (acpi_gbl_memory_lists[ACPI_MEM_LIST_WALK].list_name = "Tree Walk Node Cache"); | ||
859 | 770 | ||
860 | /* ACPI table structure */ | 771 | /* ACPI table structure */ |
861 | 772 | ||
@@ -870,7 +781,7 @@ acpi_ut_init_globals ( | |||
870 | for (i = 0; i < NUM_MUTEX; i++) | 781 | for (i = 0; i < NUM_MUTEX; i++) |
871 | { | 782 | { |
872 | acpi_gbl_mutex_info[i].mutex = NULL; | 783 | acpi_gbl_mutex_info[i].mutex = NULL; |
873 | acpi_gbl_mutex_info[i].owner_id = ACPI_MUTEX_NOT_ACQUIRED; | 784 | acpi_gbl_mutex_info[i].thread_id = ACPI_MUTEX_NOT_ACQUIRED; |
874 | acpi_gbl_mutex_info[i].use_count = 0; | 785 | acpi_gbl_mutex_info[i].use_count = 0; |
875 | } | 786 | } |
876 | 787 | ||
@@ -911,8 +822,7 @@ acpi_ut_init_globals ( | |||
911 | acpi_gbl_ns_lookup_count = 0; | 822 | acpi_gbl_ns_lookup_count = 0; |
912 | acpi_gbl_ps_find_count = 0; | 823 | acpi_gbl_ps_find_count = 0; |
913 | acpi_gbl_acpi_hardware_present = TRUE; | 824 | acpi_gbl_acpi_hardware_present = TRUE; |
914 | acpi_gbl_next_table_owner_id = ACPI_FIRST_TABLE_ID; | 825 | acpi_gbl_owner_id_mask = 0; |
915 | acpi_gbl_next_method_owner_id = ACPI_FIRST_METHOD_ID; | ||
916 | acpi_gbl_debugger_configuration = DEBUGGER_THREADING; | 826 | acpi_gbl_debugger_configuration = DEBUGGER_THREADING; |
917 | acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; | 827 | acpi_gbl_db_output_flags = ACPI_DB_CONSOLE_OUTPUT; |
918 | 828 | ||