summaryrefslogtreecommitdiff
path: root/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2016-07-26 15:05:29 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2016-07-26 15:05:29 +0000
commitd103e8b98085dbb5f7707242723b9d3ce74f2723 (patch)
tree263af7aa964a6c36a7cd561cd80268d6cbba5d5d /usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
parent9b221abb819d37d8c917941b8348a6c0e49c74b1 (diff)
downloadillumos-joyent-d103e8b98085dbb5f7707242723b9d3ce74f2723.tar.gz
OS-5536 update to ACPI version 6.x
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c')
-rw-r--r--usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c71
1 files changed, 33 insertions, 38 deletions
diff --git a/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c b/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
index 5c5c51a573..d60361921b 100644
--- a/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
+++ b/usr/src/uts/intel/io/acpica/dispatcher/dscontrol.c
@@ -6,7 +6,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2012, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -42,13 +42,12 @@
* POSSIBILITY OF SUCH DAMAGES.
*/
-#define __DSCONTROL_C__
-
#include "acpi.h"
#include "accommon.h"
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
+#include "acdebug.h"
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dscontrol")
@@ -86,7 +85,6 @@ AcpiDsExecBeginControlOp (
switch (Op->Common.AmlOpcode)
{
case AML_WHILE_OP:
-
/*
* If this is an additional iteration of a while loop, continue.
* There is no need to allocate a new control state.
@@ -107,7 +105,6 @@ AcpiDsExecBeginControlOp (
/*lint -fallthrough */
case AML_IF_OP:
-
/*
* IF/WHILE: Create a new control state to manage these
* constructs. We need to manage these as a stack, in order
@@ -123,9 +120,12 @@ AcpiDsExecBeginControlOp (
* Save a pointer to the predicate for multiple executions
* of a loop
*/
- ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
- ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
- ControlState->Control.Opcode = Op->Common.AmlOpcode;
+ ControlState->Control.AmlPredicateStart =
+ WalkState->ParserState.Aml - 1;
+ ControlState->Control.PackageEnd =
+ WalkState->ParserState.PkgEnd;
+ ControlState->Control.Opcode =
+ Op->Common.AmlOpcode;
/* Push the control state on this walk's control stack */
@@ -150,6 +150,7 @@ AcpiDsExecBeginControlOp (
break;
default:
+
break;
}
@@ -204,12 +205,10 @@ AcpiDsExecEndControlOp (
AcpiUtDeleteGenericState (ControlState);
break;
-
case AML_ELSE_OP:
break;
-
case AML_WHILE_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
@@ -226,7 +225,7 @@ AcpiDsExecEndControlOp (
* loop does not implement a timeout.
*/
ControlState->Control.LoopCount++;
- if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
+ if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations)
{
Status = AE_AML_INFINITE_LOOP;
break;
@@ -237,7 +236,8 @@ AcpiDsExecEndControlOp (
* another time
*/
Status = AE_CTRL_PENDING;
- WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
+ WalkState->AmlLastWhile =
+ ControlState->Control.AmlPredicateStart;
break;
}
@@ -252,7 +252,6 @@ AcpiDsExecEndControlOp (
AcpiUtDeleteGenericState (ControlState);
break;
-
case AML_RETURN_OP:
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
@@ -282,7 +281,8 @@ AcpiDsExecEndControlOp (
* an arg or local), resolve it now because it may
* cease to exist at the end of the method.
*/
- Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
+ Status = AcpiExResolveToValue (
+ &WalkState->Operands [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -290,7 +290,7 @@ AcpiDsExecEndControlOp (
/*
* Get the return value and save as the last result
- * value. This is the only place where WalkState->ReturnDesc
+ * value. This is the only place where WalkState->ReturnDesc
* is set to anything other than zero!
*/
WalkState->ReturnDesc = WalkState->Operands[0];
@@ -311,11 +311,15 @@ AcpiDsExecEndControlOp (
* Allow references created by the Index operator to return
* unchanged.
*/
- if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
- ((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
- ((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
+ if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) ==
+ ACPI_DESC_TYPE_OPERAND) &&
+ ((WalkState->Results->Results.ObjDesc [0])->Common.Type ==
+ ACPI_TYPE_LOCAL_REFERENCE) &&
+ ((WalkState->Results->Results.ObjDesc [0])->Reference.Class !=
+ ACPI_REFCLASS_INDEX))
{
- Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
+ Status = AcpiExResolveToValue (
+ &WalkState->Results->Results.ObjDesc [0], WalkState);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -333,9 +337,9 @@ AcpiDsExecEndControlOp (
AcpiUtRemoveReference (WalkState->Operands [0]);
}
- WalkState->Operands [0] = NULL;
- WalkState->NumOperands = 0;
- WalkState->ReturnDesc = NULL;
+ WalkState->Operands[0] = NULL;
+ WalkState->NumOperands = 0;
+ WalkState->ReturnDesc = NULL;
}
@@ -348,36 +352,27 @@ AcpiDsExecEndControlOp (
Status = AE_CTRL_TERMINATE;
break;
-
case AML_NOOP_OP:
/* Just do nothing! */
- break;
+ break;
case AML_BREAK_POINT_OP:
- /*
- * Set the single-step flag. This will cause the debugger (if present)
- * to break to the console within the AML debugger at the start of the
- * next AML instruction.
- */
- ACPI_DEBUGGER_EXEC (
- AcpiGbl_CmSingleStep = TRUE);
- ACPI_DEBUGGER_EXEC (
- AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
+#ifdef ACPI_DEBUGGER
+ AcpiDbSignalBreakPoint (WalkState);
/* Call to the OSL in case OS wants a piece of the action */
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
- "Executed AML Breakpoint opcode");
+ "Executed AML Breakpoint opcode");
+#endif
break;
-
case AML_BREAK_OP:
case AML_CONTINUE_OP: /* ACPI 2.0 */
-
/* Pop and delete control states until we find a while */
while (WalkState->ControlState &&
@@ -396,7 +391,8 @@ AcpiDsExecEndControlOp (
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
- WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
+ WalkState->AmlLastWhile =
+ WalkState->ControlState->Control.PackageEnd;
/* Return status depending on opcode */
@@ -410,7 +406,6 @@ AcpiDsExecEndControlOp (
}
break;
-
default:
ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p",