Skip to content

Commit

Permalink
MdePkg: Synchronize UEFI2.11 LoongArch64 DebugSupportLib definition
Browse files Browse the repository at this point in the history
Synchronize the changes about LoongArch64 in section 18.2.5 of UEFI2.11.

Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Zhiguang Liu <[email protected]>
Signed-off-by: Chao Li <[email protected]>
  • Loading branch information
kilaterlee committed Dec 11, 2024
1 parent cf2892d commit d981974
Showing 1 changed file with 37 additions and 26 deletions.
63 changes: 37 additions & 26 deletions MdePkg/Include/Protocol/DebugSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit d981974

Please sign in to comment.