Lines 16-21
Link Here
|
16 |
#if defined(__mips__) |
16 |
#if defined(__mips__) |
17 |
// sys/user.h in eglibc misses size_t definition |
17 |
// sys/user.h in eglibc misses size_t definition |
18 |
#include <stddef.h> |
18 |
#include <stddef.h> |
|
|
19 |
#elif defined(__powerpc64__) |
20 |
// Manually define greg_t on ppc64 |
21 |
typedef unsigned long long greg_t; |
19 |
#endif |
22 |
#endif |
20 |
#endif |
23 |
#endif |
21 |
|
24 |
|
Lines 286-291
struct regs_struct {
Link Here
|
286 |
#define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] |
289 |
#define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] |
287 |
#define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] |
290 |
#define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] |
288 |
#define SECCOMP_PT_PARM6(_regs) (_regs).regs[5] |
291 |
#define SECCOMP_PT_PARM6(_regs) (_regs).regs[5] |
|
|
292 |
|
293 |
#elif defined(__powerpc64__) |
294 |
#include <asm/ptrace.h> |
295 |
|
296 |
typedef struct pt_regs regs_struct; |
297 |
|
298 |
#ifdef ARCH_CPU_LITTLE_ENDIAN |
299 |
#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE |
300 |
#else |
301 |
#define SECCOMP_ARCH AUDIT_ARCH_PPC64 |
302 |
#endif |
303 |
|
304 |
#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg]) |
305 |
|
306 |
#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3) |
307 |
#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0) |
308 |
#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip |
309 |
#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3) |
310 |
#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4) |
311 |
#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5) |
312 |
#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6) |
313 |
#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7) |
314 |
#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8) |
315 |
|
316 |
#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr)) |
317 |
#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch)) |
318 |
#define SECCOMP_IP_MSB_IDX \ |
319 |
(offsetof(struct arch_seccomp_data, instruction_pointer) + 4) |
320 |
#define SECCOMP_IP_LSB_IDX \ |
321 |
(offsetof(struct arch_seccomp_data, instruction_pointer) + 0) |
322 |
#define SECCOMP_ARG_MSB_IDX(nr) \ |
323 |
(offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4) |
324 |
#define SECCOMP_ARG_LSB_IDX(nr) \ |
325 |
(offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0) |
326 |
|
327 |
#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3] |
328 |
#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0] |
329 |
#define SECCOMP_PT_IP(_regs) (_regs).nip |
330 |
#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3] |
331 |
#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4] |
332 |
#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5] |
333 |
#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6] |
334 |
#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7] |
335 |
#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8] |
336 |
|
289 |
#else |
337 |
#else |
290 |
#error Unsupported target platform |
338 |
#error Unsupported target platform |
291 |
|
339 |
|