@@ -58,6 +58,26 @@ const uint32_t C_ARCH_BAD = ARCH_BAD;
5858#define SCMP_ARCH_MIPSEL64N32 ARCH_BAD
5959#endif
6060
61+ #ifndef SCMP_ARCH_PPC
62+ #define SCMP_ARCH_PPC ARCH_BAD
63+ #endif
64+
65+ #ifndef SCMP_ARCH_PPC64
66+ #define SCMP_ARCH_PPC64 ARCH_BAD
67+ #endif
68+
69+ #ifndef SCMP_ARCH_PPC64LE
70+ #define SCMP_ARCH_PPC64LE ARCH_BAD
71+ #endif
72+
73+ #ifndef SCMP_ARCH_S390
74+ #define SCMP_ARCH_S390 ARCH_BAD
75+ #endif
76+
77+ #ifndef SCMP_ARCH_S390X
78+ #define SCMP_ARCH_S390X ARCH_BAD
79+ #endif
80+
6181const uint32_t C_ARCH_NATIVE = SCMP_ARCH_NATIVE;
6282const uint32_t C_ARCH_X86 = SCMP_ARCH_X86;
6383const uint32_t C_ARCH_X86_64 = SCMP_ARCH_X86_64;
@@ -70,6 +90,11 @@ const uint32_t C_ARCH_MIPS64N32 = SCMP_ARCH_MIPS64N32;
7090const uint32_t C_ARCH_MIPSEL = SCMP_ARCH_MIPSEL;
7191const uint32_t C_ARCH_MIPSEL64 = SCMP_ARCH_MIPSEL64;
7292const uint32_t C_ARCH_MIPSEL64N32 = SCMP_ARCH_MIPSEL64N32;
93+ const uint32_t C_ARCH_PPC = SCMP_ARCH_PPC;
94+ const uint32_t C_ARCH_PPC64 = SCMP_ARCH_PPC64;
95+ const uint32_t C_ARCH_PPC64LE = SCMP_ARCH_PPC64LE;
96+ const uint32_t C_ARCH_S390 = SCMP_ARCH_S390;
97+ const uint32_t C_ARCH_S390X = SCMP_ARCH_S390X;
7398
7499const uint32_t C_ACT_KILL = SCMP_ACT_KILL;
75100const uint32_t C_ACT_TRAP = SCMP_ACT_TRAP;
@@ -140,7 +165,7 @@ const (
140165 scmpError C.int = - 1
141166 // Comparison boundaries to check for architecture validity
142167 archStart ScmpArch = ArchNative
143- archEnd ScmpArch = ArchMIPSEL64N32
168+ archEnd ScmpArch = ArchS390X
144169 // Comparison boundaries to check for action validity
145170 actionStart ScmpAction = ActKill
146171 actionEnd ScmpAction = ActAllow
@@ -349,6 +374,16 @@ func archFromNative(a C.uint32_t) (ScmpArch, error) {
349374 return ArchMIPSEL64 , nil
350375 case C .C_ARCH_MIPSEL64N32 :
351376 return ArchMIPSEL64N32 , nil
377+ case C .C_ARCH_PPC :
378+ return ArchPPC , nil
379+ case C .C_ARCH_PPC64 :
380+ return ArchPPC64 , nil
381+ case C .C_ARCH_PPC64LE :
382+ return ArchPPC64LE , nil
383+ case C .C_ARCH_S390 :
384+ return ArchS390 , nil
385+ case C .C_ARCH_S390X :
386+ return ArchS390X , nil
352387 default :
353388 return 0x0 , fmt .Errorf ("unrecognized architecture" )
354389 }
@@ -379,6 +414,16 @@ func (a ScmpArch) toNative() C.uint32_t {
379414 return C .C_ARCH_MIPSEL64
380415 case ArchMIPSEL64N32 :
381416 return C .C_ARCH_MIPSEL64N32
417+ case ArchPPC :
418+ return C .C_ARCH_PPC
419+ case ArchPPC64 :
420+ return C .C_ARCH_PPC64
421+ case ArchPPC64LE :
422+ return C .C_ARCH_PPC64LE
423+ case ArchS390 :
424+ return C .C_ARCH_S390
425+ case ArchS390X :
426+ return C .C_ARCH_S390X
382427 case ArchNative :
383428 return C .C_ARCH_NATIVE
384429 default :
0 commit comments