aboutsummaryrefslogtreecommitdiff
path: root/emulators/qemu-devel
diff options
context:
space:
mode:
authorJuergen Lock <nox@FreeBSD.org>2014-07-06 16:11:28 +0000
committerJuergen Lock <nox@FreeBSD.org>2014-07-06 16:11:28 +0000
commitb3f3b52f4a1e9e7cbbadfb266b4afa03cd098a67 (patch)
treeee296fe820e846d03f8e4e36e32c8202e9e0217a /emulators/qemu-devel
parentc962d2a962585b04c3a8c2cba8d24d25d14215b9 (diff)
downloadports-b3f3b52f4a1e9e7cbbadfb266b4afa03cd098a67.tar.gz
ports-b3f3b52f4a1e9e7cbbadfb266b4afa03cd098a67.zip
Notes
Diffstat (limited to 'emulators/qemu-devel')
-rw-r--r--emulators/qemu-devel/Makefile6
-rw-r--r--emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h15
-rw-r--r--emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h50
-rw-r--r--emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h20
-rw-r--r--emulators/qemu-devel/files/extra-patch-bsd-user-trapsig22
5 files changed, 112 insertions, 1 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile
index 03e7be50b80f..d2c3577cc734 100644
--- a/emulators/qemu-devel/Makefile
+++ b/emulators/qemu-devel/Makefile
@@ -3,7 +3,7 @@
PORTNAME= qemu
PORTVERSION= 2.0.0
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= emulators
MASTER_SITES= http://wiki.qemu.org/download/:release \
LOCAL/nox:snapshot
@@ -72,6 +72,10 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-target_siginfo
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-arm-signal
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-getvfsbyname
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-kernproc
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-target_os_stack.h
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-arm-target_arch_thread.h
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-sparc64-target_arch_cpu.h
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-trapsig
.endif
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib
diff --git a/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h b/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h
new file mode 100644
index 000000000000..5876e74de3fd
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-bsd-user-arm-target_arch_thread.h
@@ -0,0 +1,15 @@
+diff --git a/bsd-user/arm/target_arch_thread.h b/bsd-user/arm/target_arch_thread.h
+index e69f612..ee4d67d 100644
+--- a/bsd-user/arm/target_arch_thread.h
++++ b/bsd-user/arm/target_arch_thread.h
+@@ -29,8 +29,8 @@ static inline void target_thread_set_upcall(CPUARMState *regs, abi_ulong entry,
+ * Make sure the stack is properly aligned.
+ * arm/include/param.h (STACKLIGN() macro)
+ */
+- sp = ((u_int)(stack_base + stack_size) & ~(8-1)) -
+- sizeof(struct target_trapframe);
++ sp = (u_int)((stack_base + stack_size) -
++ sizeof(struct target_trapframe)) & ~0x7;
+
+ /* sp = stack base */
+ regs->regs[13] = sp;
diff --git a/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h b/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h
new file mode 100644
index 000000000000..c4f901257e72
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-bsd-user-freebsd-target_os_stack.h
@@ -0,0 +1,50 @@
+diff --git a/bsd-user/freebsd/target_os_stack.h b/bsd-user/freebsd/target_os_stack.h
+index c84b69e..73aea8f 100644
+--- a/bsd-user/freebsd/target_os_stack.h
++++ b/bsd-user/freebsd/target_os_stack.h
+@@ -1,3 +1,22 @@
++/*
++ * FreeBSD setup_initial_stack() implementation.
++ *
++ * Copyright (c) 2013-14 Stacey D. Son
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, see <http://www.gnu.org/licenses/>.
++ */
++
+ #ifndef _TARGET_OS_STACK_H_
+ #define _TARGET_OS_STACK_H_
+
+@@ -64,9 +83,7 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm,
+ return -1;
+ }
+ /* Add page sizes array. */
+- /* p -= sizeof(int); */
+ p -= sizeof(abi_ulong);
+- /* if (put_user_u32(TARGET_PAGE_SIZE, p)) { */
+ if (put_user_ual(TARGET_PAGE_SIZE, p)) {
+ errno = EFAULT;
+ return -1;
+@@ -85,9 +102,9 @@ static inline int setup_initial_stack(struct bsd_binprm *bprm,
+ }
+
+ /* Make room for the argv and envp strings */
+- /* p = destp = roundup(p - TARGET_SPACE_USRSPACE - (TARGET_ARG_MAX - stringspace), sizeof(abi_ulong)); */
+- argvp = p - TARGET_SPACE_USRSPACE;
+- p = destp = roundup(p - TARGET_SPACE_USRSPACE - TARGET_ARG_MAX, sizeof(abi_ulong));
++ argvp = roundup(p - TARGET_SPACE_USRSPACE - (TARGET_ARG_MAX - stringspace),
++ sizeof(abi_ulong));
++ p = destp = p - TARGET_SPACE_USRSPACE - TARGET_ARG_MAX;
+
+ /*
+ * Add argv strings. Note that the argv[] vectors are added by
diff --git a/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h b/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h
new file mode 100644
index 000000000000..4407bb6cce77
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-bsd-user-sparc64-target_arch_cpu.h
@@ -0,0 +1,20 @@
+From nox Mon Sep 17 00:00:00 2001
+From: Juergen Lock <nox@jelal.kn-bremen.de>
+Date: 06 Jul 2014 13:23:00 +0200
+Subject: sparc64-bsd-user: sync ccr before changing carry flag
+
+Sync ccr so that changing carry flag manually after syscall works
+properly.
+
+Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
+
+--- a/bsd-user/sparc64/target_arch_cpu.h
++++ b/bsd-user/sparc64/target_arch_cpu.h
+@@ -77,6 +77,7 @@ static inline void target_cpu_loop(CPUSP
+ env->regwptr[2], env->regwptr[3],
+ env->regwptr[4], env->regwptr[5]);
+ }
++ cpu_put_ccr(env, cpu_get_ccr(env));
+ if ((unsigned int)ret >= (unsigned int)(-515)) {
+ ret = -ret;
+ #if !defined(TARGET_ABI32)
diff --git a/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig b/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig
new file mode 100644
index 000000000000..d19de61578e3
--- /dev/null
+++ b/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig
@@ -0,0 +1,22 @@
+From nox Mon Sep 17 00:00:00 2001
+From: Juergen Lock <nox@jelal.kn-bremen.de>
+Date: 06 Jul 2014 16:37:00 +0200
+Subject: bsd-user: writing to readonly page can cause trap 0xc on FreeBSD too
+
+Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
+
+--- a/user-exec.c
++++ b/user-exec.c
+@@ -230,7 +230,12 @@ int cpu_signal_handler(int host_signum,
+
+ pc = PC_sig(uc);
+ return handle_cpu_signal(pc, (unsigned long)info->si_addr,
++#if defined(__FreeBSD__) || defined(__DragonFly__)
++ (TRAP_sig(uc) == 0xe ||
++ TRAP_sig(uc) == 0xc) ?
++#else
+ TRAP_sig(uc) == 0xe ?
++#endif
+ (ERROR_sig(uc) >> 1) & 1 : 0,
+ &MASK_sig(uc), puc);
+ }