mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
UefiCpuPkg/CpuDxeRiscV64: Read hardware state in GetInterruptState
Fix CpuGetInterruptState() to read the actual hardware interrupt flag (sstatus.SIE) 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
d91dff7cbe
commit
3120fb4b69
1 changed files with 2 additions and 5 deletions
|
|
@ -13,8 +13,7 @@
|
|||
//
|
||||
// Global Variables
|
||||
//
|
||||
STATIC BOOLEAN mInterruptState = FALSE;
|
||||
STATIC EFI_HANDLE mCpuHandle = NULL;
|
||||
STATIC EFI_HANDLE mCpuHandle = NULL;
|
||||
STATIC UINTN mBootHartId;
|
||||
RISCV_EFI_BOOT_PROTOCOL gRiscvBootProtocol;
|
||||
|
||||
|
|
@ -123,7 +122,6 @@ CpuEnableInterrupt (
|
|||
)
|
||||
{
|
||||
EnableInterrupts ();
|
||||
mInterruptState = TRUE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +141,6 @@ CpuDisableInterrupt (
|
|||
)
|
||||
{
|
||||
DisableInterrupts ();
|
||||
mInterruptState = FALSE;
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +165,7 @@ CpuGetInterruptState (
|
|||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
*State = mInterruptState;
|
||||
*State = GetInterruptState ();
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue