aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswstate.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-01-27 16:43:00 -0500
committerLen Brown <len.brown@intel.com>2006-01-31 03:25:09 -0500
commitb8e4d89357fc434618a59c1047cac72641191805 (patch)
treeac97fcc6fdc277c682365900663872c96f2420bd /drivers/acpi/dispatcher/dswstate.c
parent292dd876ee765c478b27c93cc51e93a558ed58bf (diff)
[ACPI] ACPICA 20060127
Implemented support in the Resource Manager to allow unresolved namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support within the AML parser. If the interpreter slack mode is enabled (true on Linux unless acpi=strict), these unresolved references will be passed through to the caller as a NULL package entry. http://bugzilla.kernel.org/show_bug.cgi?id=5741 Implemented and deployed new macros and functions for error and warning messages across the subsystem. These macros are simpler and generate less code than their predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION, ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. Implemented the acpi_cpu_flags type to simplify host OS integration of the Acquire/Release Lock OSL interfaces. Suggested by Steven Rostedt and Andrew Morton. Fixed a problem where Alias ASL operators are sometimes not correctly resolved. causing AE_AML_INTERNAL http://bugzilla.kernel.org/show_bug.cgi?id=5189 http://bugzilla.kernel.org/show_bug.cgi?id=5674 Fixed several problems with the implementation of the ConcatenateResTemplate ASL operator. As per the ACPI specification, zero length buffers are now treated as a single EndTag. One-length buffers always cause a fatal exception. Non-zero length buffers that do not end with a full 2-byte EndTag cause a fatal exception. Fixed a possible structure overwrite in the AcpiGetObjectInfo external interface. (With assistance from Thomas Renninger) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dswstate.c')
-rw-r--r--drivers/acpi/dispatcher/dswstate.c94
1 files changed, 57 insertions, 37 deletions
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index 61aae2dcc5e2..fa78cb74ee36 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -92,23 +92,23 @@ acpi_ds_result_remove(union acpi_operand_object **object,
92 92
93 state = walk_state->results; 93 state = walk_state->results;
94 if (!state) { 94 if (!state) {
95 ACPI_REPORT_ERROR(("No result object pushed! State=%p\n", 95 ACPI_ERROR((AE_INFO, "No result object pushed! State=%p",
96 walk_state)); 96 walk_state));
97 return (AE_NOT_EXIST); 97 return (AE_NOT_EXIST);
98 } 98 }
99 99
100 if (index >= ACPI_OBJ_MAX_OPERAND) { 100 if (index >= ACPI_OBJ_MAX_OPERAND) {
101 ACPI_REPORT_ERROR(("Index out of range: %X State=%p Num=%X\n", 101 ACPI_ERROR((AE_INFO,
102 index, walk_state, 102 "Index out of range: %X State=%p Num=%X",
103 state->results.num_results)); 103 index, walk_state, state->results.num_results));
104 } 104 }
105 105
106 /* Check for a valid result object */ 106 /* Check for a valid result object */
107 107
108 if (!state->results.obj_desc[index]) { 108 if (!state->results.obj_desc[index]) {
109 ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X, Index=%X\n", 109 ACPI_ERROR((AE_INFO,
110 walk_state, state->results.num_results, 110 "Null operand! State=%p #Ops=%X, Index=%X",
111 index)); 111 walk_state, state->results.num_results, index));
112 return (AE_AML_NO_RETURN_VALUE); 112 return (AE_AML_NO_RETURN_VALUE);
113 } 113 }
114 114
@@ -160,8 +160,8 @@ acpi_ds_result_pop(union acpi_operand_object ** object,
160 } 160 }
161 161
162 if (!state->results.num_results) { 162 if (!state->results.num_results) {
163 ACPI_REPORT_ERROR(("Result stack is empty! State=%p\n", 163 ACPI_ERROR((AE_INFO, "Result stack is empty! State=%p",
164 walk_state)); 164 walk_state));
165 return (AE_AML_NO_RETURN_VALUE); 165 return (AE_AML_NO_RETURN_VALUE);
166 } 166 }
167 167
@@ -188,7 +188,7 @@ acpi_ds_result_pop(union acpi_operand_object ** object,
188 } 188 }
189 } 189 }
190 190
191 ACPI_REPORT_ERROR(("No result objects! State=%p\n", walk_state)); 191 ACPI_ERROR((AE_INFO, "No result objects! State=%p", walk_state));
192 return (AE_AML_NO_RETURN_VALUE); 192 return (AE_AML_NO_RETURN_VALUE);
193} 193}
194 194
@@ -217,14 +217,14 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
217 217
218 state = walk_state->results; 218 state = walk_state->results;
219 if (!state) { 219 if (!state) {
220 ACPI_REPORT_ERROR(("No result object pushed! State=%p\n", 220 ACPI_ERROR((AE_INFO,
221 walk_state)); 221 "No result object pushed! State=%p", walk_state));
222 return (AE_NOT_EXIST); 222 return (AE_NOT_EXIST);
223 } 223 }
224 224
225 if (!state->results.num_results) { 225 if (!state->results.num_results) {
226 ACPI_REPORT_ERROR(("No result objects! State=%p\n", 226 ACPI_ERROR((AE_INFO, "No result objects! State=%p",
227 walk_state)); 227 walk_state));
228 return (AE_AML_NO_RETURN_VALUE); 228 return (AE_AML_NO_RETURN_VALUE);
229 } 229 }
230 230
@@ -244,9 +244,10 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
244 /* Check for a valid result object */ 244 /* Check for a valid result object */
245 245
246 if (!*object) { 246 if (!*object) {
247 ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X Index=%X\n", 247 ACPI_ERROR((AE_INFO,
248 walk_state, state->results.num_results, 248 "Null operand! State=%p #Ops=%X Index=%X",
249 (u32) index)); 249 walk_state, state->results.num_results,
250 (u32) index));
250 return (AE_AML_NO_RETURN_VALUE); 251 return (AE_AML_NO_RETURN_VALUE);
251 } 252 }
252 253
@@ -281,19 +282,21 @@ acpi_ds_result_push(union acpi_operand_object * object,
281 282
282 state = walk_state->results; 283 state = walk_state->results;
283 if (!state) { 284 if (!state) {
284 ACPI_REPORT_ERROR(("No result stack frame during push\n")); 285 ACPI_ERROR((AE_INFO, "No result stack frame during push"));
285 return (AE_AML_INTERNAL); 286 return (AE_AML_INTERNAL);
286 } 287 }
287 288
288 if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { 289 if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) {
289 ACPI_REPORT_ERROR(("Result stack overflow: Obj=%p State=%p Num=%X\n", object, walk_state, state->results.num_results)); 290 ACPI_ERROR((AE_INFO,
291 "Result stack overflow: Obj=%p State=%p Num=%X",
292 object, walk_state, state->results.num_results));
290 return (AE_STACK_OVERFLOW); 293 return (AE_STACK_OVERFLOW);
291 } 294 }
292 295
293 if (!object) { 296 if (!object) {
294 ACPI_REPORT_ERROR(("Null Object! Obj=%p State=%p Num=%X\n", 297 ACPI_ERROR((AE_INFO,
295 object, walk_state, 298 "Null Object! Obj=%p State=%p Num=%X",
296 state->results.num_results)); 299 object, walk_state, state->results.num_results));
297 return (AE_BAD_PARAMETER); 300 return (AE_BAD_PARAMETER);
298 } 301 }
299 302
@@ -402,7 +405,9 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state)
402 /* Check for stack overflow */ 405 /* Check for stack overflow */
403 406
404 if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { 407 if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) {
405 ACPI_REPORT_ERROR(("Object stack overflow! Obj=%p State=%p #Ops=%X\n", object, walk_state, walk_state->num_operands)); 408 ACPI_ERROR((AE_INFO,
409 "Object stack overflow! Obj=%p State=%p #Ops=%X",
410 object, walk_state, walk_state->num_operands));
406 return (AE_STACK_OVERFLOW); 411 return (AE_STACK_OVERFLOW);
407 } 412 }
408 413
@@ -446,7 +451,10 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state)
446 /* Check for stack underflow */ 451 /* Check for stack underflow */
447 452
448 if (walk_state->num_operands == 0) { 453 if (walk_state->num_operands == 0) {
449 ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands)); 454 ACPI_ERROR((AE_INFO,
455 "Object stack underflow! Count=%X State=%p #Ops=%X",
456 pop_count, walk_state,
457 walk_state->num_operands));
450 return (AE_STACK_UNDERFLOW); 458 return (AE_STACK_UNDERFLOW);
451 } 459 }
452 460
@@ -489,7 +497,10 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
489 /* Check for stack underflow */ 497 /* Check for stack underflow */
490 498
491 if (walk_state->num_operands == 0) { 499 if (walk_state->num_operands == 0) {
492 ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands)); 500 ACPI_ERROR((AE_INFO,
501 "Object stack underflow! Count=%X State=%p #Ops=%X",
502 pop_count, walk_state,
503 walk_state->num_operands));
493 return (AE_STACK_UNDERFLOW); 504 return (AE_STACK_UNDERFLOW);
494 } 505 }
495 506
@@ -806,14 +817,14 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
806 } 817 }
807 818
808 if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { 819 if (walk_state->data_type != ACPI_DESC_TYPE_WALK) {
809 ACPI_REPORT_ERROR(("%p is not a valid walk state\n", 820 ACPI_ERROR((AE_INFO, "%p is not a valid walk state",
810 walk_state)); 821 walk_state));
811 return; 822 return;
812 } 823 }
813 824
814 if (walk_state->parser_state.scope) { 825 if (walk_state->parser_state.scope) {
815 ACPI_REPORT_ERROR(("%p walk still has a scope list\n", 826 ACPI_ERROR((AE_INFO, "%p walk still has a scope list",
816 walk_state)); 827 walk_state));
817 } 828 }
818 829
819 /* Always must free any linked control states */ 830 /* Always must free any linked control states */
@@ -872,18 +883,24 @@ acpi_ds_result_insert(void *object,
872 883
873 state = walk_state->results; 884 state = walk_state->results;
874 if (!state) { 885 if (!state) {
875 ACPI_REPORT_ERROR(("No result object pushed! State=%p\n", 886 ACPI_ERROR((AE_INFO, "No result object pushed! State=%p",
876 walk_state)); 887 walk_state));
877 return (AE_NOT_EXIST); 888 return (AE_NOT_EXIST);
878 } 889 }
879 890
880 if (index >= ACPI_OBJ_NUM_OPERANDS) { 891 if (index >= ACPI_OBJ_NUM_OPERANDS) {
881 ACPI_REPORT_ERROR(("Index out of range: %X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results)); 892 ACPI_ERROR((AE_INFO,
893 "Index out of range: %X Obj=%p State=%p Num=%X",
894 index, object, walk_state,
895 state->results.num_results));
882 return (AE_BAD_PARAMETER); 896 return (AE_BAD_PARAMETER);
883 } 897 }
884 898
885 if (!object) { 899 if (!object) {
886 ACPI_REPORT_ERROR(("Null Object! Index=%X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results)); 900 ACPI_ERROR((AE_INFO,
901 "Null Object! Index=%X Obj=%p State=%p Num=%X",
902 index, object, walk_state,
903 state->results.num_results));
887 return (AE_BAD_PARAMETER); 904 return (AE_BAD_PARAMETER);
888 } 905 }
889 906
@@ -957,7 +974,9 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
957 /* Check for stack underflow */ 974 /* Check for stack underflow */
958 975
959 if (walk_state->num_operands == 0) { 976 if (walk_state->num_operands == 0) {
960 ACPI_REPORT_ERROR(("Missing operand/stack empty! State=%p #Ops=%X\n", walk_state, walk_state->num_operands)); 977 ACPI_ERROR((AE_INFO,
978 "Missing operand/stack empty! State=%p #Ops=%X",
979 walk_state, walk_state->num_operands));
961 *object = NULL; 980 *object = NULL;
962 return (AE_AML_NO_OPERAND); 981 return (AE_AML_NO_OPERAND);
963 } 982 }
@@ -969,8 +988,9 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
969 /* Check for a valid operand */ 988 /* Check for a valid operand */
970 989
971 if (!walk_state->operands[walk_state->num_operands]) { 990 if (!walk_state->operands[walk_state->num_operands]) {
972 ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X\n", 991 ACPI_ERROR((AE_INFO,
973 walk_state, walk_state->num_operands)); 992 "Null operand! State=%p #Ops=%X",
993 walk_state, walk_state->num_operands));
974 *object = NULL; 994 *object = NULL;
975 return (AE_AML_NO_OPERAND); 995 return (AE_AML_NO_OPERAND);
976 } 996 }