@@ -68,6 +68,22 @@ const uint32_t C_ARCH_BAD = ARCH_BAD;
6868#define SCMP_ARCH_RISCV64 ARCH_BAD
6969#endif
7070
71+ #ifndef SCMP_ARCH_LOONGARCH64
72+ #define SCMP_ARCH_LOONGARCH64 ARCH_BAD
73+ #endif
74+
75+ #ifndef SCMP_ARCH_M68K
76+ #define SCMP_ARCH_M68K ARCH_BAD
77+ #endif
78+
79+ #ifndef SCMP_ARCH_SH
80+ #define SCMP_ARCH_SH ARCH_BAD
81+ #endif
82+
83+ #ifndef SCMP_ARCH_SHEB
84+ #define SCMP_ARCH_SHEB ARCH_BAD
85+ #endif
86+
7187const uint32_t C_ARCH_NATIVE = SCMP_ARCH_NATIVE;
7288const uint32_t C_ARCH_X86 = SCMP_ARCH_X86;
7389const uint32_t C_ARCH_X86_64 = SCMP_ARCH_X86_64;
@@ -88,6 +104,10 @@ const uint32_t C_ARCH_S390X = SCMP_ARCH_S390X;
88104const uint32_t C_ARCH_PARISC = SCMP_ARCH_PARISC;
89105const uint32_t C_ARCH_PARISC64 = SCMP_ARCH_PARISC64;
90106const uint32_t C_ARCH_RISCV64 = SCMP_ARCH_RISCV64;
107+ const uint32_t C_ARCH_LOONGARCH64 = SCMP_ARCH_LOONGARCH64;
108+ const uint32_t C_ARCH_M68K = SCMP_ARCH_M68K;
109+ const uint32_t C_ARCH_SH = SCMP_ARCH_SH;
110+ const uint32_t C_ARCH_SHEB = SCMP_ARCH_SHEB;
91111
92112#ifndef SCMP_ACT_LOG
93113#define SCMP_ACT_LOG 0x7ffc0000U
@@ -270,7 +290,7 @@ const (
270290 scmpError C.int = - 1
271291 // Comparison boundaries to check for architecture validity
272292 archStart ScmpArch = ArchNative
273- archEnd ScmpArch = ArchRISCV64
293+ archEnd ScmpArch = ArchSHEB
274294 // Comparison boundaries to check for action validity
275295 actionStart ScmpAction = ActKillThread
276296 actionEnd ScmpAction = ActKillProcess
@@ -531,6 +551,14 @@ func archFromNative(a C.uint32_t) (ScmpArch, error) {
531551 return ArchPARISC64 , nil
532552 case C .C_ARCH_RISCV64 :
533553 return ArchRISCV64 , nil
554+ case C .C_ARCH_LOONGARCH64 :
555+ return ArchLOONGARCH64 , nil
556+ case C .C_ARCH_M68K :
557+ return ArchM68K , nil
558+ case C .C_ARCH_SH :
559+ return ArchSH , nil
560+ case C .C_ARCH_SHEB :
561+ return ArchSHEB , nil
534562 default :
535563 return 0x0 , fmt .Errorf ("unrecognized architecture %#x" , uint32 (a ))
536564 }
@@ -577,6 +605,14 @@ func (a ScmpArch) toNative() C.uint32_t {
577605 return C .C_ARCH_PARISC64
578606 case ArchRISCV64 :
579607 return C .C_ARCH_RISCV64
608+ case ArchLOONGARCH64 :
609+ return C .C_ARCH_LOONGARCH64
610+ case ArchM68K :
611+ return C .C_ARCH_M68K
612+ case ArchSH :
613+ return C .C_ARCH_SH
614+ case ArchSHEB :
615+ return C .C_ARCH_SHEB
580616 case ArchNative :
581617 return C .C_ARCH_NATIVE
582618 default :
0 commit comments