aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2005-12-16 17:05:00 -0500
committerLen Brown <len.brown@intel.com>2005-12-28 02:54:59 -0500
commitdefba1d8f233c0d5cf3e1ea6aeb898eca7231860 (patch)
treecd8b1b84da8d8a52ad0d44107daaeeee0a0b65f4 /drivers/acpi/utilities
parentcb654695f6b912cef7cb3271665b6ee0d416124c (diff)
[ACPI] ACPICA 20051216
Implemented optional support to allow unresolved names within ASL Package objects. A null object is inserted in the package when a named reference cannot be located in the current namespace. Enabled via the interpreter slack flag which Linux has enabled by default (acpi=strict to disable slack). This should eliminate AE_NOT_FOUND exceptions seen on machines that contain such code. Implemented an optimization to the initialization sequence that can improve boot time. During ACPI device initialization, the _STA method is now run if and only if the _INI method exists. The _STA method is used to determine if the device is present; An _INI can only be run if _STA returns present, but it is a waste of time to run the _STA method if the _INI does not exist. (Prototype and assistance from Dong Wei) Implemented use of the C99 uintptr_t for the pointer casting macros if it is available in the current compiler. Otherwise, the default (void *) cast is used as before. Fixed some possible memory leaks found within the execution path of the Break, Continue, If, and CreateField operators. (Valery Podrezov) Fixed a problem introduced in the 20051202 release where an exception is generated during method execution if a control method attempts to declare another method. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities')
-rw-r--r--drivers/acpi/utilities/utalloc.c4
-rw-r--r--drivers/acpi/utilities/uteval.c20
-rw-r--r--drivers/acpi/utilities/utglobal.c9
-rw-r--r--drivers/acpi/utilities/utmisc.c2
-rw-r--r--drivers/acpi/utilities/utresrc.c109
5 files changed, 127 insertions, 17 deletions
diff --git a/drivers/acpi/utilities/utalloc.c b/drivers/acpi/utilities/utalloc.c
index e04b6119a4d7..b11b7ed788c6 100644
--- a/drivers/acpi/utilities/utalloc.c
+++ b/drivers/acpi/utilities/utalloc.c
@@ -47,7 +47,7 @@
47ACPI_MODULE_NAME("utalloc") 47ACPI_MODULE_NAME("utalloc")
48 48
49/* Local prototypes */ 49/* Local prototypes */
50#ifdef ACPI_DBG_TRACK_ALLOCATIONS 50#ifdef ACPI_DBG_TRACK_ALLOCATIONS
51static struct acpi_debug_mem_block *acpi_ut_find_allocation(void *allocation); 51static struct acpi_debug_mem_block *acpi_ut_find_allocation(void *allocation);
52 52
53static acpi_status 53static acpi_status
@@ -58,9 +58,7 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *address,
58static acpi_status 58static acpi_status
59acpi_ut_remove_allocation(struct acpi_debug_mem_block *address, 59acpi_ut_remove_allocation(struct acpi_debug_mem_block *address,
60 u32 component, char *module, u32 line); 60 u32 component, char *module, u32 line);
61#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
62 61
63#ifdef ACPI_DBG_TRACK_ALLOCATIONS
64static acpi_status 62static acpi_status
65acpi_ut_create_list(char *list_name, 63acpi_ut_create_list(char *list_name,
66 u16 object_size, struct acpi_memory_list **return_cache); 64 u16 object_size, struct acpi_memory_list **return_cache);
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c
index 7b81d5ef3c32..cd63a2d93fe3 100644
--- a/drivers/acpi/utilities/uteval.c
+++ b/drivers/acpi/utilities/uteval.c
@@ -95,7 +95,9 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state)
95 95
96 for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) { 96 for (i = 0; i < ACPI_NUM_OSI_STRINGS; i++) {
97 if (!ACPI_STRCMP(string_desc->string.pointer, 97 if (!ACPI_STRCMP(string_desc->string.pointer,
98 (char *)acpi_gbl_valid_osi_strings[i])) { 98 ACPI_CAST_PTR(char,
99 acpi_gbl_valid_osi_strings[i])))
100 {
99 /* This string is supported */ 101 /* This string is supported */
100 102
101 return_desc->integer.value = 0xFFFFFFFF; 103 return_desc->integer.value = 0xFFFFFFFF;
@@ -592,7 +594,7 @@ acpi_ut_execute_STA(struct acpi_namespace_node *device_node, u32 * flags)
592 "_STA on %4.4s was not found, assuming device is present\n", 594 "_STA on %4.4s was not found, assuming device is present\n",
593 acpi_ut_get_node_name(device_node))); 595 acpi_ut_get_node_name(device_node)));
594 596
595 *flags = 0x0F; 597 *flags = ACPI_UINT32_MAX;
596 status = AE_OK; 598 status = AE_OK;
597 } 599 }
598 600
@@ -637,17 +639,17 @@ acpi_ut_execute_sxds(struct acpi_namespace_node *device_node, u8 * highest)
637 for (i = 0; i < 4; i++) { 639 for (i = 0; i < 4; i++) {
638 highest[i] = 0xFF; 640 highest[i] = 0xFF;
639 status = acpi_ut_evaluate_object(device_node, 641 status = acpi_ut_evaluate_object(device_node,
640 (char *) 642 ACPI_CAST_PTR(char,
641 acpi_gbl_highest_dstate_names 643 acpi_gbl_highest_dstate_names
642 [i], ACPI_BTYPE_INTEGER, 644 [i]),
643 &obj_desc); 645 ACPI_BTYPE_INTEGER, &obj_desc);
644 if (ACPI_FAILURE(status)) { 646 if (ACPI_FAILURE(status)) {
645 if (status != AE_NOT_FOUND) { 647 if (status != AE_NOT_FOUND) {
646 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 648 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
647 "%s on Device %4.4s, %s\n", 649 "%s on Device %4.4s, %s\n",
648 (char *) 650 ACPI_CAST_PTR(char,
649 acpi_gbl_highest_dstate_names 651 acpi_gbl_highest_dstate_names
650 [i], 652 [i]),
651 acpi_ut_get_node_name 653 acpi_ut_get_node_name
652 (device_node), 654 (device_node),
653 acpi_format_exception 655 acpi_format_exception
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 6828c7aefa8a..7c59c2b0d953 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -485,7 +485,7 @@ char *acpi_ut_get_region_name(u8 space_id)
485 return ("invalid_space_id"); 485 return ("invalid_space_id");
486 } 486 }
487 487
488 return ((char *)acpi_gbl_region_types[space_id]); 488 return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id]));
489} 489}
490 490
491/******************************************************************************* 491/*******************************************************************************
@@ -690,11 +690,12 @@ char *acpi_ut_get_descriptor_name(void *object)
690 } 690 }
691 691
692 if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) { 692 if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) {
693 return ((char *)acpi_gbl_bad_type); 693 return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
694 } 694 }
695 695
696 return ((char *) 696 return (ACPI_CAST_PTR(char,
697 acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE(object)]); 697 acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE
698 (object)]));
698 699
699} 700}
700 701
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 64dd64b1aa18..48d511d5c04b 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -179,7 +179,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr)
179 179
180 /* Zero is not a valid owner_iD */ 180 /* Zero is not a valid owner_iD */
181 181
182 if ((owner_id == 0) || (owner_id > 255)) { 182 if (owner_id == 0) {
183 ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id)); 183 ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id));
184 return_VOID; 184 return_VOID;
185 } 185 }
diff --git a/drivers/acpi/utilities/utresrc.c b/drivers/acpi/utilities/utresrc.c
index 6c0ce7b12194..eaf0edec6efe 100644
--- a/drivers/acpi/utilities/utresrc.c
+++ b/drivers/acpi/utilities/utresrc.c
@@ -47,6 +47,115 @@
47#define _COMPONENT ACPI_UTILITIES 47#define _COMPONENT ACPI_UTILITIES
48ACPI_MODULE_NAME("utmisc") 48ACPI_MODULE_NAME("utmisc")
49 49
50#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
51/*
52 * Strings used to decode resource descriptors.
53 * Used by both the disasssembler and the debugger resource dump routines
54 */
55const char *acpi_gbl_BMdecode[2] = {
56 "not_bus_master",
57 "bus_master"
58};
59
60const char *acpi_gbl_config_decode[4] = {
61 "0 - Good Configuration",
62 "1 - Acceptable Configuration",
63 "2 - Suboptimal Configuration",
64 "3 - ***Invalid Configuration***",
65};
66
67const char *acpi_gbl_consume_decode[2] = {
68 "resource_producer",
69 "resource_consumer"
70};
71
72const char *acpi_gbl_DECdecode[2] = {
73 "pos_decode",
74 "sub_decode"
75};
76
77const char *acpi_gbl_HEdecode[2] = {
78 "Level",
79 "Edge"
80};
81
82const char *acpi_gbl_io_decode[2] = {
83 "Decode10",
84 "Decode16"
85};
86
87const char *acpi_gbl_LLdecode[2] = {
88 "active_high",
89 "active_low"
90};
91
92const char *acpi_gbl_max_decode[2] = {
93 "max_not_fixed",
94 "max_fixed"
95};
96
97const char *acpi_gbl_MEMdecode[4] = {
98 "non_cacheable",
99 "Cacheable",
100 "write_combining",
101 "Prefetchable"
102};
103
104const char *acpi_gbl_min_decode[2] = {
105 "min_not_fixed",
106 "min_fixed"
107};
108
109const char *acpi_gbl_MTPdecode[4] = {
110 "address_range_memory",
111 "address_range_reserved",
112 "address_range_aCPI",
113 "address_range_nVS"
114};
115
116const char *acpi_gbl_RNGdecode[4] = {
117 "invalid_ranges",
118 "non_iSAonly_ranges",
119 "ISAonly_ranges",
120 "entire_range"
121};
122
123const char *acpi_gbl_RWdecode[2] = {
124 "read_only",
125 "read_write"
126};
127
128const char *acpi_gbl_SHRdecode[2] = {
129 "Exclusive",
130 "Shared"
131};
132
133const char *acpi_gbl_SIZdecode[4] = {
134 "Transfer8",
135 "Transfer8_16",
136 "Transfer16",
137 "invalid_size"
138};
139
140const char *acpi_gbl_TRSdecode[2] = {
141 "dense_translation",
142 "sparse_translation"
143};
144
145const char *acpi_gbl_TTPdecode[2] = {
146 "type_static",
147 "type_translation"
148};
149
150const char *acpi_gbl_TYPdecode[4] = {
151 "Compatibility",
152 "type_a",
153 "type_b",
154 "type_f"
155};
156
157#endif
158
50/* 159/*
51 * Base sizes of the raw AML resource descriptors, indexed by resource type. 160 * Base sizes of the raw AML resource descriptors, indexed by resource type.
52 * Zero indicates a reserved (and therefore invalid) resource type. 161 * Zero indicates a reserved (and therefore invalid) resource type.