#include <asm/insn-def.h>
 
 #ifndef __ASSEMBLY__
-/*
- * ARM Architecture Reference Manual for ARMv8 Profile-A, Issue A.a
- * Section C3.1 "A64 instruction index by encoding":
- * AArch64 main encoding table
- *  Bit position
- *   28 27 26 25       Encoding Group
- *   0  0  -  -                Unallocated
- *   1  0  0  -                Data processing, immediate
- *   1  0  1  -                Branch, exception generation and system instructions
- *   -  1  -  0                Loads and stores
- *   -  1  0  1                Data processing - register
- *   0  1  1  1                Data processing - SIMD and floating point
- *   1  1  1  1                Data processing - SIMD and floating point
- * "-" means "don't care"
- */
-enum aarch64_insn_encoding_class {
-       AARCH64_INSN_CLS_UNKNOWN,       /* UNALLOCATED */
-       AARCH64_INSN_CLS_SVE,           /* SVE instructions */
-       AARCH64_INSN_CLS_DP_IMM,        /* Data processing - immediate */
-       AARCH64_INSN_CLS_DP_REG,        /* Data processing - register */
-       AARCH64_INSN_CLS_DP_FPSIMD,     /* Data processing - SIMD and FP */
-       AARCH64_INSN_CLS_LDST,          /* Loads and stores */
-       AARCH64_INSN_CLS_BR_SYS,        /* Branch, exception generation and
-                                        * system instructions */
-};
 
 enum aarch64_insn_hint_cr_op {
        AARCH64_INSN_HINT_NOP   = 0x0 << 5,
        return (val);                                                   \
 }
 
+/*
+ * ARM Architecture Reference Manual for ARMv8 Profile-A, Issue A.a
+ * Section C3.1 "A64 instruction index by encoding":
+ * AArch64 main encoding table
+ *  Bit position
+ *   28 27 26 25       Encoding Group
+ *   0  0  -  -                Unallocated
+ *   1  0  0  -                Data processing, immediate
+ *   1  0  1  -                Branch, exception generation and system instructions
+ *   -  1  -  0                Loads and stores
+ *   -  1  0  1                Data processing - register
+ *   0  1  1  1                Data processing - SIMD and floating point
+ *   1  1  1  1                Data processing - SIMD and floating point
+ * "-" means "don't care"
+ */
+__AARCH64_INSN_FUNCS(class_branch_sys, 0x1c000000, 0x14000000)
+
 __AARCH64_INSN_FUNCS(adr,      0x9F000000, 0x10000000)
 __AARCH64_INSN_FUNCS(adrp,     0x9F000000, 0x90000000)
 __AARCH64_INSN_FUNCS(prfm,     0x3FC00000, 0x39800000)
 
 #define AARCH64_INSN_N_BIT     BIT(22)
 #define AARCH64_INSN_LSL_12    BIT(22)
 
-static const int aarch64_insn_encoding_class[] = {
-       AARCH64_INSN_CLS_UNKNOWN,
-       AARCH64_INSN_CLS_UNKNOWN,
-       AARCH64_INSN_CLS_SVE,
-       AARCH64_INSN_CLS_UNKNOWN,
-       AARCH64_INSN_CLS_LDST,
-       AARCH64_INSN_CLS_DP_REG,
-       AARCH64_INSN_CLS_LDST,
-       AARCH64_INSN_CLS_DP_FPSIMD,
-       AARCH64_INSN_CLS_DP_IMM,
-       AARCH64_INSN_CLS_DP_IMM,
-       AARCH64_INSN_CLS_BR_SYS,
-       AARCH64_INSN_CLS_BR_SYS,
-       AARCH64_INSN_CLS_LDST,
-       AARCH64_INSN_CLS_DP_REG,
-       AARCH64_INSN_CLS_LDST,
-       AARCH64_INSN_CLS_DP_FPSIMD,
-};
-
-enum aarch64_insn_encoding_class __kprobes aarch64_get_insn_class(u32 insn)
-{
-       return aarch64_insn_encoding_class[(insn >> 25) & 0xf];
-}
-
 static int __kprobes aarch64_get_imm_shift_mask(enum aarch64_insn_imm_type type,
                                                u32 *maskp, int *shiftp)
 {