void-packages/srcpkgs/tor/patches/ppc.patch

36 lines
760 B
Diff

--- a/src/lib/sandbox/sandbox.c
+++ b/src/lib/sandbox/sandbox.c
@@ -115,6 +115,16 @@
#define REG_SYSCALL 8
#define M_SYSCALL regs[REG_SYSCALL]
+#elif defined(__powerpc64__)
+
+#define REG_SYSCALL 0
+#define M_SYSCALL gp_regs[REG_SYSCALL]
+
+#elif defined(__powerpc__)
+
+#define REG_SYSCALL 0
+#define M_SYSCALL gregs[REG_SYSCALL]
+
#endif /* defined(__i386__) || ... */
#ifdef M_SYSCALL
@@ -1654,7 +1664,15 @@
static int
get_syscall_from_ucontext(const ucontext_t *ctx)
{
+#if defined(__powerpc__) && !defined(__powerpc64__)
+#if defined(__GLIBC__)
+ return (int) ctx->uc_mcontext.uc_regs->M_SYSCALL;
+#else
+ return (int) ctx->uc_regs->M_SYSCALL;
+#endif
+#else
return (int) ctx->uc_mcontext.M_SYSCALL;
+#endif
}
#else
static const char *