diff options
Diffstat (limited to 'drivers/acpi/dispatcher/dswstate.c')
-rw-r--r-- | drivers/acpi/dispatcher/dswstate.c | 106 |
1 files changed, 37 insertions, 69 deletions
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c index 7d68a5aaf3c4..61aae2dcc5e2 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_REPORT_ERROR(("No result object pushed! State=%p\n", |
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_REPORT_ERROR(("Index out of range: %X State=%p Num=%X\n", |
103 | "Index out of range: %X State=%p Num=%X\n", | 102 | index, walk_state, |
104 | index, walk_state, | 103 | 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_REPORT_ERROR(("Null operand! State=%p #Ops=%X, Index=%X\n", |
112 | "Null operand! State=%p #Ops=%X, Index=%X\n", | 110 | walk_state, state->results.num_results, |
113 | walk_state, state->results.num_results, | 111 | 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_REPORT_ERROR(("Result stack is empty! State=%p\n", |
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_REPORT_ERROR(("No result objects! State=%p\n", 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_REPORT_ERROR(("No result object pushed! State=%p\n", |
226 | "Warning: No result object pushed! State=%p\n", | 221 | 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_REPORT_ERROR(("No result objects! State=%p\n", |
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,9 @@ 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_REPORT_ERROR(("Null operand! State=%p #Ops=%X Index=%X\n", |
254 | "Null operand! State=%p #Ops=%X Index=%X\n", | 248 | walk_state, state->results.num_results, |
255 | walk_state, state->results.num_results, | 249 | (u32) index)); |
256 | (u32) index)); | ||
257 | return (AE_AML_NO_RETURN_VALUE); | 250 | return (AE_AML_NO_RETURN_VALUE); |
258 | } | 251 | } |
259 | 252 | ||
@@ -293,18 +286,14 @@ acpi_ds_result_push(union acpi_operand_object * object, | |||
293 | } | 286 | } |
294 | 287 | ||
295 | if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { | 288 | if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { |
296 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 289 | ACPI_REPORT_ERROR(("Result stack overflow: Obj=%p State=%p Num=%X\n", object, walk_state, state->results.num_results)); |
297 | "Result stack overflow: Obj=%p State=%p Num=%X\n", | ||
298 | object, walk_state, | ||
299 | state->results.num_results)); | ||
300 | return (AE_STACK_OVERFLOW); | 290 | return (AE_STACK_OVERFLOW); |
301 | } | 291 | } |
302 | 292 | ||
303 | if (!object) { | 293 | if (!object) { |
304 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 294 | ACPI_REPORT_ERROR(("Null Object! Obj=%p State=%p Num=%X\n", |
305 | "Null Object! Obj=%p State=%p Num=%X\n", | 295 | object, walk_state, |
306 | object, walk_state, | 296 | state->results.num_results)); |
307 | state->results.num_results)); | ||
308 | return (AE_BAD_PARAMETER); | 297 | return (AE_BAD_PARAMETER); |
309 | } | 298 | } |
310 | 299 | ||
@@ -413,10 +402,7 @@ acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state) | |||
413 | /* Check for stack overflow */ | 402 | /* Check for stack overflow */ |
414 | 403 | ||
415 | if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { | 404 | if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { |
416 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 405 | ACPI_REPORT_ERROR(("Object stack overflow! Obj=%p State=%p #Ops=%X\n", object, walk_state, walk_state->num_operands)); |
417 | "overflow! Obj=%p State=%p #Ops=%X\n", | ||
418 | object, walk_state, | ||
419 | walk_state->num_operands)); | ||
420 | return (AE_STACK_OVERFLOW); | 406 | return (AE_STACK_OVERFLOW); |
421 | } | 407 | } |
422 | 408 | ||
@@ -460,10 +446,7 @@ acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state) | |||
460 | /* Check for stack underflow */ | 446 | /* Check for stack underflow */ |
461 | 447 | ||
462 | if (walk_state->num_operands == 0) { | 448 | if (walk_state->num_operands == 0) { |
463 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 449 | ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands)); |
464 | "Underflow! Count=%X State=%p #Ops=%X\n", | ||
465 | pop_count, walk_state, | ||
466 | walk_state->num_operands)); | ||
467 | return (AE_STACK_UNDERFLOW); | 450 | return (AE_STACK_UNDERFLOW); |
468 | } | 451 | } |
469 | 452 | ||
@@ -506,10 +489,7 @@ acpi_ds_obj_stack_pop_and_delete(u32 pop_count, | |||
506 | /* Check for stack underflow */ | 489 | /* Check for stack underflow */ |
507 | 490 | ||
508 | if (walk_state->num_operands == 0) { | 491 | if (walk_state->num_operands == 0) { |
509 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 492 | ACPI_REPORT_ERROR(("Object stack underflow! Count=%X State=%p #Ops=%X\n", pop_count, walk_state, walk_state->num_operands)); |
510 | "Underflow! Count=%X State=%p #Ops=%X\n", | ||
511 | pop_count, walk_state, | ||
512 | walk_state->num_operands)); | ||
513 | return (AE_STACK_UNDERFLOW); | 493 | return (AE_STACK_UNDERFLOW); |
514 | } | 494 | } |
515 | 495 | ||
@@ -826,16 +806,14 @@ void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state) | |||
826 | } | 806 | } |
827 | 807 | ||
828 | if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { | 808 | if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { |
829 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 809 | ACPI_REPORT_ERROR(("%p is not a valid walk state\n", |
830 | "%p is not a valid walk state\n", | 810 | walk_state)); |
831 | walk_state)); | ||
832 | return; | 811 | return; |
833 | } | 812 | } |
834 | 813 | ||
835 | if (walk_state->parser_state.scope) { | 814 | if (walk_state->parser_state.scope) { |
836 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 815 | ACPI_REPORT_ERROR(("%p walk still has a scope list\n", |
837 | "%p walk still has a scope list\n", | 816 | walk_state)); |
838 | walk_state)); | ||
839 | } | 817 | } |
840 | 818 | ||
841 | /* Always must free any linked control states */ | 819 | /* Always must free any linked control states */ |
@@ -894,25 +872,18 @@ acpi_ds_result_insert(void *object, | |||
894 | 872 | ||
895 | state = walk_state->results; | 873 | state = walk_state->results; |
896 | if (!state) { | 874 | if (!state) { |
897 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 875 | ACPI_REPORT_ERROR(("No result object pushed! State=%p\n", |
898 | "No result object pushed! State=%p\n", | 876 | walk_state)); |
899 | walk_state)); | ||
900 | return (AE_NOT_EXIST); | 877 | return (AE_NOT_EXIST); |
901 | } | 878 | } |
902 | 879 | ||
903 | if (index >= ACPI_OBJ_NUM_OPERANDS) { | 880 | if (index >= ACPI_OBJ_NUM_OPERANDS) { |
904 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 881 | ACPI_REPORT_ERROR(("Index out of range: %X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results)); |
905 | "Index out of range: %X Obj=%p State=%p Num=%X\n", | ||
906 | index, object, walk_state, | ||
907 | state->results.num_results)); | ||
908 | return (AE_BAD_PARAMETER); | 882 | return (AE_BAD_PARAMETER); |
909 | } | 883 | } |
910 | 884 | ||
911 | if (!object) { | 885 | if (!object) { |
912 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 886 | ACPI_REPORT_ERROR(("Null Object! Index=%X Obj=%p State=%p Num=%X\n", index, object, walk_state, state->results.num_results)); |
913 | "Null Object! Index=%X Obj=%p State=%p Num=%X\n", | ||
914 | index, object, walk_state, | ||
915 | state->results.num_results)); | ||
916 | return (AE_BAD_PARAMETER); | 887 | return (AE_BAD_PARAMETER); |
917 | } | 888 | } |
918 | 889 | ||
@@ -986,9 +957,7 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object, | |||
986 | /* Check for stack underflow */ | 957 | /* Check for stack underflow */ |
987 | 958 | ||
988 | if (walk_state->num_operands == 0) { | 959 | if (walk_state->num_operands == 0) { |
989 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 960 | ACPI_REPORT_ERROR(("Missing operand/stack empty! State=%p #Ops=%X\n", walk_state, walk_state->num_operands)); |
990 | "Missing operand/stack empty! State=%p #Ops=%X\n", | ||
991 | walk_state, walk_state->num_operands)); | ||
992 | *object = NULL; | 961 | *object = NULL; |
993 | return (AE_AML_NO_OPERAND); | 962 | return (AE_AML_NO_OPERAND); |
994 | } | 963 | } |
@@ -1000,9 +969,8 @@ acpi_ds_obj_stack_pop_object(union acpi_operand_object **object, | |||
1000 | /* Check for a valid operand */ | 969 | /* Check for a valid operand */ |
1001 | 970 | ||
1002 | if (!walk_state->operands[walk_state->num_operands]) { | 971 | if (!walk_state->operands[walk_state->num_operands]) { |
1003 | ACPI_DEBUG_PRINT((ACPI_DB_ERROR, | 972 | ACPI_REPORT_ERROR(("Null operand! State=%p #Ops=%X\n", |
1004 | "Null operand! State=%p #Ops=%X\n", | 973 | walk_state, walk_state->num_operands)); |
1005 | walk_state, walk_state->num_operands)); | ||
1006 | *object = NULL; | 974 | *object = NULL; |
1007 | return (AE_AML_NO_OPERAND); | 975 | return (AE_AML_NO_OPERAND); |
1008 | } | 976 | } |