aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-security/libseccomp/files/0003-tools-add-ppc64-support.patch
blob: fa56192c6a7c3e138e1ed621629561a9e0c27af5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From 21e74cf80be3d55fdfa5600bc99f284b19f75b01 Mon Sep 17 00:00:00 2001
From: Paul Moore <pmoore@redhat.com>
Date: Fri, 26 Sep 2014 12:50:40 -0400
Subject: [PATCH 03/11] tools: add ppc64 support

Signed-off-by: Paul Moore <pmoore@redhat.com>
---
 tools/scmp_arch_detect.c | 6 ++++++
 tools/scmp_bpf_disasm.c  | 4 ++++
 tools/scmp_bpf_sim.c     | 4 ++++
 tools/util.c             | 6 ++++++
 4 files changed, 20 insertions(+)

diff --git a/tools/scmp_arch_detect.c b/tools/scmp_arch_detect.c
index 5a87252..d23d2ec 100644
--- a/tools/scmp_arch_detect.c
+++ b/tools/scmp_arch_detect.c
@@ -99,6 +99,12 @@ int main(int argc, char *argv[])
 		case SCMP_ARCH_MIPSEL64N32:
 			printf("mipsel64n32\n");
 			break;
+		case SCMP_ARCH_PPC64:
+			printf("ppc64\n");
+			break;
+		case SCMP_ARCH_PPC64LE:
+			printf("ppc64le\n");
+			break;
 		default:
 			printf("unknown\n");
 		}
diff --git a/tools/scmp_bpf_disasm.c b/tools/scmp_bpf_disasm.c
index 349b8a8..9199e17 100644
--- a/tools/scmp_bpf_disasm.c
+++ b/tools/scmp_bpf_disasm.c
@@ -334,6 +334,10 @@ int main(int argc, char *argv[])
 				arch = AUDIT_ARCH_MIPS64N32;
 			else if (strcmp(optarg, "mipsel64n32") == 0)
 				arch = AUDIT_ARCH_MIPSEL64N32;
+			else if (strcmp(optarg, "ppc64") == 0)
+				arch = AUDIT_ARCH_PPC64;
+			else if (strcmp(optarg, "ppc64le") == 0)
+				arch = AUDIT_ARCH_PPC64LE;
 			else
 				exit_usage(argv[0]);
 			break;
diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c
index bb3a2e7..d3e439f 100644
--- a/tools/scmp_bpf_sim.c
+++ b/tools/scmp_bpf_sim.c
@@ -249,6 +249,10 @@ int main(int argc, char *argv[])
 				arch = AUDIT_ARCH_MIPS64N32;
 			else if (strcmp(optarg, "mipsel64n32") == 0)
 				arch = AUDIT_ARCH_MIPSEL64N32;
+			else if (strcmp(optarg, "ppc64") == 0)
+				arch = AUDIT_ARCH_PPC64;
+			else if (strcmp(optarg, "ppc64le") == 0)
+				arch = AUDIT_ARCH_PPC64LE;
 			else
 				exit_fault(EINVAL);
 			break;
diff --git a/tools/util.c b/tools/util.c
index 9b58bbb..f998009 100644
--- a/tools/util.c
+++ b/tools/util.c
@@ -62,6 +62,12 @@
 #elif __MIPSEL__
 #define ARCH_NATIVE		AUDIT_ARCH_MIPSEL64N32
 #endif /* _MIPS_SIM_NABI32 */
+#elif __PPC64__
+#ifdef __BIG_ENDIAN__
+#define ARCH_NATIVE		AUDIT_ARCH_PPC64
+#else
+#define ARCH_NATIVE		AUDIT_ARCH_PPC64LE
+#endif
 #else
 #error the simulator code needs to know about your machine type
 #endif
-- 
2.3.5