summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Li <lichao@loongson.cn>2024-12-10 20:25:17 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-12-12 04:57:03 +0000
commit3c8e10c8b3468fa81138ec332fc563e9796d8680 (patch)
treede71b0b41e9fa15e49572a1f5876bea487d8dda8
parent03783393e16d776ca29d3f13b9cab1e1c3a5d11b (diff)
downloadedk2-3c8e10c8b3468fa81138ec332fc563e9796d8680.tar.gz
MdePkg: Synchronize UEFI2.11 LoongArch64 DebugSupportLib definition
Synchronize the changes about LoongArch64 in section 18.2.5 of UEFI2.11. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn>
-rw-r--r--MdePkg/Include/Protocol/DebugSupport.h63
1 files changed, 37 insertions, 26 deletions
diff --git a/MdePkg/Include/Protocol/DebugSupport.h b/MdePkg/Include/Protocol/DebugSupport.h
index 06f99ba7f7..fced5c759f 100644
--- a/MdePkg/Include/Protocol/DebugSupport.h
+++ b/MdePkg/Include/Protocol/DebugSupport.h
@@ -680,23 +680,23 @@ typedef struct {
UINT32 STVAL;
} EFI_SYSTEM_CONTEXT_RISCV64;
-//
-// LoongArch processor exception types.
-//
-// The exception types is located in the CSR ESTAT
-// register offset 16 bits, width 6 bits.
-//
-// If you want to register an exception hook, you can
-// shfit the number left by 16 bits, and the exception
-// handler will know the types.
-//
-// For example:
-// mCpu->CpuRegisterInterruptHandler (
-// mCpu,
-// (EXCEPT_LOONGARCH_PPI << CSR_ESTAT_EXC_SHIFT),
-// PpiExceptionHandler
-// );
-//
+///
+/// LoongArch processor exception types.
+///
+/// The exception types is located in the CSR ESTAT
+/// register offset 16 bits, width 6 bits.
+///
+/// If you want to register an exception hook, you can
+/// shfit the number left by 16 bits, and the exception
+/// handler will know the types.
+///
+/// For example:
+/// mCpu->CpuRegisterInterruptHandler (
+/// mCpu,
+/// (EXCEPT_LOONGARCH_PPI << CSR_ESTAT_EXC_SHIFT),
+/// PpiExceptionHandler
+/// );
+///
#define EXCEPT_LOONGARCH_INT 0
#define EXCEPT_LOONGARCH_PIL 1
#define EXCEPT_LOONGARCH_PIS 2
@@ -716,11 +716,22 @@ typedef struct {
#define EXCEPT_LOONGARCH_SXD 16
#define EXCEPT_LOONGARCH_ASXD 17
#define EXCEPT_LOONGARCH_FPE 18
-#define EXCEPT_LOONGARCH_TBR 64 // For code only, there is no such type in the ISA spec, the TLB refill is defined for an independent exception.
+#define EXCEPT_LOONGARCH_WPE 19
+#define EXCEPT_LOONGARCH_BTD 20
+#define EXCEPT_LOONGARCH_BTE 21
+#define EXCEPT_LOONGARCH_GSPR 22
+#define EXCEPT_LOONGARCH_HVC 23
+#define EXCEPT_LOONGARCH_GCXC 24
-//
-// LoongArch processor Interrupt types.
-//
+///
+/// For coding convenience, define the maximum valid
+/// LoongArch exception.
+///
+#define MAX_LOONGARCH_EXCEPTION 64
+
+///
+/// LoongArch processor Interrupt types.
+///
#define EXCEPT_LOONGARCH_INT_SIP0 0
#define EXCEPT_LOONGARCH_INT_SIP1 1
#define EXCEPT_LOONGARCH_INT_IP0 2
@@ -735,11 +746,11 @@ typedef struct {
#define EXCEPT_LOONGARCH_INT_TIMER 11
#define EXCEPT_LOONGARCH_INT_IPI 12
-//
-// For coding convenience, define the maximum valid
-// LoongArch interrupt.
-//
-#define MAX_LOONGARCH_INTERRUPT 14
+///
+/// For coding convenience, define the maximum valid
+/// LoongArch interrupt.
+///
+#define MAX_LOONGARCH_INTERRUPT 16
typedef struct {
UINT64 R0;