Restore local changes accidentally lost in the last import.
Reviewed by: njl
This commit is contained in:
parent
fd2f6a9b16
commit
e0f7366574
@ -260,12 +260,14 @@
|
||||
#define DEBUGGER_SINGLE_THREADED 0
|
||||
#define DEBUGGER_MULTI_THREADED 1
|
||||
|
||||
#ifndef DEBUGGER_THREADING
|
||||
#ifdef ACPI_APPLICATION
|
||||
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
||||
|
||||
#else
|
||||
#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -136,6 +136,14 @@
|
||||
#define ACPI_DEBUG_OUTPUT /* for backward compatibility */
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include "opt_acpi.h"
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_DEBUG
|
||||
#define ACPI_DEBUG_OUTPUT /* for backward compatibility */
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
#include <sys/ctype.h>
|
||||
#include <sys/param.h>
|
||||
@ -143,15 +151,11 @@
|
||||
#include <sys/libkern.h>
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
#define asm __asm
|
||||
#define __cli() disable_intr()
|
||||
#define __sti() enable_intr()
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
#ifdef DEBUGGER_THREADING
|
||||
#undef DEBUGGER_THREADING
|
||||
#endif /* DEBUGGER_THREADING */
|
||||
#define DEBUGGER_THREADING 0 /* integrated with DDB */
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
#include "opt_ddb.h"
|
||||
#ifdef DDB
|
||||
#define ACPI_DEBUGGER
|
||||
|
@ -449,7 +449,9 @@ AcpiDbDisassembleAml (
|
||||
NumStatements = ACPI_STRTOUL (Statements, NULL, 0);
|
||||
}
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
AcpiDmDisassemble (NULL, Op, NumStatements);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -384,7 +384,9 @@ AcpiDbSingleStep (
|
||||
|
||||
/* Now we can display it */
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
AcpiDmDisassemble (WalkState, DisplayOp, ACPI_UINT32_MAX);
|
||||
#endif
|
||||
|
||||
if ((Op->Common.AmlOpcode == AML_IF_OP) ||
|
||||
(Op->Common.AmlOpcode == AML_WHILE_OP))
|
||||
@ -491,9 +493,11 @@ AcpiDbInitialize (void)
|
||||
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
|
||||
|
||||
AcpiGbl_DbOpt_tables = FALSE;
|
||||
AcpiGbl_DbOpt_disasm = FALSE;
|
||||
AcpiGbl_DbOpt_stats = FALSE;
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
AcpiGbl_DbOpt_disasm = FALSE;
|
||||
AcpiGbl_DbOpt_verbose = TRUE;
|
||||
#endif
|
||||
AcpiGbl_DbOpt_ini_methods = TRUE;
|
||||
|
||||
AcpiGbl_DbBuffer = AcpiOsAllocate (ACPI_DEBUG_BUFFER_SIZE);
|
||||
@ -542,11 +546,13 @@ AcpiDbInitialize (void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
if (!AcpiGbl_DbOpt_verbose)
|
||||
{
|
||||
AcpiGbl_DbOpt_disasm = TRUE;
|
||||
AcpiGbl_DbOpt_stats = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -288,6 +288,7 @@ AcpiEnterSleepState (
|
||||
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
|
||||
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
|
||||
UINT32 InValue;
|
||||
UINT32 Retry;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
@ -410,6 +411,7 @@ AcpiEnterSleepState (
|
||||
|
||||
/* Wait until we enter sleep state */
|
||||
|
||||
Retry = 1000;
|
||||
do
|
||||
{
|
||||
Status = AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &InValue, ACPI_MTX_DO_NOT_LOCK);
|
||||
@ -418,6 +420,15 @@ AcpiEnterSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some BIOSes don't set WAK_STS at all,
|
||||
* give up waiting for wakeup if we time out.
|
||||
*/
|
||||
if (Retry-- == 0)
|
||||
{
|
||||
break; /* giving up */
|
||||
}
|
||||
|
||||
/* Spin until we wake */
|
||||
|
||||
} while (!InValue);
|
||||
|
@ -1212,6 +1212,9 @@ AcpiPsParseAml (
|
||||
ACPI_THREAD_STATE *Thread;
|
||||
ACPI_THREAD_STATE *PrevWalkList = AcpiGbl_CurrentWalkList;
|
||||
ACPI_WALK_STATE *PreviousWalkState;
|
||||
ACPI_OPERAND_OBJECT **CallerReturnDesc = WalkState->CallerReturnDesc;
|
||||
ACPI_OPERAND_OBJECT *EffectiveReturnDesc = NULL;
|
||||
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("PsParseAml");
|
||||
@ -1287,6 +1290,14 @@ AcpiPsParseAml (
|
||||
/* We are done with this walk, move on to the parent if any */
|
||||
|
||||
WalkState = AcpiDsPopWalkState (Thread);
|
||||
/* Save the last effective return value */
|
||||
|
||||
if (CallerReturnDesc && WalkState->ReturnDesc)
|
||||
{
|
||||
AcpiUtRemoveReference (EffectiveReturnDesc);
|
||||
EffectiveReturnDesc = WalkState->ReturnDesc;
|
||||
AcpiUtAddReference (EffectiveReturnDesc);
|
||||
}
|
||||
|
||||
/* Reset the current scope to the beginning of scope stack */
|
||||
|
||||
@ -1350,6 +1361,17 @@ AcpiPsParseAml (
|
||||
*/
|
||||
else if (PreviousWalkState->CallerReturnDesc)
|
||||
{
|
||||
/*
|
||||
* Some AML code expects return value w/o ReturnOp.
|
||||
* Return the saved effective return value instead.
|
||||
*/
|
||||
|
||||
if (PreviousWalkState->ReturnDesc == NULL && EffectiveReturnDesc != NULL)
|
||||
{
|
||||
PreviousWalkState->ReturnDesc = EffectiveReturnDesc;
|
||||
AcpiUtAddReference (PreviousWalkState->ReturnDesc);
|
||||
}
|
||||
|
||||
*(PreviousWalkState->CallerReturnDesc) = PreviousWalkState->ReturnDesc; /* NULL if no return value */
|
||||
}
|
||||
else if (PreviousWalkState->ReturnDesc)
|
||||
@ -1364,6 +1386,7 @@ AcpiPsParseAml (
|
||||
|
||||
/* Normal exit */
|
||||
|
||||
AcpiUtRemoveReference (EffectiveReturnDesc);
|
||||
AcpiExReleaseAllMutexes (Thread);
|
||||
AcpiUtDeleteGenericState (ACPI_CAST_PTR (ACPI_GENERIC_STATE, Thread));
|
||||
AcpiGbl_CurrentWalkList = PrevWalkList;
|
||||
|
Loading…
Reference in New Issue
Block a user