Deleted Added
full compact
1/*******************************************************************************
2 *
3 * Module Name: dbmethod - Debug commands for control methods
4 *
5 ******************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

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

342
343
344 Method = AcpiDbConvertToNode (Name);
345 if (!Method)
346 {
347 return (AE_BAD_PARAMETER);
348 }
349
350 if (Method->Type != ACPI_TYPE_METHOD)
351 {
352 ACPI_ERROR ((AE_INFO, "%s (%s): Object must be a control method",
353 Name, AcpiUtGetTypeName (Method->Type)));
354 return (AE_BAD_PARAMETER);
355 }
356
357 ObjDesc = Method->Object;
358
359 Op = AcpiPsCreateScopeOp ();
360 if (!Op)
361 {
362 return (AE_NO_MEMORY);
363 }
364
365 /* Create and initialize a new walk state */
366
367 WalkState = AcpiDsCreateWalkState (0, Op, NULL, NULL);
368 if (!WalkState)
369 {
370 return (AE_NO_MEMORY);
371 }
372
373 Status = AcpiDsInitAmlWalk (WalkState, Op, NULL,
367 ObjDesc->Method.AmlStart,
368 ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
374 ObjDesc->Method.AmlStart,
375 ObjDesc->Method.AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
376 if (ACPI_FAILURE (Status))
377 {
378 return (Status);
379 }
380
374 /* Parse the AML */
381 Status = AcpiUtAllocateOwnerId (&ObjDesc->Method.OwnerId);
382 WalkState->OwnerId = ObjDesc->Method.OwnerId;
383
384 /* Push start scope on scope stack and make it current */
385
386 Status = AcpiDsScopeStackPush (Method,
387 Method->Type, WalkState);
388 if (ACPI_FAILURE (Status))
389 {
390 return (Status);
391 }
392
393 /* Parse the entire method AML including deferred operators */
394
395 WalkState->ParseFlags &= ~ACPI_PARSE_DELETE_TREE;
396 WalkState->ParseFlags |= ACPI_PARSE_DISASSEMBLE;
397
398 Status = AcpiPsParseAml (WalkState);
399 AcpiDmParseDeferredOps (Op);
400
401 /* Now we can disassemble the method */
402
403 AcpiGbl_DbOpt_verbose = FALSE;
404#ifdef ACPI_DISASSEMBLER
405 AcpiDmDisassemble (NULL, Op, 0);
406#endif
407 AcpiGbl_DbOpt_verbose = TRUE;
408
409 AcpiPsDeleteParseTree (Op);
410
411 /* Method cleanup */
412
413 AcpiNsDeleteNamespaceSubtree (Method);
414 AcpiNsDeleteNamespaceByOwner (ObjDesc->Method.OwnerId);
415 AcpiUtReleaseOwnerId (&ObjDesc->Method.OwnerId);
416 return (AE_OK);
417}
418
419
420/*******************************************************************************
421 *
422 * FUNCTION: AcpiDbWalkForExecute
423 *

--- 138 unchanged lines hidden ---