diff options
author | nox <nox@FreeBSD.org> | 2014-11-04 03:25:57 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2014-11-04 03:25:57 +0800 |
commit | 0263dfc503a31697bccd818066b08f27f8821d25 (patch) | |
tree | 83c143490297b5be842dc6e222324212e5728695 /emulators | |
parent | 16e2ea6cbfc93fa15a247e194017fd6d02f17bd6 (diff) | |
download | freebsd-ports-gnome-0263dfc503a31697bccd818066b08f27f8821d25.tar.gz freebsd-ports-gnome-0263dfc503a31697bccd818066b08f27f8821d25.tar.zst freebsd-ports-gnome-0263dfc503a31697bccd818066b08f27f8821d25.zip |
- bsd-user: deal with new sem_wait2 and sem_wake2 syscalls in head.
- Bump PORTREVISION.
Submitted by: sbruno
Obtained from: https://github.com/seanbruno/qemu-bsd-user/commit/2478a4e4a33d0523cc436eabb4a27b258b4358b8
Diffstat (limited to 'emulators')
3 files changed, 102 insertions, 1 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index 352907d166bb..b34b0190928c 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -3,7 +3,7 @@ PORTNAME= qemu PORTVERSION= 2.0.2 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= emulators MASTER_SITES= http://wiki.qemu.org/download/:release \ LOCAL/nox:snapshot @@ -80,6 +80,8 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-os-sys.c EXTRA_PATCHES+= ${FILESDIR}/extra-patch-sysctl-hw-physmem EXTRA_PATCHES+= ${FILESDIR}/extra-patch-max-arg-pages EXTRA_PATCHES+= ${FILESDIR}/extra-patch-ad92220df37d1ab3120316fcc436071c78817561 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8 +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8-before11 .endif CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib diff --git a/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8 b/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8 new file mode 100644 index 000000000000..60acfebd6da6 --- /dev/null +++ b/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8 @@ -0,0 +1,80 @@ +From 2478a4e4a33d0523cc436eabb4a27b258b4358b8 Mon Sep 17 00:00:00 2001 +From: Sean Bruno <sbruno@freebsd.org> +Date: Sun, 2 Nov 2014 15:05:40 -0800 +Subject: [PATCH] Deal with new sem_wait2 and sem_wake2 syscalls in head. + +--- + bsd-user/freebsd/os-thread.c | 19 +++++++++++++++++++ + bsd-user/freebsd/os-thread.h | 6 ++++++ + bsd-user/syscall_defs.h | 4 +++- + 3 files changed, 28 insertions(+), 1 deletion(-) + +diff --git a/bsd-user/freebsd/os-thread.c b/bsd-user/freebsd/os-thread.c +index 91a42ac..cca46cf 100644 +--- a/bsd-user/freebsd/os-thread.c ++++ b/bsd-user/freebsd/os-thread.c +@@ -225,6 +225,25 @@ abi_long freebsd_umtx_mutex_wake2(abi_ulong target_addr, + } + #endif /* UMTX_OP_MUTEX_WAKE2 */ + ++#if defined(__FreeBSD_version) && __FreeBSD_version > 1100000 ++abi_long freebsd_umtx_sem_wait(abi_ulong obj, struct timespec *timeout) ++{ ++ ++ /* XXX Assumes struct _usem is opauque to the user */ ++ if (!access_ok(VERIFY_WRITE, obj, sizeof(struct target__usem))) { ++ return -TARGET_EFAULT; ++ } ++ return get_errno(_umtx_op(g2h(obj), UMTX_OP_SEM2_WAIT, 0, NULL, timeout)); ++} ++ ++abi_long freebsd_umtx_sem_wake(abi_ulong obj, uint32_t val) ++{ ++ ++ return get_errno(_umtx_op(g2h(obj), UMTX_OP_SEM2_WAKE, val, NULL, NULL)); ++} ++#endif ++ ++#else + abi_long freebsd_umtx_sem_wait(abi_ulong obj, struct timespec *timeout) + { + +diff --git a/bsd-user/freebsd/os-thread.h b/bsd-user/freebsd/os-thread.h +index 28f737f..8157e85 100644 +--- a/bsd-user/freebsd/os-thread.h ++++ b/bsd-user/freebsd/os-thread.h +@@ -486,6 +486,9 @@ static inline abi_long do_freebsd__umtx_op(abi_ulong obj, int op, abi_ulong val, + break; + #endif /* UMTX_OP_NWAKE_PRIVATE */ + ++#if defined(__FreeBSD_version) && __FreeBSD_version > 1100000 ++ case TARGET_UMTX_OP_SEM2_WAIT: ++#endif + case TARGET_UMTX_OP_SEM_WAIT: + if (target_ts != 0) { + if (t2h_freebsd_timespec(&ts, target_ts)) { +@@ -497,6 +500,9 @@ static inline abi_long do_freebsd__umtx_op(abi_ulong obj, int op, abi_ulong val, + } + break; + ++#if defined(__FreeBSD_version) && __FreeBSD_version > 1100000 ++ case TARGET_UMTX_OP_SEM2_WAKE: ++#endif + case TARGET_UMTX_OP_SEM_WAKE: + /* Don't need to do access_ok(). */ + ret = freebsd_umtx_sem_wake(obj, val); +diff --git a/bsd-user/syscall_defs.h b/bsd-user/syscall_defs.h +index 13678d4..d02476c 100644 +--- a/bsd-user/syscall_defs.h ++++ b/bsd-user/syscall_defs.h +@@ -633,7 +633,9 @@ typedef struct { + #define TARGET_UMTX_OP_SEM_WAKE 20 + #define TARGET_UMTX_OP_NWAKE_PRIVATE 21 + #define TARGET_UMTX_OP_MUTEX_WAKE2 22 +-#define TARGET_UMTX_OP_MAX 23 ++#define TARGET_UMTX_OP_SEM2_WAIT 23 ++#define TARGET_UMTX_OP_SEM2_WAKE 24 ++#define TARGET_UMTX_OP_MAX 25 + + /* flags for UMTX_OP_CV_WAIT */ + #define TARGET_CVWAIT_CHECK_UNPARKING 0x01 diff --git a/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8-before11 b/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8-before11 new file mode 100644 index 000000000000..d0746ba545b2 --- /dev/null +++ b/emulators/qemu-devel/files/extra-patch-2478a4e4a33d0523cc436eabb4a27b258b4358b8-before11 @@ -0,0 +1,19 @@ +--- a/bsd-user/freebsd/os-thread.c ++++ b/bsd-user/freebsd/os-thread.c +@@ -241,8 +241,6 @@ abi_long freebsd_umtx_sem_wake(abi_ulong + + return get_errno(_umtx_op(g2h(obj), UMTX_OP_SEM2_WAKE, val, NULL, NULL)); + } +-#endif +- + #else + abi_long freebsd_umtx_sem_wait(abi_ulong obj, struct timespec *timeout) + { +@@ -260,6 +258,7 @@ abi_long freebsd_umtx_sem_wake(abi_ulong + return get_errno(_umtx_op(g2h(obj), UMTX_OP_SEM_WAKE, val, NULL, NULL)); + } + #endif ++#endif + + abi_long t2h_freebsd_rtprio(struct rtprio *host_rtp, abi_ulong target_addr) + { |