[edk2] [staging/branch RISC-V PATCH 1/4] RiscVPkg/Sec: Use MRET in machine trap handler.

Abner Chang posted 4 patches 7 years, 5 months ago
[edk2] [staging/branch RISC-V PATCH 1/4] RiscVPkg/Sec: Use MRET in machine trap handler.
Posted by Abner Chang 7 years, 5 months ago
Use MRET(Machine Mode Trap-Return) instead of SRET(Supervisor Mode
Trap-Return) to return from machine mode trap handler.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Abner Chang <abner.chang@hpe.com>
---
 RiscVPkg/Universal/Sec/Riscv64/SecEntry.s | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/RiscVPkg/Universal/Sec/Riscv64/SecEntry.s b/RiscVPkg/Universal/Sec/Riscv64/SecEntry.s
index f13596d..cc4ca6d 100644
--- a/RiscVPkg/Universal/Sec/Riscv64/SecEntry.s
+++ b/RiscVPkg/Universal/Sec/Riscv64/SecEntry.s
@@ -2,7 +2,7 @@
 //
 // RISC-V Sec module.
 //
-// Copyright (c) 2016, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+// Copyright (c) 2016-2017, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
 //
 // This program and the accompanying materials
 // are licensed and made available under the terms and conditions of the BSD License
@@ -77,33 +77,33 @@ ASM_PFX(_ModuleEntryPoint):
 //
 ASM_PFX(TrapFromUserModeHandler):
     call    RiscVUserModeTrapHandler
-    eret
+    mret
 
 //
 //Supervisor mode trap handler.
 //
 ASM_PFX(TrapFromSupervisorModeHandler):
     call    RiscVSupervisorModeTrapHandler
-    eret
+    mret
 
 //
 // Hypervisor mode trap handler.
 //
 ASM_PFX(TrapFromHypervisorModeHandler):
     call    RiscVHypervisorModeTrapHandler
-    eret
+    mret
 
 //
 // Machine mode trap handler.
 //
 ASM_PFX(TrapFromMachineModeHandler):
     call    RiscVMachineModeTrapHandler
-    eret
+    mret
 
 //
 // NMI trap handler.
 //
 ASM_PFX(NmiHandler):
     call    RiscVNmiHandler
-    eret
+    mret
 
-- 
2.7.4

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel