aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/hardware
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-05-26 16:36:00 -0400
committerLen Brown <len.brown@intel.com>2006-06-14 02:44:35 -0400
commit4119532c95547821dbe72d6916dfa1b2148475b3 (patch)
tree564eb8f69924fb7dc72e93526faf1547acac7d30 /drivers/acpi/hardware
parentb8d35192c55fb055792ff0641408eaaec7c88988 (diff)
ACPI: ACPICA 20060526
Restructured, flattened, and simplified the internal interfaces for namespace object evaluation - resulting in smaller code, less CPU stack use, and fewer interfaces. (With assistance from Mikhail Kouzmich) Fixed a problem with the CopyObject operator where the first parameter was not typed correctly for the parser, interpreter, compiler, and disassembler. Caused various errors and unexpected behavior. Fixed a problem where a ShiftLeft or ShiftRight of more than 64 bits produced incorrect results with some C compilers. Since the behavior of C compilers when the shift value is larger than the datatype width is apparently not well defined, the interpreter now detects this condition and simply returns zero as expected in all such cases. (BZ 395) Fixed problem reports (Valery Podrezov) integrated: - Update String-to-Integer conversion to match ACPI 3.0A spec http://bugzilla.kernel.org/show_bug.cgi?id=5329 Allow interpreter to handle nested method declarations http://bugzilla.kernel.org/show_bug.cgi?id=5361 Fixed problem reports (Fiodor Suietov) integrated: - acpi_terminate() doesn't free debug memory allocation list objects (BZ 355) - After Core Subsystem shutdown, acpi_subsystem_status() returns AE_OK (BZ 356) - acpi_os_unmap_memory() for RSDP can be invoked inconsistently (BZ 357) - Resource Manager should return AE_TYPE for non-device objects (BZ 358) - Incomplete cleanup branch in AcpiNsEvaluateRelative (BZ 359) - Use acpi_os_free() instead of ACPI_FREE in acpi_rs_set_srs_method_data (BZ 360) - Incomplete cleanup branch in acpi_ps_parse_aml (BZ 361) - Incomplete cleanup branch in acpi_ds_delete_walk_state (BZ 362) - acpi_get_table_header returns AE_NO_ACPI_TABLES until DSDT is loaded (BZ 365) - Status of the Global Initialization Handler call not used (BZ 366) - Incorrect object parameter to Global Initialization Handler (BZ 367) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/hardware')
-rw-r--r--drivers/acpi/hardware/hwregs.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/drivers/acpi/hardware/hwregs.c b/drivers/acpi/hardware/hwregs.c
index ec9f5a11a8b3..5a3aa8dd8cb7 100644
--- a/drivers/acpi/hardware/hwregs.c
+++ b/drivers/acpi/hardware/hwregs.c
@@ -127,8 +127,7 @@ acpi_status
127acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b) 127acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
128{ 128{
129 acpi_status status = AE_OK; 129 acpi_status status = AE_OK;
130 struct acpi_parameter_info info; 130 struct acpi_evaluate_info *info;
131 char *sleep_state_name;
132 131
133 ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data); 132 ACPI_FUNCTION_TRACE(acpi_get_sleep_type_data);
134 133
@@ -138,34 +137,39 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
138 return_ACPI_STATUS(AE_BAD_PARAMETER); 137 return_ACPI_STATUS(AE_BAD_PARAMETER);
139 } 138 }
140 139
141 /* Evaluate the namespace object containing the values for this state */ 140 /* Allocate the evaluation information block */
141
142 info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
143 if (!info) {
144 return_ACPI_STATUS(AE_NO_MEMORY);
145 }
142 146
143 info.parameters = NULL; 147 info->pathname =
144 info.return_object = NULL;
145 sleep_state_name =
146 ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]); 148 ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
147 149
148 status = acpi_ns_evaluate_by_name(sleep_state_name, &info); 150 /* Evaluate the namespace object containing the values for this state */
151
152 status = acpi_ns_evaluate(info);
149 if (ACPI_FAILURE(status)) { 153 if (ACPI_FAILURE(status)) {
150 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, 154 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
151 "%s while evaluating SleepState [%s]\n", 155 "%s while evaluating SleepState [%s]\n",
152 acpi_format_exception(status), 156 acpi_format_exception(status),
153 sleep_state_name)); 157 info->pathname));
154 158
155 return_ACPI_STATUS(status); 159 goto cleanup;
156 } 160 }
157 161
158 /* Must have a return object */ 162 /* Must have a return object */
159 163
160 if (!info.return_object) { 164 if (!info->return_object) {
161 ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]", 165 ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
162 sleep_state_name)); 166 info->pathname));
163 status = AE_NOT_EXIST; 167 status = AE_NOT_EXIST;
164 } 168 }
165 169
166 /* It must be of type Package */ 170 /* It must be of type Package */
167 171
168 else if (ACPI_GET_OBJECT_TYPE(info.return_object) != ACPI_TYPE_PACKAGE) { 172 else if (ACPI_GET_OBJECT_TYPE(info->return_object) != ACPI_TYPE_PACKAGE) {
169 ACPI_ERROR((AE_INFO, 173 ACPI_ERROR((AE_INFO,
170 "Sleep State return object is not a Package")); 174 "Sleep State return object is not a Package"));
171 status = AE_AML_OPERAND_TYPE; 175 status = AE_AML_OPERAND_TYPE;
@@ -178,7 +182,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
178 * by BIOS vendors seems to be to have 2 or more elements, at least 182 * by BIOS vendors seems to be to have 2 or more elements, at least
179 * one per sleep type (A/B). 183 * one per sleep type (A/B).
180 */ 184 */
181 else if (info.return_object->package.count < 2) { 185 else if (info->return_object->package.count < 2) {
182 ACPI_ERROR((AE_INFO, 186 ACPI_ERROR((AE_INFO,
183 "Sleep State return package does not have at least two elements")); 187 "Sleep State return package does not have at least two elements"));
184 status = AE_AML_NO_OPERAND; 188 status = AE_AML_NO_OPERAND;
@@ -186,35 +190,38 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 * sleep_type_a, u8 * sleep_type_b)
186 190
187 /* The first two elements must both be of type Integer */ 191 /* The first two elements must both be of type Integer */
188 192
189 else if ((ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[0]) 193 else if ((ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[0])
190 != ACPI_TYPE_INTEGER) || 194 != ACPI_TYPE_INTEGER) ||
191 (ACPI_GET_OBJECT_TYPE(info.return_object->package.elements[1]) 195 (ACPI_GET_OBJECT_TYPE(info->return_object->package.elements[1])
192 != ACPI_TYPE_INTEGER)) { 196 != ACPI_TYPE_INTEGER)) {
193 ACPI_ERROR((AE_INFO, 197 ACPI_ERROR((AE_INFO,
194 "Sleep State return package elements are not both Integers (%s, %s)", 198 "Sleep State return package elements are not both Integers (%s, %s)",
195 acpi_ut_get_object_type_name(info.return_object-> 199 acpi_ut_get_object_type_name(info->return_object->
196 package.elements[0]), 200 package.elements[0]),
197 acpi_ut_get_object_type_name(info.return_object-> 201 acpi_ut_get_object_type_name(info->return_object->
198 package.elements[1]))); 202 package.elements[1])));
199 status = AE_AML_OPERAND_TYPE; 203 status = AE_AML_OPERAND_TYPE;
200 } else { 204 } else {
201 /* Valid _Sx_ package size, type, and value */ 205 /* Valid _Sx_ package size, type, and value */
202 206
203 *sleep_type_a = (u8) 207 *sleep_type_a = (u8)
204 (info.return_object->package.elements[0])->integer.value; 208 (info->return_object->package.elements[0])->integer.value;
205 *sleep_type_b = (u8) 209 *sleep_type_b = (u8)
206 (info.return_object->package.elements[1])->integer.value; 210 (info->return_object->package.elements[1])->integer.value;
207 } 211 }
208 212
209 if (ACPI_FAILURE(status)) { 213 if (ACPI_FAILURE(status)) {
210 ACPI_EXCEPTION((AE_INFO, status, 214 ACPI_EXCEPTION((AE_INFO, status,
211 "While evaluating SleepState [%s], bad Sleep object %p type %s", 215 "While evaluating SleepState [%s], bad Sleep object %p type %s",
212 sleep_state_name, info.return_object, 216 info->pathname, info->return_object,
213 acpi_ut_get_object_type_name(info. 217 acpi_ut_get_object_type_name(info->
214 return_object))); 218 return_object)));
215 } 219 }
216 220
217 acpi_ut_remove_reference(info.return_object); 221 acpi_ut_remove_reference(info->return_object);
222
223 cleanup:
224 ACPI_FREE(info);
218 return_ACPI_STATUS(status); 225 return_ACPI_STATUS(status);
219} 226}
220 227