summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c')
-rw-r--r--UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
index 801c8393e8..fd30ce15ce 100644
--- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
+++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/LoongArch/ExceptionCommon.c
@@ -43,8 +43,24 @@ CONST CHAR8 *mExceptionNameStr[] = {
"#GCXC - Guest CSR Software/Hardware Change exception",
"#TBR - TLB refill exception" // !!! NOTICE: Because the TLB refill exception is not instructed in ECODE, so the TLB refill exception must be the last one!
};
+CONST CHAR8 *mInterruptNameStr[] = {
+ "#SIP0 - Software interrupt 0",
+ "#SIP1 - Software interrupt 1",
+ "#IP0 - Hardware interrupt 0",
+ "#IP1 - Hardware interrupt 1",
+ "#IP2 - Hardware interrupt 2",
+ "#IP3 - Hardware interrupt 3",
+ "#IP4 - Hardware interrupt 4",
+ "#IP5 - Hardware interrupt 5",
+ "#IP6 - Hardware interrupt 6",
+ "#IP7 - Hardware interrupt 7",
+ "#PMC - Performance counter overflow interrupt",
+ "#TIMER - Timer interrupt",
+ "#IPI - Inter-Processor interrupt"
+};
INTN mExceptionKnownNameNum = (sizeof (mExceptionNameStr) / sizeof (CHAR8 *));
+INTN mInterruptKnownNameNum = (sizeof (mInterruptNameStr) / sizeof (CHAR8 *));
/**
Get ASCII format string exception name by exception type.
@@ -67,6 +83,26 @@ GetExceptionNameStr (
}
/**
+ Get ASCII format string interrupt name by exception type.
+
+ @param InterruptType Interrupt type.
+
+ @return ASCII format string interrupt name.
+
+**/
+CONST CHAR8 *
+GetInterruptNameStr (
+ IN EFI_EXCEPTION_TYPE InterruptType
+ )
+{
+ if ((UINTN)InterruptType < mInterruptKnownNameNum) {
+ return mInterruptNameStr[InterruptType];
+ } else {
+ return mExceptionReservedStr;
+ }
+}
+
+/**
Prints a message to the serial port.
@param Format Format string for the message to print.