mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
UefiCpuPkg/CpuDxe: Read hardware interrupt state in GetInterruptState
Fix CpuGetInterruptState() to read the actual hardware interrupt flag (RFLAGS.IF) via BaseLib's GetInterruptState() instead of returning a cached boolean variable. The cached variable becomes stale in interrupt context where hardware disables interrupts without going through the protocol's DisableInterrupt() call. This is a PI Spec conformance fix: EFI_CPU_ARCH_PROTOCOL.GetInterruptState() is specified to return the current processor interrupt state. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
3f97b8bc7f
commit
d91dff7cbe
1 changed files with 2 additions and 5 deletions
|
|
@ -13,8 +13,7 @@
|
|||
//
|
||||
// Global Variables
|
||||
//
|
||||
BOOLEAN InterruptState = FALSE;
|
||||
EFI_HANDLE mCpuHandle = NULL;
|
||||
EFI_HANDLE mCpuHandle = NULL;
|
||||
BOOLEAN mIsFlushingGCD;
|
||||
BOOLEAN mIsAllocatingPageTable = FALSE;
|
||||
UINT64 mTimerPeriod = 0;
|
||||
|
|
@ -88,7 +87,6 @@ CpuEnableInterrupt (
|
|||
{
|
||||
EnableInterrupts ();
|
||||
|
||||
InterruptState = TRUE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +107,6 @@ CpuDisableInterrupt (
|
|||
{
|
||||
DisableInterrupts ();
|
||||
|
||||
InterruptState = FALSE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -134,7 +131,7 @@ CpuGetInterruptState (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*State = InterruptState;
|
||||
*State = GetInterruptState ();
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue