LoongArch: Define regular names for BCE/WATCH/HVC/GSPR exceptions
authorWANG Xuerui <git@xen0n.name>
Mon, 1 May 2023 09:19:10 +0000 (17:19 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Mon, 1 May 2023 09:19:10 +0000 (17:19 +0800)
Define them according to the ISA manual, in order to enable matching the
sub-exceptions for humanization purposes later.

Signed-off-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/loongarch.h

index 7d8b83dd32e9e38e9321ff08ba32f39de9823c66..b3323ab5b78d37d5acdea5ca9b3d3479eb2fdcc8 100644 (file)
@@ -1397,7 +1397,7 @@ __BUILD_CSR_OP(tlbidx)
        #define EXSUBCODE_ADEF          0       /* Fetch Instruction */
        #define EXSUBCODE_ADEM          1       /* Access Memory*/
 #define EXCCODE_ALE            9       /* Unalign Access */
-#define EXCCODE_OOB            10      /* Out of bounds */
+#define EXCCODE_BCE            10      /* Bounds Check Error */
 #define EXCCODE_SYS            11      /* System call */
 #define EXCCODE_BP             12      /* Breakpoint */
 #define EXCCODE_INE            13      /* Inst. Not Exist */
@@ -1408,11 +1408,13 @@ __BUILD_CSR_OP(tlbidx)
 #define EXCCODE_FPE            18      /* Floating Point Exception */
        #define EXCSUBCODE_FPE          0       /* Floating Point Exception */
        #define EXCSUBCODE_VFPE         1       /* Vector Exception */
-#define EXCCODE_WATCH          19      /* Watch address reference */
+#define EXCCODE_WATCH          19      /* WatchPoint Exception */
+       #define EXCSUBCODE_WPEF         0       /* ... on Instruction Fetch */
+       #define EXCSUBCODE_WPEM         1       /* ... on Memory Accesses */
 #define EXCCODE_BTDIS          20      /* Binary Trans. Disabled */
 #define EXCCODE_BTE            21      /* Binary Trans. Exception */
-#define EXCCODE_PSI            22      /* Guest Privileged Error */
-#define EXCCODE_HYP            23      /* Hypercall */
+#define EXCCODE_GSPR           22      /* Guest Privileged Error */
+#define EXCCODE_HVC            23      /* Hypercall */
 #define EXCCODE_GCM            24      /* Guest CSR modified */
        #define EXCSUBCODE_GCSC         0       /* Software caused */
        #define EXCSUBCODE_GCHC         1       /* Hardware caused */