summaryrefslogtreecommitdiffstats
path: root/recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch')
-rw-r--r--recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch128
1 files changed, 128 insertions, 0 deletions
diff --git a/recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch b/recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch
new file mode 100644
index 0000000..15bc0a8
--- /dev/null
+++ b/recipes-security/libseccomp/files/0002-arch-add-the-basic-initial-support-for-ppc64-to-the-.patch
@@ -0,0 +1,128 @@
1From 70c69945bf0da09baec2e109ba19b883de4d0e80 Mon Sep 17 00:00:00 2001
2From: Paul Moore <pmoore@redhat.com>
3Date: Fri, 26 Sep 2014 12:06:18 -0400
4Subject: [PATCH 02/11] arch: add the basic initial support for ppc64 to the
5 arch-dependent code
6
7Signed-off-by: Paul Moore <pmoore@redhat.com>
8---
9 src/arch.c | 21 +++++++++++++++++++++
10 src/python/libseccomp.pxd | 2 ++
11 src/python/seccomp.pyx | 7 +++++++
12 3 files changed, 30 insertions(+)
13
14diff --git a/src/arch.c b/src/arch.c
15index e29b579..64fc1d1 100644
16--- a/src/arch.c
17+++ b/src/arch.c
18@@ -38,6 +38,7 @@
19 #include "arch-mips.h"
20 #include "arch-mips64.h"
21 #include "arch-mips64n32.h"
22+#include "arch-ppc64.h"
23 #include "system.h"
24
25 #define default_arg_count_max 6
26@@ -74,6 +75,12 @@ const struct arch_def *arch_def_native = &arch_def_mips64n32;
27 #elif __MIPSEL__
28 const struct arch_def *arch_def_native = &arch_def_mipsel64n32;
29 #endif /* _MIPS_SIM_NABI32 */
30+#elif __PPC64__
31+#ifdef __BIG_ENDIAN__
32+const struct arch_def *arch_def_native = &arch_def_ppc64;
33+#else
34+const struct arch_def *arch_def_native = &arch_def_ppc64le;
35+#endif
36 #else
37 #error the arch code needs to know about your machine type
38 #endif /* machine type guess */
39@@ -122,6 +129,10 @@ const struct arch_def *arch_def_lookup(uint32_t token)
40 return &arch_def_mips64n32;
41 case SCMP_ARCH_MIPSEL64N32:
42 return &arch_def_mipsel64n32;
43+ case SCMP_ARCH_PPC64:
44+ return &arch_def_ppc64;
45+ case SCMP_ARCH_PPC64LE:
46+ return &arch_def_ppc64le;
47 }
48
49 return NULL;
50@@ -158,6 +169,10 @@ const struct arch_def *arch_def_lookup_name(const char *arch_name)
51 return &arch_def_mips64n32;
52 else if (strcmp(arch_name, "mipsel64n32") == 0)
53 return &arch_def_mipsel64n32;
54+ else if (strcmp(arch_name, "ppc64") == 0)
55+ return &arch_def_ppc64;
56+ else if (strcmp(arch_name, "ppc64le") == 0)
57+ return &arch_def_ppc64le;
58
59 return NULL;
60 }
61@@ -276,6 +291,9 @@ int arch_syscall_resolve_name(const struct arch_def *arch, const char *name)
62 case SCMP_ARCH_MIPS64N32:
63 case SCMP_ARCH_MIPSEL64N32:
64 return mips64n32_syscall_resolve_name(name);
65+ case SCMP_ARCH_PPC64:
66+ case SCMP_ARCH_PPC64LE:
67+ return ppc64_syscall_resolve_name(name);
68 }
69
70 return __NR_SCMP_ERROR;
71@@ -313,6 +331,9 @@ const char *arch_syscall_resolve_num(const struct arch_def *arch, int num)
72 case SCMP_ARCH_MIPS64N32:
73 case SCMP_ARCH_MIPSEL64N32:
74 return mips64n32_syscall_resolve_num(num);
75+ case SCMP_ARCH_PPC64:
76+ case SCMP_ARCH_PPC64LE:
77+ return ppc64_syscall_resolve_num(num);
78 }
79
80 return NULL;
81diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd
82index 2b50f3f..a546550 100644
83--- a/src/python/libseccomp.pxd
84+++ b/src/python/libseccomp.pxd
85@@ -38,6 +38,8 @@ cdef extern from "seccomp.h":
86 SCMP_ARCH_MIPSEL
87 SCMP_ARCH_MIPSEL64
88 SCMP_ARCH_MIPSEL64N32
89+ SCMP_ARCH_PPC64
90+ SCMP_ARCH_PPC64LE
91
92 cdef enum scmp_filter_attr:
93 SCMP_FLTATR_ACT_DEFAULT
94diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
95index d2f7c90..f30a0b6 100644
96--- a/src/python/seccomp.pyx
97+++ b/src/python/seccomp.pyx
98@@ -147,6 +147,7 @@ cdef class Arch:
99 MIPSEL - MIPS little endian O32 ABI
100 MIPSEL64 - MIPS little endian 64-bit ABI
101 MIPSEL64N32 - MIPS little endian N32 ABI
102+ PPC64 - 64-bit PowerPC
103 """
104
105 cdef int _token
106@@ -163,6 +164,8 @@ cdef class Arch:
107 MIPSEL = libseccomp.SCMP_ARCH_MIPSEL
108 MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64
109 MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32
110+ PPC64 = libseccomp.SCMP_ARCH_PPC64
111+ PPC64 = libseccomp.SCMP_ARCH_PPC64LE
112
113 def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE):
114 """ Initialize the architecture object.
115@@ -198,6 +201,10 @@ cdef class Arch:
116 self._token = libseccomp.SCMP_ARCH_MIPSEL64
117 elif arch == libseccomp.SCMP_ARCH_MIPSEL64N32:
118 self._token = libseccomp.SCMP_ARCH_MIPSEL64N32
119+ elif arch == libseccomp.SCMP_ARCH_PPC64:
120+ self._token = libseccomp.SCMP_ARCH_PPC64
121+ elif arch == libseccomp.SCMP_ARCH_PPC64LE:
122+ self._token = libseccomp.SCMP_ARCH_PPC64LE
123 else:
124 self._token = 0;
125 elif isinstance(arch, basestring):
126--
1272.3.5
128