diff options
Diffstat (limited to 'emulators/qemu-devel/files')
34 files changed, 0 insertions, 4469 deletions
diff --git a/emulators/qemu-devel/files/cdrom-dma-patch b/emulators/qemu-devel/files/cdrom-dma-patch deleted file mode 100644 index 7b6bed2e6adc..000000000000 --- a/emulators/qemu-devel/files/cdrom-dma-patch +++ /dev/null @@ -1,10 +0,0 @@ -Index: hw/ide.c -@@ -27,7 +27,7 @@ - //#define DEBUG_IDE - //#define DEBUG_IDE_ATAPI - //#define DEBUG_AIO --#define USE_DMA_CDROM -+// #define USE_DMA_CDROM - - /* Bits of HD_STATUS */ - #define ERR_STAT 0x01 diff --git a/emulators/qemu-devel/files/patch-Makefile b/emulators/qemu-devel/files/patch-Makefile deleted file mode 100644 index 58defdea2eac..000000000000 --- a/emulators/qemu-devel/files/patch-Makefile +++ /dev/null @@ -1,33 +0,0 @@ -Index: qemu/Makefile -@@ -20,6 +20,10 @@ - LDFLAGS+=-static - endif - ifdef BUILD_DOCS -+ifdef NOPORTDOCS -+DOCS=qemu.1 qemu-img.1 -+else - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 -+endif - else - DOCS= -@@ -28,7 +28,8 @@ - ifndef CONFIG_DARWIN - ifndef CONFIG_WIN32 - ifndef CONFIG_SOLARIS --LIBS+=-lrt -+# XXX need ifndef CONFIG_BSD -+# LIBS+=-lrt - endif - endif - endif -@@ -72,8 +75,10 @@ - common de-ch es fo fr-ca hu ja mk nl-be pt sl tr - - install-doc: $(DOCS) -+ifndef NOPORTDOCS - mkdir -p "$(DESTDIR)$(docdir)" - $(INSTALL) -m 644 qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" -+endif - ifndef CONFIG_WIN32 - mkdir -p "$(DESTDIR)$(mandir)/man1" - $(INSTALL) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" diff --git a/emulators/qemu-devel/files/patch-PRId64 b/emulators/qemu-devel/files/patch-PRId64 deleted file mode 100644 index 3d559d3be61b..000000000000 --- a/emulators/qemu-devel/files/patch-PRId64 +++ /dev/null @@ -1,113 +0,0 @@ -Index: qemu/vl.h -@@ -30,6 +30,12 @@ - #include <stdarg.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include <limits.h> - #include <time.h> - #include <ctype.h> -Index: qemu/dis-asm.h -@@ -13,6 +13,12 @@ - #include <stdio.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #define PARAMS(x) x - typedef void *PTR; -Index: qemu/kqemu.c -@@ -33,6 +33,12 @@ - #include <errno.h> - #include <unistd.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "cpu.h" - #include "exec-all.h" -Index: qemu/translate-all.c -@@ -22,6 +22,12 @@ - #include <stdio.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "config.h" - -Index: qemu/target-i386/helper.c -@@ -21,6 +21,13 @@ - - //#define DEBUG_PCALL - -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif -+ - #if 0 - #define raise_exception_err(a, b)\ - do {\ -Index: qemu/target-i386/helper2.c -@@ -22,6 +22,12 @@ - #include <stdio.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include <signal.h> - #include <assert.h> - -Index: qemu/target-ppc/translate.c -@@ -22,6 +22,12 @@ - #include <stdio.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - - #include "cpu.h" - #include "exec-all.h" -Index: qemu/target-sparc/helper.c -@@ -22,6 +22,12 @@ - #include <stdio.h> - #include <string.h> - #include <inttypes.h> -+#ifndef PRId64 -+#define PRId64 "lld" /* int64_t */ -+#define PRIo64 "llo" /* int64_t */ -+#define PRIx64 "llx" /* int64_t */ -+#define PRIu64 "llu" /* int64_t */ -+#endif - #include <signal.h> - #include <assert.h> - diff --git a/emulators/qemu-devel/files/patch-aa b/emulators/qemu-devel/files/patch-aa deleted file mode 100644 index 25eaa72ab235..000000000000 --- a/emulators/qemu-devel/files/patch-aa +++ /dev/null @@ -1,12 +0,0 @@ -diff -urd --exclude=CVS ../cvs/qemu/Makefile qemu-0.5.5/Makefile ---- ../cvs/qemu/Makefile Mon May 17 21:06:42 2004 -+++ qemu-0.5.5/Makefile Sun May 30 05:26:19 2004 -@@ -70,7 +70,7 @@ - - # documentation - %.html: %.texi -- texi2html -monolithic -number $< -+ -texi2html -monolithic -number $< - - qemu.1: qemu-doc.texi - ./texi2pod.pl $< qemu.pod diff --git a/emulators/qemu-devel/files/patch-ac b/emulators/qemu-devel/files/patch-ac deleted file mode 100644 index 8adf3dbd9637..000000000000 --- a/emulators/qemu-devel/files/patch-ac +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -204,7 +204,7 @@ - - if test -z "$sdl" ; then - --sdl_config="sdl-config" -+sdl_config="${SDL_CONFIG}" - sdl=no - sdl_static=no - diff --git a/emulators/qemu-devel/files/patch-audio-4 b/emulators/qemu-devel/files/patch-audio-4 deleted file mode 100644 index bb71885a2992..000000000000 --- a/emulators/qemu-devel/files/patch-audio-4 +++ /dev/null @@ -1,24 +0,0 @@ -Index: qemu/audio/audio_template.h -@@ -32,6 +32,10 @@ - #define SW glue (SWVoice, In) - #endif - -+#ifndef UINT64_MAX -+#define UINT64_MAX ((uint64_t)(18446744073709551615ULL)) -+#endif -+ - static void glue (audio_pcm_sw_fini_, TYPE) (SW *sw) - { - glue (audio_pcm_sw_free_resources_, TYPE) (sw); -Index: qemu/audio/audio.c -@@ -36,6 +36,10 @@ - /* #define DEBUG_LIVE */ - /* #define DEBUG_OUT */ - -+#ifndef INT16_MAX -+#define INT16_MAX (32767) -+#endif -+ - static struct audio_driver *drvtab[] = { - #ifdef CONFIG_OSS - &oss_audio_driver, diff --git a/emulators/qemu-devel/files/patch-audio::ossaudio.c b/emulators/qemu-devel/files/patch-audio::ossaudio.c deleted file mode 100644 index 8fc9e99b9153..000000000000 --- a/emulators/qemu-devel/files/patch-audio::ossaudio.c +++ /dev/null @@ -1,11 +0,0 @@ -Index: qemu/audio/ossaudio.c -@@ -21,8 +21,8 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ --#include <sys/mman.h> - #include <sys/types.h> -+#include <sys/mman.h> - #include <sys/ioctl.h> - #include <sys/soundcard.h> - #include <assert.h> diff --git a/emulators/qemu-devel/files/patch-bc b/emulators/qemu-devel/files/patch-bc deleted file mode 100644 index 7ad83440d48b..000000000000 --- a/emulators/qemu-devel/files/patch-bc +++ /dev/null @@ -1,12 +0,0 @@ -Index: qemu/i386-dis.c -@@ -2896,6 +2896,10 @@ - OP_E (bytemode, sizeflag); - } - -+#ifndef PRIx64 -+#define PRIx64 "llx" -+#endif -+ - static void - print_operand_value (buf, hex, disp) - char *buf; diff --git a/emulators/qemu-devel/files/patch-bd b/emulators/qemu-devel/files/patch-bd deleted file mode 100644 index 3f85d63c03a1..000000000000 --- a/emulators/qemu-devel/files/patch-bd +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -286,7 +286,7 @@ - if test -z "$prefix" ; then - prefix="/usr/local" - fi --mandir="$prefix/share/man" -+mandir="$prefix/man" - datadir="$prefix/share/qemu" - docdir="$prefix/share/doc/qemu" - bindir="$prefix/bin" diff --git a/emulators/qemu-devel/files/patch-be b/emulators/qemu-devel/files/patch-be deleted file mode 100644 index 71753fa84dfe..000000000000 --- a/emulators/qemu-devel/files/patch-be +++ /dev/null @@ -1,31 +0,0 @@ -Index: qemu/Makefile.target -@@ -404,7 +404,9 @@ - ifndef CONFIG_DARWIN - ifndef CONFIG_WIN32 - ifndef CONFIG_SOLARIS --VL_LIBS=-lutil -lrt -+#VL_LIBS=-lutil -lrt -+# XXX this cant be just merged back... -+VL_LIBS=-lutil - endif - endif - endif -Index: qemu/vl.c -@@ -541,7 +541,7 @@ - static void init_get_clock(void) - { - use_rt_clock = 0; --#if defined(__linux__) -+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) - { - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { -@@ -553,7 +553,7 @@ - - static int64_t get_clock(void) - { --#if defined(__linux__) -+#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) - if (use_rt_clock) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/emulators/qemu-devel/files/patch-bf b/emulators/qemu-devel/files/patch-bf deleted file mode 100644 index 57cc889e3119..000000000000 --- a/emulators/qemu-devel/files/patch-bf +++ /dev/null @@ -1,37 +0,0 @@ -Index: qemu/slirp/slirp_config.h -@@ -86,7 +86,7 @@ - #undef BAD_SPRINTF - - /* Define if you have readv */ --#undef HAVE_READV -+#define HAVE_READV - - /* Define if iovec needs to be declared */ - #undef DECLARE_IOVEC -@@ -95,7 +95,7 @@ - #undef DECLARE_SPRINTF - - /* Define if you have a POSIX.1 sys/wait.h */ --#undef HAVE_SYS_WAIT_H -+#define HAVE_SYS_WAIT_H - - /* Define if you have sys/select.h */ - #define HAVE_SYS_SELECT_H -@@ -107,7 +107,7 @@ - #define HAVE_ARPA_INET_H - - /* Define if you have sys/signal.h */ --#undef HAVE_SYS_SIGNAL_H -+#define HAVE_SYS_SIGNAL_H - - /* Define if you have sys/stropts.h */ - #undef HAVE_SYS_STROPTS_H -@@ -180,7 +180,7 @@ - #undef HAVE_GRANTPT - - /* Define if you have fchmod */ --#undef HAVE_FCHMOD -+#define HAVE_FCHMOD - - /* Define if you have <sys/type32.h> */ - #undef HAVE_SYS_TYPES32_H diff --git a/emulators/qemu-devel/files/patch-bg b/emulators/qemu-devel/files/patch-bg deleted file mode 100644 index d93e26741ce8..000000000000 --- a/emulators/qemu-devel/files/patch-bg +++ /dev/null @@ -1,24 +0,0 @@ -Index: qemu/Makefile.target -@@ -179,7 +179,7 @@ - - ######################################################### - --CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -+CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSMBD_COMMAND=\"${LOCALBASE}/sbin/smbd\" -I${LOCALBASE}/include - LIBS+=-lm - ifndef CONFIG_USER_ONLY - LIBS+=-lz -Index: qemu/vl.c -@@ -89,10 +89,12 @@ - #include "exec-all.h" - - #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" -+#ifndef SMBD_COMMAND - #ifdef __sun__ - #define SMBD_COMMAND "/usr/sfw/sbin/smbd" - #else - #define SMBD_COMMAND "/usr/sbin/smbd" -+#endif - #endif - - //#define DEBUG_UNUSED_IOPORT diff --git a/emulators/qemu-devel/files/patch-bh b/emulators/qemu-devel/files/patch-bh deleted file mode 100644 index 1218bb4656c5..000000000000 --- a/emulators/qemu-devel/files/patch-bh +++ /dev/null @@ -1,26 +0,0 @@ -Index: qemu/dyngen-exec.h -=================================================================== -RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v -retrieving revision 1.12 -diff -w -u -d -r1.12 dyngen-exec.h ---- dyngen-exec.h 12 May 2004 19:32:15 -0000 1.12 -+++ dyngen-exec.h 21 May 2004 15:00:41 -0000 -@@ -21,6 +21,8 @@ - #define __DYNGEN_EXEC_H__ - - #include <stddef.h> -+#include <stdio.h> -+#include "config.h" - - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; -@@ -54,9 +56,6 @@ - #define UINT32_MAX (4294967295U) - #define UINT64_MAX ((uint64_t)(18446744073709551615)) - --typedef struct FILE FILE; --extern int fprintf(FILE *, const char *, ...); --extern int printf(const char *, ...); - #undef NULL - #define NULL 0 - #ifdef _BSD diff --git a/emulators/qemu-devel/files/patch-bk b/emulators/qemu-devel/files/patch-bk deleted file mode 100644 index 09281f31aef2..000000000000 --- a/emulators/qemu-devel/files/patch-bk +++ /dev/null @@ -1,190 +0,0 @@ -Index: qemu/slirp/bootp.c -@@ -29,11 +29,12 @@ - - #define START_ADDR 15 - --#define LEASE_TIME (24 * 3600) -+#define LEASE_TIME (120) - - typedef struct { - uint8_t allocated; - uint8_t macaddr[6]; -+ int time; - } BOOTPClient; - - BOOTPClient bootp_clients[NB_ADDR]; -@@ -68,26 +69,54 @@ - { - BOOTPClient *bc; - int i; -+ int now=time(NULL); - - for(i = 0; i < NB_ADDR; i++) { - if (!memcmp(macaddr, bootp_clients[i].macaddr, 6)) - goto found; - } -+ for(i = 0; i < NB_ADDR; i++) { -+ if (now-bootp_clients[i].time > 3*LEASE_TIME) -+ goto found; -+ } - return NULL; - found: - bc = &bootp_clients[i]; -- bc->allocated = 1; - paddr->s_addr = htonl(ntohl(special_addr.s_addr) | (i + START_ADDR)); - return bc; - } - -+static BOOTPClient *find_reqaddr(struct in_addr *paddr, struct in_addr *reqaddr, const uint8_t *macaddr) -+{ -+ BOOTPClient *bc=NULL; -+ int i; -+ /*check the net prefix*/ -+ if ((ntohl(reqaddr->s_addr) & 0xffffff00) == -+ (ntohl(special_addr.s_addr) & 0xffffff00)) { -+ i=(ntohl(reqaddr->s_addr) & 0xff) - START_ADDR; -+ if (i>=0 && i< NB_ADDR) { -+ bc = &bootp_clients[i]; -+ if (bc->allocated && -+ (memcmp(macaddr, bootp_clients[i].macaddr, 6)==0)) { -+ paddr->s_addr = reqaddr->s_addr; -+ return bc; -+ } -+ else -+ bc=NULL; -+ } -+ } -+ return bc; -+} -+ -+ - static void dhcp_decode(const uint8_t *buf, int size, -- int *pmsg_type) -+ int *pmsg_type, struct sockaddr_in *preqaddr) - { - const uint8_t *p, *p_end; - int len, tag; - - *pmsg_type = 0; -+ preqaddr->sin_addr.s_addr=htonl(0L); - - p = buf; - p_end = buf + size; -@@ -114,6 +143,10 @@ - if (len >= 1) - *pmsg_type = p[0]; - break; -+ case RFC2132_REQ_ADDR: -+ if (len == 4) { -+ memcpy(&(preqaddr->sin_addr),p,4); -+ } - default: - break; - } -@@ -127,14 +160,14 @@ - BOOTPClient *bc; - struct mbuf *m; - struct bootp_t *rbp; -- struct sockaddr_in saddr, daddr; -+ struct sockaddr_in saddr, daddr, reqaddr; - struct in_addr dns_addr; - int dhcp_msg_type, val; -- uint8_t *q; -+ uint8_t *q,replytype; - - /* extract exact DHCP msg type */ -- dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type); -- dprintf("bootp packet op=%d msgtype=%d\n", bp->bp_op, dhcp_msg_type); -+ dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type,&reqaddr); -+ dprintf("bootp packet op=%d msgtype=%d reqaddr=%x\n", bp->bp_op, dhcp_msg_type,ntohl(reqaddr.sin_addr.s_addr)); - - if (dhcp_msg_type == 0) - dhcp_msg_type = DHCPREQUEST; /* Force reply for old BOOTP clients */ -@@ -152,21 +185,18 @@ - m->m_data += sizeof(struct udpiphdr); - memset(rbp, 0, sizeof(struct bootp_t)); - -- if (dhcp_msg_type == DHCPDISCOVER) { -- new_addr: -- bc = get_new_addr(&daddr.sin_addr); -- if (!bc) { -- dprintf("no address left\n"); -- return; -- } -- memcpy(bc->macaddr, client_ethaddr, 6); -- } else { -- bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -- if (!bc) { -- /* if never assigned, behaves as if it was already -- assigned (windows fix because it remembers its address) */ -- goto new_addr; -- } -+ bc=NULL; -+ daddr.sin_addr.s_addr=htonl(0L); -+ if (dhcp_msg_type == DHCPREQUEST) { -+ if (reqaddr.sin_addr.s_addr != htonl(0L)) -+ bc = find_reqaddr(&daddr.sin_addr, &reqaddr.sin_addr, bp->bp_hwaddr); -+ else -+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -+ } -+ else if (dhcp_msg_type == DHCPDISCOVER) { -+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -+ if (!bc) -+ bc = get_new_addr(&daddr.sin_addr); - } - dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); - -@@ -181,25 +211,27 @@ - rbp->bp_hlen = 6; - memcpy(rbp->bp_hwaddr, bp->bp_hwaddr, 6); - -- rbp->bp_yiaddr = daddr.sin_addr; /* Client IP address */ -- rbp->bp_siaddr = saddr.sin_addr; /* Server IP address */ -+ rbp->bp_yiaddr = daddr.sin_addr; /* IP address */ - - q = rbp->bp_vend; - memcpy(q, rfc1533_cookie, 4); - q += 4; - -- if (dhcp_msg_type == DHCPDISCOVER) { -- *q++ = RFC2132_MSG_TYPE; -- *q++ = 1; -- *q++ = DHCPOFFER; -- } else if (dhcp_msg_type == DHCPREQUEST) { -+ if (bc != NULL) { -+ memcpy(bc->macaddr, client_ethaddr, 6); -+ bc->allocated = 1; -+ bc->time = time(NULL); -+ replytype=(dhcp_msg_type == DHCPDISCOVER)?DHCPOFFER:DHCPACK; -+ } -+ else -+ replytype=DHCPNACK; -+ - *q++ = RFC2132_MSG_TYPE; - *q++ = 1; -- *q++ = DHCPACK; -- } -+ *q++ = replytype; - -- if (dhcp_msg_type == DHCPDISCOVER || -- dhcp_msg_type == DHCPREQUEST) { -+ if ((dhcp_msg_type == DHCPDISCOVER || -+ dhcp_msg_type == DHCPREQUEST) && replytype!=DHCPNACK) { - *q++ = RFC2132_SRV_ID; - *q++ = 4; - memcpy(q, &saddr.sin_addr, 4); -Index: qemu/slirp/bootp.h -=================================================================== -RCS file: /cvsroot/qemu/qemu/slirp/bootp.h,v -retrieving revision 1.1 -diff -u -r1.1 bootp.h ---- slirp/bootp.h 22 Apr 2004 00:10:47 -0000 1.1 -+++ slirp/bootp.h 5 Jun 2004 19:34:22 -0000 -@@ -71,6 +71,7 @@ - #define DHCPOFFER 2 - #define DHCPREQUEST 3 - #define DHCPACK 5 -+#define DHCPNACK 6 - - #define RFC1533_VENDOR_MAJOR 0 - #define RFC1533_VENDOR_MINOR 0 diff --git a/emulators/qemu-devel/files/patch-block-raw.c b/emulators/qemu-devel/files/patch-block-raw.c deleted file mode 100644 index 7d68d282bdaa..000000000000 --- a/emulators/qemu-devel/files/patch-block-raw.c +++ /dev/null @@ -1,51 +0,0 @@ -Index: qemu/block-raw.c -@@ -51,7 +51,10 @@ - #include <linux/cdrom.h> - #include <linux/fd.h> - #endif - #ifdef __FreeBSD__ -+#include <signal.h> -+#endif -+#if defined(__FreeBSD__) && __FreeBSD__ > 4 - #include <sys/disk.h> - #endif - -@@ -167,9 +167,20 @@ - static int aio_sig_num = SIGUSR2; - static RawAIOCB *first_aio; /* AIO issued */ - static int aio_initialized = 0; -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+static int sigaio_dont = 0; -+#endif - - static void aio_signal_handler(int signum) - { -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+ if (sigaio_dont) { -+ --sigaio_dont; -+ return; -+ } -+#endif - #ifndef QEMU_TOOL - CPUState *env = cpu_single_env; - if (env) { -@@ -284,9 +295,17 @@ - if (qemu_bh_poll()) - return; - #endif -+// FreeBSD 4.x doesn't have sigwait -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+ ++sigaio_dont; -+ do -+ sigsuspend(&wait_oset); -+ while (sigaio_dont); -+#else - sigemptyset(&set); - sigaddset(&set, aio_sig_num); - sigwait(&set, &nb_sigs); -+#endif - qemu_aio_poll(); - } - diff --git a/emulators/qemu-devel/files/patch-bsdusb.patch b/emulators/qemu-devel/files/patch-bsdusb.patch deleted file mode 100644 index 09b90c09c916..000000000000 --- a/emulators/qemu-devel/files/patch-bsdusb.patch +++ /dev/null @@ -1,690 +0,0 @@ -Index: qemu/configure -@@ -134,6 +134,7 @@ - oss="yes" - linux="yes" - user="yes" -+usb="linux" - if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then - kqemu="yes" - fi -@@ -143,6 +144,7 @@ - if [ "$bsd" = "yes" ] ; then - if [ "$darwin" != "yes" ] ; then - make="gmake" -+ usb="bsd" - fi - fi - -@@ -724,6 +726,19 @@ - fi - - echo "#define CONFIG_UNAME_RELEASE \"$uname_release\"" >> $config_h -+ -+# USB host support -+case "$usb" in -+linux) -+ echo "HOST_USB=linux" >> $conig_mak -+;; -+bsd) -+ echo "HOST_USB=bsd" >> $config_mak -+;; -+*) -+ echo "HOST_USB=stub" >> $config_mak -+;; -+esac - - for target in $target_list; do - target_dir="$target" -Index: qemu/Makefile.target -@@ -329,7 +329,7 @@ - VL_OBJS+= scsi-disk.o cdrom.o lsi53c895a.o - - # USB layer --VL_OBJS+= usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o -+VL_OBJS+= usb.o usb-hub.o usb-$(HOST_USB).o usb-hid.o usb-ohci.o usb-msd.o - - # PCI network cards - VL_OBJS+= ne2000.o rtl8139.o pcnet.o -Index: qemu/usb-stub.c -@@ -0,0 +1,11 @@ -+#include "vl.h" -+ -+void usb_host_info(void) -+{ -+ term_printf("USB host devices not supported\n"); -+} -+ -+USBDevice *usb_host_device_open(const char *devname) -+{ -+ return NULL; -+} -Index: qemu/usb-bsd.c -@@ -0,0 +1,600 @@ -+/* -+ * BSD host USB redirector -+ * -+ * Copyright (c) 2006 Lonnie Mendez -+ * Portions of code and concepts borrowed from -+ * usb-linux.c and libusb's bsd.c and are copyright their respective owners. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+ * copies of the Software, and to permit persons to whom the Software is -+ * furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -+ * THE SOFTWARE. -+ */ -+ -+#include "vl.h" -+ -+/* usb.h declares these */ -+#undef USB_SPEED_HIGH -+#undef USB_SPEED_FULL -+#undef USB_SPEED_LOW -+ -+#include <sys/ioctl.h> -+#include <dev/usb/usb.h> -+#include <signal.h> -+ -+/* This value has maximum potential at 16. -+ * You should also set hw.usb.debug to gain -+ * more detailed view. -+ */ -+//#define DEBUG -+#define UGEN_DEBUG_LEVEL 0 -+ -+ -+typedef int USBScanFunc(void *opaque, int bus_num, int addr, int class_id, -+ int vendor_id, int product_id, -+ const char *product_name, int speed); -+static int usb_host_find_device(int *pbus_num, int *paddr, -+ const char *devname); -+ -+typedef struct USBHostDevice { -+ USBDevice dev; -+ int ep_fd[USB_MAX_ENDPOINTS]; -+ int devfd; -+ char devpath[32]; -+} USBHostDevice; -+ -+ -+static int ensure_ep_open(USBHostDevice *dev, int ep, int mode) -+{ -+ char buf[32]; -+ int fd; -+ -+ /* Get the address for this endpoint */ -+ ep = UE_GET_ADDR(ep); -+ -+ if (dev->ep_fd[ep] < 0) { -+#if __FreeBSD__ -+ snprintf(buf, sizeof(buf) - 1, "%s.%d", dev->devpath, ep); -+#else -+ snprintf(buf, sizeof(buf) - 1, "%s.%02d", dev->devpath, ep); -+#endif -+ /* Try to open it O_RDWR first for those devices which have in and out -+ * endpoints with the same address (eg 0x02 and 0x82) -+ */ -+ fd = open(buf, O_RDWR); -+ if (fd < 0 && errno == ENXIO) -+ fd = open(buf, mode); -+ if (fd < 0) { -+#ifdef DEBUG -+ printf("ensure_ep_open: failed to open device endpoint %s: %s\n", -+ buf, strerror(errno)); -+#endif -+ } -+ dev->ep_fd[ep] = fd; -+ } -+ -+ return dev->ep_fd[ep]; -+} -+ -+static void ensure_eps_closed(USBHostDevice *dev) -+{ -+ int epnum = 1; -+ -+ if (!dev) -+ return; -+ -+ while (epnum < USB_MAX_ENDPOINTS) { -+ if (dev->ep_fd[epnum] >= 0) { -+ close(dev->ep_fd[epnum]); -+ dev->ep_fd[epnum] = -1; -+ } -+ epnum++; -+ } -+} -+ -+static void usb_host_handle_reset(USBDevice *dev) -+{ -+#if 0 -+ USBHostDevice *s = (USBHostDevice *)dev; -+#endif -+} -+ -+/* XXX: -+ * -check device states against transfer requests -+ * and return appropriate response -+ */ -+static int usb_host_handle_control(USBDevice *dev, -+ int request, -+ int value, -+ int index, -+ int length, -+ uint8_t *data) -+{ -+ USBHostDevice *s = (USBHostDevice *)dev; -+ struct usb_ctl_request req; -+ struct usb_alt_interface aiface; -+ int ret, timeout = 50; -+ -+ if ((request >> 8) == UT_WRITE_DEVICE && -+ (request & 0xff) == UR_SET_ADDRESS) { -+ -+ /* specific SET_ADDRESS support */ -+ dev->addr = value; -+ return 0; -+ } else if ((request >> 8) == UT_WRITE_DEVICE && -+ (request & 0xff) == UR_SET_CONFIG) { -+ -+ ensure_eps_closed(s); /* can't do this without all eps closed */ -+ -+ ret = ioctl(s->devfd, USB_SET_CONFIG, &value); -+ if (ret < 0) { -+#ifdef DEBUG -+ printf("handle_control: failed to set configuration - %s\n", -+ strerror(errno)); -+#endif -+ return USB_RET_STALL; -+ } -+ -+ return 0; -+ } else if ((request >> 8) == UT_WRITE_INTERFACE && -+ (request & 0xff) == UR_SET_INTERFACE) { -+ -+ aiface.uai_interface_index = index; -+ aiface.uai_alt_no = value; -+ -+ ensure_eps_closed(s); /* can't do this without all eps closed */ -+ ret = ioctl(s->devfd, USB_SET_ALTINTERFACE, &aiface); -+ if (ret < 0) { -+#ifdef DEBUG -+ printf("handle_control: failed to set alternate interface - %s\n", -+ strerror(errno)); -+#endif -+ return USB_RET_STALL; -+ } -+ -+ return 0; -+ } else { -+ req.ucr_request.bmRequestType = request >> 8; -+ req.ucr_request.bRequest = request & 0xff; -+ USETW(req.ucr_request.wValue, value); -+ USETW(req.ucr_request.wIndex, index); -+ USETW(req.ucr_request.wLength, length); -+ req.ucr_data = data; -+ req.ucr_flags = USBD_SHORT_XFER_OK; -+ -+ ret = ioctl(s->devfd, USB_SET_TIMEOUT, &timeout); -+#if (__NetBSD__ || __OpenBSD__) -+ if (ret < 0 && errno != EINVAL) { -+#else -+ if (ret < 0) { -+#endif -+#ifdef DEBUG -+ printf("handle_control: setting timeout failed - %s\n", -+ strerror(errno)); -+#endif -+ } -+ -+ ret = ioctl(s->devfd, USB_DO_REQUEST, &req); -+ /* ugen returns EIO for usbd_do_request_ no matter what -+ * happens with the transfer */ -+ if (ret < 0) { -+#ifdef DEBUG -+ printf("handle_control: error after request - %s\n", -+ strerror(errno)); -+#endif -+ return USB_RET_NAK; // STALL -+ } else { -+ return req.ucr_actlen; -+ } -+ } -+} -+ -+static int usb_host_handle_data(USBDevice *dev, USBPacket *p) -+{ -+ USBHostDevice *s = (USBHostDevice *)dev; -+ int ret, fd, mode; -+ int one = 1, shortpacket = 0, timeout = 50; -+ sigset_t new_mask, old_mask; -+ uint8_t devep = p->devep; -+ -+ /* protect data transfers from SIGALRM signal */ -+ sigemptyset(&new_mask); -+ sigaddset(&new_mask, SIGALRM); -+ sigprocmask(SIG_BLOCK, &new_mask, &old_mask); -+ -+ if (p->pid == USB_TOKEN_IN) { -+ devep |= 0x80; -+ mode = O_RDONLY; -+ shortpacket = 1; -+ } else { -+ mode = O_WRONLY; -+ } -+ -+ fd = ensure_ep_open(s, devep, mode); -+ if (fd < 0) { -+ sigprocmask(SIG_SETMASK, &old_mask, NULL); -+ return USB_RET_NODEV; -+ } -+ -+ if (ioctl(fd, USB_SET_TIMEOUT, &timeout) < 0) { -+#ifdef DEBUG -+ printf("handle_data: failed to set timeout - %s\n", -+ strerror(errno)); -+#endif -+ } -+ -+ if (shortpacket) { -+ if (ioctl(fd, USB_SET_SHORT_XFER, &one) < 0) { -+#ifdef DEBUG -+ printf("handle_data: failed to set short xfer mode - %s\n", -+ strerror(errno)); -+#endif -+ sigprocmask(SIG_SETMASK, &old_mask, NULL); -+ } -+ } -+ -+ if (p->pid == USB_TOKEN_IN) -+ ret = read(fd, p->data, p->len); -+ else -+ ret = write(fd, p->data, p->len); -+ -+ sigprocmask(SIG_SETMASK, &old_mask, NULL); -+ -+ if (ret < 0) { -+#ifdef DEBUG -+ printf("handle_data: error after %s data - %s\n", -+ pid == USB_TOKEN_IN ? "reading" : "writing", strerror(errno)); -+#endif -+ switch(errno) { -+ case ETIMEDOUT: -+ case EINTR: -+ return USB_RET_NAK; -+ default: -+ return USB_RET_STALL; -+ } -+ } else { -+ return ret; -+ } -+} -+ -+static void usb_host_handle_destroy(USBDevice *opaque) -+{ -+ USBHostDevice *s = (USBHostDevice *)opaque; -+ int i; -+ -+ for (i = 0; i < USB_MAX_ENDPOINTS; i++) -+ if (s->ep_fd[i] >= 0) -+ close(s->ep_fd[i]); -+ -+ if (s->devfd < 0) -+ return; -+ -+ close(s->devfd); -+ -+ qemu_free(s); -+} -+ -+USBDevice *usb_host_device_open(const char *devname) -+{ -+ struct usb_device_info bus_info, dev_info; -+ USBHostDevice *dev; -+ char ctlpath[PATH_MAX + 1]; -+ char buspath[PATH_MAX + 1]; -+ int bfd, dfd, bus, address, i; -+ int ugendebug = UGEN_DEBUG_LEVEL; -+ -+ if (usb_host_find_device(&bus, &address, devname) < 0) -+ return NULL; -+ -+ snprintf(buspath, PATH_MAX, "/dev/usb%d", bus); -+ -+ bfd = open(buspath, O_RDWR); -+ if (bfd < 0) { -+#ifdef DEBUG -+ printf("usb_host_device_open: failed to open usb bus - %s\n", -+ strerror(errno)); -+#endif -+ return NULL; -+ } -+ -+ bus_info.udi_addr = address; -+ if (ioctl(bfd, USB_DEVICEINFO, &bus_info) < 0) { -+#ifdef DEBUG -+ printf("usb_host_device_open: failed to grab bus information - %s\n", -+ strerror(errno)); -+#endif -+ return NULL; -+ } -+ -+#if __FreeBSD__ -+ snprintf(ctlpath, PATH_MAX, "/dev/%s", bus_info.udi_devnames[0]); -+#else -+ snprintf(ctlpath, PATH_MAX, "/dev/%s.00", bus_info.udi_devnames[0]); -+#endif -+ -+ dfd = open(ctlpath, O_RDWR); -+ if (dfd < 0) { -+ dfd = open(ctlpath, O_RDONLY); -+ if (dfd < 0) { -+#ifdef DEBUG -+ printf("usb_host_device_open: failed to open usb device %s - %s\n", -+ ctlpath, strerror(errno)); -+#endif -+ } -+ } -+ -+ if (dfd >= 0) { -+ dev = qemu_mallocz(sizeof(USBHostDevice)); -+ if (!dev) -+ goto fail; -+ dev->devfd = dfd; -+ -+ if (ioctl(dfd, USB_GET_DEVICEINFO, &dev_info) < 0) { -+#ifdef DEBUG -+ printf("usb_host_device_open: failed to grab device info - %s\n", -+ strerror(errno)); -+#endif -+ goto fail; -+ } -+ -+ if (dev_info.udi_speed == 1) -+ dev->dev.speed = USB_SPEED_LOW - 1; -+ else -+ dev->dev.speed = USB_SPEED_FULL - 1; -+ -+ dev->dev.handle_packet = usb_generic_handle_packet; -+ -+ dev->dev.handle_reset = usb_host_handle_reset; -+ dev->dev.handle_control = usb_host_handle_control; -+ dev->dev.handle_data = usb_host_handle_data; -+ dev->dev.handle_destroy = usb_host_handle_destroy; -+ -+ if (strncmp(dev_info.udi_product, "product", 7) != 0) -+ pstrcpy(dev->dev.devname, sizeof(dev->dev.devname), -+ dev_info.udi_product); -+ else -+ snprintf(dev->dev.devname, sizeof(dev->dev.devname), -+ "host:%s", devname); -+ -+ pstrcpy(dev->devpath, sizeof(dev->devpath), "/dev/"); -+ strcat(dev->devpath, dev_info.udi_devnames[0]); -+ -+ /* Mark the endpoints as not yet open */ -+ for (i = 0; i < USB_MAX_ENDPOINTS; i++) -+ dev->ep_fd[i] = -1; -+ -+ ioctl(dfd, USB_SETDEBUG, &ugendebug); -+ -+ return (USBDevice *)dev; -+ } -+ -+fail: -+ return NULL; -+} -+ -+static int usb_host_scan(void *opaque, USBScanFunc *func) -+{ -+ struct usb_device_info bus_info; -+ struct usb_device_info dev_info; -+ uint16_t vendor_id, product_id, class_id, speed; -+ int bfd, dfd, bus, address; -+ char busbuf[20], devbuf[20], product_name[256]; -+ int ret = 0; -+ -+ for (bus = 0; bus < 10; bus++) { -+ -+ snprintf(busbuf, sizeof(busbuf) - 1, "/dev/usb%d", bus); -+ bfd = open(busbuf, O_RDWR); -+ if (bfd < 0) -+ continue; -+ -+ for (address = 1; address < 127; address++) { -+ -+ bus_info.udi_addr = address; -+ if (ioctl(bfd, USB_DEVICEINFO, &bus_info) < 0) -+ continue; -+ -+ /* only list devices that can be used by generic layer */ -+ if (strncmp(bus_info.udi_devnames[0], "ugen", 4) != 0) -+ continue; -+ -+#if __FreeBSD__ -+ 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]); -+#endif -+ -+ dfd = open(devbuf, O_RDONLY); -+ if (dfd < 0) { -+#ifdef DEBUG -+ printf("usb_host_scan: couldn't open device %s - %s\n", devbuf, -+ strerror(errno)); -+#endif -+ continue; -+ } -+ -+ if (ioctl(dfd, USB_GET_DEVICEINFO, &dev_info) < 0) -+ printf("usb_host_scan: couldn't get device information for %s - %s\n", -+ devbuf, strerror(errno)); -+ -+ // XXX: might need to fixup endianess of word values before copying over -+ -+ vendor_id = dev_info.udi_vendorNo; -+ product_id = dev_info.udi_productNo; -+ class_id = dev_info.udi_class; -+ speed = dev_info.udi_speed; -+ -+ if (strncmp(dev_info.udi_product, "product", 7) != 0) -+ pstrcpy(product_name, sizeof(product_name), -+ dev_info.udi_product); -+ else -+ product_name[0] = '\0'; -+ -+ ret = func(opaque, bus, address, class_id, vendor_id, -+ product_id, product_name, speed); -+ -+ close(dfd); -+ -+ if (ret) -+ goto the_end; -+ } -+ -+ close(bfd); -+ } -+ -+the_end: -+ return ret; -+} -+ -+typedef struct FindDeviceState { -+ int vendor_id; -+ int product_id; -+ int bus_num; -+ int addr; -+} FindDeviceState; -+ -+static int usb_host_find_device_scan(void *opaque, int bus_num, int addr, -+ int class_id, -+ int vendor_id, int product_id, -+ const char *product_name, int speed) -+{ -+ FindDeviceState *s = opaque; -+ if (vendor_id == s->vendor_id && -+ product_id == s->product_id) { -+ s->bus_num = bus_num; -+ s->addr = addr; -+ return 1; -+ } else { -+ return 0; -+ } -+} -+ -+ -+/* the syntax is : -+ 'bus.addr' (decimal numbers) or -+ 'vendor_id:product_id' (hexa numbers) */ -+static int usb_host_find_device(int *pbus_num, int *paddr, -+ const char *devname) -+{ -+ const char *p; -+ int ret; -+ FindDeviceState fs; -+ -+ p = strchr(devname, '.'); -+ if (p) { -+ *pbus_num = strtoul(devname, NULL, 0); -+ *paddr = strtoul(p + 1, NULL, 0); -+ return 0; -+ } -+ p = strchr(devname, ':'); -+ if (p) { -+ fs.vendor_id = strtoul(devname, NULL, 16); -+ fs.product_id = strtoul(p + 1, NULL, 16); -+ ret = usb_host_scan(&fs, usb_host_find_device_scan); -+ if (ret) { -+ *pbus_num = fs.bus_num; -+ *paddr = fs.addr; -+ return 0; -+ } -+ } -+ return -1; -+} -+ -+/**********************/ -+/* USB host device info */ -+ -+struct usb_class_info { -+ int class; -+ const char *class_name; -+}; -+ -+static const struct usb_class_info usb_class_info[] = { -+ { USB_CLASS_AUDIO, "Audio"}, -+ { USB_CLASS_COMM, "Communication"}, -+ { USB_CLASS_HID, "HID"}, -+ { USB_CLASS_HUB, "Hub" }, -+ { USB_CLASS_PHYSICAL, "Physical" }, -+ { USB_CLASS_PRINTER, "Printer" }, -+ { USB_CLASS_MASS_STORAGE, "Storage" }, -+ { USB_CLASS_CDC_DATA, "Data" }, -+ { USB_CLASS_APP_SPEC, "Application Specific" }, -+ { USB_CLASS_VENDOR_SPEC, "Vendor Specific" }, -+ { USB_CLASS_STILL_IMAGE, "Still Image" }, -+ { USB_CLASS_CSCID, "Smart Card" }, -+ { USB_CLASS_CONTENT_SEC, "Content Security" }, -+ { -1, NULL } -+}; -+ -+static const char *usb_class_str(uint8_t class) -+{ -+ const struct usb_class_info *p; -+ for (p = usb_class_info; p->class != -1; p++) { -+ if (p->class == class) -+ break; -+ } -+ return p->class_name; -+} -+ -+void usb_info_device(int bus_num, int addr, int class_id, -+ int vendor_id, int product_id, -+ const char *product_name, -+ int speed) -+{ -+ const char *class_str, *speed_str; -+ -+ switch(speed) { -+ case USB_SPEED_LOW: -+ speed_str = "1.5"; -+ break; -+ case USB_SPEED_FULL: -+ speed_str = "12"; -+ break; -+ case USB_SPEED_HIGH: -+ speed_str = "480"; -+ break; -+ default: -+ speed_str = "?"; -+ break; -+ } -+ -+ term_printf(" Device %d.%d, speed %s Mb/s\n", -+ bus_num, addr, speed_str); -+ class_str = usb_class_str(class_id); -+ if (class_str) -+ term_printf(" %s:", class_str); -+ else -+ term_printf(" Class %02x:", class_id); -+ term_printf(" USB device %04x:%04x", vendor_id, product_id); -+ if (product_name[0] != '\0') -+ term_printf(", %s", product_name); -+ term_printf("\n"); -+} -+ -+static int usb_host_info_device(void *opaque, int bus_num, int addr, -+ int class_id, -+ int vendor_id, int product_id, -+ const char *product_name, -+ int speed) -+{ -+ usb_info_device(bus_num, addr, class_id, vendor_id, product_id, -+ product_name, speed); -+ return 0; -+} -+ -+void usb_host_info(void) -+{ -+ usb_host_scan(NULL, usb_host_info_device); -+} -Index: qemu/usb-linux.c -@@ -23,7 +23,6 @@ - */ - #include "vl.h" - --#if defined(__linux__) - #include <dirent.h> - #include <sys/ioctl.h> - #include <linux/compiler.h> -@@ -505,18 +504,3 @@ - { - usb_host_scan(NULL, usb_host_info_device); - } -- --#else -- --void usb_host_info(void) --{ -- term_printf("USB host devices not supported\n"); --} -- --/* XXX: modify configure to compile the right host driver */ --USBDevice *usb_host_device_open(const char *devname) --{ -- return NULL; --} -- --#endif diff --git a/emulators/qemu-devel/files/patch-bt b/emulators/qemu-devel/files/patch-bt deleted file mode 100644 index 62e8924722b3..000000000000 --- a/emulators/qemu-devel/files/patch-bt +++ /dev/null @@ -1,103 +0,0 @@ -Index: qemu/vl.c -@@ -43,6 +43,9 @@ - #ifndef __APPLE__ - #include <libutil.h> - #endif -+#ifdef __FreeBSD__ -+#include <sys/module.h> -+#endif - #else - #include <linux/if.h> - #include <linux/if_tun.h> -@@ -1059,6 +1062,34 @@ - - #endif /* CONFIG_SLIRP */ - -+#ifdef __FreeBSD__ -+#define LOAD_QUIETLY 1 -+#define LOAD_VERBOSLY 2 -+ -+int -+loadmodules(int how, const char *module, ...) -+{ -+ int loaded = 0; -+ va_list ap; -+ -+ va_start(ap, module); -+#ifndef NO_MODULES -+ while (module != NULL) { -+ if (modfind(module) == -1) { -+ if (kldload(module) == -1) { -+ if (how == LOAD_VERBOSLY) -+ fprintf(stderr, "%s: Cannot load module\n", module); -+ } else -+ loaded++; -+ } -+ module = va_arg(ap, const char *); -+ } -+ va_end(ap); -+#endif -+ return loaded; -+} -+#endif -+ - #if !defined(_WIN32) - #ifdef _BSD - static int tun_open(char *ifname, int ifname_size) -@@ -1067,11 +1098,55 @@ - char *dev; - struct stat s; - -+#ifdef __FreeBSD__ -+ int i, kldtried = 0, enoentcount = 0, err = 0; -+ char dname[100]; -+#ifdef USE_DEVTAP -+ /* -+ * 5.x has /dev/tap, but that seems to just blindly increase its -+ * couter on every open() for some people(??), i.e. on every qemu run. -+ */ -+ i = -1; -+#else -+ i = 0; -+#endif -+ for (; i < 10; i++) { -+ if (i == -1) -+ strcpy(dname, "/dev/tap"); -+ else -+ snprintf(dname, sizeof dname, "%s%d", -+ "/dev/tap", i); -+ fd = open(dname, O_RDWR); -+ if (fd >= 0) -+ break; -+ else if (errno == ENXIO || errno == ENOENT) { -+ if (i == 0 && !kldtried++) { -+ /* -+ * Attempt to load the tunnel interface KLD if it isn't loaded -+ * already. -+ */ -+ if (loadmodules(LOAD_VERBOSLY, "if_tap", NULL)) -+ i = -1; -+ continue; -+ } -+ if (errno != ENOENT || ++enoentcount > 3) { -+ err = errno; -+ break; -+ } -+ } else -+ err = errno; -+ } -+ if (fd < 0) { -+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err)); -+ return -1; -+ } -+#else - fd = open("/dev/tap", O_RDWR); - if (fd < 0) { -- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n"); -+ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno)); - return -1; - } -+#endif - - fstat(fd, &s); - dev = devname(s.st_rdev, S_IFCHR); diff --git a/emulators/qemu-devel/files/patch-fbsd b/emulators/qemu-devel/files/patch-fbsd deleted file mode 100644 index 7195d62837b8..000000000000 --- a/emulators/qemu-devel/files/patch-fbsd +++ /dev/null @@ -1,139 +0,0 @@ -Index: qemu/Makefile -@@ -25,7 +25,10 @@ - DOCS= - endif - --all: $(TOOLS) $(DOCS) recurse-all -+all: bsd/libmath.a $(TOOLS) $(DOCS) recurse-all -+ -+bsd/libmath.a: -+ ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) - - subdir-%: dyngen$(EXESUF) - $(MAKE) -C $(subst subdir-,,$@) all -@@ -40,6 +43,7 @@ - - clean: - # avoid old build problems by removing potentially incorrect old files -+ ( cd bsd ; $(BSD_MAKE) clean ) - rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h - rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ - $(MAKE) -C tests clean -Index: qemu/Makefile.target -@@ -391,8 +391,8 @@ - VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld - endif - --$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a -- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) -+$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a -+ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a - - cocoa.o: cocoa.m - $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< -Index: qemu/fpu/softfloat-native.c -@@ -2,11 +2,16 @@ - context is supported */ - #include "softfloat.h" - #include <math.h> -+#if defined(__FreeBSD__) && __FreeBSD_version < 500000 -+#include <ieeefp.h> -+#endif - - void set_float_rounding_mode(int val STATUS_PARAM) - { - STATUS(float_rounding_mode) = val; --#if defined(_BSD) && !defined(__APPLE__) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) -+#if defined(_BSD) && !defined(__APPLE__) && !defined(__FreeBSD__) || \ -+ (defined(__FreeBSD__) && __FreeBSD_version < 500000) || \ -+ (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) - fpsetround(val); - #elif defined(__arm__) - /* nothing to do */ -@@ -22,7 +25,7 @@ - } - #endif - --#if defined(_BSD) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) -+#if (defined(_BSD) && !defined(__FreeBSD__)) || (defined(HOST_SOLARIS) && HOST_SOLARIS < 10) - #define lrint(d) ((int32_t)rint(d)) - #define llrint(d) ((int64_t)rint(d)) - #define lrintf(f) ((int32_t)rint(f)) -Index: qemu/fpu/softfloat-native.h -@@ -1,8 +1,28 @@ - /* Native implementation of soft float functions */ - #include <math.h> - --#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) -+#ifdef __FreeBSD__ -+#include <osreldate.h> -+long double fabsl(long double x); -+long double remainderl(long double x, long double y); -+long double sqrtl(long double x); -+long double rintl(long double x); -+long lrintl(long double x); -+long long llrintl(long double x); -+#endif -+ -+#if (defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ -+ defined(HOST_SOLARIS) - #include <ieeefp.h> -+#if defined(__FreeBSD__) -+#define isgreater(x, y) __builtin_isgreater((x), (y)) -+#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) -+#define isless(x, y) __builtin_isless((x), (y)) -+#define islessequal(x, y) __builtin_islessequal((x), (y)) -+#define islessgreater(x, y) __builtin_islessgreater((x), (y)) -+#define isunordered(x, y) __builtin_isunordered((x), (y)) -+#endif - #define fabsf(f) ((float)fabs(f)) - #else - #include <fenv.h> -@@ -60,7 +80,9 @@ - /*---------------------------------------------------------------------------- - | Software IEC/IEEE floating-point rounding mode. - *----------------------------------------------------------------------------*/ --#if (defined(_BSD) && !defined(__APPLE__)) || defined(HOST_SOLARIS) -+#if (defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000)) || \ -+ defined(HOST_SOLARIS) - enum { - float_round_nearest_even = FP_RN, - float_round_down = FP_RM, -Index: qemu/fpu/softfloat.h -@@ -84,7 +84,8 @@ - #define FLOAT128 - #else - /* native float support */ --#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) -+#if (defined(__i386__) || defined(__x86_64__)) && \ -+ (!defined(_BSD) || defined(__FreeBSD__)) - #define FLOATX80 - #endif - #endif /* !CONFIG_SOFTFLOAT */ -Index: qemu/target-ppc/op_helper.c -@@ -303,6 +303,13 @@ - FT0 = sqrt(FT0); - } - -+#ifndef isnormal -+#define isnormal(x) \ -+ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ -+ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ -+ : __isnormall(x)) -+#endif -+ - void do_fres (void) - { - union { -Index: qemu/x86_64.ld -@@ -2,7 +2,7 @@ - OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") - OUTPUT_ARCH(i386:x86-64) - ENTRY(_start) --SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); -+SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); - SECTIONS - { - /* Read-only sections, merged into text segment: */ diff --git a/emulators/qemu-devel/files/patch-fpu-softfloat-native.c b/emulators/qemu-devel/files/patch-fpu-softfloat-native.c deleted file mode 100644 index 0a7f3018835c..000000000000 --- a/emulators/qemu-devel/files/patch-fpu-softfloat-native.c +++ /dev/null @@ -1,17 +0,0 @@ -Index: qemu/fpu/softfloat-native.c -@@ -228,7 +228,15 @@ - *----------------------------------------------------------------------------*/ - float64 float64_trunc_to_int( float64 a STATUS_PARAM ) - { -+#if defined(__FreeBSD__) && __FreeBSD__ <= 4 -+ float64 ret; -+ fpsetround(FP_RZ); -+ ret = rint(a); -+ fpsetround(STATUS(float_rounding_mode)); -+ return ret; -+#else - return trunc(a); -+#endif - } - - float64 float64_round_to_int( float64 a STATUS_PARAM )
\ No newline at end of file diff --git a/emulators/qemu-devel/files/patch-libmath b/emulators/qemu-devel/files/patch-libmath deleted file mode 100644 index e7e5cfb64034..000000000000 --- a/emulators/qemu-devel/files/patch-libmath +++ /dev/null @@ -1,2524 +0,0 @@ -diff -Nru qemu-0.7.0/bsd.orig/Makefile qemu-0.7.0/bsd/Makefile ---- qemu-0.7.0/bsd.orig/Makefile Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/Makefile Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+SRCS= ${MACHINE_ARCH}/e_atan2l.c \ -+ ${MACHINE_ARCH}/e_logl.S \ -+ ${MACHINE_ARCH}/e_powl.S \ -+ ${MACHINE_ARCH}/e_remainderl.S \ -+ ${MACHINE_ARCH}/e_sqrtl.c \ -+ ${MACHINE_ARCH}/s_ceill.S \ -+ ${MACHINE_ARCH}/s_cosl.S \ -+ ${MACHINE_ARCH}/s_floorl.S \ -+ ${MACHINE_ARCH}/s_isnormal.c \ -+ ${MACHINE_ARCH}/s_llrint.S \ -+ ${MACHINE_ARCH}/s_llrintf.S \ -+ ${MACHINE_ARCH}/s_llrintl.S \ -+ ${MACHINE_ARCH}/s_lrint.S \ -+ ${MACHINE_ARCH}/s_lrintf.S \ -+ ${MACHINE_ARCH}/s_lrintl.S \ -+ ${MACHINE_ARCH}/s_rintl.c \ -+ ${MACHINE_ARCH}/s_round.c \ -+ ${MACHINE_ARCH}/s_sinl.S \ -+ ${MACHINE_ARCH}/s_tanl.S -+ -+OBJS= ${SRCS:R:S/$/.o/} -+ -+CFLAGS+= -I. -+ -+all: libmath.a -+ -+libmath.a: ${OBJS} -+ rm -f $@ -+ ${AR} rcs $@ ${OBJS:T} -+ -+clean: -+ rm -f ${OBJS:T} libmath.a -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_atan2l.c qemu-0.7.0/bsd/amd64/e_atan2l.c ---- qemu-0.7.0/bsd.orig/amd64/e_atan2l.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_atan2l.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_atan2l (long double y, long double x) -+{ -+ long double res; -+ -+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_atan2l, atan2l) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_logl.S qemu-0.7.0/bsd/amd64/e_logl.S ---- qemu-0.7.0/bsd.orig/amd64/e_logl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_logl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,59 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ /* It is not important that this constant is precise. It is only -+ a value which is known to be on the safe side for using the -+ fyl2xp1 instruction. */ -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ -+ -+#ifdef PIC -+#define MO(op) op##(%rip) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_logl) -+ fldln2 // log(2) -+ fldt 8(%rsp) // x : log(2) -+ fld %st // x : x : log(2) -+ fsubl MO(one) // x-1 : x : log(2) -+ fld %st // x-1 : x-1 : x : log(2) -+ fabs // |x-1| : x-1 : x : log(2) -+ fcompl MO(limit) // x-1 : x : log(2) -+ fnstsw // x-1 : x : log(2) -+ andb $0x45, %ah -+ jz 2f -+ fstp %st(1) // x-1 : log(2) -+ fyl2xp1 // log(x) -+ ret -+ -+2: fstp %st(0) // x : log(2) -+ fyl2x // log(x) -+ ret -+END (__ieee754_logl) -+ -+weak_alias(__ieee754_logl,logl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_powl.S qemu-0.7.0/bsd/amd64/e_powl.S ---- qemu-0.7.0/bsd.orig/amd64/e_powl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_powl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,341 @@ -+/* ix87 specific implementation of pow function. -+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(infinity,@object) -+inf_zero: -+infinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f -+ ASM_SIZE_DIRECTIVE(infinity) -+ ASM_TYPE_DIRECTIVE(zero,@object) -+zero: .double 0.0 -+ ASM_SIZE_DIRECTIVE(zero) -+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) -+minf_mzero: -+minfinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff -+mzero: -+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 -+ ASM_SIZE_DIRECTIVE(minf_mzero) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ ASM_TYPE_DIRECTIVE(p63,@object) -+p63: -+ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 -+ ASM_SIZE_DIRECTIVE(p63) -+ -+#ifdef PIC -+#define MO(op) op##(%rip) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_powl) -+ fldt 24(%rsp) // y -+ fxam -+ -+ -+ fnstsw -+ movb %ah, %dl -+ andb $0x45, %ah -+ cmpb $0x40, %ah // is y == 0 ? -+ je 11f -+ -+ cmpb $0x05, %ah // is y == ±inf ? -+ je 12f -+ -+ cmpb $0x01, %ah // is y == NaN ? -+ je 30f -+ -+ fldt 8(%rsp) // x : y -+ -+ fxam -+ fnstsw -+ movb %ah, %dh -+ andb $0x45, %ah -+ cmpb $0x40, %ah -+ je 20f // x is ±0 -+ -+ cmpb $0x05, %ah -+ je 15f // x is ±inf -+ -+ fxch // y : x -+ -+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ -+ fldl MO(p63) // 1L<<63 : y : x -+ fld %st(1) // y : 1L<<63 : y : x -+ fabs // |y| : 1L<<63 : y : x -+ fcomip %st(1), %st // 1L<<63 : y : x -+ fstp %st(0) // y : x -+ jnc 2f -+ -+ /* First see whether `y' is a natural number. In this case we -+ can use a more precise algorithm. */ -+ fld %st // y : y : x -+ fistpll -8(%rsp) // y : x -+ fildll -8(%rsp) // int(y) : y : x -+ fucomip %st(1),%st // y : x -+ jne 2f -+ -+ /* OK, we have an integer value for y. */ -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ orl $0, %edx -+ fstp %st(0) // x -+ jns 4f // y >= 0, jump -+ fdivrl MO(one) // 1/x (now referred to as x) -+ negl %eax -+ adcl $0, %edx -+ negl %edx -+4: fldl MO(one) // 1 : x -+ fxch -+ -+6: shrdl $1, %edx, %eax -+ jnc 5f -+ fxch -+ fmul %st(1) // x : ST*x -+ fxch -+5: fmul %st(0), %st // x*x : ST*x -+ shrl $1, %edx -+ movl %eax, %ecx -+ orl %edx, %ecx -+ jnz 6b -+ fstp %st(0) // ST*x -+ ret -+ -+ /* y is ±NAN */ -+30: fldt 8(%rsp) // x : y -+ fldl MO(one) // 1.0 : x : y -+ fucomip %st(1),%st // x : y -+ je 31f -+ fxch // y : x -+31: fstp %st(1) -+ ret -+ -+ .align ALIGNARG(4) -+2: /* y is a real number. */ -+ fxch // x : y -+ fldl MO(one) // 1.0 : x : y -+ fld %st(1) // x : 1.0 : x : y -+ fsub %st(1) // x-1 : 1.0 : x : y -+ fabs // |x-1| : 1.0 : x : y -+ fcompl MO(limit) // 1.0 : x : y -+ fnstsw -+ fxch // x : 1.0 : y -+ test $4500,%eax -+ jz 7f -+ fsub %st(1) // x-1 : 1.0 : y -+ fyl2xp1 // log2(x) : y -+ jmp 8f -+ -+7: fyl2x // log2(x) : y -+8: fmul %st(1) // y*log2(x) : y -+ fxam -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? -+ je 28f -+ fst %st(1) // y*log2(x) : y*log2(x) -+ frndint // int(y*log2(x)) : y*log2(x) -+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) -+ fxch // fract(y*log2(x)) : int(y*log2(x)) -+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) -+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) -+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) -+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) -+ ret -+ -+28: fstp %st(1) // y*log2(x) -+ fldl MO(one) // 1 : y*log2(x) -+ fscale // 2^(y*log2(x)) : y*log2(x) -+ fstp %st(1) // 2^(y*log2(x)) -+ ret -+ -+ // pow(x,±0) = 1 -+ .align ALIGNARG(4) -+11: fstp %st(0) // pop y -+ fldl MO(one) -+ ret -+ -+ // y == ±inf -+ .align ALIGNARG(4) -+12: fstp %st(0) // pop y -+ fldt 8(%rsp) // x -+ fabs -+ fcompl MO(one) // < 1, == 1, or > 1 -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x45, %ah -+ je 13f // jump if x is NaN -+ -+ cmpb $0x40, %ah -+ je 14f // jump if |x| == 1 -+ -+ shlb $1, %ah -+ xorb %ah, %dl -+ andl $2, %edx -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rdx, 4) -+#else -+ fldl inf_zero(,%rdx, 4) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+14: fldl MO(one) -+ ret -+ -+ .align ALIGNARG(4) -+13: fldt 8(%rsp) // load x == NaN -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±inf -+15: fstp %st(0) // y -+ testb $2, %dh -+ jz 16f // jump if x == +inf -+ -+ // We must find out whether y is an odd integer. -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 17f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp), %eax -+ mov -4(%rsp), %edx -+ andb $1, %al -+ jz 18f // jump if not odd -+ // It's an odd integer. -+ shrl $31, %edx -+#ifdef PIC -+ lea minf_mzero(%rip),%rcx -+ fldl (%rcx, %rdx, 8) -+#else -+ fldl minf_mzero(,%rdx, 8) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+16: fcompl MO(zero) -+ fnstsw -+ shrl $5, %eax -+ andl $8, %eax -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rax, 1) -+#else -+ fldl inf_zero(,%rax, 1) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+17: shll $30, %edx // sign bit for y in right position -+18: shrl $31, %edx -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rdx, 8) -+#else -+ fldl inf_zero(,%rdx, 8) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 -+20: fstp %st(0) // y -+ testb $2, %dl -+ jz 21f // y > 0 -+ -+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. -+ testb $2, %dh -+ jz 25f -+ -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 26f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ andb $1, %al -+ jz 27f // jump if not odd -+ // It's an odd integer. -+ // Raise divide-by-zero exception and get minus infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ fchs -+ ret -+ -+25: fstp %st(0) -+26: -+27: // Raise divide-by-zero exception and get infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. -+21: testb $2, %dh -+ jz 22f -+ -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 23f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ andb $1, %al -+ jz 24f // jump if not odd -+ // It's an odd integer. -+ fldl MO(mzero) -+ ret -+ -+22: fstp %st(0) -+23: -+24: fldl MO(zero) -+ ret -+ -+END(__ieee754_powl) -+ -+weak_alias(__ieee754_powl,powl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_remainderl.S qemu-0.7.0/bsd/amd64/e_remainderl.S ---- qemu-0.7.0/bsd.orig/amd64/e_remainderl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_remainderl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,23 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ENTRY(__ieee754_remainderl) -+ fldt 24(%rsp) -+ fldt 8(%rsp) -+1: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 1b -+ fstp %st(1) -+ ret -+END (__ieee754_remainderl) -+ -+weak_alias(__ieee754_remainderl,remainderl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c qemu-0.7.0/bsd/amd64/e_sqrtl.c ---- qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_sqrtl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_sqrtl (long double x) -+{ -+ long double res; -+ -+ asm ("fsqrt" : "=t" (res) : "0" (x)); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_sqrtl,sqrtl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_ceill.S qemu-0.7.0/bsd/amd64/s_ceill.S ---- qemu-0.7.0/bsd.orig/amd64/s_ceill.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_ceill.S Fri Apr 29 02:22:18 2005 -@@ -0,0 +1,246 @@ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunPro, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ * -+ * From: @(#)s_ceil.c 5.1 93/09/24 -+ */ -+/* XXX: generated from src/lib/msun/src/s_ceill.c */ -+ -+#include <machine/asm.h> -+ -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ .file "s_ceill.c" -+ .section .rodata.cst8,"aM",@progbits,8 -+ .p2align 3 -+.LC0: -+ .long 2281731484 -+ .long 2117592124 -+ .text -+ .p2align 4,,15 -+.globl ceill -+ .type ceill, @function -+ceill: -+.LFB17: -+ pushq %rbp -+.LCFI0: -+ pushq %rbx -+.LCFI1: -+ fldt 24(%rsp) -+ movq $0, -16(%rsp) -+ fld %st(0) -+ fstpt -40(%rsp) -+ movl -32(%rsp), %edi -+ movq -40(%rsp), %rsi -+ movl %edi, -16(%rsp) -+ movl -16(%rsp), %r11d -+ movq %rsi, -24(%rsp) -+ movl %r11d, %r10d -+ andl $32767, %r10d -+ leal -16383(%r10), %r8d -+ cmpl $30, %r8d -+ jg .L2 -+ testl %r8d, %r8d -+ js .L38 -+ movl -20(%rsp), %r9d -+ leal 1(%r8), %ecx -+ mov -24(%rsp), %eax -+ movl $4294967295, %ebp -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbp -+ mov %r9d, %ebx -+ movq %rbx, %rdx -+ andq %rbp, %rdx -+ orq %rax, %rdx -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ jne .L12 -+ movl $31, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ addl %eax, %r9d -+ mov %r9d, %eax -+ cmpq %rbx, %rax -+ jae .L32 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %r9d -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L32: -+ movl %r9d, -20(%rsp) -+.L12: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebp, %eax -+ movl $0, -24(%rsp) -+ notl %eax -+ andl %eax, %r9d -+ movl %r9d, -20(%rsp) -+ .p2align 4,,7 -+.L31: -+ movq -24(%rsp), %rsi -+ movl -16(%rsp), %edi -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L2: -+ cmpl $62, %r8d -+ jle .L45 -+.L44: -+ ffreep %st(0) -+.L17: -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L45: -+ movl -24(%rsp), %edx -+ leal 1(%r8), %ecx -+ movq $-1, %rbx -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbx -+ mov %edx, %r9d -+ testq %rbx, %r9 -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ jne .L20 -+ cmpl $31, %r8d -+ je .L36 -+ movl $63, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ leal (%rdx,%rax), %eax -+ movl %eax, -24(%rsp) -+ mov %eax, %eax -+ cmpq %r9, %rax -+ jae .L20 -+.L36: -+ movl -20(%rsp), %eax -+ leal 1(%rax), %ecx -+ cmpl %eax, %ecx -+ jae .L34 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %ecx -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L34: -+ movl %ecx, -20(%rsp) -+ .p2align 4,,7 -+.L20: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebx, %eax -+ notl %eax -+ andl %eax, -24(%rsp) -+ jmp .L31 -+ .p2align 4,,7 -+.L42: -+ fstp %st(1) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L38: -+ fldl .LC0(%rip) -+ faddp %st, %st(1) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ jbe .L44 -+ testl %r10d, %r10d -+ jle .L39 -+.L7: -+ movabsq $-9223372036854775808, %rsi -+ movl $16383, %edi -+ testb $-128, -15(%rsp) -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ fcmovne %st(1), %st -+ fstp %st(1) -+ fstpt -40(%rsp) -+ movq -40(%rsp), %rsi -+ movl -32(%rsp), %edi -+ movq %rsi, -24(%rsp) -+ movl %edi, -16(%rsp) -+ jmp .L17 -+.L39: -+ movl -24(%rsp), %eax -+ orl -20(%rsp), %eax -+ je .L44 -+ jmp .L7 -+.LFE17: -+ .size ceill, .-ceill -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .p2align 3 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .quad .LFB17 -+ .quad .LFE17-.LFB17 -+ .byte 0x4 -+ .long .LCFI0-.LFB17 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xe -+ .uleb128 0x18 -+ .byte 0x83 -+ .uleb128 0x3 -+ .byte 0x86 -+ .uleb128 0x2 -+ .p2align 3 -+.LEFDE1: -+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_cosl.S qemu-0.7.0/bsd/amd64/s_cosl.S ---- qemu-0.7.0/bsd.orig/amd64/s_cosl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_cosl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,33 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__cosl) -+ fldt 8(%rsp) -+ fcos -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fcos -+ ret -+END (__cosl) -+weak_alias (__cosl, cosl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_floorl.S qemu-0.7.0/bsd/amd64/s_floorl.S ---- qemu-0.7.0/bsd.orig/amd64/s_floorl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_floorl.S Fri Apr 29 02:24:32 2005 -@@ -0,0 +1,247 @@ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunPro, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ * -+ * From: @(#)s_floor.c 5.1 93/09/24 -+ */ -+/* XXX: generated from src/lib/msun/src/s_floorl.c */ -+ -+#include <machine/asm.h> -+ -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ .file "s_floorl.c" -+ .section .rodata.cst8,"aM",@progbits,8 -+ .p2align 3 -+.LC0: -+ .long 2281731484 -+ .long 2117592124 -+ .section .rodata.cst4,"aM",@progbits,4 -+ .p2align 2 -+.LC2: -+ .long 3212836864 -+ .text -+ .p2align 4,,15 -+.globl floorl -+ .type floorl, @function -+floorl: -+.LFB17: -+ pushq %rbp -+.LCFI0: -+ pushq %rbx -+.LCFI1: -+ fldt 24(%rsp) -+ movq $0, -16(%rsp) -+ fld %st(0) -+ fstpt -40(%rsp) -+ movl -32(%rsp), %edi -+ movq -40(%rsp), %rsi -+ movl %edi, -16(%rsp) -+ movl -16(%rsp), %r11d -+ movq %rsi, -24(%rsp) -+ movl %r11d, %r10d -+ andl $32767, %r10d -+ leal -16383(%r10), %r8d -+ cmpl $30, %r8d -+ jg .L2 -+ testl %r8d, %r8d -+ js .L38 -+ movl -20(%rsp), %r9d -+ leal 1(%r8), %ecx -+ mov -24(%rsp), %eax -+ movl $4294967295, %ebp -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbp -+ mov %r9d, %ebx -+ movq %rbx, %rdx -+ andq %rbp, %rdx -+ orq %rax, %rdx -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ je .L12 -+ movl $31, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ addl %eax, %r9d -+ mov %r9d, %eax -+ cmpq %rbx, %rax -+ jae .L32 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %r9d -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L32: -+ movl %r9d, -20(%rsp) -+.L12: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebp, %eax -+ movl $0, -24(%rsp) -+ notl %eax -+ andl %eax, %r9d -+ movl %r9d, -20(%rsp) -+ .p2align 4,,7 -+.L31: -+ movq -24(%rsp), %rsi -+ movl -16(%rsp), %edi -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L2: -+ cmpl $62, %r8d -+ jle .L45 -+.L44: -+ ffreep %st(0) -+.L17: -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L45: -+ movl -24(%rsp), %edx -+ leal 1(%r8), %ecx -+ movq $-1, %rbx -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbx -+ mov %edx, %r9d -+ testq %rbx, %r9 -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ je .L20 -+ cmpl $31, %r8d -+ je .L36 -+ movl $63, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ leal (%rdx,%rax), %eax -+ movl %eax, -24(%rsp) -+ mov %eax, %eax -+ cmpq %r9, %rax -+ jae .L20 -+.L36: -+ movl -20(%rsp), %eax -+ leal 1(%rax), %ecx -+ cmpl %eax, %ecx -+ jae .L34 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %ecx -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L34: -+ movl %ecx, -20(%rsp) -+ .p2align 4,,7 -+.L20: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebx, %eax -+ notl %eax -+ andl %eax, -24(%rsp) -+ jmp .L31 -+ .p2align 4,,7 -+.L42: -+ fstp %st(1) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L38: -+ fldl .LC0(%rip) -+ faddp %st, %st(1) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ jbe .L44 -+ testl %r10d, %r10d -+ jle .L39 -+.L7: -+ testb $-128, -15(%rsp) -+ je .L9 -+ ffreep %st(0) -+ flds .LC2(%rip) -+.L9: -+ fstpt -40(%rsp) -+ movq -40(%rsp), %rsi -+ movl -32(%rsp), %edi -+ movq %rsi, -24(%rsp) -+ movl %edi, -16(%rsp) -+ jmp .L17 -+.L39: -+ movl -24(%rsp), %eax -+ orl -20(%rsp), %eax -+ je .L44 -+ jmp .L7 -+.LFE17: -+ .size floorl, .-floorl -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .p2align 3 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .quad .LFB17 -+ .quad .LFE17-.LFB17 -+ .byte 0x4 -+ .long .LCFI0-.LFB17 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xe -+ .uleb128 0x18 -+ .byte 0x83 -+ .uleb128 0x3 -+ .byte 0x86 -+ .uleb128 0x2 -+ .p2align 3 -+.LEFDE1: -+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_isnormal.c qemu-0.7.0/bsd/amd64/s_isnormal.c ---- qemu-0.7.0/bsd.orig/amd64/s_isnormal.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_isnormal.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,85 @@ -+/*- -+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org> -+ * Copyright (c) 2002-2004 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $ -+ */ -+ -+union IEEEf2bits { -+ float f; -+ struct { -+ unsigned int man :23; -+ unsigned int exp :8; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEd2bits { -+ double d; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :20; -+ unsigned int exp :11; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEl2bits { -+ long double e; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :32; -+ unsigned int exp :15; -+ unsigned int sign :1; -+ unsigned int junk :16; -+ } bits; -+}; -+ -+int -+__isnormal(double d) -+{ -+ union IEEEd2bits u; -+ -+ u.d = d; -+ return (u.bits.exp != 0 && u.bits.exp != 2047); -+} -+ -+int -+__isnormalf(float f) -+{ -+ union IEEEf2bits u; -+ -+ u.f = f; -+ return (u.bits.exp != 0 && u.bits.exp != 255); -+} -+ -+int -+__isnormall(long double e) -+{ -+ union IEEEl2bits u; -+ -+ u.e = e; -+ return (u.bits.exp != 0 && u.bits.exp != 32767); -+} -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrint.S qemu-0.7.0/bsd/amd64/s_llrint.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,6 @@ -+#include <machine/asm.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+/* sizeof(long) == sizeof(long long) */ -+#define fn llrint -+#include "s_lrint.S" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintf.S qemu-0.7.0/bsd/amd64/s_llrintf.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,6 @@ -+#include <machine/asm.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+/* sizeof(long) == sizeof(long long) */ -+#define fn llrintf -+#include "s_lrintf.S" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintl.S qemu-0.7.0/bsd/amd64/s_llrintl.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997, 2002 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__llrintl) -+ fldt 8(%rsp) -+ fistpll -8(%rsp) -+ fwait -+ movq -8(%rsp),%rax -+ ret -+END(__llrintl) -+weak_alias (__llrintl, llrintl) -+strong_alias (__llrintl, __lrintl) -+weak_alias (__llrintl, lrintl) -+ -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrint.S qemu-0.7.0/bsd/amd64/s_lrint.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+ -+#ifndef fn -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+#define fn lrint -+#endif -+ -+ENTRY(fn) -+ cvtsd2si %xmm0, %rax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintf.S qemu-0.7.0/bsd/amd64/s_lrintf.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+ -+#ifndef fn -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+#define fn lrintf -+#endif -+ -+ENTRY(fn) -+ cvtss2si %xmm0, %rax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintl.S qemu-0.7.0/bsd/amd64/s_lrintl.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1 @@ -+/* Not needed, see s_llrintl.S. */ -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_rintl.c qemu-0.7.0/bsd/amd64/s_rintl.c ---- qemu-0.7.0/bsd.orig/amd64/s_rintl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_rintl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,18 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com> -+ * Public domain. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__rintl (long double x) -+{ -+ long double res; -+ -+ asm ("frndint" : "=t" (res) : "0" (x)); -+ return res; -+} -+ -+weak_alias (__rintl, rintl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_round.c qemu-0.7.0/bsd/amd64/s_round.c ---- qemu-0.7.0/bsd.orig/amd64/s_round.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_round.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,51 @@ -+/*- -+ * Copyright (c) 2003, Steven G. Kargl -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice unmodified, this list of conditions, and the following -+ * disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include <sys/cdefs.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $"); -+ -+#include <math.h> -+ -+double -+round(double x) -+{ -+ double t; -+ -+ if (!isfinite(x)) -+ return (x); -+ -+ if (x >= 0.0) { -+ t = floor(x); -+ if (t - x <= -0.5) -+ t += 1.0; -+ return (t); -+ } else { -+ t = floor(-x); -+ if (t + x <= -0.5) -+ t += 1.0; -+ return (-t); -+ } -+} -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_sinl.S qemu-0.7.0/bsd/amd64/s_sinl.S ---- qemu-0.7.0/bsd.orig/amd64/s_sinl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_sinl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,31 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ENTRY(__sinl) -+ fldt 8(%rsp) -+ fsin -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fsin -+ ret -+END (__sinl) -+weak_alias (__sinl, sinl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_tanl.S qemu-0.7.0/bsd/amd64/s_tanl.S ---- qemu-0.7.0/bsd.orig/amd64/s_tanl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_tanl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,34 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__tanl) -+ fldt 8(%rsp) -+ fptan -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ fstp %st(0) -+ ret -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fptan -+ fstp %st(0) -+ ret -+END (__tanl) -+weak_alias (__tanl, tanl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_atan2l.c qemu-0.7.0/bsd/i386/e_atan2l.c ---- qemu-0.7.0/bsd.orig/i386/e_atan2l.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_atan2l.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_atan2l (long double y, long double x) -+{ -+ long double res; -+ -+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_atan2l, atan2l) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_logl.S qemu-0.7.0/bsd/i386/e_logl.S ---- qemu-0.7.0/bsd.orig/i386/e_logl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_logl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,63 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ /* It is not important that this constant is precise. It is only -+ a value which is known to be on the safe side for using the -+ fyl2xp1 instruction. */ -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ -+ -+#ifdef PIC -+#define MO(op) op##@GOTOFF(%edx) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_logl) -+ fldln2 // log(2) -+ fldt 4(%esp) // x : log(2) -+#ifdef PIC -+ call 1f -+1: popl %edx -+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx -+#endif -+ fld %st // x : x : log(2) -+ fsubl MO(one) // x-1 : x : log(2) -+ fld %st // x-1 : x-1 : x : log(2) -+ fabs // |x-1| : x-1 : x : log(2) -+ fcompl MO(limit) // x-1 : x : log(2) -+ fnstsw // x-1 : x : log(2) -+ andb $0x45, %ah -+ jz 2f -+ fstp %st(1) // x-1 : log(2) -+ fyl2xp1 // log(x) -+ ret -+ -+2: fstp %st(0) // x : log(2) -+ fyl2x // log(x) -+ ret -+END (__ieee754_logl) -+ -+weak_alias(__ieee754_logl,logl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_powl.S qemu-0.7.0/bsd/i386/e_powl.S ---- qemu-0.7.0/bsd.orig/i386/e_powl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_powl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,341 @@ -+/* ix87 specific implementation of pow function. -+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 -+ Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(infinity,@object) -+inf_zero: -+infinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f -+ ASM_SIZE_DIRECTIVE(infinity) -+ ASM_TYPE_DIRECTIVE(zero,@object) -+zero: .double 0.0 -+ ASM_SIZE_DIRECTIVE(zero) -+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) -+minf_mzero: -+minfinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff -+mzero: -+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 -+ ASM_SIZE_DIRECTIVE(minf_mzero) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ ASM_TYPE_DIRECTIVE(p63,@object) -+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 -+ ASM_SIZE_DIRECTIVE(p63) -+ -+#ifdef PIC -+#define MO(op) op##@GOTOFF(%ecx) -+#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) -+#else -+#define MO(op) op -+#define MOX(op,x,f) op(,x,f) -+#endif -+ -+ .text -+ENTRY(__ieee754_powl) -+ fldt 16(%esp) // y -+ fxam -+ -+#ifdef PIC -+ call 1f -+1: popl %ecx -+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx -+#endif -+ -+ fnstsw -+ movb %ah, %dl -+ andb $0x45, %ah -+ cmpb $0x40, %ah // is y == 0 ? -+ je 11f -+ -+ cmpb $0x05, %ah // is y == ±inf ? -+ je 12f -+ -+ cmpb $0x01, %ah // is y == NaN ? -+ je 30f -+ -+ fldt 4(%esp) // x : y -+ -+ subl $8,%esp -+ -+ fxam -+ fnstsw -+ movb %ah, %dh -+ andb $0x45, %ah -+ cmpb $0x40, %ah -+ je 20f // x is ±0 -+ -+ cmpb $0x05, %ah -+ je 15f // x is ±inf -+ -+ fxch // y : x -+ -+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ -+ fld %st // y : y : x -+ fabs // |y| : y : x -+ fcompl MO(p63) // y : x -+ fnstsw -+ sahf -+ jnc 2f -+ -+ /* First see whether `y' is a natural number. In this case we -+ can use a more precise algorithm. */ -+ fld %st // y : y : x -+ fistpll (%esp) // y : x -+ fildll (%esp) // int(y) : y : x -+ fucomp %st(1) // y : x -+ fnstsw -+ sahf -+ jne 2f -+ -+ /* OK, we have an integer value for y. */ -+ popl %eax -+ popl %edx -+ orl $0, %edx -+ fstp %st(0) // x -+ jns 4f // y >= 0, jump -+ fdivrl MO(one) // 1/x (now referred to as x) -+ negl %eax -+ adcl $0, %edx -+ negl %edx -+4: fldl MO(one) // 1 : x -+ fxch -+ -+6: shrdl $1, %edx, %eax -+ jnc 5f -+ fxch -+ fmul %st(1) // x : ST*x -+ fxch -+5: fmul %st(0), %st // x*x : ST*x -+ shrl $1, %edx -+ movl %eax, %ecx -+ orl %edx, %ecx -+ jnz 6b -+ fstp %st(0) // ST*x -+ ret -+ -+ /* y is ±NAN */ -+30: fldt 4(%esp) // x : y -+ fldl MO(one) // 1.0 : x : y -+ fucomp %st(1) // x : y -+ fnstsw -+ sahf -+ je 31f -+ fxch // y : x -+31: fstp %st(1) -+ ret -+ -+ .align ALIGNARG(4) -+2: /* y is a real number. */ -+ fxch // x : y -+ fldl MO(one) // 1.0 : x : y -+ fld %st(1) // x : 1.0 : x : y -+ fsub %st(1) // x-1 : 1.0 : x : y -+ fabs // |x-1| : 1.0 : x : y -+ fcompl MO(limit) // 1.0 : x : y -+ fnstsw -+ fxch // x : 1.0 : y -+ sahf -+ ja 7f -+ fsub %st(1) // x-1 : 1.0 : y -+ fyl2xp1 // log2(x) : y -+ jmp 8f -+ -+7: fyl2x // log2(x) : y -+8: fmul %st(1) // y*log2(x) : y -+ fxam -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? -+ je 28f -+ fst %st(1) // y*log2(x) : y*log2(x) -+ frndint // int(y*log2(x)) : y*log2(x) -+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) -+ fxch // fract(y*log2(x)) : int(y*log2(x)) -+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) -+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) -+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) -+ addl $8, %esp -+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) -+ ret -+ -+28: fstp %st(1) // y*log2(x) -+ fldl MO(one) // 1 : y*log2(x) -+ fscale // 2^(y*log2(x)) : y*log2(x) -+ addl $8, %esp -+ fstp %st(1) // 2^(y*log2(x)) -+ ret -+ -+ // pow(x,±0) = 1 -+ .align ALIGNARG(4) -+11: fstp %st(0) // pop y -+ fldl MO(one) -+ ret -+ -+ // y == ±inf -+ .align ALIGNARG(4) -+12: fstp %st(0) // pop y -+ fldt 4(%esp) // x -+ fabs -+ fcompl MO(one) // < 1, == 1, or > 1 -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x45, %ah -+ je 13f // jump if x is NaN -+ -+ cmpb $0x40, %ah -+ je 14f // jump if |x| == 1 -+ -+ shlb $1, %ah -+ xorb %ah, %dl -+ andl $2, %edx -+ fldl MOX(inf_zero, %edx, 4) -+ ret -+ -+ .align ALIGNARG(4) -+14: fldl MO(one) -+ ret -+ -+ .align ALIGNARG(4) -+13: fldt 4(%esp) // load x == NaN -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±inf -+15: fstp %st(0) // y -+ testb $2, %dh -+ jz 16f // jump if x == +inf -+ -+ // We must find out whether y is an odd integer. -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 17f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 18f // jump if not odd -+ // It's an odd integer. -+ shrl $31, %edx -+ fldl MOX(minf_mzero, %edx, 8) -+ ret -+ -+ .align ALIGNARG(4) -+16: fcompl MO(zero) -+ addl $8, %esp -+ fnstsw -+ shrl $5, %eax -+ andl $8, %eax -+ fldl MOX(inf_zero, %eax, 1) -+ ret -+ -+ .align ALIGNARG(4) -+17: shll $30, %edx // sign bit for y in right position -+ addl $8, %esp -+18: shrl $31, %edx -+ fldl MOX(inf_zero, %edx, 8) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 -+20: fstp %st(0) // y -+ testb $2, %dl -+ jz 21f // y > 0 -+ -+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. -+ testb $2, %dh -+ jz 25f -+ -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 26f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 27f // jump if not odd -+ // It's an odd integer. -+ // Raise divide-by-zero exception and get minus infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ fchs -+ ret -+ -+25: fstp %st(0) -+26: addl $8, %esp -+27: // Raise divide-by-zero exception and get infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. -+21: testb $2, %dh -+ jz 22f -+ -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 23f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 24f // jump if not odd -+ // It's an odd integer. -+ fldl MO(mzero) -+ ret -+ -+22: fstp %st(0) -+23: addl $8, %esp // Don't use 2 x pop -+24: fldl MO(zero) -+ ret -+ -+END(__ieee754_powl) -+ -+weak_alias(__ieee754_powl,powl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_remainderl.S qemu-0.7.0/bsd/i386/e_remainderl.S ---- qemu-0.7.0/bsd.orig/i386/e_remainderl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_remainderl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,24 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__ieee754_remainderl) -+ fldt 16(%esp) -+ fldt 4(%esp) -+1: fprem1 -+ fstsw %ax -+ sahf -+ jp 1b -+ fstp %st(1) -+ ret -+END (__ieee754_remainderl) -+ -+weak_alias(__ieee754_remainderl,remainderl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_sqrtl.c qemu-0.7.0/bsd/i386/e_sqrtl.c ---- qemu-0.7.0/bsd.orig/i386/e_sqrtl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_sqrtl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_sqrtl (long double x) -+{ -+ long double res; -+ -+ asm ("fsqrt" : "=t" (res) : "0" (x)); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_sqrtl,sqrtl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_ceill.S qemu-0.7.0/bsd/i386/s_ceill.S ---- qemu-0.7.0/bsd.orig/i386/s_ceill.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_ceill.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,27 @@ -+/* -+ * Based on code written by J.T. Conklin <jtc@NetBSD.org>. -+ * Public domain. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ENTRY(ceill) -+ pushl %ebp -+ movl %esp,%ebp -+ subl $8,%esp -+ -+ fstcw -4(%ebp) /* store fpu control word */ -+ movw -4(%ebp),%dx -+ orw $0x0800,%dx /* round towards +oo */ -+ andw $0xfbff,%dx -+ movw %dx,-8(%ebp) -+ fldcw -8(%ebp) /* load modfied control word */ -+ -+ fldt 8(%ebp) /* round */ -+ frndint -+ -+ fldcw -4(%ebp) /* restore original control word */ -+ -+ leave -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_cosl.S qemu-0.7.0/bsd/i386/s_cosl.S ---- qemu-0.7.0/bsd.orig/i386/s_cosl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_cosl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__cosl) -+ fldt 4(%esp) -+ fcos -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fcos -+ ret -+END (__cosl) -+weak_alias (__cosl, cosl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_floorl.S qemu-0.7.0/bsd/i386/s_floorl.S ---- qemu-0.7.0/bsd.orig/i386/s_floorl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_floorl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,27 @@ -+/* -+ * Based on code written by J.T. Conklin <jtc@NetBSD.org>. -+ * Public domain. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ENTRY(floorl) -+ pushl %ebp -+ movl %esp,%ebp -+ subl $8,%esp -+ -+ fstcw -4(%ebp) /* store fpu control word */ -+ movw -4(%ebp),%dx -+ orw $0x0400,%dx /* round towards -oo */ -+ andw $0xf7ff,%dx -+ movw %dx,-8(%ebp) -+ fldcw -8(%ebp) /* load modfied control word */ -+ -+ fldt 8(%ebp) /* round */ -+ frndint -+ -+ fldcw -4(%ebp) /* restore original control word */ -+ -+ leave -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_isnormal.c qemu-0.7.0/bsd/i386/s_isnormal.c ---- qemu-0.7.0/bsd.orig/i386/s_isnormal.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_isnormal.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,85 @@ -+/*- -+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org> -+ * Copyright (c) 2002-2004 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $ -+ */ -+ -+union IEEEf2bits { -+ float f; -+ struct { -+ unsigned int man :23; -+ unsigned int exp :8; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEd2bits { -+ double d; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :20; -+ unsigned int exp :11; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEl2bits { -+ long double e; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :32; -+ unsigned int exp :15; -+ unsigned int sign :1; -+ unsigned int junk :16; -+ } bits; -+}; -+ -+int -+__isnormal(double d) -+{ -+ union IEEEd2bits u; -+ -+ u.d = d; -+ return (u.bits.exp != 0 && u.bits.exp != 2047); -+} -+ -+int -+__isnormalf(float f) -+{ -+ union IEEEf2bits u; -+ -+ u.f = f; -+ return (u.bits.exp != 0 && u.bits.exp != 255); -+} -+ -+int -+__isnormall(long double e) -+{ -+ union IEEEl2bits u; -+ -+ u.e = e; -+ return (u.bits.exp != 0 && u.bits.exp != 32767); -+} -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrint.S qemu-0.7.0/bsd/i386/s_llrint.S ---- qemu-0.7.0/bsd.orig/i386/s_llrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $"); -+ -+ENTRY(llrint) -+ fldl 4(%esp) -+ subl $8,%esp -+ fistpll (%esp) -+ popl %eax -+ popl %edx -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintf.S qemu-0.7.0/bsd/i386/s_llrintf.S ---- qemu-0.7.0/bsd.orig/i386/s_llrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ENTRY(llrintf) -+ flds 4(%esp) -+ subl $8,%esp -+ fistpll (%esp) -+ popl %eax -+ popl %edx -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintl.S qemu-0.7.0/bsd/i386/s_llrintl.S ---- qemu-0.7.0/bsd.orig/i386/s_llrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__llrintl) -+ fldt 4(%esp) -+ subl $8, %esp -+ fistpll (%esp) -+ fwait -+ popl %eax -+ popl %edx -+ ret -+END(__llrintl) -+weak_alias (__llrintl, llrintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrint.S qemu-0.7.0/bsd/i386/s_lrint.S ---- qemu-0.7.0/bsd.orig/i386/s_lrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $"); -+ -+ENTRY(lrint) -+ fldl 4(%esp) -+ subl $4,%esp -+ fistpl (%esp) -+ popl %eax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintf.S qemu-0.7.0/bsd/i386/s_lrintf.S ---- qemu-0.7.0/bsd.orig/i386/s_lrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $") -+ -+ENTRY(lrintf) -+ flds 4(%esp) -+ subl $4,%esp -+ fistpl (%esp) -+ popl %eax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintl.S qemu-0.7.0/bsd/i386/s_lrintl.S ---- qemu-0.7.0/bsd.orig/i386/s_lrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,34 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library 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 -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__lrintl) -+ fldt 4(%esp) -+ subl $4, %esp -+ fistpl (%esp) -+ fwait -+ popl %eax -+ ret -+END(__lrintl) -+weak_alias (__lrintl, lrintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_rintl.c qemu-0.7.0/bsd/i386/s_rintl.c ---- qemu-0.7.0/bsd.orig/i386/s_rintl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_rintl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,18 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com> -+ * Public domain. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__rintl (long double x) -+{ -+ long double res; -+ -+ asm ("frndint" : "=t" (res) : "0" (x)); -+ return res; -+} -+ -+weak_alias (__rintl, rintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_round.c qemu-0.7.0/bsd/i386/s_round.c ---- qemu-0.7.0/bsd.orig/i386/s_round.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_round.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,51 @@ -+/*- -+ * Copyright (c) 2003, Steven G. Kargl -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice unmodified, this list of conditions, and the following -+ * disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include <sys/cdefs.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.3 2006-08-21 23:02:01 shaun Exp $"); -+ -+#include <math.h> -+ -+double -+round(double x) -+{ -+ double t; -+ -+ if (!isfinite(x)) -+ return (x); -+ -+ if (x >= 0.0) { -+ t = floor(x); -+ if (t - x <= -0.5) -+ t += 1.0; -+ return (t); -+ } else { -+ t = floor(-x); -+ if (t + x <= -0.5) -+ t += 1.0; -+ return (-t); -+ } -+} -diff -Nru qemu-0.7.0/bsd.orig/i386/s_sinl.S qemu-0.7.0/bsd/i386/s_sinl.S ---- qemu-0.7.0/bsd.orig/i386/s_sinl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_sinl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__sinl) -+ fldt 4(%esp) -+ fsin -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fsin -+ ret -+END (__sinl) -+weak_alias (__sinl, sinl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_tanl.S qemu-0.7.0/bsd/i386/s_tanl.S ---- qemu-0.7.0/bsd.orig/i386/s_tanl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_tanl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,33 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__tanl) -+ fldt 4(%esp) -+ fptan -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ fstp %st(0) -+ ret -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fptan -+ fstp %st(0) -+ ret -+END (__tanl) -+weak_alias (__tanl, tanl) -diff -Nru qemu-0.7.0/bsd.orig/sysdep.h qemu-0.7.0/bsd/sysdep.h ---- qemu-0.7.0/bsd.orig/sysdep.h Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/sysdep.h Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+#ifndef _QEMU_BSD_SYSDEP_H_ -+#define _QEMU_BSD_SYSDEP_H_ -+ -+#include <sys/cdefs.h> -+ -+#define HAVE_ELF -+ -+#ifdef __ASSEMBLER__ -+#define ALIGNARG(log2) 1<<log2 -+#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; -+#define ASM_SIZE_DIRECTIVE(name) .size name,.-name; -+#define END(x) -+#define strong_alias(sym,alias) .set alias,sym; -+#define weak_alias(sym,alias) .weak alias; .equ alias,sym; -+#else -+#define strong_alias(sym,alias) __strong_reference(sym,alias); -+#define weak_alias(sym,alias) __weak_reference(sym,alias); -+#endif -+ -+#endif diff --git a/emulators/qemu-devel/files/patch-libmath2 b/emulators/qemu-devel/files/patch-libmath2 deleted file mode 100644 index a6f6475ee8b4..000000000000 --- a/emulators/qemu-devel/files/patch-libmath2 +++ /dev/null @@ -1,67 +0,0 @@ -Index: qemu/bsd/Makefile -@@ -16,7 +16,8 @@ - ${MACHINE_ARCH}/s_rintl.c \ - ${MACHINE_ARCH}/s_round.c \ - ${MACHINE_ARCH}/s_sinl.S \ -- ${MACHINE_ARCH}/s_tanl.S -+ ${MACHINE_ARCH}/s_tanl.S \ -+ ${MACHINE_ARCH}/s_ldexpl.c - - OBJS= ${SRCS:R:S/$/.o/} - -Index: qemu/bsd/i386/s_ldexpl.c -@@ -0,0 +1,21 @@ -+#include <math.h> -+#include <errno.h> -+#include <sysdep.h> -+ -+long double __ldexpl(long double x, int expn) -+{ -+ long double res; -+ if (!isfinite (x) || x == 0.0L) -+ return x; -+ -+ __asm__ ("fscale" -+ : "=t" (res) -+ : "0" (x), "u" ((long double) expn)); -+ -+ if (!isfinite (res) || res == 0.0L) -+ errno = ERANGE; -+ -+ return res; -+} -+ -+weak_alias(__ldexpl,ldexpl) -Index: qemu/bsd/amd64/s_ldexpl.c -@@ -0,0 +1,21 @@ -+#include <math.h> -+#include <errno.h> -+#include <sysdep.h> -+ -+long double __ldexpl(long double x, int expn) -+{ -+ long double res; -+ if (!isfinite (x) || x == 0.0L) -+ return x; -+ -+ __asm__ ("fscale" -+ : "=t" (res) -+ : "0" (x), "u" ((long double) expn)); -+ -+ if (!isfinite (res) || res == 0.0L) -+ errno = ERANGE; -+ -+ return res; -+} -+ -+weak_alias(__ldexpl,ldexpl) -Index: qemu/target-i386/helper.c -@@ -2886,6 +2886,8 @@ - ST0 = floatx_round_to_int(ST0, &env->fp_status); - } - -+long double ldexpl(long double, int); -+ - void helper_fscale(void) - { - ST0 = ldexp (ST0, (int)(ST1)); diff --git a/emulators/qemu-devel/files/patch-libmath4 b/emulators/qemu-devel/files/patch-libmath4 deleted file mode 100644 index 0c482370b8ba..000000000000 --- a/emulators/qemu-devel/files/patch-libmath4 +++ /dev/null @@ -1,45 +0,0 @@ -Index: qemu/bsd/i386/s_ldexpl.c -@@ -2,6 +2,30 @@ - #include <errno.h> - #include <sysdep.h> - -+/* 4.x doesnt have isfinite */ -+#ifndef isfinite -+#define isfinite __isfinitel -+ -+union IEEEl2bits { -+ long double e; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :32; -+ unsigned int exp :15; -+ unsigned int sign :1; -+ unsigned int junk :16; -+ } bits; -+}; -+ -+static int __isfinitel(long double x) -+{ -+ union IEEEl2bits u; -+ -+ u.e = x; -+ return (u.bits.exp != 32767); -+} -+#endif -+ - long double __ldexpl(long double x, int expn) - { - long double res; -Index: qemu/bsd/i386/s_round.c -@@ -29,6 +29,11 @@ - - #include <math.h> - -+/* 4.x doesnt have isfinite */ -+#ifndef isfinite -+#define isfinite(x) (!isnan(x) && !isinf(x)) -+#endif -+ - double - round(double x) - { diff --git a/emulators/qemu-devel/files/patch-osdep.c b/emulators/qemu-devel/files/patch-osdep.c deleted file mode 100644 index 3d5382b50c51..000000000000 --- a/emulators/qemu-devel/files/patch-osdep.c +++ /dev/null @@ -1,40 +0,0 @@ -Index: qemu/osdep.c -@@ -323,7 +323,9 @@ - - #elif defined(USE_KQEMU) - -+#ifndef __FreeBSD__ - #include <sys/vfs.h> -+#endif - #include <sys/mman.h> - #include <fcntl.h> - -@@ -334,6 +336,7 @@ - const char *tmpdir; - char phys_ram_file[1024]; - void *ptr; -+#ifndef __FreeBSD__ - struct statfs stfs; - - if (phys_ram_fd < 0) { -@@ -389,12 +392,20 @@ - } - unlink(phys_ram_file); - } -+#endif - size = (size + 4095) & ~4095; -+#ifndef __FreeBSD__ - ftruncate(phys_ram_fd, phys_ram_size + size); - ptr = mmap(NULL, - size, - PROT_WRITE | PROT_READ, MAP_SHARED, - phys_ram_fd, phys_ram_size); -+#else -+ ptr = mmap(NULL, -+ size, -+ PROT_WRITE | PROT_READ, MAP_PRIVATE|MAP_ANON, -+ -1, 0); -+#endif - if (ptr == MAP_FAILED) { - fprintf(stderr, "Could not map physical memory\n"); - exit(1); diff --git a/emulators/qemu-devel/files/patch-qemu-img.c b/emulators/qemu-devel/files/patch-qemu-img.c deleted file mode 100644 index b525b50a3bcb..000000000000 --- a/emulators/qemu-devel/files/patch-qemu-img.c +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/qemu-img.c -@@ -134,7 +134,7 @@ - "Command syntax:\n" - " create [-e] [-b base_image] [-f fmt] filename [size]\n" - " commit [-f fmt] filename\n" -- " convert [-c] [-e] [-f fmt] filename [-O output_fmt] output_filename\n" -+ " convert [-c] [-e] [-f fmt] [-O output_fmt] filename output_filename\n" - " info [-f fmt] filename\n" - "\n" - "Command parameters:\n" diff --git a/emulators/qemu-devel/files/patch-qemu-img.texi b/emulators/qemu-devel/files/patch-qemu-img.texi deleted file mode 100644 index 79693026dd2d..000000000000 --- a/emulators/qemu-devel/files/patch-qemu-img.texi +++ /dev/null @@ -1,19 +0,0 @@ -Index: qemu/qemu-img.texi -@@ -10,7 +10,7 @@ - @table @option - @item create [-e] [-b @var{base_image}] [-f @var{fmt}] @var{filename} [@var{size}] - @item commit [-f @var{fmt}] @var{filename} --@item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename} -+@item convert [-c] [-e] [-f @var{fmt}] [-O @var{output_fmt}] @var{filename} @var{output_filename} - @item info [-f @var{fmt}] @var{filename} - @end table - -@@ -83,7 +83,7 @@ - - Commit the changes recorded in @var{filename} in its base image. - --@item convert [-c] [-e] [-f @var{fmt}] @var{filename} [-O @var{output_fmt}] @var{output_filename} -+@item convert [-c] [-e] [-f @var{fmt}] [-O @var{output_fmt}] @var{filename} @var{output_filename} - - Convert the disk image @var{filename} to disk image @var{output_filename} - using format @var{output_fmt}. It can be optionnaly encrypted diff --git a/emulators/qemu-devel/files/patch-sdl.c b/emulators/qemu-devel/files/patch-sdl.c deleted file mode 100644 index a5cc515a4b10..000000000000 --- a/emulators/qemu-devel/files/patch-sdl.c +++ /dev/null @@ -1,14 +0,0 @@ -Index: qemu/sdl.c -@@ -115,9 +115,9 @@ - 0xb5, /* 112 Divide */ - 0xb8, /* 113 Alt-R */ - 0xc6, /* 114 Break */ -- 0x0, /* 115 */ -- 0x0, /* 116 */ -- 0x0, /* 117 */ -+ 0xdb, /* 115 windows left button */ -+ 0xdc, /* 116 windows right button */ -+ 0xdd, /* 117 right menu button */ - 0x0, /* 118 */ - 0x0, /* 119 */ - 0x70, /* 120 Hiragana_Katakana */ diff --git a/emulators/qemu-devel/files/patch-slirp-udp.c b/emulators/qemu-devel/files/patch-slirp-udp.c deleted file mode 100644 index 3b32db529881..000000000000 --- a/emulators/qemu-devel/files/patch-slirp-udp.c +++ /dev/null @@ -1,26 +0,0 @@ -Index: qemu/slirp/udp.c -@@ -205,8 +208,6 @@ - /* udp_last_so = so; */ - so->so_laddr = ip->ip_src; - so->so_lport = uh->uh_sport; -- so->so_faddr = ip->ip_dst; /* XXX */ -- so->so_fport = uh->uh_dport; /* XXX */ - - if ((so->so_iptos = udp_tos(so)) == 0) - so->so_iptos = ip->ip_tos; -@@ -216,6 +217,15 @@ - * and if it is, do the fork_exec() etc. - */ - } -+ -+ /* -+ * Assign destination unconditionally -+ * -+ * This fixes the case where packets are sent from the same -+ * source ip/port to different destination ips/ports -+ */ -+ so->so_faddr = ip->ip_dst; /* XXX */ -+ so->so_fport = uh->uh_dport; /* XXX */ - - iphlen += sizeof(struct udphdr); - m->m_len -= iphlen; diff --git a/emulators/qemu-devel/files/patch-target-mips-cpu.h b/emulators/qemu-devel/files/patch-target-mips-cpu.h deleted file mode 100644 index 52d83af15fb2..000000000000 --- a/emulators/qemu-devel/files/patch-target-mips-cpu.h +++ /dev/null @@ -1,15 +0,0 @@ -Index: qemu/target-mips/cpu.h -@@ -8,6 +8,13 @@ - #include "config.h" - #include "softfloat.h" - -+#ifdef __FreeBSD__ -+#if __FreeBSD__ <= 4 -+typedef uint32_t uint_fast8_t; -+typedef uint32_t uint_fast16_t; -+#endif -+#endif -+ - typedef union fpr_t fpr_t; - union fpr_t { - double d; diff --git a/emulators/qemu-devel/files/patch-vl.c b/emulators/qemu-devel/files/patch-vl.c deleted file mode 100644 index 437dafe471b2..000000000000 --- a/emulators/qemu-devel/files/patch-vl.c +++ /dev/null @@ -1,26 +0,0 @@ -Index: qemu/vl.c -@@ -1510,7 +1510,7 @@ - return chr; - } - --#if defined(__linux__) -+#if defined(__linux__) || defined(__FreeBSD__) - static CharDriverState *qemu_chr_open_pty(void) - { - struct termios tty; -@@ -1665,6 +1665,7 @@ - return chr; - } - -+#if defined(__linux__) - static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) - { - int fd = (int)chr->opaque; -@@ -1727,6 +1728,7 @@ - chr->chr_ioctl = pp_ioctl; - return chr; - } -+#endif /* defined(__linux__) */ - - #else - CharDriverState *qemu_chr_open_pty(void) diff --git a/emulators/qemu-devel/files/patch-vl.c-nographic b/emulators/qemu-devel/files/patch-vl.c-nographic deleted file mode 100644 index be2f002c4920..000000000000 --- a/emulators/qemu-devel/files/patch-vl.c-nographic +++ /dev/null @@ -1,9 +0,0 @@ -Index: qemu/vl.c -@@ -4668,6 +4668,7 @@ - case QEMU_OPTION_nographic: - pstrcpy(monitor_device, sizeof(monitor_device), "stdio"); - pstrcpy(serial_devices[0], sizeof(serial_devices[0]), "stdio"); -+ pstrcpy(parallel_devices[0], sizeof(parallel_devices[0]), "null"); - nographic = 1; - break; - case QEMU_OPTION_kernel: diff --git a/emulators/qemu-devel/files/patch-vl.c-ppbus b/emulators/qemu-devel/files/patch-vl.c-ppbus deleted file mode 100644 index fc06147d8f5a..000000000000 --- a/emulators/qemu-devel/files/patch-vl.c-ppbus +++ /dev/null @@ -1,92 +0,0 @@ ---- vl.c.orig Mon Aug 21 23:06:11 2006 -+++ vl.c Mon Aug 21 23:04:49 2006 -@@ -48,6 +48,8 @@ - #endif - #ifdef __FreeBSD__ - #include <sys/module.h> -+#include <dev/ppbus/ppi.h> -+#include <dev/ppbus/ppbconf.h> - #endif - #else - #ifndef __sun__ -@@ -1728,7 +1730,65 @@ - chr->chr_ioctl = pp_ioctl; - return chr; - } --#endif /* defined(__linux__) */ -+#elif defined(__FreeBSD__) -+static int pp_ioctl(CharDriverState *chr, int cmd, void *arg) -+{ -+ int fd = (int)chr->opaque; -+ uint8_t b; -+ -+ switch(cmd) { -+ case CHR_IOCTL_PP_READ_DATA: -+ if (ioctl(fd, PPIGDATA, &b) < 0) -+ return -ENOTSUP; -+ *(uint8_t *)arg = b; -+ break; -+ case CHR_IOCTL_PP_WRITE_DATA: -+ b = *(uint8_t *)arg; -+ if (ioctl(fd, PPISDATA, &b) < 0) -+ return -ENOTSUP; -+ break; -+ case CHR_IOCTL_PP_READ_CONTROL: -+ if (ioctl(fd, PPIGCTRL, &b) < 0) -+ return -ENOTSUP; -+ *(uint8_t *)arg = b; -+ break; -+ case CHR_IOCTL_PP_WRITE_CONTROL: -+ b = *(uint8_t *)arg; -+ if (ioctl(fd, PPISCTRL, &b) < 0) -+ return -ENOTSUP; -+ break; -+ case CHR_IOCTL_PP_READ_STATUS: -+ if (ioctl(fd, PPIGSTATUS, &b) < 0) -+ return -ENOTSUP; -+ *(uint8_t *)arg = b; -+ break; -+ default: -+ return -ENOTSUP; -+ } -+ return 0; -+} -+ -+CharDriverState *qemu_chr_open_pp(const char *filename) -+{ -+ CharDriverState *chr; -+ int fd; -+ -+ fd = open(filename, O_RDWR); -+ if (fd < 0) -+ return NULL; -+ -+ chr = qemu_mallocz(sizeof(CharDriverState)); -+ if (!chr) { -+ close(fd); -+ return NULL; -+ } -+ chr->opaque = (void *)fd; -+ chr->chr_write = null_chr_write; -+ chr->chr_add_read_handler = null_chr_add_read_handler; -+ chr->chr_ioctl = pp_ioctl; -+ return chr; -+} -+#endif - - #else - CharDriverState *qemu_chr_open_pty(void) -@@ -2562,6 +2622,13 @@ - #endif - #if defined(__linux__) - if (strstart(filename, "/dev/parport", NULL)) { -+ return qemu_chr_open_pp(filename); -+ } else -+ if (strstart(filename, "/dev/", NULL)) { -+ return qemu_chr_open_tty(filename); -+ } else -+#elif defined(__FreeBSD__) -+ if (strstart(filename, "/dev/ppi", NULL)) { - return qemu_chr_open_pp(filename); - } else - if (strstart(filename, "/dev/", NULL)) { diff --git a/emulators/qemu-devel/files/patch-vl.c-serial b/emulators/qemu-devel/files/patch-vl.c-serial deleted file mode 100644 index 76c290e28abb..000000000000 --- a/emulators/qemu-devel/files/patch-vl.c-serial +++ /dev/null @@ -1,17 +0,0 @@ -Index: qemu/vl.c -@@ -1606,10 +1606,13 @@ - cfsetospeed(&tty, spd); - - tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP -- |INLCR|IGNCR|ICRNL|IXON); -- tty.c_oflag |= OPOST; -+ |INLCR|IGNCR|ICRNL|IXON|IMAXBEL); -+ tty.c_oflag &= ~OPOST; /* Don't do any output processing! */ - tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN|ISIG); - tty.c_cflag &= ~(CSIZE|PARENB|PARODD|CRTSCTS|CSTOPB); -+#ifdef __FreeBSD__ -+ cfmakeraw(&tty); -+#endif - switch(data_bits) { - default: - case 8: diff --git a/emulators/qemu-devel/files/patch-vl.h b/emulators/qemu-devel/files/patch-vl.h deleted file mode 100644 index 8307eee09785..000000000000 --- a/emulators/qemu-devel/files/patch-vl.h +++ /dev/null @@ -1,12 +0,0 @@ -Index: qemu/vl.h -@@ -73,6 +73,10 @@ - #define PRIo64 "I64o" - #endif - -+#ifndef ENOMEDIUM -+#define ENOMEDIUM 4097 -+#endif -+ - #ifdef QEMU_TOOL - - /* we use QEMU_TOOL in the command line tools which do not depend on diff --git a/emulators/qemu-devel/files/rtl8139-re-patch b/emulators/qemu-devel/files/rtl8139-re-patch deleted file mode 100644 index dbb301d4057a..000000000000 --- a/emulators/qemu-devel/files/rtl8139-re-patch +++ /dev/null @@ -1,10 +0,0 @@ -Index: hw/rtl8139.c -@@ -58,7 +58,7 @@ - //#define RTL8139_CALCULATE_RXCRC 1 - - /* Uncomment to enable on-board timer interrupts */ --//#define RTL8139_ONBOARD_TIMER 1 -+#define RTL8139_ONBOARD_TIMER 1 - - #if defined(RTL8139_CALCULATE_RXCRC) - /* For crc32 */ |