@@ -58,6 +58,13 @@ const uintptr_t C_FILTER_FLAG_NEW_LISTENER = SECCOMP_FILTER_FLAG_NEW_LISTENER;
58
58
#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
59
59
#endif
60
60
61
+ #ifndef AUDIT_ARCH_LOONGARCH64
62
+ #ifndef EM_LOONGARCH
63
+ #define EM_LOONGARCH 258
64
+ #endif
65
+ #define AUDIT_ARCH_LOONGARCH64 (EM_LOONGARCH|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
66
+ #endif
67
+
61
68
// We use the AUDIT_ARCH_* values because those are the ones used by the kernel
62
69
// and SCMP_ARCH_* sometimes has fake values (such as SCMP_ARCH_X32). But we
63
70
// use <seccomp.h> so we get libseccomp's fallback definitions of AUDIT_ARCH_*.
@@ -78,6 +85,7 @@ const uint32_t C_AUDIT_ARCH_PPC64LE = AUDIT_ARCH_PPC64LE;
78
85
const uint32_t C_AUDIT_ARCH_S390 = AUDIT_ARCH_S390;
79
86
const uint32_t C_AUDIT_ARCH_S390X = AUDIT_ARCH_S390X;
80
87
const uint32_t C_AUDIT_ARCH_RISCV64 = AUDIT_ARCH_RISCV64;
88
+ const uint32_t C_AUDIT_ARCH_LOONGARCH64 = AUDIT_ARCH_LOONGARCH64;
81
89
*/
82
90
import "C"
83
91
@@ -217,6 +225,8 @@ func scmpArchToAuditArch(arch libseccomp.ScmpArch) (linuxAuditArch, error) {
217
225
return linuxAuditArch (C .C_AUDIT_ARCH_S390X ), nil
218
226
case libseccomp .ArchRISCV64 :
219
227
return linuxAuditArch (C .C_AUDIT_ARCH_RISCV64 ), nil
228
+ case libseccomp .ArchLOONGARCH64 :
229
+ return linuxAuditArch (C .C_AUDIT_ARCH_LOONGARCH64 ), nil
220
230
default :
221
231
return invalidArch , fmt .Errorf ("unknown architecture: %v" , arch )
222
232
}
0 commit comments