audk/MdePkg/Include
Andrei Warkentin 69da506c92 UefiCpuPkg: BaseRiscV64CpuExceptionHandlerLib: clean up
RegisterCpuInterruptHandler did not allow setting
exception handlers for anything beyond the timer IRQ.
Beyond that, it didn't meet the spec around handling
of inputs.

RiscVSupervisorModeTrapHandler now will invoke
set handlers for both exceptions and interrupts.
Two arrays of handlers are maintained - one for exceptions
and one for interrupts.

For unhandled traps, RiscVSupervisorModeTrapHandler dumps
state using the now implemented DumpCpuContext.

For EFI_SYSTEM_CONTEXT_RISCV64, extend this with the trapped
PC address (SEPC), just like on AArch64 (ELR). This is
necessary for X86EmulatorPkg to work as it allows a trap
handler to return execution to a different place. Add
SSTATUS/STVAL as well, at least for debugging purposes. There
is no value in hiding this.

Fix nested exception handling. Handler code should not
be saving SIE (the value is saved in SSTATUS.SPIE) or
directly restored (that's done by SRET). Save and
restore the entire SSTATUS and STVAL, too.

Cc: Daniel Schaefer <git@danielschaefer.me>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Signed-off-by: Andrei Warkentin <andrei.warkentin@intel.com>
2023-03-08 18:10:34 +00:00
..
AArch64 MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Arm MdePkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
Ebc MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Guid MdePkg: Add After Ready To Boot Event Definition from UEFI 2.9 2023-02-15 12:34:20 +00:00
Ia32 MdePkg: Remove the macro definitions regarding Opcode. 2022-03-01 01:45:47 +00:00
IndustryStandard MdePkg: Add NVMe boot partition header definition 2023-02-10 03:14:12 +00:00
Library MdePkg: Add BaseRiscVSbiLib Library for RISC-V 2023-02-16 05:53:28 +00:00
LoongArch64 MdePkg: Fix UINT64 and INT64 word length for LoongArch64 2023-02-01 02:12:41 +00:00
Pi MdeModulePkg: Correct memory type in PrePiDxeCis.h 2023-01-30 13:52:27 +00:00
Ppi MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Protocol UefiCpuPkg: BaseRiscV64CpuExceptionHandlerLib: clean up 2023-03-08 18:10:34 +00:00
Register MdePkg/Register: Add register definition header files for RISC-V 2023-02-16 05:53:28 +00:00
RiscV64 MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Uefi MdePkg: Label CreateEvent NotifyFunction and NotifyContext optional 2023-02-03 07:41:01 +00:00
X64 MdePkg: Remove the macro definitions regarding Opcode. 2022-03-01 01:45:47 +00:00
Base.h MdePkg/Include: Update Base.h to improve C++ compatibility 2022-11-11 05:46:51 +00:00
ConfidentialComputingGuestAttr.h MdePkg: Add CC_GUEST_TYPE in ConfidentialComputingGuestAttr.h 2022-04-19 01:26:08 +00:00
PiDxe.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiMm.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiPei.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiSmm.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Uefi.h MdePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00