Deleted Added
full compact
dsmethod.c (99146) dsmethod.c (99679)
1/******************************************************************************
2 *
3 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
1/******************************************************************************
2 *
3 * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
4 * $Revision: 81 $
4 * $Revision: 86 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 104 unchanged lines hidden (view full) ---

117#define __DSMETHOD_C__
118
119#include "acpi.h"
120#include "acparser.h"
121#include "amlcode.h"
122#include "acdispat.h"
123#include "acinterp.h"
124#include "acnamesp.h"
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 104 unchanged lines hidden (view full) ---

117#define __DSMETHOD_C__
118
119#include "acpi.h"
120#include "acparser.h"
121#include "amlcode.h"
122#include "acdispat.h"
123#include "acinterp.h"
124#include "acnamesp.h"
125#include "actables.h"
126#include "acdebug.h"
127
128
129#define _COMPONENT ACPI_DISPATCHER
130 ACPI_MODULE_NAME ("dsmethod")
131
132
133/*******************************************************************************
134 *

--- 31 unchanged lines hidden (view full) ---

166 /* Parameter Validation */
167
168 if (!ObjHandle)
169 {
170 return_ACPI_STATUS (AE_NULL_ENTRY);
171 }
172
173 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** NamedObj=%p\n",
125
126
127#define _COMPONENT ACPI_DISPATCHER
128 ACPI_MODULE_NAME ("dsmethod")
129
130
131/*******************************************************************************
132 *

--- 31 unchanged lines hidden (view full) ---

164 /* Parameter Validation */
165
166 if (!ObjHandle)
167 {
168 return_ACPI_STATUS (AE_NULL_ENTRY);
169 }
170
171 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Parsing [%4.4s] **** NamedObj=%p\n",
174 (char *) &((ACPI_NAMESPACE_NODE *) ObjHandle)->Name, ObjHandle));
172 ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii, ObjHandle));
175
176 /* Extract the method object from the method Node */
177
178 Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
179 ObjDesc = AcpiNsGetAttachedObject (Node);
180 if (!ObjDesc)
181 {
182 return_ACPI_STATUS (AE_NULL_OBJECT);

--- 21 unchanged lines hidden (view full) ---

204 if (!Op)
205 {
206 return_ACPI_STATUS (AE_NO_MEMORY);
207 }
208
209 /* Init new op with the method name and pointer back to the Node */
210
211 AcpiPsSetName (Op, Node->Name.Integer);
173
174 /* Extract the method object from the method Node */
175
176 Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
177 ObjDesc = AcpiNsGetAttachedObject (Node);
178 if (!ObjDesc)
179 {
180 return_ACPI_STATUS (AE_NULL_OBJECT);

--- 21 unchanged lines hidden (view full) ---

202 if (!Op)
203 {
204 return_ACPI_STATUS (AE_NO_MEMORY);
205 }
206
207 /* Init new op with the method name and pointer back to the Node */
208
209 AcpiPsSetName (Op, Node->Name.Integer);
212 Op->Node = Node;
210 Op->Common.Node = Node;
213
214 /*
215 * Get a new OwnerId for objects created by this method. Namespace
216 * objects (such as Operation Regions) can be created during the
217 * first pass parse.
218 */
219 OwnerId = AcpiUtAllocateOwnerId (ACPI_OWNER_TYPE_METHOD);
220 ObjDesc->Method.OwningId = OwnerId;
221
222 /* Create and initialize a new walk state */
223
211
212 /*
213 * Get a new OwnerId for objects created by this method. Namespace
214 * objects (such as Operation Regions) can be created during the
215 * first pass parse.
216 */
217 OwnerId = AcpiUtAllocateOwnerId (ACPI_OWNER_TYPE_METHOD);
218 ObjDesc->Method.OwningId = OwnerId;
219
220 /* Create and initialize a new walk state */
221
224 WalkState = AcpiDsCreateWalkState (OwnerId,
225 NULL, NULL, NULL);
222 WalkState = AcpiDsCreateWalkState (OwnerId, NULL, NULL, NULL);
226 if (!WalkState)
227 {
228 return_ACPI_STATUS (AE_NO_MEMORY);
229 }
230
231 Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
232 ObjDesc->Method.AmlLength, NULL, NULL, 1);
233 if (ACPI_FAILURE (Status))

--- 13 unchanged lines hidden (view full) ---

247 * take on dynamic run-time values.
248 */
249 Status = AcpiPsParseAml (WalkState);
250 if (ACPI_FAILURE (Status))
251 {
252 return_ACPI_STATUS (Status);
253 }
254
223 if (!WalkState)
224 {
225 return_ACPI_STATUS (AE_NO_MEMORY);
226 }
227
228 Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
229 ObjDesc->Method.AmlLength, NULL, NULL, 1);
230 if (ACPI_FAILURE (Status))

--- 13 unchanged lines hidden (view full) ---

