aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswstate.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2005-08-05 00:44:28 -0400
committerLen Brown <len.brown@intel.com>2005-08-05 00:45:14 -0400
commit4be44fcd3bf648b782f4460fd06dfae6c42ded4b (patch)
tree5b5b7d296ea58786f53b95e5eac9565ff66890b0 /drivers/acpi/dispatcher/dswstate.c
parentc65ade4dc8b486e8c8b9b0a6399789a5428e2039 (diff)
[ACPI] Lindent all ACPI files
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/dispatcher/dswstate.c')
-rw-r--r--drivers/acpi/dispatcher/dswstate.c640
1 files changed, 297 insertions, 343 deletions
diff --git a/drivers/acpi/dispatcher/dswstate.c b/drivers/acpi/dispatcher/dswstate.c
index 5621665991b5..7d68a5aaf3c4 100644
--- a/drivers/acpi/dispatcher/dswstate.c
+++ b/drivers/acpi/dispatcher/dswstate.c
@@ -41,37 +41,28 @@
41 * POSSIBILITY OF SUCH DAMAGES. 41 * POSSIBILITY OF SUCH DAMAGES.
42 */ 42 */
43 43
44
45#include <acpi/acpi.h> 44#include <acpi/acpi.h>
46#include <acpi/acparser.h> 45#include <acpi/acparser.h>
47#include <acpi/acdispat.h> 46#include <acpi/acdispat.h>
48#include <acpi/acnamesp.h> 47#include <acpi/acnamesp.h>
49 48
50#define _COMPONENT ACPI_DISPATCHER 49#define _COMPONENT ACPI_DISPATCHER
51 ACPI_MODULE_NAME ("dswstate") 50ACPI_MODULE_NAME("dswstate")
52 51
53/* Local prototypes */ 52/* Local prototypes */
54
55#ifdef ACPI_OBSOLETE_FUNCTIONS 53#ifdef ACPI_OBSOLETE_FUNCTIONS
56acpi_status 54acpi_status
57acpi_ds_result_insert ( 55acpi_ds_result_insert(void *object,
58 void *object, 56 u32 index, struct acpi_walk_state *walk_state);
59 u32 index,
60 struct acpi_walk_state *walk_state);
61 57
62acpi_status 58acpi_status acpi_ds_obj_stack_delete_all(struct acpi_walk_state *walk_state);
63acpi_ds_obj_stack_delete_all (
64 struct acpi_walk_state *walk_state);
65 59
66acpi_status 60acpi_status
67acpi_ds_obj_stack_pop_object ( 61acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
68 union acpi_operand_object **object, 62 struct acpi_walk_state *walk_state);
69 struct acpi_walk_state *walk_state); 63
70 64void *acpi_ds_obj_stack_get_value(u32 index,
71void * 65 struct acpi_walk_state *walk_state);
72acpi_ds_obj_stack_get_value (
73 u32 index,
74 struct acpi_walk_state *walk_state);
75#endif 66#endif
76 67
77#ifdef ACPI_FUTURE_USAGE 68#ifdef ACPI_FUTURE_USAGE
@@ -92,36 +83,35 @@ acpi_ds_obj_stack_get_value (
92 ******************************************************************************/ 83 ******************************************************************************/
93 84
94acpi_status 85acpi_status
95acpi_ds_result_remove ( 86acpi_ds_result_remove(union acpi_operand_object **object,
96 union acpi_operand_object **object, 87 u32 index, struct acpi_walk_state *walk_state)
97 u32 index,
98 struct acpi_walk_state *walk_state)
99{ 88{
100 union acpi_generic_state *state; 89 union acpi_generic_state *state;
101
102
103 ACPI_FUNCTION_NAME ("ds_result_remove");
104 90
91 ACPI_FUNCTION_NAME("ds_result_remove");
105 92
106 state = walk_state->results; 93 state = walk_state->results;
107 if (!state) { 94 if (!state) {
108 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n", 95 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
109 walk_state)); 96 "No result object pushed! State=%p\n",
97 walk_state));
110 return (AE_NOT_EXIST); 98 return (AE_NOT_EXIST);
111 } 99 }
112 100
113 if (index >= ACPI_OBJ_MAX_OPERAND) { 101 if (index >= ACPI_OBJ_MAX_OPERAND) {
114 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 102 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
115 "Index out of range: %X State=%p Num=%X\n", 103 "Index out of range: %X State=%p Num=%X\n",
116 index, walk_state, state->results.num_results)); 104 index, walk_state,
105 state->results.num_results));
117 } 106 }
118 107
119 /* Check for a valid result object */ 108 /* Check for a valid result object */
120 109
121 if (!state->results.obj_desc [index]) { 110 if (!state->results.obj_desc[index]) {
122 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 111 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
123 "Null operand! State=%p #Ops=%X, Index=%X\n", 112 "Null operand! State=%p #Ops=%X, Index=%X\n",
124 walk_state, state->results.num_results, index)); 113 walk_state, state->results.num_results,
114 index));
125 return (AE_AML_NO_RETURN_VALUE); 115 return (AE_AML_NO_RETURN_VALUE);
126 } 116 }
127 117
@@ -129,18 +119,20 @@ acpi_ds_result_remove (
129 119
130 state->results.num_results--; 120 state->results.num_results--;
131 121
132 *object = state->results.obj_desc [index]; 122 *object = state->results.obj_desc[index];
133 state->results.obj_desc [index] = NULL; 123 state->results.obj_desc[index] = NULL;
134 124
135 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 125 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
136 "Obj=%p [%s] Index=%X State=%p Num=%X\n", 126 "Obj=%p [%s] Index=%X State=%p Num=%X\n",
137 *object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL", 127 *object,
138 index, walk_state, state->results.num_results)); 128 (*object) ? acpi_ut_get_object_type_name(*object) :
129 "NULL", index, walk_state,
130 state->results.num_results));
139 131
140 return (AE_OK); 132 return (AE_OK);
141} 133}
142 134
143#endif /* ACPI_FUTURE_USAGE */ 135#endif /* ACPI_FUTURE_USAGE */
144 136
145/******************************************************************************* 137/*******************************************************************************
146 * 138 *
@@ -157,16 +149,13 @@ acpi_ds_result_remove (
157 ******************************************************************************/ 149 ******************************************************************************/
158 150
159acpi_status 151acpi_status
160acpi_ds_result_pop ( 152acpi_ds_result_pop(union acpi_operand_object ** object,
161 union acpi_operand_object **object, 153 struct acpi_walk_state * walk_state)
162 struct acpi_walk_state *walk_state)
163{ 154{
164 acpi_native_uint index; 155 acpi_native_uint index;
165 union acpi_generic_state *state; 156 union acpi_generic_state *state;
166
167
168 ACPI_FUNCTION_NAME ("ds_result_pop");
169 157
158 ACPI_FUNCTION_NAME("ds_result_pop");
170 159
171 state = walk_state->results; 160 state = walk_state->results;
172 if (!state) { 161 if (!state) {
@@ -174,8 +163,9 @@ acpi_ds_result_pop (
174 } 163 }
175 164
176 if (!state->results.num_results) { 165 if (!state->results.num_results) {
177 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Result stack is empty! State=%p\n", 166 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
178 walk_state)); 167 "Result stack is empty! State=%p\n",
168 walk_state));
179 return (AE_AML_NO_RETURN_VALUE); 169 return (AE_AML_NO_RETURN_VALUE);
180 } 170 }
181 171
@@ -186,26 +176,27 @@ acpi_ds_result_pop (
186 for (index = ACPI_OBJ_NUM_OPERANDS; index; index--) { 176 for (index = ACPI_OBJ_NUM_OPERANDS; index; index--) {
187 /* Check for a valid result object */ 177 /* Check for a valid result object */
188 178
189 if (state->results.obj_desc [index -1]) { 179 if (state->results.obj_desc[index - 1]) {
190 *object = state->results.obj_desc [index -1]; 180 *object = state->results.obj_desc[index - 1];
191 state->results.obj_desc [index -1] = NULL; 181 state->results.obj_desc[index - 1] = NULL;
192 182
193 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 183 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
194 "Obj=%p [%s] Index=%X State=%p Num=%X\n", 184 "Obj=%p [%s] Index=%X State=%p Num=%X\n",
195 *object, 185 *object,
196 (*object) ? acpi_ut_get_object_type_name (*object) : "NULL", 186 (*object) ?
197 (u32) index -1, walk_state, state->results.num_results)); 187 acpi_ut_get_object_type_name(*object)
188 : "NULL", (u32) index - 1, walk_state,
189 state->results.num_results));
198 190
199 return (AE_OK); 191 return (AE_OK);
200 } 192 }
201 } 193 }
202 194
203 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 195 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
204 "No result objects! State=%p\n", walk_state)); 196 "No result objects! State=%p\n", walk_state));
205 return (AE_AML_NO_RETURN_VALUE); 197 return (AE_AML_NO_RETURN_VALUE);
206} 198}
207 199
208
209/******************************************************************************* 200/*******************************************************************************
210 * 201 *
211 * FUNCTION: acpi_ds_result_pop_from_bottom 202 * FUNCTION: acpi_ds_result_pop_from_bottom
@@ -221,38 +212,37 @@ acpi_ds_result_pop (
221 ******************************************************************************/ 212 ******************************************************************************/
222 213
223acpi_status 214acpi_status
224acpi_ds_result_pop_from_bottom ( 215acpi_ds_result_pop_from_bottom(union acpi_operand_object ** object,
225 union acpi_operand_object **object, 216 struct acpi_walk_state * walk_state)
226 struct acpi_walk_state *walk_state)
227{ 217{
228 acpi_native_uint index; 218 acpi_native_uint index;
229 union acpi_generic_state *state; 219 union acpi_generic_state *state;
230
231
232 ACPI_FUNCTION_NAME ("ds_result_pop_from_bottom");
233 220
221 ACPI_FUNCTION_NAME("ds_result_pop_from_bottom");
234 222
235 state = walk_state->results; 223 state = walk_state->results;
236 if (!state) { 224 if (!state) {
237 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 225 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
238 "Warning: No result object pushed! State=%p\n", walk_state)); 226 "Warning: No result object pushed! State=%p\n",
227 walk_state));
239 return (AE_NOT_EXIST); 228 return (AE_NOT_EXIST);
240 } 229 }
241 230
242 if (!state->results.num_results) { 231 if (!state->results.num_results) {
243 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result objects! State=%p\n", 232 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
244 walk_state)); 233 "No result objects! State=%p\n", walk_state));
245 return (AE_AML_NO_RETURN_VALUE); 234 return (AE_AML_NO_RETURN_VALUE);
246 } 235 }
247 236
248 /* Remove Bottom element */ 237 /* Remove Bottom element */
249 238
250 *object = state->results.obj_desc [0]; 239 *object = state->results.obj_desc[0];
251 240
252 /* Push entire stack down one element */ 241 /* Push entire stack down one element */
253 242
254 for (index = 0; index < state->results.num_results; index++) { 243 for (index = 0; index < state->results.num_results; index++) {
255 state->results.obj_desc [index] = state->results.obj_desc [index + 1]; 244 state->results.obj_desc[index] =
245 state->results.obj_desc[index + 1];
256 } 246 }
257 247
258 state->results.num_results--; 248 state->results.num_results--;
@@ -260,20 +250,21 @@ acpi_ds_result_pop_from_bottom (
260 /* Check for a valid result object */ 250 /* Check for a valid result object */
261 251
262 if (!*object) { 252 if (!*object) {
263 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 253 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
264 "Null operand! State=%p #Ops=%X Index=%X\n", 254 "Null operand! State=%p #Ops=%X Index=%X\n",
265 walk_state, state->results.num_results, (u32) index)); 255 walk_state, state->results.num_results,
256 (u32) index));
266 return (AE_AML_NO_RETURN_VALUE); 257 return (AE_AML_NO_RETURN_VALUE);
267 } 258 }
268 259
269 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] Results=%p State=%p\n", 260 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] Results=%p State=%p\n",
270 *object, (*object) ? acpi_ut_get_object_type_name (*object) : "NULL", 261 *object,
271 state, walk_state)); 262 (*object) ? acpi_ut_get_object_type_name(*object) :
263 "NULL", state, walk_state));
272 264
273 return (AE_OK); 265 return (AE_OK);
274} 266}
275 267
276
277/******************************************************************************* 268/*******************************************************************************
278 * 269 *
279 * FUNCTION: acpi_ds_result_push 270 * FUNCTION: acpi_ds_result_push
@@ -288,47 +279,50 @@ acpi_ds_result_pop_from_bottom (
288 ******************************************************************************/ 279 ******************************************************************************/
289 280
290acpi_status 281acpi_status
291acpi_ds_result_push ( 282acpi_ds_result_push(union acpi_operand_object * object,
292 union acpi_operand_object *object, 283 struct acpi_walk_state * walk_state)
293 struct acpi_walk_state *walk_state)
294{ 284{
295 union acpi_generic_state *state; 285 union acpi_generic_state *state;
296
297
298 ACPI_FUNCTION_NAME ("ds_result_push");
299 286
287 ACPI_FUNCTION_NAME("ds_result_push");
300 288
301 state = walk_state->results; 289 state = walk_state->results;
302 if (!state) { 290 if (!state) {
303 ACPI_REPORT_ERROR (("No result stack frame during push\n")); 291 ACPI_REPORT_ERROR(("No result stack frame during push\n"));
304 return (AE_AML_INTERNAL); 292 return (AE_AML_INTERNAL);
305 } 293 }
306 294
307 if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) { 295 if (state->results.num_results == ACPI_OBJ_NUM_OPERANDS) {
308 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 296 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
309 "Result stack overflow: Obj=%p State=%p Num=%X\n", 297 "Result stack overflow: Obj=%p State=%p Num=%X\n",
310 object, walk_state, state->results.num_results)); 298 object, walk_state,
299 state->results.num_results));
311 return (AE_STACK_OVERFLOW); 300 return (AE_STACK_OVERFLOW);
312 } 301 }
313 302
314 if (!object) { 303 if (!object) {
315 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 304 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
316 "Null Object! Obj=%p State=%p Num=%X\n", 305 "Null Object! Obj=%p State=%p Num=%X\n",
317 object, walk_state, state->results.num_results)); 306 object, walk_state,
307 state->results.num_results));
318 return (AE_BAD_PARAMETER); 308 return (AE_BAD_PARAMETER);
319 } 309 }
320 310
321 state->results.obj_desc [state->results.num_results] = object; 311 state->results.obj_desc[state->results.num_results] = object;
322 state->results.num_results++; 312 state->results.num_results++;
323 313
324 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n", 314 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
325 object, object ? acpi_ut_get_object_type_name ((union acpi_operand_object *) object) : "NULL", 315 object,
326 walk_state, state->results.num_results, walk_state->current_result)); 316 object ?
317 acpi_ut_get_object_type_name((union
318 acpi_operand_object *)
319 object) : "NULL",
320 walk_state, state->results.num_results,
321 walk_state->current_result));
327 322
328 return (AE_OK); 323 return (AE_OK);
329} 324}
330 325
331
332/******************************************************************************* 326/*******************************************************************************
333 * 327 *
334 * FUNCTION: acpi_ds_result_stack_push 328 * FUNCTION: acpi_ds_result_stack_push
@@ -341,30 +335,26 @@ acpi_ds_result_push (
341 * 335 *
342 ******************************************************************************/ 336 ******************************************************************************/
343 337
344acpi_status 338acpi_status acpi_ds_result_stack_push(struct acpi_walk_state * walk_state)
345acpi_ds_result_stack_push (
346 struct acpi_walk_state *walk_state)
347{ 339{
348 union acpi_generic_state *state; 340 union acpi_generic_state *state;
349 341
350 ACPI_FUNCTION_NAME ("ds_result_stack_push"); 342 ACPI_FUNCTION_NAME("ds_result_stack_push");
351 343
352 344 state = acpi_ut_create_generic_state();
353 state = acpi_ut_create_generic_state ();
354 if (!state) { 345 if (!state) {
355 return (AE_NO_MEMORY); 346 return (AE_NO_MEMORY);
356 } 347 }
357 348
358 state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT; 349 state->common.data_type = ACPI_DESC_TYPE_STATE_RESULT;
359 acpi_ut_push_generic_state (&walk_state->results, state); 350 acpi_ut_push_generic_state(&walk_state->results, state);
360 351
361 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Results=%p State=%p\n", 352 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Results=%p State=%p\n",
362 state, walk_state)); 353 state, walk_state));
363 354
364 return (AE_OK); 355 return (AE_OK);
365} 356}
366 357
367
368/******************************************************************************* 358/*******************************************************************************
369 * 359 *
370 * FUNCTION: acpi_ds_result_stack_pop 360 * FUNCTION: acpi_ds_result_stack_pop
@@ -377,35 +367,31 @@ acpi_ds_result_stack_push (
377 * 367 *
378 ******************************************************************************/ 368 ******************************************************************************/
379 369
380acpi_status 370acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state * walk_state)
381acpi_ds_result_stack_pop (
382 struct acpi_walk_state *walk_state)
383{ 371{
384 union acpi_generic_state *state; 372 union acpi_generic_state *state;
385
386 ACPI_FUNCTION_NAME ("ds_result_stack_pop");
387 373
374 ACPI_FUNCTION_NAME("ds_result_stack_pop");
388 375
389 /* Check for stack underflow */ 376 /* Check for stack underflow */
390 377
391 if (walk_state->results == NULL) { 378 if (walk_state->results == NULL) {
392 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Underflow - State=%p\n", 379 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Underflow - State=%p\n",
393 walk_state)); 380 walk_state));
394 return (AE_AML_NO_OPERAND); 381 return (AE_AML_NO_OPERAND);
395 } 382 }
396 383
397 state = acpi_ut_pop_generic_state (&walk_state->results); 384 state = acpi_ut_pop_generic_state(&walk_state->results);
398 385
399 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 386 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
400 "Result=%p remaining_results=%X State=%p\n", 387 "Result=%p remaining_results=%X State=%p\n",
401 state, state->results.num_results, walk_state)); 388 state, state->results.num_results, walk_state));
402 389
403 acpi_ut_delete_generic_state (state); 390 acpi_ut_delete_generic_state(state);
404 391
405 return (AE_OK); 392 return (AE_OK);
406} 393}
407 394
408
409/******************************************************************************* 395/*******************************************************************************
410 * 396 *
411 * FUNCTION: acpi_ds_obj_stack_push 397 * FUNCTION: acpi_ds_obj_stack_push
@@ -420,35 +406,35 @@ acpi_ds_result_stack_pop (
420 ******************************************************************************/ 406 ******************************************************************************/
421 407
422acpi_status 408acpi_status
423acpi_ds_obj_stack_push ( 409acpi_ds_obj_stack_push(void *object, struct acpi_walk_state * walk_state)
424 void *object,
425 struct acpi_walk_state *walk_state)
426{ 410{
427 ACPI_FUNCTION_NAME ("ds_obj_stack_push"); 411 ACPI_FUNCTION_NAME("ds_obj_stack_push");
428
429 412
430 /* Check for stack overflow */ 413 /* Check for stack overflow */
431 414
432 if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) { 415 if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) {
433 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 416 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
434 "overflow! Obj=%p State=%p #Ops=%X\n", 417 "overflow! Obj=%p State=%p #Ops=%X\n",
435 object, walk_state, walk_state->num_operands)); 418 object, walk_state,
419 walk_state->num_operands));
436 return (AE_STACK_OVERFLOW); 420 return (AE_STACK_OVERFLOW);
437 } 421 }
438 422
439 /* Put the object onto the stack */ 423 /* Put the object onto the stack */
440 424
441 walk_state->operands [walk_state->num_operands] = object; 425 walk_state->operands[walk_state->num_operands] = object;
442 walk_state->num_operands++; 426 walk_state->num_operands++;
443 427
444 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n", 428 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
445 object, acpi_ut_get_object_type_name ((union acpi_operand_object *) object), 429 object,
446 walk_state, walk_state->num_operands)); 430 acpi_ut_get_object_type_name((union
431 acpi_operand_object *)
432 object), walk_state,
433 walk_state->num_operands));
447 434
448 return (AE_OK); 435 return (AE_OK);
449} 436}
450 437
451
452/******************************************************************************* 438/*******************************************************************************
453 * 439 *
454 * FUNCTION: acpi_ds_obj_stack_pop 440 * FUNCTION: acpi_ds_obj_stack_pop
@@ -464,38 +450,35 @@ acpi_ds_obj_stack_push (
464 ******************************************************************************/ 450 ******************************************************************************/
465 451
466acpi_status 452acpi_status
467acpi_ds_obj_stack_pop ( 453acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state * walk_state)
468 u32 pop_count,
469 struct acpi_walk_state *walk_state)
470{ 454{
471 u32 i; 455 u32 i;
472
473 ACPI_FUNCTION_NAME ("ds_obj_stack_pop");
474 456
457 ACPI_FUNCTION_NAME("ds_obj_stack_pop");
475 458
476 for (i = 0; i < pop_count; i++) { 459 for (i = 0; i < pop_count; i++) {
477 /* Check for stack underflow */ 460 /* Check for stack underflow */
478 461
479 if (walk_state->num_operands == 0) { 462 if (walk_state->num_operands == 0) {
480 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 463 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
481 "Underflow! Count=%X State=%p #Ops=%X\n", 464 "Underflow! Count=%X State=%p #Ops=%X\n",
482 pop_count, walk_state, walk_state->num_operands)); 465 pop_count, walk_state,
466 walk_state->num_operands));
483 return (AE_STACK_UNDERFLOW); 467 return (AE_STACK_UNDERFLOW);
484 } 468 }
485 469
486 /* Just set the stack entry to null */ 470 /* Just set the stack entry to null */
487 471
488 walk_state->num_operands--; 472 walk_state->num_operands--;
489 walk_state->operands [walk_state->num_operands] = NULL; 473 walk_state->operands[walk_state->num_operands] = NULL;
490 } 474 }
491 475
492 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n", 476 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
493 pop_count, walk_state, walk_state->num_operands)); 477 pop_count, walk_state, walk_state->num_operands));
494 478
495 return (AE_OK); 479 return (AE_OK);
496} 480}
497 481
498
499/******************************************************************************* 482/*******************************************************************************
500 * 483 *
501 * FUNCTION: acpi_ds_obj_stack_pop_and_delete 484 * FUNCTION: acpi_ds_obj_stack_pop_and_delete
@@ -511,44 +494,43 @@ acpi_ds_obj_stack_pop (
511 ******************************************************************************/ 494 ******************************************************************************/
512 495
513acpi_status 496acpi_status
514acpi_ds_obj_stack_pop_and_delete ( 497acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
515 u32 pop_count, 498 struct acpi_walk_state * walk_state)
516 struct acpi_walk_state *walk_state)
517{ 499{
518 u32 i; 500 u32 i;
519 union acpi_operand_object *obj_desc; 501 union acpi_operand_object *obj_desc;
520
521
522 ACPI_FUNCTION_NAME ("ds_obj_stack_pop_and_delete");
523 502
503 ACPI_FUNCTION_NAME("ds_obj_stack_pop_and_delete");
524 504
525 for (i = 0; i < pop_count; i++) { 505 for (i = 0; i < pop_count; i++) {
526 /* Check for stack underflow */ 506 /* Check for stack underflow */
527 507
528 if (walk_state->num_operands == 0) { 508 if (walk_state->num_operands == 0) {
529 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 509 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
530 "Underflow! Count=%X State=%p #Ops=%X\n", 510 "Underflow! Count=%X State=%p #Ops=%X\n",
531 pop_count, walk_state, walk_state->num_operands)); 511 pop_count, walk_state,
512 walk_state->num_operands));
532 return (AE_STACK_UNDERFLOW); 513 return (AE_STACK_UNDERFLOW);
533 } 514 }
534 515
535 /* Pop the stack and delete an object if present in this stack entry */ 516 /* Pop the stack and delete an object if present in this stack entry */
536 517
537 walk_state->num_operands--; 518 walk_state->num_operands--;
538 obj_desc = walk_state->operands [walk_state->num_operands]; 519 obj_desc = walk_state->operands[walk_state->num_operands];
539 if (obj_desc) { 520 if (obj_desc) {
540 acpi_ut_remove_reference (walk_state->operands [walk_state->num_operands]); 521 acpi_ut_remove_reference(walk_state->
541 walk_state->operands [walk_state->num_operands] = NULL; 522 operands[walk_state->
523 num_operands]);
524 walk_state->operands[walk_state->num_operands] = NULL;
542 } 525 }
543 } 526 }
544 527
545 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n", 528 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
546 pop_count, walk_state, walk_state->num_operands)); 529 pop_count, walk_state, walk_state->num_operands));
547 530
548 return (AE_OK); 531 return (AE_OK);
549} 532}
550 533
551
552/******************************************************************************* 534/*******************************************************************************
553 * 535 *
554 * FUNCTION: acpi_ds_get_current_walk_state 536 * FUNCTION: acpi_ds_get_current_walk_state
@@ -562,25 +544,21 @@ acpi_ds_obj_stack_pop_and_delete (
562 * 544 *
563 ******************************************************************************/ 545 ******************************************************************************/
564 546
565struct acpi_walk_state * 547struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
566acpi_ds_get_current_walk_state ( 548 *thread)
567 struct acpi_thread_state *thread)
568
569{ 549{
570 ACPI_FUNCTION_NAME ("ds_get_current_walk_state"); 550 ACPI_FUNCTION_NAME("ds_get_current_walk_state");
571
572 551
573 if (!thread) { 552 if (!thread) {
574 return (NULL); 553 return (NULL);
575 } 554 }
576 555
577 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Current walk_state %p\n", 556 ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "Current walk_state %p\n",
578 thread->walk_state_list)); 557 thread->walk_state_list));
579 558
580 return (thread->walk_state_list); 559 return (thread->walk_state_list);
581} 560}
582 561
583
584/******************************************************************************* 562/*******************************************************************************
585 * 563 *
586 * FUNCTION: acpi_ds_push_walk_state 564 * FUNCTION: acpi_ds_push_walk_state
@@ -595,20 +573,17 @@ acpi_ds_get_current_walk_state (
595 ******************************************************************************/ 573 ******************************************************************************/
596 574
597void 575void
598acpi_ds_push_walk_state ( 576acpi_ds_push_walk_state(struct acpi_walk_state *walk_state,
599 struct acpi_walk_state *walk_state, 577 struct acpi_thread_state *thread)
600 struct acpi_thread_state *thread)
601{ 578{
602 ACPI_FUNCTION_TRACE ("ds_push_walk_state"); 579 ACPI_FUNCTION_TRACE("ds_push_walk_state");
603
604 580
605 walk_state->next = thread->walk_state_list; 581 walk_state->next = thread->walk_state_list;
606 thread->walk_state_list = walk_state; 582 thread->walk_state_list = walk_state;
607 583
608 return_VOID; 584 return_VOID;
609} 585}
610 586
611
612/******************************************************************************* 587/*******************************************************************************
613 * 588 *
614 * FUNCTION: acpi_ds_pop_walk_state 589 * FUNCTION: acpi_ds_pop_walk_state
@@ -623,15 +598,11 @@ acpi_ds_push_walk_state (
623 * 598 *
624 ******************************************************************************/ 599 ******************************************************************************/
625 600
626struct acpi_walk_state * 601struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread)
627acpi_ds_pop_walk_state (
628 struct acpi_thread_state *thread)
629{ 602{
630 struct acpi_walk_state *walk_state; 603 struct acpi_walk_state *walk_state;
631
632
633 ACPI_FUNCTION_TRACE ("ds_pop_walk_state");
634 604
605 ACPI_FUNCTION_TRACE("ds_pop_walk_state");
635 606
636 walk_state = thread->walk_state_list; 607 walk_state = thread->walk_state_list;
637 608
@@ -647,10 +618,9 @@ acpi_ds_pop_walk_state (
647 */ 618 */
648 } 619 }
649 620
650 return_PTR (walk_state); 621 return_PTR(walk_state);
651} 622}
652 623
653
654/******************************************************************************* 624/*******************************************************************************
655 * 625 *
656 * FUNCTION: acpi_ds_create_walk_state 626 * FUNCTION: acpi_ds_create_walk_state
@@ -667,57 +637,55 @@ acpi_ds_pop_walk_state (
667 * 637 *
668 ******************************************************************************/ 638 ******************************************************************************/
669 639
670struct acpi_walk_state * 640struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
671acpi_ds_create_walk_state ( 641 union acpi_parse_object
672 acpi_owner_id owner_id, 642 *origin,
673 union acpi_parse_object *origin, 643 union acpi_operand_object
674 union acpi_operand_object *mth_desc, 644 *mth_desc,
675 struct acpi_thread_state *thread) 645 struct acpi_thread_state
646 *thread)
676{ 647{
677 struct acpi_walk_state *walk_state; 648 struct acpi_walk_state *walk_state;
678 acpi_status status; 649 acpi_status status;
679
680
681 ACPI_FUNCTION_TRACE ("ds_create_walk_state");
682 650
651 ACPI_FUNCTION_TRACE("ds_create_walk_state");
683 652
684 walk_state = ACPI_MEM_CALLOCATE (sizeof (struct acpi_walk_state)); 653 walk_state = ACPI_MEM_CALLOCATE(sizeof(struct acpi_walk_state));
685 if (!walk_state) { 654 if (!walk_state) {
686 return_PTR (NULL); 655 return_PTR(NULL);
687 } 656 }
688 657
689 walk_state->data_type = ACPI_DESC_TYPE_WALK; 658 walk_state->data_type = ACPI_DESC_TYPE_WALK;
690 walk_state->owner_id = owner_id; 659 walk_state->owner_id = owner_id;
691 walk_state->origin = origin; 660 walk_state->origin = origin;
692 walk_state->method_desc = mth_desc; 661 walk_state->method_desc = mth_desc;
693 walk_state->thread = thread; 662 walk_state->thread = thread;
694 663
695 walk_state->parser_state.start_op = origin; 664 walk_state->parser_state.start_op = origin;
696 665
697 /* Init the method args/local */ 666 /* Init the method args/local */
698 667
699#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY)) 668#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
700 acpi_ds_method_data_init (walk_state); 669 acpi_ds_method_data_init(walk_state);
701#endif 670#endif
702 671
703 /* Create an initial result stack entry */ 672 /* Create an initial result stack entry */
704 673
705 status = acpi_ds_result_stack_push (walk_state); 674 status = acpi_ds_result_stack_push(walk_state);
706 if (ACPI_FAILURE (status)) { 675 if (ACPI_FAILURE(status)) {
707 ACPI_MEM_FREE (walk_state); 676 ACPI_MEM_FREE(walk_state);
708 return_PTR (NULL); 677 return_PTR(NULL);
709 } 678 }
710 679
711 /* Put the new state at the head of the walk list */ 680 /* Put the new state at the head of the walk list */
712 681
713 if (thread) { 682 if (thread) {
714 acpi_ds_push_walk_state (walk_state, thread); 683 acpi_ds_push_walk_state(walk_state, thread);
715 } 684 }
716 685
717 return_PTR (walk_state); 686 return_PTR(walk_state);
718} 687}
719 688
720
721/******************************************************************************* 689/*******************************************************************************
722 * 690 *
723 * FUNCTION: acpi_ds_init_aml_walk 691 * FUNCTION: acpi_ds_init_aml_walk
@@ -737,27 +705,23 @@ acpi_ds_create_walk_state (
737 ******************************************************************************/ 705 ******************************************************************************/
738 706
739acpi_status 707acpi_status
740acpi_ds_init_aml_walk ( 708acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
741 struct acpi_walk_state *walk_state, 709 union acpi_parse_object *op,
742 union acpi_parse_object *op, 710 struct acpi_namespace_node *method_node,
743 struct acpi_namespace_node *method_node, 711 u8 * aml_start,
744 u8 *aml_start, 712 u32 aml_length,
745 u32 aml_length, 713 struct acpi_parameter_info *info, u8 pass_number)
746 struct acpi_parameter_info *info,
747 u8 pass_number)
748{ 714{
749 acpi_status status; 715 acpi_status status;
750 struct acpi_parse_state *parser_state = &walk_state->parser_state; 716 struct acpi_parse_state *parser_state = &walk_state->parser_state;
751 union acpi_parse_object *extra_op; 717 union acpi_parse_object *extra_op;
752
753 718
754 ACPI_FUNCTION_TRACE ("ds_init_aml_walk"); 719 ACPI_FUNCTION_TRACE("ds_init_aml_walk");
755 720
756 721 walk_state->parser_state.aml =
757 walk_state->parser_state.aml = 722 walk_state->parser_state.aml_start = aml_start;
758 walk_state->parser_state.aml_start = aml_start;
759 walk_state->parser_state.aml_end = 723 walk_state->parser_state.aml_end =
760 walk_state->parser_state.pkg_end = aml_start + aml_length; 724 walk_state->parser_state.pkg_end = aml_start + aml_length;
761 725
762 /* The next_op of the next_walk will be the beginning of the method */ 726 /* The next_op of the next_walk will be the beginning of the method */
763 727
@@ -766,42 +730,45 @@ acpi_ds_init_aml_walk (
766 730
767 if (info) { 731 if (info) {
768 if (info->parameter_type == ACPI_PARAM_GPE) { 732 if (info->parameter_type == ACPI_PARAM_GPE) {
769 walk_state->gpe_event_info = ACPI_CAST_PTR (struct acpi_gpe_event_info, 733 walk_state->gpe_event_info =
770 info->parameters); 734 ACPI_CAST_PTR(struct acpi_gpe_event_info,
771 } 735 info->parameters);
772 else { 736 } else {
773 walk_state->params = info->parameters; 737 walk_state->params = info->parameters;
774 walk_state->caller_return_desc = &info->return_object; 738 walk_state->caller_return_desc = &info->return_object;
775 } 739 }
776 } 740 }
777 741
778 status = acpi_ps_init_scope (&walk_state->parser_state, op); 742 status = acpi_ps_init_scope(&walk_state->parser_state, op);
779 if (ACPI_FAILURE (status)) { 743 if (ACPI_FAILURE(status)) {
780 return_ACPI_STATUS (status); 744 return_ACPI_STATUS(status);
781 } 745 }
782 746
783 if (method_node) { 747 if (method_node) {
784 walk_state->parser_state.start_node = method_node; 748 walk_state->parser_state.start_node = method_node;
785 walk_state->walk_type = ACPI_WALK_METHOD; 749 walk_state->walk_type = ACPI_WALK_METHOD;
786 walk_state->method_node = method_node; 750 walk_state->method_node = method_node;
787 walk_state->method_desc = acpi_ns_get_attached_object (method_node); 751 walk_state->method_desc =
752 acpi_ns_get_attached_object(method_node);
788 753
789 /* Push start scope on scope stack and make it current */ 754 /* Push start scope on scope stack and make it current */
790 755
791 status = acpi_ds_scope_stack_push (method_node, ACPI_TYPE_METHOD, walk_state); 756 status =
792 if (ACPI_FAILURE (status)) { 757 acpi_ds_scope_stack_push(method_node, ACPI_TYPE_METHOD,
793 return_ACPI_STATUS (status); 758 walk_state);
759 if (ACPI_FAILURE(status)) {
760 return_ACPI_STATUS(status);
794 } 761 }
795 762
796 /* Init the method arguments */ 763 /* Init the method arguments */
797 764
798 status = acpi_ds_method_data_init_args (walk_state->params, 765 status = acpi_ds_method_data_init_args(walk_state->params,
799 ACPI_METHOD_NUM_ARGS, walk_state); 766 ACPI_METHOD_NUM_ARGS,
800 if (ACPI_FAILURE (status)) { 767 walk_state);
801 return_ACPI_STATUS (status); 768 if (ACPI_FAILURE(status)) {
769 return_ACPI_STATUS(status);
802 } 770 }
803 } 771 } else {
804 else {
805 /* 772 /*
806 * Setup the current scope. 773 * Setup the current scope.
807 * Find a Named Op that has a namespace node associated with it. 774 * Find a Named Op that has a namespace node associated with it.
@@ -815,27 +782,27 @@ acpi_ds_init_aml_walk (
815 782
816 if (!extra_op) { 783 if (!extra_op) {
817 parser_state->start_node = NULL; 784 parser_state->start_node = NULL;
818 } 785 } else {
819 else {
820 parser_state->start_node = extra_op->common.node; 786 parser_state->start_node = extra_op->common.node;
821 } 787 }
822 788
823 if (parser_state->start_node) { 789 if (parser_state->start_node) {
824 /* Push start scope on scope stack and make it current */ 790 /* Push start scope on scope stack and make it current */
825 791
826 status = acpi_ds_scope_stack_push (parser_state->start_node, 792 status =
827 parser_state->start_node->type, walk_state); 793 acpi_ds_scope_stack_push(parser_state->start_node,
828 if (ACPI_FAILURE (status)) { 794 parser_state->start_node->
829 return_ACPI_STATUS (status); 795 type, walk_state);
796 if (ACPI_FAILURE(status)) {
797 return_ACPI_STATUS(status);
830 } 798 }
831 } 799 }
832 } 800 }
833 801
834 status = acpi_ds_init_callbacks (walk_state, pass_number); 802 status = acpi_ds_init_callbacks(walk_state, pass_number);
835 return_ACPI_STATUS (status); 803 return_ACPI_STATUS(status);
836} 804}
837 805
838
839/******************************************************************************* 806/*******************************************************************************
840 * 807 *
841 * FUNCTION: acpi_ds_delete_walk_state 808 * FUNCTION: acpi_ds_delete_walk_state
@@ -848,29 +815,27 @@ acpi_ds_init_aml_walk (
848 * 815 *
849 ******************************************************************************/ 816 ******************************************************************************/
850 817
851void 818void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
852acpi_ds_delete_walk_state (
853 struct acpi_walk_state *walk_state)
854{ 819{
855 union acpi_generic_state *state; 820 union acpi_generic_state *state;
856
857
858 ACPI_FUNCTION_TRACE_PTR ("ds_delete_walk_state", walk_state);
859 821
822 ACPI_FUNCTION_TRACE_PTR("ds_delete_walk_state", walk_state);
860 823
861 if (!walk_state) { 824 if (!walk_state) {
862 return; 825 return;
863 } 826 }
864 827
865 if (walk_state->data_type != ACPI_DESC_TYPE_WALK) { 828 if (walk_state->data_type != ACPI_DESC_TYPE_WALK) {
866 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p is not a valid walk state\n", 829 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
867 walk_state)); 830 "%p is not a valid walk state\n",
831 walk_state));
868 return; 832 return;
869 } 833 }
870 834
871 if (walk_state->parser_state.scope) { 835 if (walk_state->parser_state.scope) {
872 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%p walk still has a scope list\n", 836 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
873 walk_state)); 837 "%p walk still has a scope list\n",
838 walk_state));
874 } 839 }
875 840
876 /* Always must free any linked control states */ 841 /* Always must free any linked control states */
@@ -879,7 +844,7 @@ acpi_ds_delete_walk_state (
879 state = walk_state->control_state; 844 state = walk_state->control_state;
880 walk_state->control_state = state->common.next; 845 walk_state->control_state = state->common.next;
881 846
882 acpi_ut_delete_generic_state (state); 847 acpi_ut_delete_generic_state(state);
883 } 848 }
884 849
885 /* Always must free any linked parse states */ 850 /* Always must free any linked parse states */
@@ -888,7 +853,7 @@ acpi_ds_delete_walk_state (
888 state = walk_state->scope_info; 853 state = walk_state->scope_info;
889 walk_state->scope_info = state->common.next; 854 walk_state->scope_info = state->common.next;
890 855
891 acpi_ut_delete_generic_state (state); 856 acpi_ut_delete_generic_state(state);
892 } 857 }
893 858
894 /* Always must free any stacked result states */ 859 /* Always must free any stacked result states */
@@ -897,14 +862,13 @@ acpi_ds_delete_walk_state (
897 state = walk_state->results; 862 state = walk_state->results;
898 walk_state->results = state->common.next; 863 walk_state->results = state->common.next;
899 864
900 acpi_ut_delete_generic_state (state); 865 acpi_ut_delete_generic_state(state);
901 } 866 }
902 867
903 ACPI_MEM_FREE (walk_state); 868 ACPI_MEM_FREE(walk_state);
904 return_VOID; 869 return_VOID;
905} 870}
906 871
907
908#ifdef ACPI_OBSOLETE_FUNCTIONS 872#ifdef ACPI_OBSOLETE_FUNCTIONS
909/******************************************************************************* 873/*******************************************************************************
910 * 874 *
@@ -921,50 +885,53 @@ acpi_ds_delete_walk_state (
921 ******************************************************************************/ 885 ******************************************************************************/
922 886
923acpi_status 887acpi_status
924acpi_ds_result_insert ( 888acpi_ds_result_insert(void *object,
925 void *object, 889 u32 index, struct acpi_walk_state *walk_state)
926 u32 index,
927 struct acpi_walk_state *walk_state)
928{ 890{
929 union acpi_generic_state *state; 891 union acpi_generic_state *state;
930
931
932 ACPI_FUNCTION_NAME ("ds_result_insert");
933 892
893 ACPI_FUNCTION_NAME("ds_result_insert");
934 894
935 state = walk_state->results; 895 state = walk_state->results;
936 if (!state) { 896 if (!state) {
937 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No result object pushed! State=%p\n", 897 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
938 walk_state)); 898 "No result object pushed! State=%p\n",
899 walk_state));
939 return (AE_NOT_EXIST); 900 return (AE_NOT_EXIST);
940 } 901 }
941 902
942 if (index >= ACPI_OBJ_NUM_OPERANDS) { 903 if (index >= ACPI_OBJ_NUM_OPERANDS) {
943 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 904 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
944 "Index out of range: %X Obj=%p State=%p Num=%X\n", 905 "Index out of range: %X Obj=%p State=%p Num=%X\n",
945 index, object, walk_state, state->results.num_results)); 906 index, object, walk_state,
907 state->results.num_results));
946 return (AE_BAD_PARAMETER); 908 return (AE_BAD_PARAMETER);
947 } 909 }
948 910
949 if (!object) { 911 if (!object) {
950 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 912 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
951 "Null Object! Index=%X Obj=%p State=%p Num=%X\n", 913 "Null Object! Index=%X Obj=%p State=%p Num=%X\n",
952 index, object, walk_state, state->results.num_results)); 914 index, object, walk_state,
915 state->results.num_results));
953 return (AE_BAD_PARAMETER); 916 return (AE_BAD_PARAMETER);
954 } 917 }
955 918
956 state->results.obj_desc [index] = object; 919 state->results.obj_desc[index] = object;
957 state->results.num_results++; 920 state->results.num_results++;
958 921
959 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, 922 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
960 "Obj=%p [%s] State=%p Num=%X Cur=%X\n", 923 "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
961 object, object ? acpi_ut_get_object_type_name ((union acpi_operand_object *) object) : "NULL", 924 object,
962 walk_state, state->results.num_results, walk_state->current_result)); 925 object ?
926 acpi_ut_get_object_type_name((union
927 acpi_operand_object *)
928 object) : "NULL",
929 walk_state, state->results.num_results,
930 walk_state->current_result));
963 931
964 return (AE_OK); 932 return (AE_OK);
965} 933}
966 934
967
968/******************************************************************************* 935/*******************************************************************************
969 * 936 *
970 * FUNCTION: acpi_ds_obj_stack_delete_all 937 * FUNCTION: acpi_ds_obj_stack_delete_all
@@ -978,29 +945,24 @@ acpi_ds_result_insert (
978 * 945 *
979 ******************************************************************************/ 946 ******************************************************************************/
980 947
981acpi_status 948acpi_status acpi_ds_obj_stack_delete_all(struct acpi_walk_state * walk_state)
982acpi_ds_obj_stack_delete_all (
983 struct acpi_walk_state *walk_state)
984{ 949{
985 u32 i; 950 u32 i;
986
987
988 ACPI_FUNCTION_TRACE_PTR ("ds_obj_stack_delete_all", walk_state);
989 951
952 ACPI_FUNCTION_TRACE_PTR("ds_obj_stack_delete_all", walk_state);
990 953
991 /* The stack size is configurable, but fixed */ 954 /* The stack size is configurable, but fixed */
992 955
993 for (i = 0; i < ACPI_OBJ_NUM_OPERANDS; i++) { 956 for (i = 0; i < ACPI_OBJ_NUM_OPERANDS; i++) {
994 if (walk_state->operands[i]) { 957 if (walk_state->operands[i]) {
995 acpi_ut_remove_reference (walk_state->operands[i]); 958 acpi_ut_remove_reference(walk_state->operands[i]);
996 walk_state->operands[i] = NULL; 959 walk_state->operands[i] = NULL;
997 } 960 }
998 } 961 }
999 962
1000 return_ACPI_STATUS (AE_OK); 963 return_ACPI_STATUS(AE_OK);
1001} 964}
1002 965
1003
1004/******************************************************************************* 966/*******************************************************************************
1005 * 967 *
1006 * FUNCTION: acpi_ds_obj_stack_pop_object 968 * FUNCTION: acpi_ds_obj_stack_pop_object
@@ -1016,19 +978,17 @@ acpi_ds_obj_stack_delete_all (
1016 ******************************************************************************/ 978 ******************************************************************************/
1017 979
1018acpi_status 980acpi_status
1019acpi_ds_obj_stack_pop_object ( 981acpi_ds_obj_stack_pop_object(union acpi_operand_object **object,
1020 union acpi_operand_object **object, 982 struct acpi_walk_state *walk_state)
1021 struct acpi_walk_state *walk_state)
1022{ 983{
1023 ACPI_FUNCTION_NAME ("ds_obj_stack_pop_object"); 984 ACPI_FUNCTION_NAME("ds_obj_stack_pop_object");
1024
1025 985
1026 /* Check for stack underflow */ 986 /* Check for stack underflow */
1027 987
1028 if (walk_state->num_operands == 0) { 988 if (walk_state->num_operands == 0) {
1029 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 989 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1030 "Missing operand/stack empty! State=%p #Ops=%X\n", 990 "Missing operand/stack empty! State=%p #Ops=%X\n",
1031 walk_state, walk_state->num_operands)); 991 walk_state, walk_state->num_operands));
1032 *object = NULL; 992 *object = NULL;
1033 return (AE_AML_NO_OPERAND); 993 return (AE_AML_NO_OPERAND);
1034 } 994 }
@@ -1039,27 +999,26 @@ acpi_ds_obj_stack_pop_object (
1039 999
1040 /* Check for a valid operand */ 1000 /* Check for a valid operand */
1041 1001
1042 if (!walk_state->operands [walk_state->num_operands]) { 1002 if (!walk_state->operands[walk_state->num_operands]) {
1043 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 1003 ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
1044 "Null operand! State=%p #Ops=%X\n", 1004 "Null operand! State=%p #Ops=%X\n",
1045 walk_state, walk_state->num_operands)); 1005 walk_state, walk_state->num_operands));
1046 *object = NULL; 1006 *object = NULL;
1047 return (AE_AML_NO_OPERAND); 1007 return (AE_AML_NO_OPERAND);
1048 } 1008 }
1049 1009
1050 /* Get operand and set stack entry to null */ 1010 /* Get operand and set stack entry to null */
1051 1011
1052 *object = walk_state->operands [walk_state->num_operands]; 1012 *object = walk_state->operands[walk_state->num_operands];
1053 walk_state->operands [walk_state->num_operands] = NULL; 1013 walk_state->operands[walk_state->num_operands] = NULL;
1054 1014
1055 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n", 1015 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
1056 *object, acpi_ut_get_object_type_name (*object), 1016 *object, acpi_ut_get_object_type_name(*object),
1057 walk_state, walk_state->num_operands)); 1017 walk_state, walk_state->num_operands));
1058 1018
1059 return (AE_OK); 1019 return (AE_OK);
1060} 1020}
1061 1021
1062
1063/******************************************************************************* 1022/*******************************************************************************
1064 * 1023 *
1065 * FUNCTION: acpi_ds_obj_stack_get_value 1024 * FUNCTION: acpi_ds_obj_stack_get_value
@@ -1075,30 +1034,25 @@ acpi_ds_obj_stack_pop_object (
1075 * 1034 *
1076 ******************************************************************************/ 1035 ******************************************************************************/
1077 1036
1078void * 1037void *acpi_ds_obj_stack_get_value(u32 index, struct acpi_walk_state *walk_state)
1079acpi_ds_obj_stack_get_value (
1080 u32 index,
1081 struct acpi_walk_state *walk_state)
1082{ 1038{
1083 1039
1084 ACPI_FUNCTION_TRACE_PTR ("ds_obj_stack_get_value", walk_state); 1040 ACPI_FUNCTION_TRACE_PTR("ds_obj_stack_get_value", walk_state);
1085
1086 1041
1087 /* Can't do it if the stack is empty */ 1042 /* Can't do it if the stack is empty */
1088 1043
1089 if (walk_state->num_operands == 0) { 1044 if (walk_state->num_operands == 0) {
1090 return_PTR (NULL); 1045 return_PTR(NULL);
1091 } 1046 }
1092 1047
1093 /* or if the index is past the top of the stack */ 1048 /* or if the index is past the top of the stack */
1094 1049
1095 if (index > (walk_state->num_operands - (u32) 1)) { 1050 if (index > (walk_state->num_operands - (u32) 1)) {
1096 return_PTR (NULL); 1051 return_PTR(NULL);
1097 } 1052 }
1098 1053
1099 return_PTR (walk_state->operands[(acpi_native_uint)(walk_state->num_operands - 1) - 1054 return_PTR(walk_state->
1100 index]); 1055 operands[(acpi_native_uint) (walk_state->num_operands - 1) -
1056 index]);
1101} 1057}
1102#endif 1058#endif
1103
1104