ports/emulators/qemu-devel/files/extra-patch-bsd-user-trapsig
Juergen Lock b3f3b52f4a Four more bsd-user fixes, poudriere now builds more armv6 packages
and sparc64 dynamic exectuables get a little further:

- Fix crashes with long argv invocations. [1]
- Fix ARMv6 stack alignment in a new thread. [1]
- sparc64: sync ccr before changing carry flag.
- Writing to readonly page can cause trap 0xc on FreeBSD too.
- Bump PORTREVISION.

Submitted by:	sson [1]
2014-07-06 16:11:28 +00:00

22 lines
771 B
Text

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);
}