summaryrefslogtreecommitdiff
path: root/emulators/qemu/patches
diff options
context:
space:
mode:
authorasau <asau@pkgsrc.org>2009-10-11 16:04:13 +0000
committerasau <asau@pkgsrc.org>2009-10-11 16:04:13 +0000
commit8ffbfed7d375cca2533258e57e2f91ba6298e87c (patch)
treebf451c5aea2e8891faa08e09f2d2d04b8532bb9b /emulators/qemu/patches
parent7e83c333512d071e008d7cb435a66a059b3aad01 (diff)
downloadpkgsrc-8ffbfed7d375cca2533258e57e2f91ba6298e87c.tar.gz
Update to qemu 0.11.0. With input from Hasso Tepper (Dragonfly).
Changes since previous package: version 0.11.0 - fix rtc polling mode (Bernhard Kauer) - qcow2: order concurrent aio requests (Kevin Wolf) - qemu-io: port to win32 (Stefan Weil) - alpha: fix extlh instruction (Vince Weaver) - tcg: fix size of local variables in tcg_gen_bswap64_i64 (Stefan Weil) - net: fix send ordering (Jan Kiszka) - escc: fix IRQ routing (Aurelien Jarno) - versatile: fix Linux task preemption (Aurelien Jarno) - curses: reduce memory usage by 250MB (Aurelien Jarno) version 0.11.0-rc2 - mips: fix conditional move off fp conditions codes (Nath Froyd) - fix migration to obey -S (Paolo Bonzini) - remove pc-0-10 machine type (Mark McLoughlin) - vnc: fix copyrect screen corruption (Gerd Hoffman) - fix vm state change handlers running order (Markus Armbruster) - e1000: fix eerc and ics emulation (Bill Paul) - fix sdl zooming with pl110 (Blue Swirl) - sparc64: flush pending conditional evaluations (Igor Kovalenko) - esp: fix interrupt register read (Blue Swirl) - option rom makefile fixes (Paul Brook) - fix sparse warnings (Blue Swirl) - fix symfind (Laurent Desnogues) - win32: fix default prefix (Stefan Weil) - fix checksum writing in signboot (Alex Graf) - fix sdl window resize (Stefano Stabellini) - do not resize the screen on hw_invalidate (Stefano Stabellini) - Add checks for -smbios option (Beth Kon) - fix do_set_link (Luiz Capitulino) - fix do_commit behavior (Luiz Capitulino) - make windows notice media change (Gleb Natapov) - check for PR_SET_NAME being defined (Nathan Froyd) - fix migration for ide devices (Anthony Liguori) - Use correct depth in vmware vga (Reimar Doffiner) - support 32bpp cursors in sdl (Reimar Doffinger) - fix device name completion for eject (Blue Swirl) - make screendump use DisplayState properly (Stefano Stabellini) - fix autostart with live migration (Avi Kivity) - fix detached migration with exec (Chris Lalancette) - fix segv when changing vnc password in sdl (Zach Amsden) - fix vnc password clearing with stdio monitor (Zach Amsden) - clean up VGA type selection (Zach Amsden) - add missing linefeed in error message (Stefan Weil) version 0.11.0-rc1 - add machine aliasing support (Mark McLoughlin) - add getfd/closefd monitor commands (Mark McLoughlin) - use correct headers for tap-win32 (Filip Navara) - fix live migration (Glauber Costa) - slirp: use monotonic clock if available (Ed Swierk) - clear msix_entries_nr on error (Michael Tsirkin) - HPET: fix reg writes (Beth Kon) - slirp: fix guestfwd for incoming data (Jan Kiszka) - fix build of qemu-thread.c on win32 (Sebastian Herbszt) - improve signrom.sh portability (Christoph Egger) - fix qemu-img convert to copy unallocated parts of the image (Akkarit Sangpetch) - vmdk: fix backing file handling (Kevin Wolf) - scsi: add save/restore support (Nolan Leake) - fix live migration for SCSI (Nolan Leake) - various sparc build fixes (Blue Swirl) - fix OpenBSD build (Blue Swirl) - only allow -cpu host when using KVM (Anthony Liguori) - fix build breakage when !KVM (Anthony Liguori)
Diffstat (limited to 'emulators/qemu/patches')
-rw-r--r--emulators/qemu/patches/patch-av27
-rw-r--r--emulators/qemu/patches/patch-da13
-rw-r--r--emulators/qemu/patches/patch-db32
-rw-r--r--emulators/qemu/patches/patch-dc15
-rw-r--r--emulators/qemu/patches/patch-dd26
-rw-r--r--emulators/qemu/patches/patch-de10
-rw-r--r--emulators/qemu/patches/patch-df13
-rw-r--r--emulators/qemu/patches/patch-dg14
-rw-r--r--emulators/qemu/patches/patch-dh58
-rw-r--r--emulators/qemu/patches/patch-di13
-rw-r--r--emulators/qemu/patches/patch-dj43
-rw-r--r--emulators/qemu/patches/patch-dk29
-rw-r--r--emulators/qemu/patches/patch-dl29
13 files changed, 41 insertions, 281 deletions
diff --git a/emulators/qemu/patches/patch-av b/emulators/qemu/patches/patch-av
deleted file mode 100644
index e084c729c30..00000000000
--- a/emulators/qemu/patches/patch-av
+++ /dev/null
@@ -1,27 +0,0 @@
-$NetBSD: patch-av,v 1.3 2007/10/07 21:21:00 heinz Exp $
-
- Provide trunc() implementation for NetBSD 3 and Dragonfly
-
---- fpu/softfloat-native.c.orig 2007-02-06 00:01:54.000000000 +0100
-+++ fpu/softfloat-native.c
-@@ -3,6 +3,20 @@
- #include "softfloat.h"
- #include <math.h>
-
-+#if defined(__DragonFly__) || defined(__NetBSD__)
-+# include <sys/param.h>
-+#endif
-+
-+#if (defined(__DragonFly__) && __DragonFly_version < 195000) || (defined(__NetBSD__) && __NetBSD_Version__ <= 399001700)
-+static double trunc( double val )
-+{
-+ if (val > 0)
-+ return floor(val);
-+ else
-+ return ceil(val);
-+}
-+#endif
-+
- void set_float_rounding_mode(int val STATUS_PARAM)
- {
- STATUS(float_rounding_mode) = val;
diff --git a/emulators/qemu/patches/patch-da b/emulators/qemu/patches/patch-da
deleted file mode 100644
index 331815944b3..00000000000
--- a/emulators/qemu/patches/patch-da
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-da,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- audio/sdlaudio.c.orig 2009-08-30 08:33:14 +0300
-+++ audio/sdlaudio.c 2009-08-30 08:41:26 +0300
-@@ -29,7 +29,7 @@
- #ifndef _WIN32
- #ifdef __sun__
- #define _POSIX_PTHREAD_SEMANTICS 1
--#elif defined(__OpenBSD__) || defined(__FreeBSD__)
-+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
- #include <pthread.h>
- #endif
- #include <signal.h>
diff --git a/emulators/qemu/patches/patch-db b/emulators/qemu/patches/patch-db
deleted file mode 100644
index 424dae2094a..00000000000
--- a/emulators/qemu/patches/patch-db
+++ /dev/null
@@ -1,32 +0,0 @@
-$NetBSD: patch-db,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- block-raw-posix.c.orig 2009-07-17 03:56:22 +0300
-+++ block-raw-posix.c 2009-08-30 15:51:48 +0300
-@@ -63,6 +63,11 @@
- #include <sys/dkio.h>
- #endif
-
-+#ifdef __DragonFly__
-+#include <sys/ioctl.h>
-+#include <sys/diskslice.h>
-+#endif
-+
- //#define DEBUG_FLOPPY
-
- //#define DEBUG_BLOCK
-@@ -766,6 +771,15 @@ static int64_t raw_getlength(BlockDrive
- if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
- #ifdef DIOCGMEDIASIZE
- if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
-+#elif defined(DIOCGPART)
-+ {
-+ struct partinfo pi;
-+ if (ioctl(fd, DIOCGPART, &pi) == 0)
-+ size = pi.media_size;
-+ else
-+ size = 0;
-+ }
-+ if (size == 0)
- #endif
- #ifdef CONFIG_COCOA
- size = LONG_LONG_MAX;
diff --git a/emulators/qemu/patches/patch-dc b/emulators/qemu/patches/patch-dc
deleted file mode 100644
index 14084102579..00000000000
--- a/emulators/qemu/patches/patch-dc
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD: patch-dc,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- block.c.orig 2009-07-17 03:56:22 +0300
-+++ block.c 2009-08-30 15:53:21 +0300
-@@ -35,8 +35,10 @@
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <sys/ioctl.h>
-+#ifndef __DragonFly__
- #include <sys/disk.h>
- #endif
-+#endif
-
- #define SECTOR_BITS 9
- #define SECTOR_SIZE (1 << SECTOR_BITS)
diff --git a/emulators/qemu/patches/patch-dd b/emulators/qemu/patches/patch-dd
index 4f972458b04..ea17b0c1889 100644
--- a/emulators/qemu/patches/patch-dd
+++ b/emulators/qemu/patches/patch-dd
@@ -1,29 +1,13 @@
-$NetBSD: patch-dd,v 1.2 2009/09/22 12:18:33 tnn Exp $
+$NetBSD: patch-dd,v 1.3 2009/10/11 16:04:13 asau Exp $
---- configure.orig 2009-07-17 02:56:22.000000000 +0200
-+++ configure
-@@ -228,6 +228,15 @@ if [ "$cpu" = "i386" -o "$cpu" = "x86_64
- kqemu="yes"
- fi
- ;;
-+DragonFly)
-+bsd="yes"
-+audio_drv_list="oss"
-+audio_possible_drivers="oss sdl esd pa"
-+if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then
-+ kqemu="yes"
-+fi
-+aio="no"
-+;;
- NetBSD)
- bsd="yes"
- audio_drv_list="oss"
-@@ -1102,7 +1111,7 @@ else
+--- configure.orig 2009-09-23 23:01:31.000000000 +0400
++++ configure 2009-09-30 14:02:37.000000000 +0400
+@@ -1384,7 +1384,7 @@
if test -z "$prefix" ; then
prefix="/usr/local"
fi
- mansuffix="/share/man"
-+ #mansuffix="/share/man"
++# mansuffix="/share/man"
datasuffix="/share/qemu"
docsuffix="/share/doc/qemu"
binsuffix="/bin"
diff --git a/emulators/qemu/patches/patch-de b/emulators/qemu/patches/patch-de
index 72766a6e605..c8324738f16 100644
--- a/emulators/qemu/patches/patch-de
+++ b/emulators/qemu/patches/patch-de
@@ -1,12 +1,12 @@
-$NetBSD: patch-de,v 1.2 2009/08/31 14:30:50 tnn Exp $
+$NetBSD: patch-de,v 1.3 2009/10/11 16:04:13 asau Exp $
---- exec.c.orig 2009-07-17 02:56:22.000000000 +0200
-+++ exec.c
-@@ -454,7 +454,7 @@ static void code_gen_alloc(unsigned long
+--- exec.c.orig 2009-09-23 23:01:32.000000000 +0400
++++ exec.c 2009-09-30 14:03:55.000000000 +0400
+@@ -464,7 +464,7 @@
exit(1);
}
}
--#elif defined(__FreeBSD__)
+-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
{
int flags;
diff --git a/emulators/qemu/patches/patch-df b/emulators/qemu/patches/patch-df
deleted file mode 100644
index 74c94e49cf5..00000000000
--- a/emulators/qemu/patches/patch-df
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-df,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- net.c.orig 2009-08-30 08:33:13 +0300
-+++ net.c 2009-08-30 15:58:08 +0300
-@@ -59,7 +59,7 @@
- #include <sys/select.h>
- #ifdef _BSD
- #include <sys/stat.h>
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- #include <libutil.h>
- #else
- #include <util.h>
diff --git a/emulators/qemu/patches/patch-dg b/emulators/qemu/patches/patch-dg
index 89522cce633..d94e14678fa 100644
--- a/emulators/qemu/patches/patch-dg
+++ b/emulators/qemu/patches/patch-dg
@@ -1,21 +1,21 @@
-$NetBSD: patch-dg,v 1.2 2009/08/31 14:34:07 tnn Exp $
+$NetBSD: patch-dg,v 1.3 2009/10/11 16:04:13 asau Exp $
---- osdep.c.orig 2009-07-17 02:56:24.000000000 +0200
-+++ osdep.c
-@@ -90,7 +90,7 @@ static void *kqemu_vmalloc(size_t size)
+--- osdep.c.orig 2009-09-23 23:01:32.000000000 +0400
++++ osdep.c 2009-09-30 14:05:39.000000000 +0400
+@@ -110,7 +110,7 @@
void *ptr;
/* no need (?) for a dummy file on OpenBSD/FreeBSD */
--#if defined(__OpenBSD__) || defined(__FreeBSD__)
+-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
int map_anon = MAP_ANON;
#else
int map_anon = 0;
-@@ -157,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
+@@ -181,7 +181,7 @@
}
size = (size + 4095) & ~4095;
ftruncate(phys_ram_fd, phys_ram_size + size);
--#endif /* !(__OpenBSD__ || __FreeBSD__) */
+-#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__) */
+#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__ || __NetBSD__) */
ptr = mmap(NULL,
size,
diff --git a/emulators/qemu/patches/patch-dh b/emulators/qemu/patches/patch-dh
deleted file mode 100644
index 6e8ead2be7c..00000000000
--- a/emulators/qemu/patches/patch-dh
+++ /dev/null
@@ -1,58 +0,0 @@
-$NetBSD: patch-dh,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- qemu-char.c.orig 2009-07-17 03:56:24 +0300
-+++ qemu-char.c 2009-08-30 16:00:34 +0300
-@@ -66,6 +66,10 @@
- #include <libutil.h>
- #include <dev/ppbus/ppi.h>
- #include <dev/ppbus/ppbconf.h>
-+#elif defined(__DragonFly__)
-+#include <libutil.h>
-+#include <dev/misc/ppi/ppi.h>
-+#include <bus/ppbus/ppbconf.h>
- #else
- #include <util.h>
- #endif
-@@ -798,7 +802,7 @@ void cfmakeraw (struct termios *termios_
- #endif
-
- #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
-- || defined(__NetBSD__) || defined(__OpenBSD__)
-+ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-
- typedef struct {
- int fd;
-@@ -928,7 +932,7 @@ static CharDriverState *qemu_chr_open_pt
- PtyCharDriver *s;
- struct termios tty;
- int slave_fd, len;
--#if defined(__OpenBSD__)
-+#if defined(__OpenBSD__) || defined(__DragonFly__)
- char pty_name[PATH_MAX];
- #define q_ptsname(x) pty_name
- #else
-@@ -1274,7 +1278,7 @@ static CharDriverState *qemu_chr_open_pp
- }
- #endif /* __linux__ */
-
--#if defined(__FreeBSD__)
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- static int pp_ioctl(CharDriverState *chr, int cmd, void *arg)
- {
- int fd = (int)chr->opaque;
-@@ -2162,13 +2166,13 @@ CharDriverState *qemu_chr_open(const cha
- if (strstart(filename, "/dev/parport", NULL)) {
- chr = qemu_chr_open_pp(filename);
- } else
--#elif defined(__FreeBSD__)
-+#elif defined(__FreeBSD__) || defined(__DragonFly__)
- if (strstart(filename, "/dev/ppi", NULL)) {
- chr = qemu_chr_open_pp(filename);
- } else
- #endif
- #if defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
-- || defined(__NetBSD__) || defined(__OpenBSD__)
-+ || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
- if (strstart(filename, "/dev/", NULL)) {
- chr = qemu_chr_open_tty(filename);
- } else
diff --git a/emulators/qemu/patches/patch-di b/emulators/qemu/patches/patch-di
deleted file mode 100644
index 3be9b78ce6a..00000000000
--- a/emulators/qemu/patches/patch-di
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-di,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- savevm.c.orig 2009-08-30 08:33:14 +0300
-+++ savevm.c 2009-08-30 16:01:20 +0300
-@@ -63,7 +63,7 @@
- #include <sys/select.h>
- #ifdef _BSD
- #include <sys/stat.h>
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- #include <libutil.h>
- #else
- #include <util.h>
diff --git a/emulators/qemu/patches/patch-dj b/emulators/qemu/patches/patch-dj
deleted file mode 100644
index 6b9705cb0ae..00000000000
--- a/emulators/qemu/patches/patch-dj
+++ /dev/null
@@ -1,43 +0,0 @@
-$NetBSD: patch-dj,v 1.1 2009/08/31 10:18:49 hasso Exp $
-
---- usb-bsd.c.orig 2009-07-17 03:56:26 +0300
-+++ usb-bsd.c 2009-08-30 16:01:57 +0300
-@@ -34,7 +34,11 @@
- #undef USB_SPEED_LOW
-
- #include <sys/ioctl.h>
-+#ifndef __DragonFly__
- #include <dev/usb/usb.h>
-+#else
-+#include <bus/usb/usb.h>
-+#endif
- #include <signal.h>
-
- /* This value has maximum potential at 16.
-@@ -68,7 +72,7 @@ static int ensure_ep_open(USBHostDevice
- ep = UE_GET_ADDR(ep);
-
- if (dev->ep_fd[ep] < 0) {
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->devpath, ep);
- #else
- snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->devpath, ep);
-@@ -321,7 +325,7 @@ USBDevice *usb_host_device_open(const ch
- return NULL;
- }
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- snprintf(ctlpath, PATH_MAX, "/dev/%s", bus_info.udi_devnames[0]);
- #else
- snprintf(ctlpath, PATH_MAX, "/dev/%s.00", bus_info.udi_devnames[0]);
-@@ -411,7 +415,7 @@ static int usb_host_scan(void *opaque, U
- if (strncmp(bus_info.udi_devnames[0], "ugen", 4) != 0)
- continue;
-
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s", bus_info.udi_devnames[0]);
- #else
- snprintf(devbuf, sizeof(devbuf) - 1, "/dev/%s.00", bus_info.udi_devnames[0]);
diff --git a/emulators/qemu/patches/patch-dk b/emulators/qemu/patches/patch-dk
index 8c26942b6e1..0467337fc47 100644
--- a/emulators/qemu/patches/patch-dk
+++ b/emulators/qemu/patches/patch-dk
@@ -1,32 +1,21 @@
-$NetBSD: patch-dk,v 1.3 2009/08/31 14:49:21 tnn Exp $
+$NetBSD: patch-dk,v 1.4 2009/10/11 16:04:13 asau Exp $
---- vl.c.orig 2009-07-17 02:56:26.000000000 +0200
-+++ vl.c
-@@ -74,7 +74,7 @@
- #include <sys/select.h>
- #ifdef _BSD
- #include <sys/stat.h>
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__DragonFly__)
- #include <libutil.h>
- #else
- #include <util.h>
-@@ -755,7 +755,8 @@ static int use_rt_clock;
- static void init_get_clock(void)
+--- vl.c.orig 2009-09-23 23:01:32.000000000 +0400
++++ vl.c 2009-09-30 14:10:21.000000000 +0400
+@@ -567,7 +567,7 @@
{
use_rt_clock = 0;
--#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
-+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+ #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+- || defined(__DragonFly__)
+ || defined(__DragonFly__) || defined(__NetBSD__)
{
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) {
-@@ -767,7 +768,8 @@ static void init_get_clock(void)
-
+@@ -580,7 +580,7 @@
static int64_t get_clock(void)
{
--#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000)
-+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+ #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \
+- || defined(__DragonFly__)
+ || defined(__DragonFly__) || defined(__NetBSD__)
if (use_rt_clock) {
struct timespec ts;
diff --git a/emulators/qemu/patches/patch-dl b/emulators/qemu/patches/patch-dl
index c41981a3d98..ded28bebbda 100644
--- a/emulators/qemu/patches/patch-dl
+++ b/emulators/qemu/patches/patch-dl
@@ -1,35 +1,36 @@
-$NetBSD: patch-dl,v 1.2 2009/08/31 13:07:04 asau Exp $
+$NetBSD: patch-dl,v 1.3 2009/10/11 16:04:13 asau Exp $
---- cpu-exec.c.orig 2009-07-17 04:56:22.000000000 +0400
-+++ cpu-exec.c 2009-08-31 16:38:35.000000000 +0400
-@@ -1156,6 +1156,18 @@
- # define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext->ss.eip))
+--- cpu-exec.c.orig 2009-09-23 23:01:32.000000000 +0400
++++ cpu-exec.c 2009-09-30 14:18:16.000000000 +0400
+@@ -1247,6 +1247,20 @@
# define TRAP_sig(context) ((context)->uc_mcontext->es.trapno)
# define ERROR_sig(context) ((context)->uc_mcontext->es.err)
+ # define MASK_sig(context) ((context)->uc_sigmask)
+#elif defined (__NetBSD__)
+# include <ucontext.h>
+
+# define EIP_sig(context) ((context)->uc_mcontext.__gregs[_REG_EIP])
+# define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO])
+# define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR])
++# define MASK_sig(context) ((context)->uc_sigmask)
+#elif defined (__FreeBSD__) || defined(__DragonFly__)
+# include <ucontext.h>
+
+# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_eip))
+# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno)
+# define ERROR_sig(context) ((context)->uc_mcontext.mc_err)
- #else
- # define EIP_sig(context) ((context)->uc_mcontext.gregs[REG_EIP])
- # define TRAP_sig(context) ((context)->uc_mcontext.gregs[REG_TRAPNO])
-@@ -1166,7 +1178,11 @@
++# define MASK_sig(context) ((context)->uc_sigmask)
+ #elif defined(__OpenBSD__)
+ # define EIP_sig(context) ((context)->sc_eip)
+ # define TRAP_sig(context) ((context)->sc_trapno)
+@@ -1263,7 +1277,9 @@
void *puc)
{
siginfo_t *info = pinfo;
+-#if defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__)
+ ucontext_t *uc = puc;
-+#else
++#elif defined(__OpenBSD__)
+ struct sigcontext *uc = puc;
+ #else
struct ucontext *uc = puc;
-+#endif
- unsigned long pc;
- int trapno;
-