]>
Commit | Line | Data |
---|---|---|
29e3f737 TW |
1 | /* |
2 | * Copyright (C) 2023 Thomas Weißschuh <thomas@t-8ch.de> | |
3 | * | |
4 | * This file may be distributed under the terms of the | |
5 | * GNU Lesser General Public License. | |
6 | */ | |
7 | #ifndef UTIL_LINUX_AUDIT_ARCH_H | |
8 | #define UTIL_LINUX_AUDIT_ARCH_H | |
9 | ||
10 | #if __x86_64__ | |
11 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_X86_64 | |
12 | #elif __i386__ | |
13 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_I386 | |
14 | #elif __arm__ | |
15 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM | |
16 | #elif __aarch64__ | |
17 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_AARCH64 | |
18 | #elif __riscv | |
19 | # if __riscv_xlen == 32 | |
20 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_RISCV32 | |
21 | # elif __riscv_xlen == 64 | |
22 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_RISCV64 | |
23 | # endif | |
24 | #elif __s390x__ | |
25 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_S390X | |
26 | #elif __s390__ | |
27 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_S390 | |
28 | #elif __PPC64__ | |
29 | # if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
30 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC64 | |
31 | # else | |
32 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC64LE | |
33 | # endif | |
34 | #elif __powerpc__ | |
35 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_PPC | |
36 | #elif __mips__ | |
37 | # if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
38 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPS | |
39 | # else | |
40 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_MIPSEL | |
41 | # endif | |
42 | #elif __arc__ | |
43 | # if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ | |
44 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2BE | |
45 | # else | |
46 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARCV2 | |
47 | # endif | |
48 | #elif __sparc__ | |
49 | # if __SIZEOF_POINTER__ == 4 | |
50 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_SPARC | |
51 | # else | |
52 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_SPARC64 | |
53 | # endif | |
c345a400 TW |
54 | #elif __loongarch__ |
55 | # if __SIZEOF_POINTER__ == 4 | |
56 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_LOONGARCH32 | |
57 | # else | |
58 | # define SECCOMP_ARCH_NATIVE AUDIT_ARCH_LOONGARCH64 | |
59 | # endif | |
29e3f737 TW |
60 | #else |
61 | # error Unknown target architecture | |
62 | #endif | |
63 | ||
64 | #endif /* UTIL_LINUX_AUDIT_ARCH_H */ |