diff options
Diffstat (limited to 'recipes-security/libseccomp/files/0009-arch-add-basic-initial-ppc-support-to-the-arch-depen.patch')
-rw-r--r-- | recipes-security/libseccomp/files/0009-arch-add-basic-initial-ppc-support-to-the-arch-depen.patch | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/recipes-security/libseccomp/files/0009-arch-add-basic-initial-ppc-support-to-the-arch-depen.patch b/recipes-security/libseccomp/files/0009-arch-add-basic-initial-ppc-support-to-the-arch-depen.patch new file mode 100644 index 0000000..5e97ec5 --- /dev/null +++ b/recipes-security/libseccomp/files/0009-arch-add-basic-initial-ppc-support-to-the-arch-depen.patch | |||
@@ -0,0 +1,117 @@ | |||
1 | From c0fa35a2756a1fcedcf4d4a14688226d2a1cd86b Mon Sep 17 00:00:00 2001 | ||
2 | From: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
3 | Date: Wed, 11 Feb 2015 13:23:26 +0000 | ||
4 | Subject: [PATCH 09/11] arch: add basic initial ppc support to the | ||
5 | arch-dependent code | ||
6 | |||
7 | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> | ||
8 | Signed-off-by: Paul Moore <pmoore@redhat.com> | ||
9 | --- | ||
10 | src/arch.c | 11 +++++++++++ | ||
11 | src/python/libseccomp.pxd | 1 + | ||
12 | src/python/seccomp.pyx | 6 +++++- | ||
13 | 3 files changed, 17 insertions(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/src/arch.c b/src/arch.c | ||
16 | index 64fc1d1..f73db6b 100644 | ||
17 | --- a/src/arch.c | ||
18 | +++ b/src/arch.c | ||
19 | @@ -39,6 +39,7 @@ | ||
20 | #include "arch-mips64.h" | ||
21 | #include "arch-mips64n32.h" | ||
22 | #include "arch-ppc64.h" | ||
23 | +#include "arch-ppc.h" | ||
24 | #include "system.h" | ||
25 | |||
26 | #define default_arg_count_max 6 | ||
27 | @@ -81,6 +82,8 @@ const struct arch_def *arch_def_native = &arch_def_ppc64; | ||
28 | #else | ||
29 | const struct arch_def *arch_def_native = &arch_def_ppc64le; | ||
30 | #endif | ||
31 | +#elif __PPC__ | ||
32 | +const struct arch_def *arch_def_native = &arch_def_ppc; | ||
33 | #else | ||
34 | #error the arch code needs to know about your machine type | ||
35 | #endif /* machine type guess */ | ||
36 | @@ -133,6 +136,8 @@ const struct arch_def *arch_def_lookup(uint32_t token) | ||
37 | return &arch_def_ppc64; | ||
38 | case SCMP_ARCH_PPC64LE: | ||
39 | return &arch_def_ppc64le; | ||
40 | + case SCMP_ARCH_PPC: | ||
41 | + return &arch_def_ppc; | ||
42 | } | ||
43 | |||
44 | return NULL; | ||
45 | @@ -173,6 +178,8 @@ const struct arch_def *arch_def_lookup_name(const char *arch_name) | ||
46 | return &arch_def_ppc64; | ||
47 | else if (strcmp(arch_name, "ppc64le") == 0) | ||
48 | return &arch_def_ppc64le; | ||
49 | + else if (strcmp(arch_name, "ppc") == 0) | ||
50 | + return &arch_def_ppc; | ||
51 | |||
52 | return NULL; | ||
53 | } | ||
54 | @@ -294,6 +301,8 @@ int arch_syscall_resolve_name(const struct arch_def *arch, const char *name) | ||
55 | case SCMP_ARCH_PPC64: | ||
56 | case SCMP_ARCH_PPC64LE: | ||
57 | return ppc64_syscall_resolve_name(name); | ||
58 | + case SCMP_ARCH_PPC: | ||
59 | + return ppc_syscall_resolve_name(name); | ||
60 | } | ||
61 | |||
62 | return __NR_SCMP_ERROR; | ||
63 | @@ -334,6 +343,8 @@ const char *arch_syscall_resolve_num(const struct arch_def *arch, int num) | ||
64 | case SCMP_ARCH_PPC64: | ||
65 | case SCMP_ARCH_PPC64LE: | ||
66 | return ppc64_syscall_resolve_num(num); | ||
67 | + case SCMP_ARCH_PPC: | ||
68 | + return ppc_syscall_resolve_num(num); | ||
69 | } | ||
70 | |||
71 | return NULL; | ||
72 | diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd | ||
73 | index a546550..e9c0f6a 100644 | ||
74 | --- a/src/python/libseccomp.pxd | ||
75 | +++ b/src/python/libseccomp.pxd | ||
76 | @@ -40,6 +40,7 @@ cdef extern from "seccomp.h": | ||
77 | SCMP_ARCH_MIPSEL64N32 | ||
78 | SCMP_ARCH_PPC64 | ||
79 | SCMP_ARCH_PPC64LE | ||
80 | + SCMP_ARCH_PPC | ||
81 | |||
82 | cdef enum scmp_filter_attr: | ||
83 | SCMP_FLTATR_ACT_DEFAULT | ||
84 | diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx | ||
85 | index f30a0b6..2da8c66 100644 | ||
86 | --- a/src/python/seccomp.pyx | ||
87 | +++ b/src/python/seccomp.pyx | ||
88 | @@ -148,6 +148,7 @@ cdef class Arch: | ||
89 | MIPSEL64 - MIPS little endian 64-bit ABI | ||
90 | MIPSEL64N32 - MIPS little endian N32 ABI | ||
91 | PPC64 - 64-bit PowerPC | ||
92 | + PPC - 32-bit PowerPC | ||
93 | """ | ||
94 | |||
95 | cdef int _token | ||
96 | @@ -165,7 +166,8 @@ cdef class Arch: | ||
97 | MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64 | ||
98 | MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32 | ||
99 | PPC64 = libseccomp.SCMP_ARCH_PPC64 | ||
100 | - PPC64 = libseccomp.SCMP_ARCH_PPC64LE | ||
101 | + PPC64LE = libseccomp.SCMP_ARCH_PPC64LE | ||
102 | + PPC = libseccomp.SCMP_ARCH_PPC | ||
103 | |||
104 | def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE): | ||
105 | """ Initialize the architecture object. | ||
106 | @@ -205,6 +207,8 @@ cdef class Arch: | ||
107 | self._token = libseccomp.SCMP_ARCH_PPC64 | ||
108 | elif arch == libseccomp.SCMP_ARCH_PPC64LE: | ||
109 | self._token = libseccomp.SCMP_ARCH_PPC64LE | ||
110 | + elif arch == libseccomp.SCMP_ARCH_PPC: | ||
111 | + self._token = libseccomp.SCMP_ARCH_PPC | ||
112 | else: | ||
113 | self._token = 0; | ||
114 | elif isinstance(arch, basestring): | ||
115 | -- | ||
116 | 2.3.5 | ||
117 | |||