244 * take on dynamic run-time values.
245 */
246 Status = AcpiPsParseAml (WalkState);
247 if (ACPI_FAILURE (Status))
248 {
249 return_ACPI_STATUS (Status);
250 }
251
255 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
256 (char *) &((ACPI_NAMESPACE_NODE *) ObjHandle)->Name, ObjHandle, Op));
252 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
253 "**** [%4.4s] Parsed **** NamedObj=%p Op=%p\n",
254 ((ACPI_NAMESPACE_NODE *) ObjHandle)->Name.Ascii, ObjHandle, Op));
257
258 AcpiPsDeleteParseTree (Op);
259 return_ACPI_STATUS (Status);
260}
261
262
263/*******************************************************************************
264 *

--- 191 unchanged lines hidden (view full) ---

456 AcpiUtRemoveReference (ThisWalkState->Operands [i]);
457 ThisWalkState->Operands [i] = NULL;
458 }
459
460 /* Clear the operand stack */
461
462 ThisWalkState->NumOperands = 0;
463
255
256 AcpiPsDeleteParseTree (Op);
257 return_ACPI_STATUS (Status);
258}
259
260
261/*******************************************************************************
262 *

--- 191 unchanged lines hidden (view full) ---

454 AcpiUtRemoveReference (ThisWalkState->Operands [i]);
455 ThisWalkState->Operands [i] = NULL;
456 }
457
458 /* Clear the operand stack */
459
460 ThisWalkState->NumOperands = 0;
461
464 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Starting nested execution, newstate=%p\n",
465 NextWalkState));
462 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
463 "Starting nested execution, newstate=%p\n", NextWalkState));
466
467 return_ACPI_STATUS (AE_OK);
468
469
470 /* On error, we must delete the new walk state */
471
472Cleanup:
464
465 return_ACPI_STATUS (AE_OK);
466
467
468 /* On error, we must delete the new walk state */
469
470Cleanup:
473 AcpiDsTerminateControlMethod (NextWalkState);
471 (void) AcpiDsTerminateControlMethod (NextWalkState);
474 AcpiDsDeleteWalkState (NextWalkState);
475 return_ACPI_STATUS (Status);
476
477}
478
479
480/*******************************************************************************
481 *

--- 74 unchanged lines hidden (view full) ---

556 ACPI_OPERAND_OBJECT *ObjDesc;
557 ACPI_NAMESPACE_NODE *MethodNode;
558 ACPI_STATUS Status;
559
560
561 ACPI_FUNCTION_TRACE_PTR ("DsTerminateControlMethod", WalkState);
562
563
472 AcpiDsDeleteWalkState (NextWalkState);
473 return_ACPI_STATUS (Status);
474
475}
476
477
478/*******************************************************************************
479 *

--- 74 unchanged lines hidden (view full) ---

554 ACPI_OPERAND_OBJECT *ObjDesc;
555 ACPI_NAMESPACE_NODE *MethodNode;
556 ACPI_STATUS Status;
557
558
559 ACPI_FUNCTION_TRACE_PTR ("DsTerminateControlMethod", WalkState);
560
561
562 if (!WalkState)
563 {
564 return (AE_BAD_PARAMETER);
565 }
566
564 /* The current method object was saved in the walk state */
565
566 ObjDesc = WalkState->MethodDesc;
567 if (!ObjDesc)
568 {
569 return_ACPI_STATUS (AE_OK);
570 }
571

--- 11 unchanged lines hidden (view full) ---

583 {
584 return_ACPI_STATUS (Status);
585 }
586
587 /* Signal completion of the execution of this method if necessary */
588
589 if (WalkState->MethodDesc->Method.Semaphore)
590 {
567 /* The current method object was saved in the walk state */
568
569 ObjDesc = WalkState->MethodDesc;
570 if (!ObjDesc)
571 {
572 return_ACPI_STATUS (AE_OK);
573 }
574

--- 11 unchanged lines hidden (view full) ---

586 {
587 return_ACPI_STATUS (Status);
588 }
589
590 /* Signal completion of the execution of this method if necessary */
591
592 if (WalkState->MethodDesc->Method.Semaphore)
593 {
591 AcpiOsSignalSemaphore (
592 WalkState->MethodDesc->Method.Semaphore, 1);
594 Status = AcpiOsSignalSemaphore (
595 WalkState->MethodDesc->Method.Semaphore, 1);
596 if (ACPI_FAILURE (Status))
597 {
598 ACPI_REPORT_ERROR (("Could not signal method semaphore\n"));
599 Status = AE_OK;
600
601 /* Ignore error and continue cleanup */
602 }
593 }
594
595 /* Decrement the thread count on the method parse tree */
596
597 WalkState->MethodDesc->Method.ThreadCount--;
598 if (!WalkState->MethodDesc->Method.ThreadCount)
599 {
600 /*

--- 39 unchanged lines hidden ---
603 }
604
605 /* Decrement the thread count on the method parse tree */
606
607 WalkState->MethodDesc->Method.ThreadCount--;
608 if (!WalkState->MethodDesc->Method.ThreadCount)
609 {
610 /*

--- 39 unchanged lines hidden ---