diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dswstate.c')
-rw-r--r-- | drivers/acpi/dispatcher/dswstate.c | 128 |
1 files changed, 58 insertions, 70 deletions
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c index 7d68a5aaf3c4..fa78cb74ee36 100644 --- a/drivers/acpi/dispatcher/dswstate.c +++ b/drivers/acpi/dispatcher/dswstate.c | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2005, R. Byron Moore | 8 | * Copyright (C) 2000 - 2006, R. Byron Moore |
9 | * All rights reserved. | 9 | * All rights reserved. |
10 | * | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without |
@@ -92,26 +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_DEBUG_PRINT((ACPI_DB_ERROR, | 95 | ACPI_ERROR((AE_INFO, "No result object pushed! State=%p", |
96 | "No result object pushed! State=%p\n", | 96 | walk_state)); |
97 | walk_state)); | ||
98 | return (AE_NOT_EXIST); | 97 | return (AE_NOT_EXIST); |
99 | } | 98 | } |
100 | 99 | ||
101 | if (index >= ACPI_OBJ_MAX_OPERAND) { | 100 | if (index >= ACPI_OBJ_MAX_OPERAND) { |
102 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 101 | ACPI_ERROR((AE_INFO, |
103 | "Index out of range: %X State=%p Num=%X\n", | 102 | "Index out of range: %X State=%p Num=%X", |
104 | index, walk_state, | 103 | index, walk_state, state->results.num_results)); |
105 | state->results.num_results)); | ||
106 | } | 104 | } |
107 | 105 | ||
108 | /* Check for a valid result object */ | 106 | /* Check for a valid result object */ |
109 | 107 | ||
110 | if (!state->results.obj_desc[index]) { | 108 | if (!state->results.obj_desc[index]) { |
111 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 109 | ACPI_ERROR((AE_INFO, |
112 | "Null operand! State=%p #Ops=%X, Index=%X\n", | 110 | "Null operand! State=%p #Ops=%X, Index=%X", |
113 | walk_state, state->results.num_results, | 111 | walk_state, state->results.num_results, index)); |
114 | index)); | ||
115 | return (AE_AML_NO_RETURN_VALUE); | 112 | return (AE_AML_NO_RETURN_VALUE); |
116 | } | 113 | } |
117 | 114 | ||
@@ -163,9 +160,8 @@ acpi_ds_result_pop(union acpi_operand_object ** object, | |||
163 | } | 160 | } |
164 | 161 | ||
165 | if (!state->results.num_results) { | 162 | if (!state->results.num_results) { |
166 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 163 | ACPI_ERROR((AE_INFO, "Result stack is empty! State=%p", |
167 | "Result stack is empty! State=%p\n", | 164 | walk_state)); |
168 | walk_state)); | ||
169 | return (AE_AML_NO_RETURN_VALUE); | 165 | return (AE_AML_NO_RETURN_VALUE); |
170 | } | 166 | } |
171 | 167 | ||
@@ -192,8 +188,7 @@ acpi_ds_result_pop(union acpi_operand_object ** object, | |||
192 | } | 188 | } |
193 | } | 189 | } |
194 | 190 | ||
195 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 191 | ACPI_ERROR((AE_INFO, "No result objects! State=%p", walk_state)); |
196 | "No result objects! State=%p\n", walk_state)); | ||
197 | return (AE_AML_NO_RETURN_VALUE); | 192 | return (AE_AML_NO_RETURN_VALUE); |
198 | } | 193 | } |
199 | 194 | ||
@@ -222,15 +217,14 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object, | |||
222 | 217 | ||
223 | state = walk_state->results; | 218 | state = walk_state->results; |
224 | if (!state) { | 219 | if (!state) { |
225 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 220 | ACPI_ERROR((AE_INFO, |
226 | "Warning: No result object pushed! State=%p\n", | 221 | "No result object pushed! State=%p", walk_state)); |
227 | walk_state)); | ||
228 | return (AE_NOT_EXIST); | 222 | return (AE_NOT_EXIST); |
229 | } | 223 | } |
230 | 224 | ||
231 | if (!state->results.num_results) { | 225 | if (!state->results.num_results) { |
232 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 226 | ACPI_ERROR((AE_INFO, "No result objects! State=%p", |
233 | "No result objects! State=%p\n", walk_state)); | 227 | walk_state)); |
234 | return (AE_AML_NO_RETURN_VALUE); | 228 | return (AE_AML_NO_RETURN_VALUE); |
235 | } | 229 | } |
236 | 230 | ||
@@ -250,10 +244,10 @@ acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object, | |||
250 | /* Check for a valid result object */ | 244 | /* Check for a valid result object */ |
251 | 245 | ||
252 | if (!*object) { | 246 | if (!*object) { |
253 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 247 | ACPI_ERROR((AE_INFO, |
254 | "Null operand! State=%p #Ops=%X Index=%X\n", | 248 | "Null operand! State=%p #Ops=%X Index=%X", |
255 | walk_state, state->results.num_results, | 249 | walk_state, state->results.num_results, |
256 | (u32) index)); | 250 | (u32) index)); |
257 | return (AE_AML_NO_RETURN_VALUE); | 251 | return (AE_AML_NO_RETURN_VALUE); |
258 | } | 252 | } |
259 | 253 | ||
@@ -288,23 +282,21 @@ acpi_ds_result_push(union acpi_operand_object * object, | |||
288 | 282 | ||
289 | state = walk_state->results; | 283 | state = walk_state->results; |
290 | if (!state) { | 284 | if (!state) { |
291 | ACPI_REPORT_ERROR(("No result stack frame during push\n")); | 285 | ACPI_ERROR((AE_INFO, "No result stack frame during push")); |
292 | return (AE_AML_INTERNAL); | 286 | return (AE_AML_INTERNAL); |
293 | } | 287 | } |
294 | 288 | ||
295 | if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { | 289 | if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { |
296 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 290 | ACPI_ERROR((AE_INFO, |
297 | "Result stack overflow: Obj=%p State=%p Num=%X\n", | 291 | "Result stack overflow: Obj=%p State=%p Num=%X", |
298 | object, walk_state, | 292 | object, walk_state, state->results.num_results)); |
299 | state->results.num_results)); | ||
300 | return (AE_STACK_OVERFLOW); | 293 | return (AE_STACK_OVERFLOW); |
301 | } | 294 | } |
302 | 295 | ||
303 | if (!object) { | 296 | if (!object) { |
304 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 297 | ACPI_ERROR((AE_INFO, |
305 | "Null Object! Obj=%p State=%p Num=%X\n", | 298 | "Null Object! Obj=%p State=%p Num=%X", |
306 | object, walk_state, | 299 | object, walk_state, state->results.num_results)); |
307 | state->results.num_results)); | ||
308 | return (AE_BAD_PARAMETER); | 300 | return (AE_BAD_PARAMETER); |
309 | } | 301 | } |
310 | 302 | ||
@@ -413,10 +405,9 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state) | |||
413 | /* Check for stack overflow */ | 405 | /* Check for stack overflow */ |
414 | 406 | ||
415 | if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { | 407 | if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { |
416 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 408 | ACPI_ERROR((AE_INFO, |
417 | "overflow! Obj=%p State=%p #Ops=%X\n", | 409 | "Object stack overflow! Obj=%p State=%p #Ops=%X", |
418 | object, walk_state, | 410 | object, walk_state, walk_state->num_operands)); |
419 | walk_state->num_operands)); | ||
420 | return (AE_STACK_OVERFLOW); | 411 | return (AE_STACK_OVERFLOW); |
421 | } | 412 | } |
422 | 413 | ||
@@ -460,10 +451,10 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state) | |||
460 | /* Check for stack underflow */ | 451 | /* Check for stack underflow */ |
461 | 452 | ||
462 | if (walk_state->num_operands == 0) { | 453 | if (walk_state->num_operands == 0) { |
463 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 454 | ACPI_ERROR((AE_INFO, |
464 | "Underflow! Count=%X State=%p #Ops=%X\n", | 455 | "Object stack underflow! Count=%X State=%p #Ops=%X", |
465 | pop_count, walk_state, | 456 | pop_count, walk_state, |
466 | walk_state->num_operands)); | 457 | walk_state->num_operands)); |
467 | return (AE_STACK_UNDERFLOW); | 458 | return (AE_STACK_UNDERFLOW); |
468 | } | 459 | } |
469 | 460 | ||
@@ -506,10 +497,10 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | |||
506 | /* Check for stack underflow */ | 497 | /* Check for stack underflow */ |
507 | 498 | ||
508 | if (walk_state->num_operands == 0) { | 499 | if (walk_state->num_operands == 0) { |
509 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 500 | ACPI_ERROR((AE_INFO, |
510 | "Underflow! Count=%X State=%p #Ops=%X\n", | 501 | "Object stack underflow! Count=%X State=%p #Ops=%X", |
511 | pop_count, walk_state, | 502 | pop_count, walk_state, |
512 | walk_state->num_operands)); | 503 | walk_state->num_operands)); |
513 | return (AE_STACK_UNDERFLOW); | 504 | return (AE_STACK_UNDERFLOW); |
514 | } | 505 | } |
515 | 506 | ||
@@ -826,16 +817,14 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state) | |||
826 | } | 817 | } |
827 | 818 | ||
828 | if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { | 819 | if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { |
829 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 820 | ACPI_ERROR((AE_INFO, "%p is not a valid walk state", |
830 | "%p is not a valid walk state\n", | 821 | walk_state)); |
831 | walk_state)); | ||
832 | return; | 822 | return; |
833 | } | 823 | } |
834 | 824 | ||
835 | if (walk_state->parser_state.scope) { | 825 | if (walk_state->parser_state.scope) { |
836 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 826 | ACPI_ERROR((AE_INFO, "%p walk still has a scope list", |
837 | "%p walk still has a scope list\n", | 827 | walk_state)); |
838 | walk_state)); | ||
839 | } | 828 | } |
840 | 829 | ||
841 | /* Always must free any linked control states */ | 830 | /* Always must free any linked control states */ |
@@ -894,25 +883,24 @@ acpi_ds_result_insert(void *object, | |||
894 | 883 | ||
895 | state = walk_state->results; | 884 | state = walk_state->results; |
896 | if (!state) { | 885 | if (!state) { |
897 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 886 | ACPI_ERROR((AE_INFO, "No result object pushed! State=%p", |
898 | "No result object pushed! State=%p\n", | 887 | walk_state)); |
899 | walk_state)); | ||
900 | return (AE_NOT_EXIST); | 888 | return (AE_NOT_EXIST); |
901 | } | 889 | } |
902 | 890 | ||
903 | if (index >= ACPI_OBJ_NUM_OPERANDS) { | 891 | if (index >= ACPI_OBJ_NUM_OPERANDS) { |
904 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 892 | ACPI_ERROR((AE_INFO, |
905 | "Index out of range: %X Obj=%p State=%p Num=%X\n", | 893 | "Index out of range: %X Obj=%p State=%p Num=%X", |
906 | index, object, walk_state, | 894 | index, object, walk_state, |
907 | state->results.num_results)); | 895 | state->results.num_results)); |
908 | return (AE_BAD_PARAMETER); | 896 | return (AE_BAD_PARAMETER); |
909 | } | 897 | } |
910 | 898 | ||
911 | if (!object) { | 899 | if (!object) { |
912 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 900 | ACPI_ERROR((AE_INFO, |
913 | "Null Object! Index=%X Obj=%p State=%p Num=%X\n", | 901 | "Null Object! Index=%X Obj=%p State=%p Num=%X", |
914 | index, object, walk_state, | 902 | index, object, walk_state, |
915 | state->results.num_results)); | 903 | state->results.num_results)); |
916 | return (AE_BAD_PARAMETER); | 904 | return (AE_BAD_PARAMETER); |
917 | } | 905 | } |
918 | 906 | ||
@@ -986,9 +974,9 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object, | |||
986 | /* Check for stack underflow */ | 974 | /* Check for stack underflow */ |
987 | 975 | ||
988 | if (walk_state->num_operands == 0) { | 976 | if (walk_state->num_operands == 0) { |
989 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 977 | ACPI_ERROR((AE_INFO, |
990 | "Missing operand/stack empty! State=%p #Ops=%X\n", | 978 | "Missing operand/stack empty! State=%p #Ops=%X", |
991 | walk_state, walk_state->num_operands)); | 979 | walk_state, walk_state->num_operands)); |
992 | *object = NULL; | 980 | *object = NULL; |
993 | return (AE_AML_NO_OPERAND); | 981 | return (AE_AML_NO_OPERAND); |
994 | } | 982 | } |
@@ -1000,9 +988,9 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object, | |||
1000 | /* Check for a valid operand */ | 988 | /* Check for a valid operand */ |
1001 | 989 | ||
1002 | if (!walk_state->operands[walk_state->num_operands]) { | 990 | if (!walk_state->operands[walk_state->num_operands]) { |
1003 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 991 | ACPI_ERROR((AE_INFO, |
1004 | "Null operand! State=%p #Ops=%X\n", | 992 | "Null operand! State=%p #Ops=%X", |
1005 | walk_state, walk_state->num_operands)); | 993 | walk_state, walk_state->num_operands)); |
1006 | *object = NULL; | 994 | *object = NULL; |
1007 | return (AE_AML_NO_OPERAND); | 995 | return (AE_AML_NO_OPERAND); |
1008 | } | 996 | } |