summaryrefslogtreecommitdiff
path: root/user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-03 04:54:31 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-07-03 04:54:31 -0500
commit76033d6ea82669a441290a19804b54e3892388a7 (patch)
tree4296076d60bcd864383468669d18e83e9ec453c6 /user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
parentc7b5a77ca52ce331d117cb8d5892277a487b95ce (diff)
downloadpackages-76033d6ea82669a441290a19804b54e3892388a7.tar.gz
packages-76033d6ea82669a441290a19804b54e3892388a7.tar.bz2
packages-76033d6ea82669a441290a19804b54e3892388a7.tar.xz
packages-76033d6ea82669a441290a19804b54e3892388a7.zip
user/qemu: new package
Diffstat (limited to 'user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch')
-rw-r--r--user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch b/user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
new file mode 100644
index 000000000..c3a918775
--- /dev/null
+++ b/user/qemu/0001-linux-user-fix-build-with-musl-on-ppc64le.patch
@@ -0,0 +1,67 @@
+--- a/linux-user/host/ppc64/hostdep.h
++++ b/linux-user/host/ppc64/hostdep.h
+@@ -25,7 +25,11 @@
+ static inline void rewind_if_in_safe_syscall(void *puc)
+ {
+ ucontext_t *uc = puc;
++#if defined(__GLIBC__) || defined(__UCLIBC__)
+ unsigned long *pcreg = &uc->uc_mcontext.gp_regs[PT_NIP];
++#else // Musl
++ unsigned long *pcreg = &uc->uc_mcontext.gp_regs[32];
++#endif
+
+ if (*pcreg > (uintptr_t)safe_syscall_start
+ && *pcreg < (uintptr_t)safe_syscall_end) {
+--- a/accel/tcg/user-exec.c
++++ a/accel/tcg/user-exec.c
+@@ -228,6 +228,7 @@
+ */
+ #ifdef linux
+ /* All Registers access - only for local access */
++#if defined(__GLIBC__) || defined(__UCLIBC__)
+ #define REG_sig(reg_name, context) \
+ ((context)->uc_mcontext.regs->reg_name)
+ /* Gpr Registers access */
+@@ -245,15 +246,42 @@
+ /* Condition register */
+ #define CR_sig(context) REG_sig(ccr, context)
+
++#else // Musl
++#define REG_sig(reg_num, context) \
++ ((context)->uc_mcontext.gp_regs[reg_num])
++/* Gpr Registers access */
++#define GPR_sig(reg_num, context) REG_sig(gpr[reg_num], context)
++/* Program counter */
++#define IAR_sig(context) REG_sig(32, context)
++/* Machine State Register (Supervisor) */
++#define MSR_sig(context) REG_sig(33, context)
++/* Count register */
++#define CTR_sig(context) REG_sig(35, context)
++/* User's integer exception register */
++#define XER_sig(context) REG_sig(37, context)
++/* Link register */
++#define LR_sig(context) REG_sig(36, context)
++/* Condition register */
++#define CR_sig(context) REG_sig(38, context)
++#endif
++
++
+ /* Float Registers access */
+ #define FLOAT_sig(reg_num, context) \
+ (((double *)((char *)((context)->uc_mcontext.regs + 48 * 4)))[reg_num])
+ #define FPSCR_sig(context) \
+ (*(int *)((char *)((context)->uc_mcontext.regs + (48 + 32 * 2) * 4)))
+ /* Exception Registers access */
++#if defined(__GLIBC__) || defined(__UCLIBC__)
+ #define DAR_sig(context) REG_sig(dar, context)
+ #define DSISR_sig(context) REG_sig(dsisr, context)
+ #define TRAP_sig(context) REG_sig(trap, context)
++#else // Musl
++#define DAR_sig(context) REG_sig(41, context)
++#define DSISR_sig(context) REG_sig(42, context)
++#define TRAP_sig(context) REG_sig(40, context)
++#endif
++
+ #endif /* linux */
+
+ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)