# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # qemu-devel/ # qemu-devel/Makefile # qemu-devel/distinfo # qemu-devel/pkg-descr # qemu-devel/pkg-message # qemu-devel/pkg-plist # qemu-devel/files/ # qemu-devel/files/cdrom-dma-patch # qemu-devel/files/gns3-qemu-options.hx.patch # qemu-devel/files/net_c.patch # qemu-devel/files/net_h.patch # qemu-devel/files/patch-90_security # qemu-devel/files/patch-Makefile # qemu-devel/files/patch-Makefile.objs # qemu-devel/files/patch-bf # qemu-devel/files/patch-bg # qemu-devel/files/patch-bsd-user-ld # qemu-devel/files/patch-bsd-user-syscall.c # qemu-devel/files/patch-configure # qemu-devel/files/patch-fbsd # qemu-devel/files/patch-hw-ppc_newworld.c # qemu-devel/files/patch-hw-ppc_oldworld.c # qemu-devel/files/patch-libmath # qemu-devel/files/patch-libmath2 # qemu-devel/files/patch-libmath_FreeBSD-version # qemu-devel/files/patch-os-posix.c # qemu-devel/files/patch-ppc.ld # qemu-devel/files/patch-qemu-doc.texi # qemu-devel/files/patch-qemu-timer.h # qemu-devel/files/patch-sgabios-read-only-rom16.ld # qemu-devel/files/patch-tapclose # qemu-devel/files/patch-vl.c-serial # qemu-devel/files/patch-x_keymap.c # qemu-devel/files/patch-z-bandaid-usb-current # qemu-devel/files/pcap-client-type.sed # qemu-devel/files/pcap-patch # qemu-devel/files/qemu-ifdown.sample # qemu-devel/files/qemu-ifup.sample # qemu-devel/files/revert-fbsd-libmath-patch # echo c - qemu-devel/ mkdir -p qemu-devel/ > /dev/null 2>&1 echo x - qemu-devel/Makefile sed 's/^X//' >qemu-devel/Makefile << '7dfd4c0d0b3d5cbe45480e2bbf1a89f1' X# New ports collection makefile for: qemu X# Date created: 2004/05/31 X# Whom: Juergen Lock X# X# $FreeBSD: ports/emulators/qemu-devel/Makefile,v 1.123 2011/07/13 20:01:41 nox Exp $ X# X XPORTNAME= qemu XPORTVERSION= 0.15.0 XCATEGORIES= emulators XMASTER_SITES= SAVANNAH:release \ X http://wiki.qemu.org/download/:release \ X LOCAL:snapshot XMASTER_SITE_SUBDIR= qemu/:release nox/:snapshot XPKGNAMESUFFIX= -devel XDISTFILES= ${DISTNAME}${EXTRACT_SUFX}:release \ X sgabios-read-only-r8${EXTRACT_SUFX}:snapshot XDIST_SUBDIR= qemu/${PORTVERSION} X XPATCH_SITES= http://code.gns3.net/qemu-patches/raw-file/0b69b9be6a8e/ XPATCH_DIST_STRIP= -p1 X XMAINTAINER= nox@FreeBSD.org XCOMMENT= QEMU CPU Emulator - development version X XHAS_CONFIGURE= yes XUSE_GMAKE= yes XUSE_PYTHON= yes XUSE_GNOME= glib20 XUSE_PERL5_BUILD= yes XPATCH_STRIP= -p1 XMAKE_ENV+= BSD_MAKE="${MAKE}" LDFLAGS="${LDFLAGS}" XMAN1= qemu.1 qemu-img.1 XMAN8= qemu-nbd.8 XONLY_FOR_ARCHS= amd64 i386 powerpc # XXX someone wants to debug sparc64 hosts? XCONFLICTS_INSTALL= qemu-[0-9]* XMAKE_JOBS_SAFE= yes X XOPTIONS= SAMBA "samba dependency (for -smb)" Off \ X SDL "SDL/X dependency (graphical output)" On \ X OPENGL "OpenGL dependency" On \ X GNUTLS "gnutls dependency (vnc encryption)" On \ X SASL "cyrus-sasl dependency (vnc encryption)" On \ X CURL "libcurl dependency (remote images)" On \ X CDROM_DMA "IDE CDROM DMA" On \ X PCAP "pcap dependency (networking with bpf)" On \ X USBREDIR "usb device network redirection (experimental!)" Off \ X GNS3 "gns3 patches (udp, promiscuous multicast)" Off \ X ADD_AUDIO "Emulate more audio hardware (experimental!)" Off \ X ALL_TARGETS "Also build bsd-user targets (for testing)" Off X X.include X XCONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib XPORTDOCS= docs qemu-doc.html qemu-tech.html XLIB_DEPENDS+= jpeg:${PORTSDIR}/graphics/jpeg \ X png.6:${PORTSDIR}/graphics/png X X.if defined(WITHOUT_ALL_TARGETS) XCONFIGURE_ARGS+= --disable-bsd-user XPLIST_SUB+= ALLTARGETS="@comment " X.else XPLIST_SUB+= ALLTARGETS="" X.if ${ARCH} == "sparc64" XIGNORE= bsd-user targets not tested on sparc64 X.endif X.endif X X.if defined(WITH_GNS3) XPATCHFILES+= hw_e1000_c.patch X#PATCHFILES+= net_c.patch X#PATCHFILES+= net_h.patch XEXTRA_PATCHES+= ${FILESDIR}/net_c.patch XEXTRA_PATCHES+= ${FILESDIR}/net_h.patch XPATCHFILES+= net_udp_c.patch XPATCHFILES+= net_udp_h.patch XPATCHFILES+= Makefile_objs.patch XEXTRA_PATCHES+= ${FILESDIR}/gns3-qemu-options.hx.patch X.endif X XWITHOUT_CPU_CFLAGS=yes #to avoid problems with register allocation XCFLAGS:= ${CFLAGS:C/-fno-tree-vrp//} XCONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} --enable-docs \ X --disable-linux-user --disable-linux-aio \ X --disable-darwin-user --disable-kvm --disable-xen \ X --extra-cflags=-DSMBD_COMMAND=\\\"${LOCALBASE}/sbin/smbd\\\"\ -I${WRKSRC}\ -I${LOCALBASE}/include\ -DPREFIX=\\\"${PREFIX}\\\" X X.if defined(WITHOUT_SDL) XCONFIGURE_ARGS+= --disable-sdl X.else XUSE_SDL= sdl X.endif X X.if defined(WITHOUT_GNUTLS) XCONFIGURE_ARGS+= --disable-vnc-tls X.else XLIB_DEPENDS+= gnutls:${PORTSDIR}/security/gnutls X.endif X X.if defined(WITHOUT_SASL) XCONFIGURE_ARGS+= --disable-vnc-sasl X.else XLIB_DEPENDS+= sasl2:${PORTSDIR}/security/cyrus-sasl2 X.endif X X.if defined(WITHOUT_CURL) XCONFIGURE_ARGS+= --disable-curl X.else XLIB_DEPENDS+= curl:${PORTSDIR}/ftp/curl X.endif X X.if defined(WITHOUT_OPENGL) XCONFIGURE_ARGS+= --disable-opengl X.else XUSE_GL= yes X.endif X X.if defined(WITHOUT_USBREDIR) XCONFIGURE_ARGS+= --disable-usb-redir X.else XLIB_DEPENDS+= usbredirparser:${PORTSDIR}/net/usbredir X.endif X X.if defined(WITH_PCAP) XCONFIGURE_ARGS+= --enable-pcap X.endif X X.if defined(WITH_ADD_AUDIO) XCONFIGURE_ARGS+= --audio-card-list=ac97,es1370,sb16,cs4231a,adlib,gus,hda X.endif X X.if defined(WITH_SAMBA) XRUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba35 X.endif X X.if defined(NOPORTDOCS) XMAKE_ARGS+= NOPORTDOCS=${NOPORTDOCS} X.else XBUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html X.endif X X.if ${ARCH} == "amd64" XMAKE_ARGS+= ARCH=x86_64 X.endif X X.if ${ARCH} == "powerpc" XMAKE_ARGS+= ARCH=ppc X.endif X X.if ${ARCH} == "sparc64" XCONFIGURE_ARGS+= --sparc_cpu=v9 X.endif X X.if ${OSVERSION} < 900033 && ${ARCH} == "amd64" XBUILD_DEPENDS+= ${LOCALBASE}/bin/as:${PORTSDIR}/devel/binutils XCONFIGURE_ENV+= COMPILER_PATH=${LOCALBASE}/bin XMAKE_ENV+= COMPILER_PATH=${LOCALBASE}/bin X.endif X Xpre-patch: X @for A in ${ONLY_FOR_ARCHS}; do \ X ${MKDIR} ${WRKSRC}/bsd/$$A; \ X done X Xpost-patch: X.if (${ARCH} == "powerpc" || ${ARCH} == "sparc64") X.if ${OSVERSION} < 800030 X# These OSVERSION don't have all the needed long double fns in their X# libc so just disable 80 bit floats completely. X @cd ${WRKSRC} && ${PATCH} --quiet -R ${PATCH_STRIP} < ${FILESDIR}/patch-libmath_FreeBSD-version X @cd ${WRKSRC} && ${PATCH} --quiet -R ${PATCH_STRIP} < ${FILESDIR}/patch-fbsd X.else X# ...else we only need to disable the libmath build. (since its X# x86-specific.) X @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/revert-fbsd-libmath-patch X.endif X.endif X X.if defined(WITH_PCAP) X @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/pcap-patch X @${REINPLACE_CMD} -f ${FILESDIR}/pcap-client-type.sed ${WRKSRC}/net.h X.endif X.if defined(WITHOUT_CDROM_DMA) X @cd ${WRKSRC} && ${PATCH} --quiet < ${FILESDIR}/cdrom-dma-patch X.endif X @${REINPLACE_CMD} -E \ X -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing|" \ X -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ X ${WRKSRC}/Makefile.target X @${REINPLACE_CMD} -E \ X -e "s|^(CFLAGS=).*|\1${CFLAGS} -fno-strict-aliasing -I.|" \ X -e "s|^(LDFLAGS=).*|\1${LDFLAGS}|" \ X ${WRKSRC}/Makefile X @${REINPLACE_CMD} -E \ X -e "1s|^(#! )/usr/bin/perl|\1${PERL}|" \ X ${WRKSRC}/scripts/texi2pod.pl X X.if ${OSVERSION} >= 800091 X# XXX need to disable usb host code on head while it's not ported to the X# new usb stack yet Xpost-configure: X @${REINPLACE_CMD} -E \ X -e "s|^(HOST_USB=)bsd|\1stub|" \ X ${WRKSRC}/config-host.mak X.endif X Xpost-build: X @(cd ${WRKDIR}/sgabios-read-only && ${GMAKE}) X Xpost-install: X.if !defined(NOPORTDOCS) X @(cd ${WRKSRC} && ${COPYTREE_SHARE} docs ${DOCSDIR}/) X.endif X @${INSTALL_DATA} ${WRKDIR}/sgabios-read-only/sgabios.bin ${DATADIR} X @${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup.sample ${PREFIX}/etc X @${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifdown.sample ${PREFIX}/etc X @if [ ! -f ${PREFIX}/etc/qemu-ifup ]; then \ X ${CP} -p ${PREFIX}/etc/qemu-ifup.sample ${PREFIX}/etc/qemu-ifup ; \ X fi X @if [ ! -f ${PREFIX}/etc/qemu-ifdown ]; then \ X ${CP} -p ${PREFIX}/etc/qemu-ifdown.sample ${PREFIX}/etc/qemu-ifdown ; \ X fi X @${CAT} ${PKGMESSAGE} X X.include 7dfd4c0d0b3d5cbe45480e2bbf1a89f1 echo x - qemu-devel/distinfo sed 's/^X//' >qemu-devel/distinfo << '33bd2e48c6257b45e0920aa43a62f7ab' XSHA256 (qemu/0.15.0/qemu-0.15.0.tar.gz) = 0197e52dba07aeb6dfe0343b0c2ae08ed374d2cb0af3bb9ec73fed5baa0cb74d XSIZE (qemu/0.15.0/qemu-0.15.0.tar.gz) = 9577243 XSHA256 (qemu/0.15.0/sgabios-read-only-r8.tar.gz) = b5a511f237f9e3fbceb8d406b818253c1661773fc12c3ec14f0580ab15151384 XSIZE (qemu/0.15.0/sgabios-read-only-r8.tar.gz) = 31201 XSHA256 (qemu/0.15.0/hw_e1000_c.patch) = a9c8f29b8493ac62526b2ed4078b3e69c8e9c709a049f4fa11765ce37067e5a5 XSIZE (qemu/0.15.0/hw_e1000_c.patch) = 407 XSHA256 (qemu/0.15.0/net_udp_c.patch) = 6cbe5b229381db94fb6865bb53741217f914749723eea734917143f6db457a51 XSIZE (qemu/0.15.0/net_udp_c.patch) = 4115 XSHA256 (qemu/0.15.0/net_udp_h.patch) = e43853ba86689cb9ace6a177f891ab8536f6fbce21c7e9fa3ee0d5b25c47b463 XSIZE (qemu/0.15.0/net_udp_h.patch) = 1518 XSHA256 (qemu/0.15.0/Makefile_objs.patch) = 7bfed73dfa87b78fd9b3231c1664ff9c871e8b38009b82bf9311573cbb679d58 XSIZE (qemu/0.15.0/Makefile_objs.patch) = 371 33bd2e48c6257b45e0920aa43a62f7ab echo x - qemu-devel/pkg-descr sed 's/^X//' >qemu-devel/pkg-descr << '035debc45d3ce7a58234833270c3c910' XQEMU is a FAST! processor emulator using dynamic translation to achieve Xgood emulation speed. XQEMU has two operating modes: X X * Full system emulation. In this mode, QEMU emulates a full system X(for example a PC), including a processor and various peripherials. XIt can be used to launch different Operating Systems without rebooting Xthe PC or to debug system code. X * User mode emulation (Linux host only). In this mode, QEMU can launch XLinux processes compiled for one CPU on another CPU. It can be used to Xlaunch the Wine Windows API emulator or to ease cross-compilation and Xcross-debugging. X XAs QEMU requires no host kernel patches to run, it is very safe and easy to use. X XSee also the preconfigured system images on http://oszoo.org/ XMany live cd isos also work. X XWWW: http://wiki.qemu.org/Main_Page 035debc45d3ce7a58234833270c3c910 echo x - qemu-devel/pkg-message sed 's/^X//' >qemu-devel/pkg-message << 'f1deb0182de1bb2473fde145fdf3c66c' XFreeBSD host notes X================== X X- Needs to run as root in order to use /dev/tap* networking (why?) (actually X RELENG_6 and above now has a sysctl net.link.tap.user_open to allow users to X use it too. Don't forget to adjust device node permissions in X /etc/devfs.rules.) X X- slirp (usermode networking) is fixed now in cvs, on FreeSBIE 1.0 guests you X still have to manually do: echo nameserver 10.0.2.3 >/etc/resolv.conf but X i've been told that that's normal. (fixed on FreeSBIE 1.1.) And you have X to wait a bit for dhclient to do its thing; traffic to address 10.0.2.2 is X routed to 127.1 on the host. X X- Expect timer problems when guest kernel HZ is > hosts, for example time X sleep 1 takes 49 seconds and booting sleeps for minutes at the acd0 probe X with a FreeSBIE 1.0 guest, thats because its kernel is built with HZ=5000, X and FreeBSD's default is 100... (no longer a problem with FreeSBIE 1.1.) X The linux 2.6 kernel uses 1000 by default btw. (changed to 250 later, and X recent linux kernels now no longer have a fixed HZ, aka `tickless X kernel'...) Enabling /dev/rtc doesn't seem to help either (not included X since it needs a patch to emulators/rtc.) X X- Update: the above problem has gotten worse with FreeBSD guests X somewhere before 8.0, mainly since the kernel now usually wants X double or even quadruple number of timer irqs compared to HZ if X it detects an apic (and at least early versions of FreeBSD 8 had X a bug that essentially halved qemu's clock rate too); the only X reason you usually don't see symptoms of this with FreeBSD 8 X guests is they automatically reduce their HZ to 100 when running X in a VM while the default for the host kernel is still HZ=1000. X Workaround: you can disable the apic clock in the guest by setting X X hint.apic.0.clock="0" X X in loader.conf(5) (or manually at the loader prompt), if that X doesn't work the only things you can do is either reduce the X guest's HZ to, say, 100 by setting e.g. X X kern.hz="100" X X from the loader as above (which usually is a good idea in a VM X anyway and FreeBSD 8 now does by itself as mentioned), or otherwise X increase the host's HZ to 2000 or even 4000 from the loader in X the same way. X X- The -smb option (smb-export local dir to guest using the default X slirp networking) needs the net/samba34 port/package installed X in addition to qemu. X X- If you want to use usb devices connected to the host in the guest X (usb_add host:... monitor command; this doesn't work on FreeBSD 8 and X -current atm because of the new usb stack - help updating the usb-bsd.c code X is more than welcome here!) you need to make sure the host isn't claiming X them, e.g. for umass devices (like memory sticks or external harddrives) X make sure umass isn't in the kernel (you can then still load it as a kld X when needed), also unless you are running qemu as root you then need to fix X permissions for /dev/ugen* device nodes: if you are on 5.x or later (devfs) X put a rule in /etc/devfs.rules, activate it in /etc/rc.conf and run X /etc/rc.d/devfs restart. Example devfs.rules: X X [ugen_ruleset=20] X add path 'ugen*' mode 660 group operator X X corresponding rc.conf line: X X devfs_system_ruleset="ugen_ruleset" X X- If you want to test the new (in 0.15.0) usb network redirection (USBREDIR X option) see this thread by Hans de Goede redhat.com>: X X http://thread.gmane.org/gmane.comp.emulators.qemu/110176/focus=110183 X X Quote: X X Example usage: X X 1) Start usbredirserver for a usb device: X sudo usbredirserver 045e:0772 X 2) Start qemu with usb2 support + a chardev talking to usbredirserver + X a usb-redir device using this chardev: X qemu ... \ X -readconfig docs/ich9-ehci-uhci.cfg \ X -chardev socket,id=usbredirchardev,host=localhost,port=4000 \ X -device usb-redir,chardev=usbredirchardev,id=usbredirdev X X [you would replace docs/ich9-ehci-uhci.cfg with e.g. X /usr/local/share/doc/qemu/docs/ich9-ehci-uhci.cfg, but turns out X ehci seems broken for me here with FreeBSD guests at least, I get: X X FETCHENTRY: entry at 22C5484 is of type 2 which is not supported yet Xprocessing error - resetting ehci HC X Assertion failed: (0), function ehci_advance_state, file /data/ports/emulators/qemu-devel/work/qemu-0.15.0/hw/usb-ehci.c, line 2045. X X Starting the same without ehci (-readconfig) works, tho usbredirserver X crashes when qemu exits.] X X- Still usb: since the hub is no longer attached to the uchi controller and X the wakeup mechanism, resume interrupt is not implemented yet linux guests X will suspend the bus, i.e. they wont see devices usb_add'ed after its X (linux') uhci module got loaded. Workaround: either add devices before X linux loads the module or rmmod and modprobe it afterwards. X X- If you get repeated `atapi_poll called!' console messages with FreeBSD X guests or other weird cdrom problems then thats probably because the guest X has atapicam loaded, which for reasons still to be determined has problems X with qemu's now by default enabled cdrom dma. You can build the port with X CDROM_DMA disabled to disable it. [Looks like this is fixed in recent X FreeBSD guest versions.] X X- If you build qemu wihout SDL and then get crashes running it try passing it X -nographic. This should probably be default in that case... X X- qemu's network boot roms (-boot n) have a bug when bootfiles sizes are a X multiple of blksize, if this affects you (like with FreeBSD's /boot/pxeboot) X you can do like X X cp /boot/pxeboot pxeboot-qemu && chmod +w pxeboot-qemu && echo >>pxeboot-qemu X X and then use pxeboot-qemu. Actually you need recent btx code X (from after 7.0 was released) because of the real mode boot X problem, so use at least pxeboot from there. And I just did that X for the pxeboot extracted out of X X ftp://ftp.freebsd.org/pub/FreeBSD/snapshots/200805/7.0-STABLE-200805-i386-bootonly.iso X X and placed it here: X X http://people.freebsd.org/~nox/qemu/pxeboot-qemu X X- If you use slirp (usernet, the default) and want to mount nfs into the guest X and you are not running qemu as root, then mountd(8) on the exporting box X needs to be run with -n in order to accept requests from ports >= 1024. X X- (not FreeBSD-specific:) There have been reports of qcow2 corruption with (at X least) win2k guests on recent kvm (which uses similar qcow2 code than qemu X now, see this thread: X X http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg00713.html - X X the consensus on that thread seems to be that qcow(2) code has always been X experimental and you should use raw images if you want reliability; raw is X also usually faster.) You should be able to migrate existing images to raw X using qemu-img(1)'s convert function; raw doesn't support advanced features X like snapshots tho. [a few important qcow2 bugfixed have been committed in X the meantime so this _might_ be less of an issue now.] X X- (also not FreeBSD-specific:) It is recommended to pass raw images using the X new -drive syntax, specifying format=raw explicitly in order to avoid X malicious guests being able to exploit the format autodetection thats X otherwise getting used. (Not that you should run malicious guests anyway, X but this eleminates at least a known attack vector.) X X- qemu now has improved physical cdrom support, but still there still is at X least one known problem: you need to have the guest eject the disc if you X want to change it/take it out, or otherwise the guest may continue using X state (like size) of the old disc. (You can also do like `change ide1-cd0 X /dev/acd0' in the monitor after taking out the disc if a guest cannot eject X it itself.) X X- The default configuration location (qemu-ifup script etc.) has been changed X from /etc to PREFIX/etc (usually /usr/local/etc). Move your files X accordingly. X X- The pcap code (-net nic... -net pcap,ifname=...) should work properly now, X with only one exception: Advanced features like TSO used on the host X interface can cause oversize packets which now do get truncated to avoid X confusing/panicing guests but of course still will cause retransmissions. X So if you see slow throughput and `pcap_send: packet size > ..., truncating' X messages on qemu's tty try disabling TSO etc on the host interface at least X while using pcap. X X- kqemu is no longer supported in qemu upstream after the 0.11 branch X was created, which means also not in this version. (Linux has moved X on to kvm now for qemu(-like) virtualization needs, so if you want qemu X to go faster and don't want to switch to virtualbox or stick to the older X emulators/qemu port which is at 0.11.1 atm and as such still supports X kqemu you should help getting the FreeBSD kvm port updated and X completed: X X http://wiki.freebsd.org/FabioChecconi/PortingLinuxKVMToFreeBSD X X ) f1deb0182de1bb2473fde145fdf3c66c echo x - qemu-devel/pkg-plist sed 's/^X//' >qemu-devel/pkg-plist << '930b43c848ba711e30f30724ff455e10' Xbin/qemu Xbin/qemu-ga Xbin/qemu-img Xbin/qemu-io Xbin/qemu-nbd Xbin/qemu-system-arm Xbin/qemu-system-cris Xbin/qemu-system-lm32 Xbin/qemu-system-m68k Xbin/qemu-system-microblaze Xbin/qemu-system-microblazeel Xbin/qemu-system-mips Xbin/qemu-system-mips64 Xbin/qemu-system-mips64el Xbin/qemu-system-mipsel Xbin/qemu-system-ppc Xbin/qemu-system-ppc64 Xbin/qemu-system-ppcemb Xbin/qemu-system-s390x Xbin/qemu-system-sh4 Xbin/qemu-system-sh4eb Xbin/qemu-system-sparc Xbin/qemu-system-sparc64 X%%ALLTARGETS%%bin/qemu-i386 X%%ALLTARGETS%%bin/qemu-sparc X%%ALLTARGETS%%bin/qemu-sparc64 X%%ALLTARGETS%%bin/qemu-x86_64 Xbin/qemu-system-x86_64 X@unexec if cmp -s %D/etc/qemu-ifup.sample %D/etc/qemu-ifup; then rm -f %D/etc/qemu-ifup; fi Xetc/qemu-ifup.sample X@exec if [ ! -f %D/etc/qemu-ifup ] ; then cp -p %D/%F %B/qemu-ifup; fi X@unexec if cmp -s %D/etc/qemu-ifdown.sample %D/etc/qemu-ifdown; then rm -f %D/etc/qemu-ifdown; fi Xetc/qemu-ifdown.sample X@exec if [ ! -f %D/etc/qemu-ifdown ] ; then cp -p %D/%F %B/qemu-ifdown; fi X@unexec if cmp -s %D/etc/qemu/target-x86_64.conf.sample %D/etc/qemu/target-x86_64.conf; then rm -f %D/etc/qemu/target-x86_64.conf; fi Xetc/qemu/target-x86_64.conf.sample X@exec if [ ! -f %D/etc/qemu/target-x86_64.conf ] ; then cp -p %D/%F %B/etc/qemu/target-x86_64.conf; fi X@dirrmtry etc/qemu X%%DATADIR%%/bios.bin X%%DATADIR%%/vgabios.bin X%%DATADIR%%/vgabios-cirrus.bin X%%DATADIR%%/vgabios-qxl.bin X%%DATADIR%%/vgabios-stdvga.bin X%%DATADIR%%/vgabios-vmware.bin X%%DATADIR%%/ppc_rom.bin X%%DATADIR%%/openbios-ppc X%%DATADIR%%/openbios-sparc32 X%%DATADIR%%/openbios-sparc64 X%%DATADIR%%/pxe-e1000.rom X%%DATADIR%%/pxe-eepro100.rom X%%DATADIR%%/pxe-ne2k_pci.rom X%%DATADIR%%/pxe-rtl8139.rom X%%DATADIR%%/pxe-pcnet.rom X%%DATADIR%%/pxe-virtio.rom X%%DATADIR%%/petalogix-ml605.dtb X%%DATADIR%%/mpc8544ds.dtb X%%DATADIR%%/spapr-rtas.bin X%%DATADIR%%/slof.bin X%%DATADIR%%/s390-zipl.rom X%%DATADIR%%/linuxboot.bin X%%DATADIR%%/multiboot.bin X%%DATADIR%%/sgabios.bin X%%DATADIR%%/petalogix-s3adsp1800.dtb X%%DATADIR%%/bamboo.dtb X%%DATADIR%%/keymaps/ar X%%DATADIR%%/keymaps/common X%%DATADIR%%/keymaps/da X%%DATADIR%%/keymaps/de X%%DATADIR%%/keymaps/de-ch X%%DATADIR%%/keymaps/en-gb X%%DATADIR%%/keymaps/en-us X%%DATADIR%%/keymaps/es X%%DATADIR%%/keymaps/et X%%DATADIR%%/keymaps/fi X%%DATADIR%%/keymaps/fo X%%DATADIR%%/keymaps/fr X%%DATADIR%%/keymaps/fr-be X%%DATADIR%%/keymaps/fr-ca X%%DATADIR%%/keymaps/fr-ch X%%DATADIR%%/keymaps/hr X%%DATADIR%%/keymaps/hu X%%DATADIR%%/keymaps/is X%%DATADIR%%/keymaps/it X%%DATADIR%%/keymaps/ja X%%DATADIR%%/keymaps/lt X%%DATADIR%%/keymaps/lv X%%DATADIR%%/keymaps/mk X%%DATADIR%%/keymaps/modifiers X%%DATADIR%%/keymaps/nl X%%DATADIR%%/keymaps/nl-be X%%DATADIR%%/keymaps/no X%%DATADIR%%/keymaps/pl X%%DATADIR%%/keymaps/pt X%%DATADIR%%/keymaps/pt-br X%%DATADIR%%/keymaps/ru X%%DATADIR%%/keymaps/sl X%%DATADIR%%/keymaps/sv X%%DATADIR%%/keymaps/th X%%DATADIR%%/keymaps/tr X@dirrm %%DATADIR%%/keymaps X@dirrm %%DATADIR%% 930b43c848ba711e30f30724ff455e10 echo c - qemu-devel/files/ mkdir -p qemu-devel/files/ > /dev/null 2>&1 echo x - qemu-devel/files/cdrom-dma-patch sed 's/^X//' >qemu-devel/files/cdrom-dma-patch << '062df0636034fb4e7733f7caae0dc066' XIndex: hw/ide/internal.h X@@ -27,7 +27,7 @@ X //#define DEBUG_IDE X //#define DEBUG_IDE_ATAPI X //#define DEBUG_AIO X-#define USE_DMA_CDROM X+// #define USE_DMA_CDROM X X /* Bits of HD_STATUS */ X #define ERR_STAT 0x01 062df0636034fb4e7733f7caae0dc066 echo x - qemu-devel/files/gns3-qemu-options.hx.patch sed 's/^X//' >qemu-devel/files/gns3-qemu-options.hx.patch << '3daf9d5706be6d5e3e0585cce8b8de5a' X--- a/qemu-options.hx X+++ b/qemu-options.hx X@@ -1050,6 +1050,8 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, X " connect the user mode network stack to VLAN 'n', configure its\n" X " DHCP server and enabled optional services\n" X #endif X+ "-net udp[,vlan=n],sport=sport,dport=dport,daddr=host\n" X+ " connect the vlan 'n' to a udp host (for dynamips/pemu/GNS3)\n" X #ifdef _WIN32 X "-net tap[,vlan=n][,name=str],ifname=name\n" X " connect the host TAP network interface to VLAN 'n'\n" 3daf9d5706be6d5e3e0585cce8b8de5a echo x - qemu-devel/files/net_c.patch sed 's/^X//' >qemu-devel/files/net_c.patch << '64144894f2f26d7317c3a7972ed0d576' X--- qemu-0.15.0/net.c.orig X+++ qemu-0.15.0/net.c X@@ -30,6 +30,7 @@ X #include "net/dump.h" X #include "net/slirp.h" X #include "net/vde.h" X+#include "net/udp.h" X #include "net/util.h" X #include "monitor.h" X #include "qemu-common.h" X@@ -1029,6 +1030,27 @@ static const struct { X }, X }, X #endif X+ [NET_CLIENT_TYPE_UDP] = { X+ .type = "udp", X+ .init = net_init_udp, X+ .desc = { X+ NET_COMMON_PARAMS_DESC, X+ { X+ .name = "sport", X+ .type = QEMU_OPT_NUMBER, X+ .help = "source port number", X+ }, { X+ .name = "daddr", X+ .type = QEMU_OPT_STRING, X+ .help = "destination IP address", X+ }, { X+ .name = "dport", X+ .type = QEMU_OPT_NUMBER, X+ .help = "destination port number", X+ }, X+ { /* end of list */ } X+ }, X+ }, X [NET_CLIENT_TYPE_DUMP] = { X .type = "dump", X .init = net_init_dump, 64144894f2f26d7317c3a7972ed0d576 echo x - qemu-devel/files/net_h.patch sed 's/^X//' >qemu-devel/files/net_h.patch << '85d117d78edfbd98cf865eb56ca604d8' X--- qemu-0.15.0/net.h.orig X+++ qemu-0.15.0/net.h X@@ -35,6 +35,7 @@ typedef enum { X NET_CLIENT_TYPE_TAP, X NET_CLIENT_TYPE_SOCKET, X NET_CLIENT_TYPE_VDE, X+ NET_CLIENT_TYPE_UDP, X NET_CLIENT_TYPE_DUMP, X X NET_CLIENT_TYPE_MAX 85d117d78edfbd98cf865eb56ca604d8 echo x - qemu-devel/files/patch-90_security sed 's/^X//' >qemu-devel/files/patch-90_security << '98b470dc711860c6a968b099d4b32055' XIndex: qemu/hw/dma.c X@@ -344,9 +344,11 @@ static void channel_run (int ncont, int X } X #endif X X- n = r->transfer_handler (r->opaque, ichan + (ncont << 2), X- r->now[COUNT], (r->base[COUNT] + 1) << ncont); X- r->now[COUNT] = n; X+ if (r->transfer_handler) { X+ n = r->transfer_handler (r->opaque, ichan + (ncont << 2), X+ r->now[COUNT], (r->base[COUNT] + 1) << ncont); X+ r->now[COUNT] = n; X+ } X ldebug ("dma_pos %d size %d\n", n, (r->base[COUNT] + 1) << ncont); X } X XIndex: qemu/hw/fdc.c X@@ -1322,7 +1322,8 @@ X fd_sector(cur_drv)); X return 0; X } X- if (bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X+ if (cur_drv->bs == NULL || X+ bdrv_read(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X FLOPPY_DPRINTF("error getting sector %d\n", X fd_sector(cur_drv)); X /* Sure, image size is too small... */ X@@ -1776,7 +1777,8 @@ X if (pos == FD_SECTOR_LEN - 1 || X fdctrl->data_pos == fdctrl->data_len) { X cur_drv = get_cur_drv(fdctrl); X- if (bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X+ if (cur_drv->bs == NULL || X+ bdrv_write(cur_drv->bs, fd_sector(cur_drv), fdctrl->fifo, 1) < 0) { X FLOPPY_ERROR("writing sector %d\n", fd_sector(cur_drv)); X return; X } XIndex: qemu-0.8.2/hw/pc.c X@@ -335,8 +336,9 @@ void bochs_bios_write(void *opaque, uint X /* LGPL'ed VGA BIOS messages */ X case 0x501: X case 0x502: X+ /* according to documentation, these can be safely ignored */ X fprintf(stderr, "VGA BIOS panic, line %d\n", val); X- exit(1); X+ break; X case 0x500: X case 0x503: X #ifdef DEBUG_BIOS XIndex: qemu-0.8.2/hw/sb16.c X=================================================================== X--- qemu-0.8.2.orig/hw/sb16.c 2006-07-22 20:23:34.000000000 +0300 X+++ qemu-0.8.2/hw/sb16.c 2007-04-20 06:05:59.000000000 +0300 X@@ -1235,8 +1235,10 @@ static int SB_read_DMA (void *opaque, in X s->block_size); X #endif X X- while (s->left_till_irq <= 0) { X- s->left_till_irq = s->block_size + s->left_till_irq; X+ if (s->block_size) { X+ while (s->left_till_irq <= 0) { X+ s->left_till_irq = s->block_size + s->left_till_irq; X+ } X } X X return dma_pos; XIndex: qemu/hw/i8259.c X@@ -302,7 +302,8 @@ X s->init4 = val & 1; X s->single_mode = val & 2; X if (val & 0x08) X- hw_error("level sensitive irq not supported"); X+ /* hw_error("level sensitive irq not supported"); */ X+ return; X } else if (val & 0x08) { X if (val & 0x04) X s->poll = 1; 98b470dc711860c6a968b099d4b32055 echo x - qemu-devel/files/patch-Makefile sed 's/^X//' >qemu-devel/files/patch-Makefile << '84dfd695309825a8b7c2b649e7e82e77' XIndex: qemu/Makefile X@@ -29,7 +29,11 @@ $(call set-vpath, $(SRC_PATH):$(SRC_PATH X LIBS+=-lz $(LIBS_TOOLS) X X ifdef BUILD_DOCS X+ifdef NOPORTDOCS X+DOCS=qemu.1 qemu-img.1 qemu-nbd.8 X+else X DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt X+endif X else X DOCS= X endif X@@ -169,8 +173,10 @@ BLOBS= X endif X X install-doc: $(DOCS) X+ifndef NOPORTDOCS X $(INSTALL_DIR) "$(DESTDIR)$(docdir)" X $(INSTALL_DATA) qemu-doc.html qemu-tech.html "$(DESTDIR)$(docdir)" X+endif X ifdef CONFIG_POSIX X $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" X $(INSTALL_DATA) qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1" X@@ -180,7 +186,10 @@ endif X X install-sysconfig: X $(INSTALL_DIR) "$(DESTDIR)$(sysconfdir)/qemu" X- $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu" X+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(DESTDIR)$(sysconfdir)/qemu/target-x86_64.conf.sample" X+ if [ ! -f "$(sysconfdir)/qemu/target-x86_64.conf" ]; then \ X+ $(INSTALL_DATA) $(SRC_PATH)/sysconfigs/target/target-x86_64.conf "$(sysconfdir)/qemu"; \ X+ fi X X install: all $(if $(BUILD_DOCS),install-doc) install-sysconfig X $(INSTALL_DIR) "$(DESTDIR)$(bindir)" 84dfd695309825a8b7c2b649e7e82e77 echo x - qemu-devel/files/patch-Makefile.objs sed 's/^X//' >qemu-devel/files/patch-Makefile.objs << '20f40671d76878e2d92331ae8273a919' X--- a/Makefile.objs X+++ b/Makefile.objs X@@ -166,6 +166,7 @@ user-obj-y = X user-obj-y += envlist.o path.o X user-obj-y += tcg-runtime.o host-utils.o X user-obj-y += cutils.o cache-utils.o X+user-obj-y += qemu-thread-posix.o X X ###################################################################### X # libhw 20f40671d76878e2d92331ae8273a919 echo x - qemu-devel/files/patch-bf sed 's/^X//' >qemu-devel/files/patch-bf << '3f590533f5abb97696ef7d1d2986b90e' XIndex: qemu/slirp/slirp_config.h X@@ -86,7 +86,7 @@ X #undef BAD_SPRINTF X X /* Define if you have readv */ X-#undef HAVE_READV X+#define HAVE_READV X X /* Define if iovec needs to be declared */ X #undef DECLARE_IOVEC X@@ -95,7 +95,7 @@ X #undef DECLARE_SPRINTF X X /* Define if you have a POSIX.1 sys/wait.h */ X-#undef HAVE_SYS_WAIT_H X+#define HAVE_SYS_WAIT_H X X /* Define if you have sys/select.h */ X #define HAVE_SYS_SELECT_H X@@ -107,7 +107,7 @@ X #define HAVE_ARPA_INET_H X X /* Define if you have sys/signal.h */ X-#undef HAVE_SYS_SIGNAL_H X+#define HAVE_SYS_SIGNAL_H X X /* Define if you have sys/stropts.h */ X #undef HAVE_SYS_STROPTS_H X@@ -180,7 +180,7 @@ X #undef HAVE_GRANTPT X X /* Define if you have fchmod */ X-#undef HAVE_FCHMOD X+#define HAVE_FCHMOD X X /* Define if you have */ X #undef HAVE_SYS_TYPES32_H 3f590533f5abb97696ef7d1d2986b90e echo x - qemu-devel/files/patch-bg sed 's/^X//' >qemu-devel/files/patch-bg << 'e1d0da9b7e9ede5e6fc04cf2dcbb2483' XIndex: qemu/net.h X@@ -99,12 +99,14 @@ X int slirp_is_inited(void); X void net_client_check(void); X X-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" X-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" X+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" X+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" X+#ifndef SMBD_COMMAND X #ifdef __sun__ X #define SMBD_COMMAND "/usr/sfw/sbin/smbd" X #else X #define SMBD_COMMAND "/usr/sbin/smbd" X #endif X+#endif X X #endif XIndex: qemu/net/tap.h X@@ -29,8 +29,8 @@ X #include "qemu-common.h" X #include "qemu-option.h" X X-#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" X-#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" X+#define DEFAULT_NETWORK_SCRIPT PREFIX "/etc/qemu-ifup" X+#define DEFAULT_NETWORK_DOWN_SCRIPT PREFIX "/etc/qemu-ifdown" X X int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan); X e1d0da9b7e9ede5e6fc04cf2dcbb2483 echo x - qemu-devel/files/patch-bsd-user-ld sed 's/^X//' >qemu-devel/files/patch-bsd-user-ld << '4b5bdc89e95bbb5ba2c1f5a4995ec25a' X--- a/x86_64.ld X+++ b/x86_64.ld X@@ -1,54 +1,58 @@ X-/* Default linker script, for normal executables */ X-OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") X+/* Script for -z combreloc: combine and sort reloc sections */ X+OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", X+ "elf64-x86-64-freebsd") X OUTPUT_ARCH(i386:x86-64) X ENTRY(_start) X+SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); X SECTIONS X { X /* Read-only sections, merged into text segment: */ X- . = 0x60000000 + SIZEOF_HEADERS; X+ PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS; X .interp : { *(.interp) } X .hash : { *(.hash) } X+ .gnu.hash : { *(.gnu.hash) } X .dynsym : { *(.dynsym) } X .dynstr : { *(.dynstr) } X .gnu.version : { *(.gnu.version) } X .gnu.version_d : { *(.gnu.version_d) } X .gnu.version_r : { *(.gnu.version_r) } X- .rel.init : { *(.rel.init) } X- .rela.init : { *(.rela.init) } X- .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } X- .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } X- .rel.fini : { *(.rel.fini) } X- .rela.fini : { *(.rela.fini) } X- .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } X- .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } X- .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } X- .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } X- .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } X- .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } X- .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } X- .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } X- .rel.ctors : { *(.rel.ctors) } X- .rela.ctors : { *(.rela.ctors) } X- .rel.dtors : { *(.rel.dtors) } X- .rela.dtors : { *(.rela.dtors) } X- .rel.got : { *(.rel.got) } X- .rela.got : { *(.rela.got) } X- .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } X- .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } X- .rel.plt : X- { X- *(.rel.plt) X- PROVIDE_HIDDEN (__rel_iplt_start = .); X- *(.rel.iplt) X- PROVIDE_HIDDEN (__rel_iplt_end = .); X- } X- .rela.plt : X- { X- *(.rela.plt) X- PROVIDE_HIDDEN (__rela_iplt_start = .); X- *(.rela.iplt) X- PROVIDE_HIDDEN (__rela_iplt_end = .); X- } X+ .rel.dyn : X+ { X+ *(.rel.init) X+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) X+ *(.rel.fini) X+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) X+ *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) X+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) X+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) X+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) X+ *(.rel.ctors) X+ *(.rel.dtors) X+ *(.rel.got) X+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) X+ *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) X+ *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) X+ *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) X+ } X+ .rela.dyn : X+ { X+ *(.rela.init) X+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) X+ *(.rela.fini) X+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) X+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) X+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) X+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) X+ *(.rela.ctors) X+ *(.rela.dtors) X+ *(.rela.got) X+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) X+ *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) X+ *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) X+ *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) X+ } X+ .rel.plt : { *(.rel.plt) } X+ .rela.plt : { *(.rela.plt) } X .init : X { X KEEP (*(.init)) X@@ -57,6 +61,7 @@ SECTIONS X .text : X { X *(.text .stub .text.* .gnu.linkonce.t.*) X+ KEEP (*(.text.*personality*)) X /* .gnu.warning sections are handled specially by elf32.em. */ X *(.gnu.warning) X } =0x90909090 X@@ -71,35 +76,36 @@ SECTIONS X .rodata1 : { *(.rodata1) } X .eh_frame_hdr : { *(.eh_frame_hdr) } X .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } X- .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table) } X+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } X /* Adjust the address for the data segment. We want to adjust up to X the same address within the page on the next page up. */ X- . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000); X- /* Ensure the __preinit_array_start label is properly aligned. We X- could instead move the label definition inside the section, but X- the linker would then create the section even if it turns out to X- be empty, which isn't pretty. */ X- . = ALIGN(64 / 8); X- PROVIDE (__preinit_array_start = .); X- .preinit_array : { *(.preinit_array) } X- PROVIDE (__preinit_array_end = .); X- PROVIDE (__init_array_start = .); X- .init_array : { *(.init_array) } X- PROVIDE (__init_array_end = .); X- PROVIDE (__fini_array_start = .); X- .fini_array : { *(.fini_array) } X- PROVIDE (__fini_array_end = .); X- .data : X- { X- *(.data .data.* .gnu.linkonce.d.*) X- SORT(CONSTRUCTORS) X- } X- .data1 : { *(.data1) } X+ . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); X+ /* Exception handling */ X+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } X+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } X+ /* Thread Local Storage sections */ X .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } X .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } X- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } X- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table) } X- .dynamic : { *(.dynamic) } X+ .preinit_array : X+ { X+ PROVIDE_HIDDEN (__preinit_array_start = .); X+ KEEP (*(.preinit_array)) X+ PROVIDE_HIDDEN (__preinit_array_end = .); X+ } X+ .init_array : X+ { X+ PROVIDE_HIDDEN (__init_array_start = .); X+ KEEP (*(SORT(.init_array.*))) X+ KEEP (*(.init_array)) X+ PROVIDE_HIDDEN (__init_array_end = .); X+ } X+ .fini_array : X+ { X+ PROVIDE_HIDDEN (__fini_array_start = .); X+ KEEP (*(.fini_array)) X+ KEEP (*(SORT(.fini_array.*))) X+ PROVIDE_HIDDEN (__fini_array_end = .); X+ } X .ctors : X { X /* gcc uses crtbegin.o to find the start of X@@ -112,25 +118,37 @@ SECTIONS X doesn't matter which directory crtbegin.o X is in. */ X KEEP (*crtbegin.o(.ctors)) X+ KEEP (*crtbegin?.o(.ctors)) X /* We don't want to include the .ctor section from X- from the crtend.o file until after the sorted ctors. X+ the crtend.o file until after the sorted ctors. X The .ctor section from the crtend file contains the X end of ctors marker and it must be last */ X- KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors)) X+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) X KEEP (*(SORT(.ctors.*))) X KEEP (*(.ctors)) X } X .dtors : X { X KEEP (*crtbegin.o(.dtors)) X- KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors)) X+ KEEP (*crtbegin?.o(.dtors)) X+ KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) X KEEP (*(SORT(.dtors.*))) X KEEP (*(.dtors)) X } X .jcr : { KEEP (*(.jcr)) } X- .got : { *(.got.plt) *(.got) } X- _edata = .; X- PROVIDE (edata = .); X+ .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) } X+ .dynamic : { *(.dynamic) } X+ .got : { *(.got) } X+ . = DATA_SEGMENT_RELRO_END (24, .); X+ .got.plt : { *(.got.plt) } X+ .data : X+ { X+ *(.data .data.* .gnu.linkonce.d.*) X+ KEEP (*(.gnu.linkonce.d.*personality*)) X+ SORT(CONSTRUCTORS) X+ } X+ .data1 : { *(.data1) } X+ _edata = .; PROVIDE (edata = .); X __bss_start = .; X .bss : X { X@@ -139,12 +157,29 @@ SECTIONS X *(COMMON) X /* Align here to ensure that the .bss section occupies space up to X _end. Align after .bss to ensure correct alignment even if the X- .bss section disappears because there are no input sections. */ X- . = ALIGN(64 / 8); X+ .bss section disappears because there are no input sections. X+ FIXME: Why do we need it? When there is no .bss section, we don't X+ pad the .data section. */ X+ . = ALIGN(. != 0 ? 64 / 8 : 1); X+ } X+ .lbss : X+ { X+ *(.dynlbss) X+ *(.lbss .lbss.* .gnu.linkonce.lb.*) X+ *(LARGE_COMMON) X+ } X+ . = ALIGN(64 / 8); X+ .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : X+ { X+ *(.lrodata .lrodata.* .gnu.linkonce.lr.*) X+ } X+ .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) : X+ { X+ *(.ldata .ldata.* .gnu.linkonce.l.*) X+ . = ALIGN(. != 0 ? 64 / 8 : 1); X } X . = ALIGN(64 / 8); X- _end = .; X- PROVIDE (end = .); X+ _end = .; PROVIDE (end = .); X . = DATA_SEGMENT_END (.); X /* Stabs debugging sections. */ X .stab 0 : { *(.stab) } X@@ -179,4 +214,9 @@ SECTIONS X .debug_funcnames 0 : { *(.debug_funcnames) } X .debug_typenames 0 : { *(.debug_typenames) } X .debug_varnames 0 : { *(.debug_varnames) } X+ /* DWARF 3 */ X+ .debug_pubtypes 0 : { *(.debug_pubtypes) } X+ .debug_ranges 0 : { *(.debug_ranges) } X+ .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) } X+ /DISCARD/ : { *(.note.GNU-stack) } X } X--- a/i386.ld X+++ b/i386.ld X@@ -1,69 +1,88 @@ X-/* ld script to make i386 Linux kernel X- * Written by Martin Mares ; X- */ X-OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") X+OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", X+ "elf32-i386-freebsd") X OUTPUT_ARCH(i386) X ENTRY(_start) X SECTIONS X { X /* Read-only sections, merged into text segment: */ X- . = 0x60000000 + SIZEOF_HEADERS; X- .interp : { *(.interp) } X- .hash : { *(.hash) } X- .dynsym : { *(.dynsym) } X- .dynstr : { *(.dynstr) } X- .gnu.version : { *(.gnu.version) } X- .gnu.version_d : { *(.gnu.version_d) } X- .gnu.version_r : { *(.gnu.version_r) } X- .rel.text : X- { *(.rel.text) *(.rel.gnu.linkonce.t*) } X- .rela.text : X- { *(.rela.text) *(.rela.gnu.linkonce.t*) } X- .rel.data : X- { *(.rel.data) *(.rel.gnu.linkonce.d*) } X- .rela.data : X- { *(.rela.data) *(.rela.gnu.linkonce.d*) } X- .rel.rodata : X- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) } X- .rela.rodata : X- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) } X- .rel.got : { *(.rel.got) } X- .rela.got : { *(.rela.got) } X- .rel.ctors : { *(.rel.ctors) } X- .rela.ctors : { *(.rela.ctors) } X- .rel.dtors : { *(.rel.dtors) } X- .rela.dtors : { *(.rela.dtors) } X- .rel.init : { *(.rel.init) } X- .rela.init : { *(.rela.init) } X- .rel.fini : { *(.rel.fini) } X- .rela.fini : { *(.rela.fini) } X- .rel.bss : { *(.rel.bss) } X- .rela.bss : { *(.rela.bss) } X- .rel.plt : X+ PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS; X+ .interp : { *(.interp) } X+ .hash : { *(.hash) } X+ .dynsym : { *(.dynsym) } X+ .dynstr : { *(.dynstr) } X+ .gnu.version : { *(.gnu.version) } X+ .gnu.version_d : { *(.gnu.version_d) } X+ .gnu.version_r : { *(.gnu.version_r) } X+ .rel.dyn : X+ { X+ *(.rel.init) X+ *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) X+ *(.rel.fini) X+ *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) X+ *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) X+ *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) X+ *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) X+ *(.rel.ctors) X+ *(.rel.dtors) X+ *(.rel.got) X+ *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) X+ } X+ .rela.dyn : X+ { X+ *(.rela.init) X+ *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) X+ *(.rela.fini) X+ *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) X+ *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) X+ *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) X+ *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) X+ *(.rela.ctors) X+ *(.rela.dtors) X+ *(.rela.got) X+ *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) X+ } X+ .rel.plt : X { X *(.rel.plt) X- PROVIDE_HIDDEN (__rel_iplt_start = .); X+ PROVIDE (__rel_iplt_start = .); X *(.rel.iplt) X- PROVIDE_HIDDEN (__rel_iplt_end = .); X+ PROVIDE (__rel_iplt_end = .); X } X .rela.plt : X { X *(.rela.plt) X- PROVIDE_HIDDEN (__rela_iplt_start = .); X+ PROVIDE (__rela_iplt_start = .); X *(.rela.iplt) X- PROVIDE_HIDDEN (__rela_iplt_end = .); X+ PROVIDE (__rela_iplt_end = .); X } X- .init : { *(.init) } =0x47ff041f X- .text : X+ .init : X { X- *(.text) X+ KEEP (*(.init)) X+ } =0x90909090 X+ .plt : { *(.plt) } X+ .text : X+ { X+ *(.text .stub .text.* .gnu.linkonce.t.*) X /* .gnu.warning sections are handled specially by elf32.em. */ X *(.gnu.warning) X- *(.gnu.linkonce.t*) X- } =0x47ff041f X- _etext = .; X+ } =0x90909090 X+ .fini : X+ { X+ KEEP (*(.fini)) X+ } =0x90909090 X+ PROVIDE (__etext = .); X+ PROVIDE (_etext = .); X PROVIDE (etext = .); X- .fini : { *(.fini) } =0x47ff041f X+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } X+ .rodata1 : { *(.rodata1) } X+ .eh_frame_hdr : { *(.eh_frame_hdr) } X+ /* Adjust the address for the data segment. We want to adjust up to X+ the same address within the page on the next page up. */ X+ . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1)); . = DATA_SEGMENT_ALIGN (0x1000, 0x1000); X+ /* Ensure the __preinit_array_start label is properly aligned. We X+ could instead move the label definition inside the section, but X+ the linker would then create the section even if it turns out to X+ be empty, which isn't pretty. */ X . = ALIGN(32 / 8); X PROVIDE (__preinit_array_start = .); X .preinit_array : { *(.preinit_array) } X@@ -74,56 +93,71 @@ SECTIONS X PROVIDE (__fini_array_start = .); X .fini_array : { *(.fini_array) } X PROVIDE (__fini_array_end = .); X- .rodata : { *(.rodata) *(.gnu.linkonce.r*) } X- .rodata1 : { *(.rodata1) } X- .reginfo : { *(.reginfo) } X- /* Adjust the address for the data segment. We want to adjust up to X- the same address within the page on the next page up. */ X- . = ALIGN(0x100000) + (. & (0x100000 - 1)); X- .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } X- .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } X- .data : X+ .data : X { X- *(.data) X- *(.gnu.linkonce.d*) X- CONSTRUCTORS X+ *(.data .data.* .gnu.linkonce.d.*) X+ SORT(CONSTRUCTORS) X } X- .data1 : { *(.data1) } X- .ctors : X- { X- *(.ctors) X- } X- .dtors : X- { X- *(.dtors) X- } X- .plt : { *(.plt) } X- .got : { *(.got.plt) *(.got) } X- .dynamic : { *(.dynamic) } X- /* We want the small data sections together, so single-instruction offsets X- can access them all, and initialized data all before uninitialized, so X- we can shorten the on-disk segment size. */ X- .sdata : { *(.sdata) } X- _edata = .; X+ .data1 : { *(.data1) } X+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } X+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } X+ .eh_frame : { KEEP (*(.eh_frame)) } X+ .gcc_except_table : { *(.gcc_except_table) } X+ .dynamic : { *(.dynamic) } X+ .ctors : X+ { X+ /* gcc uses crtbegin.o to find the start of X+ the constructors, so we make sure it is X+ first. Because this is a wildcard, it X+ doesn't matter if the user does not X+ actually link against crtbegin.o; the X+ linker won't look for a file to match a X+ wildcard. The wildcard also means that it X+ doesn't matter which directory crtbegin.o X+ is in. */ X+ KEEP (*crtbegin*.o(.ctors)) X+ /* We don't want to include the .ctor section from X+ from the crtend.o file until after the sorted ctors. X+ The .ctor section from the crtend file contains the X+ end of ctors marker and it must be last */ X+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) X+ KEEP (*(SORT(.ctors.*))) X+ KEEP (*(.ctors)) X+ } X+ .dtors : X+ { X+ KEEP (*crtbegin*.o(.dtors)) X+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) X+ KEEP (*(SORT(.dtors.*))) X+ KEEP (*(.dtors)) X+ } X+ .jcr : { KEEP (*(.jcr)) } X+ .got : { *(.got.plt) *(.got) } X+ _edata = .; X PROVIDE (edata = .); X __bss_start = .; X- .sbss : { *(.sbss) *(.scommon) } X- .bss : X+ .bss : X { X *(.dynbss) X- *(.bss) X+ *(.bss .bss.* .gnu.linkonce.b.*) X *(COMMON) X+ /* Align here to ensure that the .bss section occupies space up to X+ _end. Align after .bss to ensure correct alignment even if the X+ .bss section disappears because there are no input sections. */ X+ . = ALIGN(32 / 8); X } X- _end = . ; X+ . = ALIGN(32 / 8); X+ _end = .; X PROVIDE (end = .); X+ . = DATA_SEGMENT_END (.); X /* Stabs debugging sections. */ X- .stab 0 : { *(.stab) } X- .stabstr 0 : { *(.stabstr) } X- .stab.excl 0 : { *(.stab.excl) } X- .stab.exclstr 0 : { *(.stab.exclstr) } X- .stab.index 0 : { *(.stab.index) } X+ .stab 0 : { *(.stab) } X+ .stabstr 0 : { *(.stabstr) } X+ .stab.excl 0 : { *(.stab.excl) } X+ .stab.exclstr 0 : { *(.stab.exclstr) } X+ .stab.index 0 : { *(.stab.index) } X .stab.indexstr 0 : { *(.stab.indexstr) } X- .comment 0 : { *(.comment) } X+ .comment 0 : { *(.comment) } X /* DWARF debug sections. X Symbols in the DWARF debugging sections are relative to the beginning X of the section so we begin them at 0. */ X@@ -137,7 +171,7 @@ SECTIONS X .debug_aranges 0 : { *(.debug_aranges) } X .debug_pubnames 0 : { *(.debug_pubnames) } X /* DWARF 2 */ X- .debug_info 0 : { *(.debug_info) } X+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } X .debug_abbrev 0 : { *(.debug_abbrev) } X .debug_line 0 : { *(.debug_line) } X .debug_frame 0 : { *(.debug_frame) } X@@ -149,5 +183,5 @@ SECTIONS X .debug_funcnames 0 : { *(.debug_funcnames) } X .debug_typenames 0 : { *(.debug_typenames) } X .debug_varnames 0 : { *(.debug_varnames) } X- /* These must appear regardless of . */ X+ /DISCARD/ : { *(.note.GNU-stack) } X } 4b5bdc89e95bbb5ba2c1f5a4995ec25a echo x - qemu-devel/files/patch-bsd-user-syscall.c sed 's/^X//' >qemu-devel/files/patch-bsd-user-syscall.c << '1eef35bb9ecb3b4bc9a668127a3dbe8a' Xdiff --git a/bsd-user/syscall.c b/bsd-user/syscall.c Xindex eb1cdf2..2c32637 100644 X--- a/bsd-user/syscall.c X+++ b/bsd-user/syscall.c X@@ -212,7 +212,11 @@ static int sysctl_oldcvt(void *holdp, size_t holdlen, uint32_t kind) X *(uint64_t *)holdp = tswap64(*(unsigned long *)holdp); X break; X #endif X+#if !defined(__FreeBSD_version) || __FreeBSD_version < 900031 X case CTLTYPE_QUAD: X+#else X+ case CTLTYPE_U64: X+#endif X *(uint64_t *)holdp = tswap64(*(uint64_t *)holdp); X break; X case CTLTYPE_STRING: 1eef35bb9ecb3b4bc9a668127a3dbe8a echo x - qemu-devel/files/patch-configure sed 's/^X//' >qemu-devel/files/patch-configure << '4b1fd297110c38b595108a3402834a36' X--- a/configure X+++ a/configure X@@ -285,7 +285,7 @@ bigendian="no" X mingw32="no" X EXESUF="" X prefix="/usr/local" X-mandir="\${prefix}/share/man" X+mandir="\${prefix}/man" X datadir="\${prefix}/share/qemu" X docdir="\${prefix}/share/doc/qemu" X bindir="\${prefix}/bin" X@@ -1964,15 +1964,18 @@ if compile_prog "" "" ; then X fi X X # Check if tools are available to build documentation. X+#if test "$docs" != "no" ; then X+# if has makeinfo && has pod2man; then X+# docs=yes X+# else X+# if test "$docs" = "yes" ; then X+# feature_not_found "docs" X+# fi X+# docs=no X+# fi X+#fi X if test "$docs" != "no" ; then X- if has makeinfo && has pod2man; then X- docs=yes X- else X- if test "$docs" = "yes" ; then X- feature_not_found "docs" X- fi X- docs=no X- fi X+ docs=yes X fi X X # Search for bswap_32 function 4b1fd297110c38b595108a3402834a36 echo x - qemu-devel/files/patch-fbsd sed 's/^X//' >qemu-devel/files/patch-fbsd << 'e367e6454cabeb9bf100a0a894cef648' XIndex: qemu/Makefile X@@ -49,7 +49,10 @@ X X -include config-all-devices.mak X X-build-all: $(DOCS) $(TOOLS) recurse-all X+build-all: $(DOCS) $(TOOLS) bsd/libmath.a recurse-all X+ X+bsd/libmath.a: X+ ( cd bsd ; unset MAKEFLAGS ; $(BSD_MAKE) CC=$(CC) ) X X config-host.h: config-host.h-timestamp X config-host.h-timestamp: config-host.mak X@@ -237,6 +240,7 @@ X X clean: X # avoid old build problems by removing potentially incorrect old files X+ ( cd bsd ; $(BSD_MAKE) clean ) X rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h X rm -f *.o *.d *.a $(TOOLS) TAGS cscope.* *.pod *~ */*~ X rm -f slirp/*.o slirp/*.d audio/*.o audio/*.d block/*.o block/*.d net/*.o net/*.d XIndex: qemu/Makefile.target X@@ -312,8 +312,8 @@ endif # CONFIG_SOFTMMU X X obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o X X-$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) X- $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)) X+$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../bsd/libmath.a X+ $(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y) ../bsd/libmath.a) X X X gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/feature_to_c.sh XIndex: qemu/target-ppc/op_helper.c X@@ -293,6 +293,13 @@ X uint32_t exp = (u.ll >> 52) & 0x7FF; X return ((0 < exp) && (exp < 0x7FF)); X } X+#else X+#ifndef isnormal X+#define isnormal(x) \ X+ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ X+ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ X+ : __isnormall(x)) X+#endif X #endif X X uint32_t helper_compute_fprf (uint64_t arg, uint32_t set_fprf) e367e6454cabeb9bf100a0a894cef648 echo x - qemu-devel/files/patch-hw-ppc_newworld.c sed 's/^X//' >qemu-devel/files/patch-hw-ppc_newworld.c << '12d5320f3d3488f372e0a116b4751f71' X--- a/hw/ppc_newworld.c X+++ b/hw/ppc_newworld.c X@@ -68,6 +68,11 @@ X #include "hw/usb.h" X #include "blockdev.h" X X+/* FreeBSD headers define this */ X+#ifdef round_page X+#undef round_page X+#endif X+ X #define MAX_IDE_BUS 2 X #define CFG_ADDR 0xf0000510 X 12d5320f3d3488f372e0a116b4751f71 echo x - qemu-devel/files/patch-hw-ppc_oldworld.c sed 's/^X//' >qemu-devel/files/patch-hw-ppc_oldworld.c << '1573e9c393255bbda869ae7c2df27ee9' X--- a/hw/ppc_oldworld.c X+++ b/hw/ppc_oldworld.c X@@ -47,6 +47,11 @@ X #define MAX_IDE_BUS 2 X #define CFG_ADDR 0xf0000510 X X+/* FreeBSD headers define this */ X+#ifdef round_page X+#undef round_page X+#endif X+ X static int fw_cfg_boot_set(void *opaque, const char *boot_device) X { X fw_cfg_add_i16(opaque, FW_CFG_BOOT_DEVICE, boot_device[0]); 1573e9c393255bbda869ae7c2df27ee9 echo x - qemu-devel/files/patch-libmath sed 's/^X//' >qemu-devel/files/patch-libmath << '2fbcaeb21e15e22d5a7f7966e483b0ee' Xdiff -Nru qemu-0.7.0/bsd.orig/Makefile qemu-0.7.0/bsd/Makefile X--- qemu-0.7.0/bsd.orig/Makefile Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/Makefile Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,32 @@ X+SRCS= ${MACHINE_ARCH}/e_atan2l.c \ X+ ${MACHINE_ARCH}/e_logl.S \ X+ ${MACHINE_ARCH}/e_powl.S \ X+ ${MACHINE_ARCH}/e_remainderl.S \ X+ ${MACHINE_ARCH}/e_sqrtl.c \ X+ ${MACHINE_ARCH}/s_ceill.S \ X+ ${MACHINE_ARCH}/s_cosl.S \ X+ ${MACHINE_ARCH}/s_floorl.S \ X+ ${MACHINE_ARCH}/s_isnormal.c \ X+ ${MACHINE_ARCH}/s_llrint.S \ X+ ${MACHINE_ARCH}/s_llrintf.S \ X+ ${MACHINE_ARCH}/s_llrintl.S \ X+ ${MACHINE_ARCH}/s_lrint.S \ X+ ${MACHINE_ARCH}/s_lrintf.S \ X+ ${MACHINE_ARCH}/s_lrintl.S \ X+ ${MACHINE_ARCH}/s_rintl.c \ X+ ${MACHINE_ARCH}/s_round.c \ X+ ${MACHINE_ARCH}/s_sinl.S \ X+ ${MACHINE_ARCH}/s_tanl.S X+ X+OBJS= ${SRCS:R:S/$/.o/} X+ X+CFLAGS+= -I. X+ X+all: libmath.a X+ X+libmath.a: ${OBJS} X+ rm -f $@ X+ ${AR} rcs $@ ${OBJS:T} X+ X+clean: X+ rm -f ${OBJS:T} libmath.a Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/e_atan2l.c qemu-0.7.0/bsd/amd64/e_atan2l.c X--- qemu-0.7.0/bsd.orig/amd64/e_atan2l.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/e_atan2l.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,20 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+ X+long double X+__ieee754_atan2l (long double y, long double x) X+{ X+ long double res; X+ X+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); X+ X+ return res; X+} X+ X+weak_alias(__ieee754_atan2l, atan2l) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/e_logl.S qemu-0.7.0/bsd/amd64/e_logl.S X--- qemu-0.7.0/bsd.orig/amd64/e_logl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/e_logl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,59 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ * Adapted for x86-64 by Andreas Jaeger . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ X+#ifdef __ELF__ X+ .section .rodata X+#else X+ .text X+#endif X+ .align ALIGNARG(4) X+ ASM_TYPE_DIRECTIVE(one,@object) X+one: .double 1.0 X+ ASM_SIZE_DIRECTIVE(one) X+ /* It is not important that this constant is precise. It is only X+ a value which is known to be on the safe side for using the X+ fyl2xp1 instruction. */ X+ ASM_TYPE_DIRECTIVE(limit,@object) X+limit: .double 0.29 X+ ASM_SIZE_DIRECTIVE(limit) X+ X+ X+#ifdef PIC X+#define MO(op) op##(%rip) X+#else X+#define MO(op) op X+#endif X+ X+ .text X+ENTRY(__ieee754_logl) X+ fldln2 // log(2) X+ fldt 8(%rsp) // x : log(2) X+ fld %st // x : x : log(2) X+ fsubl MO(one) // x-1 : x : log(2) X+ fld %st // x-1 : x-1 : x : log(2) X+ fabs // |x-1| : x-1 : x : log(2) X+ fcompl MO(limit) // x-1 : x : log(2) X+ fnstsw // x-1 : x : log(2) X+ andb $0x45, %ah X+ jz 2f X+ fstp %st(1) // x-1 : log(2) X+ fyl2xp1 // log(x) X+ ret X+ X+2: fstp %st(0) // x : log(2) X+ fyl2x // log(x) X+ ret X+END (__ieee754_logl) X+ X+weak_alias(__ieee754_logl,logl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/e_powl.S qemu-0.7.0/bsd/amd64/e_powl.S X--- qemu-0.7.0/bsd.orig/amd64/e_powl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/e_powl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,341 @@ X+/* ix87 specific implementation of pow function. X+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. X+ This file is part of the GNU C Library. X+ Contributed by Ulrich Drepper , 1996. X+ X+ The GNU C Library is free software; you can redistribute it and/or X+ modify it under the terms of the GNU Lesser General Public X+ License as published by the Free Software Foundation; either X+ version 2.1 of the License, or (at your option) any later version. X+ X+ The GNU C Library is distributed in the hope that it will be useful, X+ but WITHOUT ANY WARRANTY; without even the implied warranty of X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X+ Lesser General Public License for more details. X+ X+ You should have received a copy of the GNU Lesser General Public X+ License along with the GNU C Library; if not, write to the Free X+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA X+ 02111-1307 USA. */ X+ X+#include X+#include X+ X+#ifdef __ELF__ X+ .section .rodata X+#else X+ .text X+#endif X+ X+ .align ALIGNARG(4) X+ ASM_TYPE_DIRECTIVE(infinity,@object) X+inf_zero: X+infinity: X+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f X+ ASM_SIZE_DIRECTIVE(infinity) X+ ASM_TYPE_DIRECTIVE(zero,@object) X+zero: .double 0.0 X+ ASM_SIZE_DIRECTIVE(zero) X+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) X+minf_mzero: X+minfinity: X+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff X+mzero: X+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 X+ ASM_SIZE_DIRECTIVE(minf_mzero) X+ ASM_TYPE_DIRECTIVE(one,@object) X+one: .double 1.0 X+ ASM_SIZE_DIRECTIVE(one) X+ ASM_TYPE_DIRECTIVE(limit,@object) X+limit: .double 0.29 X+ ASM_SIZE_DIRECTIVE(limit) X+ ASM_TYPE_DIRECTIVE(p63,@object) X+p63: X+ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 X+ ASM_SIZE_DIRECTIVE(p63) X+ X+#ifdef PIC X+#define MO(op) op##(%rip) X+#else X+#define MO(op) op X+#endif X+ X+ .text X+ENTRY(__ieee754_powl) X+ fldt 24(%rsp) // y X+ fxam X+ X+ X+ fnstsw X+ movb %ah, %dl X+ andb $0x45, %ah X+ cmpb $0x40, %ah // is y == 0 ? X+ je 11f X+ X+ cmpb $0x05, %ah // is y == ±inf ? X+ je 12f X+ X+ cmpb $0x01, %ah // is y == NaN ? X+ je 30f X+ X+ fldt 8(%rsp) // x : y X+ X+ fxam X+ fnstsw X+ movb %ah, %dh X+ andb $0x45, %ah X+ cmpb $0x40, %ah X+ je 20f // x is ±0 X+ X+ cmpb $0x05, %ah X+ je 15f // x is ±inf X+ X+ fxch // y : x X+ X+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ X+ fldl MO(p63) // 1L<<63 : y : x X+ fld %st(1) // y : 1L<<63 : y : x X+ fabs // |y| : 1L<<63 : y : x X+ fcomip %st(1), %st // 1L<<63 : y : x X+ fstp %st(0) // y : x X+ jnc 2f X+ X+ /* First see whether `y' is a natural number. In this case we X+ can use a more precise algorithm. */ X+ fld %st // y : y : x X+ fistpll -8(%rsp) // y : x X+ fildll -8(%rsp) // int(y) : y : x X+ fucomip %st(1),%st // y : x X+ jne 2f X+ X+ /* OK, we have an integer value for y. */ X+ mov -8(%rsp),%eax X+ mov -4(%rsp),%edx X+ orl $0, %edx X+ fstp %st(0) // x X+ jns 4f // y >= 0, jump X+ fdivrl MO(one) // 1/x (now referred to as x) X+ negl %eax X+ adcl $0, %edx X+ negl %edx X+4: fldl MO(one) // 1 : x X+ fxch X+ X+6: shrdl $1, %edx, %eax X+ jnc 5f X+ fxch X+ fmul %st(1) // x : ST*x X+ fxch X+5: fmul %st(0), %st // x*x : ST*x X+ shrl $1, %edx X+ movl %eax, %ecx X+ orl %edx, %ecx X+ jnz 6b X+ fstp %st(0) // ST*x X+ ret X+ X+ /* y is ±NAN */ X+30: fldt 8(%rsp) // x : y X+ fldl MO(one) // 1.0 : x : y X+ fucomip %st(1),%st // x : y X+ je 31f X+ fxch // y : x X+31: fstp %st(1) X+ ret X+ X+ .align ALIGNARG(4) X+2: /* y is a real number. */ X+ fxch // x : y X+ fldl MO(one) // 1.0 : x : y X+ fld %st(1) // x : 1.0 : x : y X+ fsub %st(1) // x-1 : 1.0 : x : y X+ fabs // |x-1| : 1.0 : x : y X+ fcompl MO(limit) // 1.0 : x : y X+ fnstsw X+ fxch // x : 1.0 : y X+ test $4500,%eax X+ jz 7f X+ fsub %st(1) // x-1 : 1.0 : y X+ fyl2xp1 // log2(x) : y X+ jmp 8f X+ X+7: fyl2x // log2(x) : y X+8: fmul %st(1) // y*log2(x) : y X+ fxam X+ fnstsw X+ andb $0x45, %ah X+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? X+ je 28f X+ fst %st(1) // y*log2(x) : y*log2(x) X+ frndint // int(y*log2(x)) : y*log2(x) X+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) X+ fxch // fract(y*log2(x)) : int(y*log2(x)) X+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) X+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) X+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) X+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) X+ ret X+ X+28: fstp %st(1) // y*log2(x) X+ fldl MO(one) // 1 : y*log2(x) X+ fscale // 2^(y*log2(x)) : y*log2(x) X+ fstp %st(1) // 2^(y*log2(x)) X+ ret X+ X+ // pow(x,±0) = 1 X+ .align ALIGNARG(4) X+11: fstp %st(0) // pop y X+ fldl MO(one) X+ ret X+ X+ // y == ±inf X+ .align ALIGNARG(4) X+12: fstp %st(0) // pop y X+ fldt 8(%rsp) // x X+ fabs X+ fcompl MO(one) // < 1, == 1, or > 1 X+ fnstsw X+ andb $0x45, %ah X+ cmpb $0x45, %ah X+ je 13f // jump if x is NaN X+ X+ cmpb $0x40, %ah X+ je 14f // jump if |x| == 1 X+ X+ shlb $1, %ah X+ xorb %ah, %dl X+ andl $2, %edx X+#ifdef PIC X+ lea inf_zero(%rip),%rcx X+ fldl (%rcx, %rdx, 4) X+#else X+ fldl inf_zero(,%rdx, 4) X+#endif X+ ret X+ X+ .align ALIGNARG(4) X+14: fldl MO(one) X+ ret X+ X+ .align ALIGNARG(4) X+13: fldt 8(%rsp) // load x == NaN X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±inf X+15: fstp %st(0) // y X+ testb $2, %dh X+ jz 16f // jump if x == +inf X+ X+ // We must find out whether y is an odd integer. X+ fld %st // y : y X+ fistpll -8(%rsp) // y X+ fildll -8(%rsp) // int(y) : y X+ fucomip %st(1),%st X+ ffreep %st // X+ jne 17f X+ X+ // OK, the value is an integer, but is it odd? X+ mov -8(%rsp), %eax X+ mov -4(%rsp), %edx X+ andb $1, %al X+ jz 18f // jump if not odd X+ // It's an odd integer. X+ shrl $31, %edx X+#ifdef PIC X+ lea minf_mzero(%rip),%rcx X+ fldl (%rcx, %rdx, 8) X+#else X+ fldl minf_mzero(,%rdx, 8) X+#endif X+ ret X+ X+ .align ALIGNARG(4) X+16: fcompl MO(zero) X+ fnstsw X+ shrl $5, %eax X+ andl $8, %eax X+#ifdef PIC X+ lea inf_zero(%rip),%rcx X+ fldl (%rcx, %rax, 1) X+#else X+ fldl inf_zero(,%rax, 1) X+#endif X+ ret X+ X+ .align ALIGNARG(4) X+17: shll $30, %edx // sign bit for y in right position X+18: shrl $31, %edx X+#ifdef PIC X+ lea inf_zero(%rip),%rcx X+ fldl (%rcx, %rdx, 8) X+#else X+ fldl inf_zero(,%rdx, 8) X+#endif X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±0 X+20: fstp %st(0) // y X+ testb $2, %dl X+ jz 21f // y > 0 X+ X+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. X+ testb $2, %dh X+ jz 25f X+ X+ fld %st // y : y X+ fistpll -8(%rsp) // y X+ fildll -8(%rsp) // int(y) : y X+ fucomip %st(1),%st X+ ffreep %st // X+ jne 26f X+ X+ // OK, the value is an integer, but is it odd? X+ mov -8(%rsp),%eax X+ mov -4(%rsp),%edx X+ andb $1, %al X+ jz 27f // jump if not odd X+ // It's an odd integer. X+ // Raise divide-by-zero exception and get minus infinity value. X+ fldl MO(one) X+ fdivl MO(zero) X+ fchs X+ ret X+ X+25: fstp %st(0) X+26: X+27: // Raise divide-by-zero exception and get infinity value. X+ fldl MO(one) X+ fdivl MO(zero) X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. X+21: testb $2, %dh X+ jz 22f X+ X+ fld %st // y : y X+ fistpll -8(%rsp) // y X+ fildll -8(%rsp) // int(y) : y X+ fucomip %st(1),%st X+ ffreep %st // X+ jne 23f X+ X+ // OK, the value is an integer, but is it odd? X+ mov -8(%rsp),%eax X+ mov -4(%rsp),%edx X+ andb $1, %al X+ jz 24f // jump if not odd X+ // It's an odd integer. X+ fldl MO(mzero) X+ ret X+ X+22: fstp %st(0) X+23: X+24: fldl MO(zero) X+ ret X+ X+END(__ieee754_powl) X+ X+weak_alias(__ieee754_powl,powl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/e_remainderl.S qemu-0.7.0/bsd/amd64/e_remainderl.S X--- qemu-0.7.0/bsd.orig/amd64/e_remainderl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/e_remainderl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,23 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ * Adapted for x86-64 by Andreas Jaeger . X+ */ X+ X+#include X+#include X+ X+ENTRY(__ieee754_remainderl) X+ fldt 24(%rsp) X+ fldt 8(%rsp) X+1: fprem1 X+ fstsw %ax X+ testl $0x400,%eax X+ jnz 1b X+ fstp %st(1) X+ ret X+END (__ieee754_remainderl) X+ X+weak_alias(__ieee754_remainderl,remainderl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c qemu-0.7.0/bsd/amd64/e_sqrtl.c X--- qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/e_sqrtl.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,20 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+ X+long double X+__ieee754_sqrtl (long double x) X+{ X+ long double res; X+ X+ asm ("fsqrt" : "=t" (res) : "0" (x)); X+ X+ return res; X+} X+ X+weak_alias(__ieee754_sqrtl,sqrtl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_ceill.S qemu-0.7.0/bsd/amd64/s_ceill.S X--- qemu-0.7.0/bsd.orig/amd64/s_ceill.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_ceill.S Fri Apr 29 02:22:18 2005 X@@ -0,0 +1,246 @@ X+/* X+ * ==================================================== X+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. X+ * X+ * Developed at SunPro, a Sun Microsystems, Inc. business. X+ * Permission to use, copy, modify, and distribute this X+ * software is freely granted, provided that this notice X+ * is preserved. X+ * ==================================================== X+ * X+ * From: @(#)s_ceil.c 5.1 93/09/24 X+ */ X+/* XXX: generated from src/lib/msun/src/s_ceill.c */ X+ X+#include X+ X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ .file "s_ceill.c" X+ .section .rodata.cst8,"aM",@progbits,8 X+ .p2align 3 X+.LC0: X+ .long 2281731484 X+ .long 2117592124 X+ .text X+ .p2align 4,,15 X+.globl ceill X+ .type ceill, @function X+ceill: X+.LFB17: X+ pushq %rbp X+.LCFI0: X+ pushq %rbx X+.LCFI1: X+ fldt 24(%rsp) X+ movq $0, -16(%rsp) X+ fld %st(0) X+ fstpt -40(%rsp) X+ movl -32(%rsp), %edi X+ movq -40(%rsp), %rsi X+ movl %edi, -16(%rsp) X+ movl -16(%rsp), %r11d X+ movq %rsi, -24(%rsp) X+ movl %r11d, %r10d X+ andl $32767, %r10d X+ leal -16383(%r10), %r8d X+ cmpl $30, %r8d X+ jg .L2 X+ testl %r8d, %r8d X+ js .L38 X+ movl -20(%rsp), %r9d X+ leal 1(%r8), %ecx X+ mov -24(%rsp), %eax X+ movl $4294967295, %ebp X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ shrq %cl, %rbp X+ mov %r9d, %ebx X+ movq %rbx, %rdx X+ andq %rbp, %rdx X+ orq %rax, %rdx X+ fldt -40(%rsp) X+ je .L42 X+ ffreep %st(0) X+ testb $-128, -15(%rsp) X+ jne .L12 X+ movl $31, %ecx X+ movl $1, %eax X+ subl %r8d, %ecx X+ salq %cl, %rax X+ addl %eax, %r9d X+ mov %r9d, %eax X+ cmpq %rbx, %rax X+ jae .L32 X+ leal 1(%r10), %edx X+ movl %r11d, %eax X+ orl $-2147483648, %r9d X+ andw $-32768, %ax X+ andw $32767, %dx X+ orl %edx, %eax X+ movw %ax, -16(%rsp) X+.L32: X+ movl %r9d, -20(%rsp) X+.L12: X+ faddl .LC0(%rip) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ fstp %st(0) X+ jbe .L31 X+ movl %ebp, %eax X+ movl $0, -24(%rsp) X+ notl %eax X+ andl %eax, %r9d X+ movl %r9d, -20(%rsp) X+ .p2align 4,,7 X+.L31: X+ movq -24(%rsp), %rsi X+ movl -16(%rsp), %edi X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ fldt -40(%rsp) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L2: X+ cmpl $62, %r8d X+ jle .L45 X+.L44: X+ ffreep %st(0) X+.L17: X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ fldt -40(%rsp) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L45: X+ movl -24(%rsp), %edx X+ leal 1(%r8), %ecx X+ movq $-1, %rbx X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ shrq %cl, %rbx X+ mov %edx, %r9d X+ testq %rbx, %r9 X+ fldt -40(%rsp) X+ je .L42 X+ ffreep %st(0) X+ testb $-128, -15(%rsp) X+ jne .L20 X+ cmpl $31, %r8d X+ je .L36 X+ movl $63, %ecx X+ movl $1, %eax X+ subl %r8d, %ecx X+ salq %cl, %rax X+ leal (%rdx,%rax), %eax X+ movl %eax, -24(%rsp) X+ mov %eax, %eax X+ cmpq %r9, %rax X+ jae .L20 X+.L36: X+ movl -20(%rsp), %eax X+ leal 1(%rax), %ecx X+ cmpl %eax, %ecx X+ jae .L34 X+ leal 1(%r10), %edx X+ movl %r11d, %eax X+ orl $-2147483648, %ecx X+ andw $-32768, %ax X+ andw $32767, %dx X+ orl %edx, %eax X+ movw %ax, -16(%rsp) X+.L34: X+ movl %ecx, -20(%rsp) X+ .p2align 4,,7 X+.L20: X+ faddl .LC0(%rip) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ fstp %st(0) X+ jbe .L31 X+ movl %ebx, %eax X+ notl %eax X+ andl %eax, -24(%rsp) X+ jmp .L31 X+ .p2align 4,,7 X+.L42: X+ fstp %st(1) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L38: X+ fldl .LC0(%rip) X+ faddp %st, %st(1) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ jbe .L44 X+ testl %r10d, %r10d X+ jle .L39 X+.L7: X+ movabsq $-9223372036854775808, %rsi X+ movl $16383, %edi X+ testb $-128, -15(%rsp) X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ fldt -40(%rsp) X+ fcmovne %st(1), %st X+ fstp %st(1) X+ fstpt -40(%rsp) X+ movq -40(%rsp), %rsi X+ movl -32(%rsp), %edi X+ movq %rsi, -24(%rsp) X+ movl %edi, -16(%rsp) X+ jmp .L17 X+.L39: X+ movl -24(%rsp), %eax X+ orl -20(%rsp), %eax X+ je .L44 X+ jmp .L7 X+.LFE17: X+ .size ceill, .-ceill X+ .section .eh_frame,"a",@progbits X+.Lframe1: X+ .long .LECIE1-.LSCIE1 X+.LSCIE1: X+ .long 0x0 X+ .byte 0x1 X+ .string "" X+ .uleb128 0x1 X+ .sleb128 -8 X+ .byte 0x10 X+ .byte 0xc X+ .uleb128 0x7 X+ .uleb128 0x8 X+ .byte 0x90 X+ .uleb128 0x1 X+ .p2align 3 X+.LECIE1: X+.LSFDE1: X+ .long .LEFDE1-.LASFDE1 X+.LASFDE1: X+ .long .LASFDE1-.Lframe1 X+ .quad .LFB17 X+ .quad .LFE17-.LFB17 X+ .byte 0x4 X+ .long .LCFI0-.LFB17 X+ .byte 0xe X+ .uleb128 0x10 X+ .byte 0x4 X+ .long .LCFI1-.LCFI0 X+ .byte 0xe X+ .uleb128 0x18 X+ .byte 0x83 X+ .uleb128 0x3 X+ .byte 0x86 X+ .uleb128 0x2 X+ .p2align 3 X+.LEFDE1: X+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_cosl.S qemu-0.7.0/bsd/amd64/s_cosl.S X--- qemu-0.7.0/bsd.orig/amd64/s_cosl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_cosl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,33 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ * Adapted for x86-64 by Andreas Jaeger . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__cosl) X+ fldt 8(%rsp) X+ fcos X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ ret X+ .align ALIGNARG(4) X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fcos X+ ret X+END (__cosl) X+weak_alias (__cosl, cosl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_floorl.S qemu-0.7.0/bsd/amd64/s_floorl.S X--- qemu-0.7.0/bsd.orig/amd64/s_floorl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_floorl.S Fri Apr 29 02:24:32 2005 X@@ -0,0 +1,247 @@ X+/* X+ * ==================================================== X+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. X+ * X+ * Developed at SunPro, a Sun Microsystems, Inc. business. X+ * Permission to use, copy, modify, and distribute this X+ * software is freely granted, provided that this notice X+ * is preserved. X+ * ==================================================== X+ * X+ * From: @(#)s_floor.c 5.1 93/09/24 X+ */ X+/* XXX: generated from src/lib/msun/src/s_floorl.c */ X+ X+#include X+ X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ .file "s_floorl.c" X+ .section .rodata.cst8,"aM",@progbits,8 X+ .p2align 3 X+.LC0: X+ .long 2281731484 X+ .long 2117592124 X+ .section .rodata.cst4,"aM",@progbits,4 X+ .p2align 2 X+.LC2: X+ .long 3212836864 X+ .text X+ .p2align 4,,15 X+.globl floorl X+ .type floorl, @function X+floorl: X+.LFB17: X+ pushq %rbp X+.LCFI0: X+ pushq %rbx X+.LCFI1: X+ fldt 24(%rsp) X+ movq $0, -16(%rsp) X+ fld %st(0) X+ fstpt -40(%rsp) X+ movl -32(%rsp), %edi X+ movq -40(%rsp), %rsi X+ movl %edi, -16(%rsp) X+ movl -16(%rsp), %r11d X+ movq %rsi, -24(%rsp) X+ movl %r11d, %r10d X+ andl $32767, %r10d X+ leal -16383(%r10), %r8d X+ cmpl $30, %r8d X+ jg .L2 X+ testl %r8d, %r8d X+ js .L38 X+ movl -20(%rsp), %r9d X+ leal 1(%r8), %ecx X+ mov -24(%rsp), %eax X+ movl $4294967295, %ebp X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ shrq %cl, %rbp X+ mov %r9d, %ebx X+ movq %rbx, %rdx X+ andq %rbp, %rdx X+ orq %rax, %rdx X+ fldt -40(%rsp) X+ je .L42 X+ ffreep %st(0) X+ testb $-128, -15(%rsp) X+ je .L12 X+ movl $31, %ecx X+ movl $1, %eax X+ subl %r8d, %ecx X+ salq %cl, %rax X+ addl %eax, %r9d X+ mov %r9d, %eax X+ cmpq %rbx, %rax X+ jae .L32 X+ leal 1(%r10), %edx X+ movl %r11d, %eax X+ orl $-2147483648, %r9d X+ andw $-32768, %ax X+ andw $32767, %dx X+ orl %edx, %eax X+ movw %ax, -16(%rsp) X+.L32: X+ movl %r9d, -20(%rsp) X+.L12: X+ faddl .LC0(%rip) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ fstp %st(0) X+ jbe .L31 X+ movl %ebp, %eax X+ movl $0, -24(%rsp) X+ notl %eax X+ andl %eax, %r9d X+ movl %r9d, -20(%rsp) X+ .p2align 4,,7 X+.L31: X+ movq -24(%rsp), %rsi X+ movl -16(%rsp), %edi X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ fldt -40(%rsp) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L2: X+ cmpl $62, %r8d X+ jle .L45 X+.L44: X+ ffreep %st(0) X+.L17: X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ fldt -40(%rsp) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L45: X+ movl -24(%rsp), %edx X+ leal 1(%r8), %ecx X+ movq $-1, %rbx X+ movq %rsi, -40(%rsp) X+ movl %edi, -32(%rsp) X+ shrq %cl, %rbx X+ mov %edx, %r9d X+ testq %rbx, %r9 X+ fldt -40(%rsp) X+ je .L42 X+ ffreep %st(0) X+ testb $-128, -15(%rsp) X+ je .L20 X+ cmpl $31, %r8d X+ je .L36 X+ movl $63, %ecx X+ movl $1, %eax X+ subl %r8d, %ecx X+ salq %cl, %rax X+ leal (%rdx,%rax), %eax X+ movl %eax, -24(%rsp) X+ mov %eax, %eax X+ cmpq %r9, %rax X+ jae .L20 X+.L36: X+ movl -20(%rsp), %eax X+ leal 1(%rax), %ecx X+ cmpl %eax, %ecx X+ jae .L34 X+ leal 1(%r10), %edx X+ movl %r11d, %eax X+ orl $-2147483648, %ecx X+ andw $-32768, %ax X+ andw $32767, %dx X+ orl %edx, %eax X+ movw %ax, -16(%rsp) X+.L34: X+ movl %ecx, -20(%rsp) X+ .p2align 4,,7 X+.L20: X+ faddl .LC0(%rip) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ fstp %st(0) X+ jbe .L31 X+ movl %ebx, %eax X+ notl %eax X+ andl %eax, -24(%rsp) X+ jmp .L31 X+ .p2align 4,,7 X+.L42: X+ fstp %st(1) X+ popq %rbx X+ popq %rbp X+ ret X+ .p2align 4,,7 X+.L38: X+ fldl .LC0(%rip) X+ faddp %st, %st(1) X+ fldz X+ fxch %st(1) X+ fucomip %st(1), %st X+ jbe .L44 X+ testl %r10d, %r10d X+ jle .L39 X+.L7: X+ testb $-128, -15(%rsp) X+ je .L9 X+ ffreep %st(0) X+ flds .LC2(%rip) X+.L9: X+ fstpt -40(%rsp) X+ movq -40(%rsp), %rsi X+ movl -32(%rsp), %edi X+ movq %rsi, -24(%rsp) X+ movl %edi, -16(%rsp) X+ jmp .L17 X+.L39: X+ movl -24(%rsp), %eax X+ orl -20(%rsp), %eax X+ je .L44 X+ jmp .L7 X+.LFE17: X+ .size floorl, .-floorl X+ .section .eh_frame,"a",@progbits X+.Lframe1: X+ .long .LECIE1-.LSCIE1 X+.LSCIE1: X+ .long 0x0 X+ .byte 0x1 X+ .string "" X+ .uleb128 0x1 X+ .sleb128 -8 X+ .byte 0x10 X+ .byte 0xc X+ .uleb128 0x7 X+ .uleb128 0x8 X+ .byte 0x90 X+ .uleb128 0x1 X+ .p2align 3 X+.LECIE1: X+.LSFDE1: X+ .long .LEFDE1-.LASFDE1 X+.LASFDE1: X+ .long .LASFDE1-.Lframe1 X+ .quad .LFB17 X+ .quad .LFE17-.LFB17 X+ .byte 0x4 X+ .long .LCFI0-.LFB17 X+ .byte 0xe X+ .uleb128 0x10 X+ .byte 0x4 X+ .long .LCFI1-.LCFI0 X+ .byte 0xe X+ .uleb128 0x18 X+ .byte 0x83 X+ .uleb128 0x3 X+ .byte 0x86 X+ .uleb128 0x2 X+ .p2align 3 X+.LEFDE1: X+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_isnormal.c qemu-0.7.0/bsd/amd64/s_isnormal.c X--- qemu-0.7.0/bsd.orig/amd64/s_isnormal.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_isnormal.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,85 @@ X+/*- X+ * Copyright (c) 2003 Mike Barcroft X+ * Copyright (c) 2002-2004 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ * X+ * $FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $ X+ */ X+ X+union IEEEf2bits { X+ float f; X+ struct { X+ unsigned int man :23; X+ unsigned int exp :8; X+ unsigned int sign :1; X+ } bits; X+}; X+ X+union IEEEd2bits { X+ double d; X+ struct { X+ unsigned int manl :32; X+ unsigned int manh :20; X+ unsigned int exp :11; X+ unsigned int sign :1; X+ } bits; X+}; X+ X+union IEEEl2bits { X+ long double e; X+ struct { X+ unsigned int manl :32; X+ unsigned int manh :32; X+ unsigned int exp :15; X+ unsigned int sign :1; X+ unsigned int junk :16; X+ } bits; X+}; X+ X+int X+__isnormal(double d) X+{ X+ union IEEEd2bits u; X+ X+ u.d = d; X+ return (u.bits.exp != 0 && u.bits.exp != 2047); X+} X+ X+int X+__isnormalf(float f) X+{ X+ union IEEEf2bits u; X+ X+ u.f = f; X+ return (u.bits.exp != 0 && u.bits.exp != 255); X+} X+ X+int X+__isnormall(long double e) X+{ X+ union IEEEl2bits u; X+ X+ u.e = e; X+ return (u.bits.exp != 0 && u.bits.exp != 32767); X+} Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrint.S qemu-0.7.0/bsd/amd64/s_llrint.S X--- qemu-0.7.0/bsd.orig/amd64/s_llrint.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_llrint.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,6 @@ X+#include X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+/* sizeof(long) == sizeof(long long) */ X+#define fn llrint X+#include "s_lrint.S" Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintf.S qemu-0.7.0/bsd/amd64/s_llrintf.S X--- qemu-0.7.0/bsd.orig/amd64/s_llrintf.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_llrintf.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,6 @@ X+#include X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+/* sizeof(long) == sizeof(long long) */ X+#define fn llrintf X+#include "s_lrintf.S" Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintl.S qemu-0.7.0/bsd/amd64/s_llrintl.S X--- qemu-0.7.0/bsd.orig/amd64/s_llrintl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_llrintl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,35 @@ X+/* Round argument to nearest integral value according to current rounding X+ direction. X+ Copyright (C) 1997, 2002 Free Software Foundation, Inc. X+ This file is part of the GNU C Library. X+ X+ The GNU C Library is free software; you can redistribute it and/or X+ modify it under the terms of the GNU Lesser General Public X+ License as published by the Free Software Foundation; either X+ version 2.1 of the License, or (at your option) any later version. X+ X+ The GNU C Library is distributed in the hope that it will be useful, X+ but WITHOUT ANY WARRANTY; without even the implied warranty of X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X+ Lesser General Public License for more details. X+ X+ You should have received a copy of the GNU Lesser General Public X+ License along with the GNU C Library; if not, write to the Free X+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA X+ 02111-1307 USA. */ X+ X+#include X+#include X+ X+ .text X+ENTRY(__llrintl) X+ fldt 8(%rsp) X+ fistpll -8(%rsp) X+ fwait X+ movq -8(%rsp),%rax X+ ret X+END(__llrintl) X+weak_alias (__llrintl, llrintl) X+strong_alias (__llrintl, __lrintl) X+weak_alias (__llrintl, lrintl) X+ Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrint.S qemu-0.7.0/bsd/amd64/s_lrint.S X--- qemu-0.7.0/bsd.orig/amd64/s_lrint.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_lrint.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,36 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+ X+#ifndef fn X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+#define fn lrint X+#endif X+ X+ENTRY(fn) X+ cvtsd2si %xmm0, %rax X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintf.S qemu-0.7.0/bsd/amd64/s_lrintf.S X--- qemu-0.7.0/bsd.orig/amd64/s_lrintf.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_lrintf.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,36 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+ X+#ifndef fn X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+#define fn lrintf X+#endif X+ X+ENTRY(fn) X+ cvtss2si %xmm0, %rax X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintl.S qemu-0.7.0/bsd/amd64/s_lrintl.S X--- qemu-0.7.0/bsd.orig/amd64/s_lrintl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_lrintl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1 @@ X+/* Not needed, see s_llrintl.S. */ Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_rintl.c qemu-0.7.0/bsd/amd64/s_rintl.c X--- qemu-0.7.0/bsd.orig/amd64/s_rintl.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_rintl.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,18 @@ X+/* X+ * Written by J.T. Conklin . X+ * Changes for long double by Ulrich Drepper X+ * Public domain. X+ */ X+ X+#include X+ X+long double X+__rintl (long double x) X+{ X+ long double res; X+ X+ asm ("frndint" : "=t" (res) : "0" (x)); X+ return res; X+} X+ X+weak_alias (__rintl, rintl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_round.c qemu-0.7.0/bsd/amd64/s_round.c X--- qemu-0.7.0/bsd.orig/amd64/s_round.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_round.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,51 @@ X+/*- X+ * Copyright (c) 2003, Steven G. Kargl X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice unmodified, this list of conditions, and the following X+ * disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES X+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. X+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, X+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT X+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, X+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY X+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT X+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF X+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. X+ */ X+ X+#include X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $"); X+ X+#include X+ X+double X+round(double x) X+{ X+ double t; X+ X+ if (!isfinite(x)) X+ return (x); X+ X+ if (x >= 0.0) { X+ t = floor(x); X+ if (t - x <= -0.5) X+ t += 1.0; X+ return (t); X+ } else { X+ t = floor(-x); X+ if (t + x <= -0.5) X+ t += 1.0; X+ return (-t); X+ } X+} Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_sinl.S qemu-0.7.0/bsd/amd64/s_sinl.S X--- qemu-0.7.0/bsd.orig/amd64/s_sinl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_sinl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,31 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ * Adapted for x86-64 by Andreas Jaeger . X+ */ X+ X+#include X+#include X+ X+ENTRY(__sinl) X+ fldt 8(%rsp) X+ fsin X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ ret X+ .align ALIGNARG(4) X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fsin X+ ret X+END (__sinl) X+weak_alias (__sinl, sinl) Xdiff -Nru qemu-0.7.0/bsd.orig/amd64/s_tanl.S qemu-0.7.0/bsd/amd64/s_tanl.S X--- qemu-0.7.0/bsd.orig/amd64/s_tanl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/amd64/s_tanl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,34 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ * Adapted for x86-64 by Andreas Jaeger . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__tanl) X+ fldt 8(%rsp) X+ fptan X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ fstp %st(0) X+ ret X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fptan X+ fstp %st(0) X+ ret X+END (__tanl) X+weak_alias (__tanl, tanl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/e_atan2l.c qemu-0.7.0/bsd/i386/e_atan2l.c X--- qemu-0.7.0/bsd.orig/i386/e_atan2l.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/e_atan2l.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,20 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+ X+long double X+__ieee754_atan2l (long double y, long double x) X+{ X+ long double res; X+ X+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); X+ X+ return res; X+} X+ X+weak_alias(__ieee754_atan2l, atan2l) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/e_logl.S qemu-0.7.0/bsd/i386/e_logl.S X--- qemu-0.7.0/bsd.orig/i386/e_logl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/e_logl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,63 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ X+#ifdef __ELF__ X+ .section .rodata X+#else X+ .text X+#endif X+ .align ALIGNARG(4) X+ ASM_TYPE_DIRECTIVE(one,@object) X+one: .double 1.0 X+ ASM_SIZE_DIRECTIVE(one) X+ /* It is not important that this constant is precise. It is only X+ a value which is known to be on the safe side for using the X+ fyl2xp1 instruction. */ X+ ASM_TYPE_DIRECTIVE(limit,@object) X+limit: .double 0.29 X+ ASM_SIZE_DIRECTIVE(limit) X+ X+ X+#ifdef PIC X+#define MO(op) op##@GOTOFF(%edx) X+#else X+#define MO(op) op X+#endif X+ X+ .text X+ENTRY(__ieee754_logl) X+ fldln2 // log(2) X+ fldt 4(%esp) // x : log(2) X+#ifdef PIC X+ call 1f X+1: popl %edx X+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx X+#endif X+ fld %st // x : x : log(2) X+ fsubl MO(one) // x-1 : x : log(2) X+ fld %st // x-1 : x-1 : x : log(2) X+ fabs // |x-1| : x-1 : x : log(2) X+ fcompl MO(limit) // x-1 : x : log(2) X+ fnstsw // x-1 : x : log(2) X+ andb $0x45, %ah X+ jz 2f X+ fstp %st(1) // x-1 : log(2) X+ fyl2xp1 // log(x) X+ ret X+ X+2: fstp %st(0) // x : log(2) X+ fyl2x // log(x) X+ ret X+END (__ieee754_logl) X+ X+weak_alias(__ieee754_logl,logl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/e_powl.S qemu-0.7.0/bsd/i386/e_powl.S X--- qemu-0.7.0/bsd.orig/i386/e_powl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/e_powl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,341 @@ X+/* ix87 specific implementation of pow function. X+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 X+ Free Software Foundation, Inc. X+ This file is part of the GNU C Library. X+ Contributed by Ulrich Drepper , 1996. X+ X+ The GNU C Library is free software; you can redistribute it and/or X+ modify it under the terms of the GNU Lesser General Public X+ License as published by the Free Software Foundation; either X+ version 2.1 of the License, or (at your option) any later version. X+ X+ The GNU C Library is distributed in the hope that it will be useful, X+ but WITHOUT ANY WARRANTY; without even the implied warranty of X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X+ Lesser General Public License for more details. X+ X+ You should have received a copy of the GNU Lesser General Public X+ License along with the GNU C Library; if not, write to the Free X+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA X+ 02111-1307 USA. */ X+ X+#include X+#include X+ X+#ifdef __ELF__ X+ .section .rodata X+#else X+ .text X+#endif X+ X+ .align ALIGNARG(4) X+ ASM_TYPE_DIRECTIVE(infinity,@object) X+inf_zero: X+infinity: X+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f X+ ASM_SIZE_DIRECTIVE(infinity) X+ ASM_TYPE_DIRECTIVE(zero,@object) X+zero: .double 0.0 X+ ASM_SIZE_DIRECTIVE(zero) X+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) X+minf_mzero: X+minfinity: X+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff X+mzero: X+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 X+ ASM_SIZE_DIRECTIVE(minf_mzero) X+ ASM_TYPE_DIRECTIVE(one,@object) X+one: .double 1.0 X+ ASM_SIZE_DIRECTIVE(one) X+ ASM_TYPE_DIRECTIVE(limit,@object) X+limit: .double 0.29 X+ ASM_SIZE_DIRECTIVE(limit) X+ ASM_TYPE_DIRECTIVE(p63,@object) X+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 X+ ASM_SIZE_DIRECTIVE(p63) X+ X+#ifdef PIC X+#define MO(op) op##@GOTOFF(%ecx) X+#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) X+#else X+#define MO(op) op X+#define MOX(op,x,f) op(,x,f) X+#endif X+ X+ .text X+ENTRY(__ieee754_powl) X+ fldt 16(%esp) // y X+ fxam X+ X+#ifdef PIC X+ call 1f X+1: popl %ecx X+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx X+#endif X+ X+ fnstsw X+ movb %ah, %dl X+ andb $0x45, %ah X+ cmpb $0x40, %ah // is y == 0 ? X+ je 11f X+ X+ cmpb $0x05, %ah // is y == ±inf ? X+ je 12f X+ X+ cmpb $0x01, %ah // is y == NaN ? X+ je 30f X+ X+ fldt 4(%esp) // x : y X+ X+ subl $8,%esp X+ X+ fxam X+ fnstsw X+ movb %ah, %dh X+ andb $0x45, %ah X+ cmpb $0x40, %ah X+ je 20f // x is ±0 X+ X+ cmpb $0x05, %ah X+ je 15f // x is ±inf X+ X+ fxch // y : x X+ X+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ X+ fld %st // y : y : x X+ fabs // |y| : y : x X+ fcompl MO(p63) // y : x X+ fnstsw X+ sahf X+ jnc 2f X+ X+ /* First see whether `y' is a natural number. In this case we X+ can use a more precise algorithm. */ X+ fld %st // y : y : x X+ fistpll (%esp) // y : x X+ fildll (%esp) // int(y) : y : x X+ fucomp %st(1) // y : x X+ fnstsw X+ sahf X+ jne 2f X+ X+ /* OK, we have an integer value for y. */ X+ popl %eax X+ popl %edx X+ orl $0, %edx X+ fstp %st(0) // x X+ jns 4f // y >= 0, jump X+ fdivrl MO(one) // 1/x (now referred to as x) X+ negl %eax X+ adcl $0, %edx X+ negl %edx X+4: fldl MO(one) // 1 : x X+ fxch X+ X+6: shrdl $1, %edx, %eax X+ jnc 5f X+ fxch X+ fmul %st(1) // x : ST*x X+ fxch X+5: fmul %st(0), %st // x*x : ST*x X+ shrl $1, %edx X+ movl %eax, %ecx X+ orl %edx, %ecx X+ jnz 6b X+ fstp %st(0) // ST*x X+ ret X+ X+ /* y is ±NAN */ X+30: fldt 4(%esp) // x : y X+ fldl MO(one) // 1.0 : x : y X+ fucomp %st(1) // x : y X+ fnstsw X+ sahf X+ je 31f X+ fxch // y : x X+31: fstp %st(1) X+ ret X+ X+ .align ALIGNARG(4) X+2: /* y is a real number. */ X+ fxch // x : y X+ fldl MO(one) // 1.0 : x : y X+ fld %st(1) // x : 1.0 : x : y X+ fsub %st(1) // x-1 : 1.0 : x : y X+ fabs // |x-1| : 1.0 : x : y X+ fcompl MO(limit) // 1.0 : x : y X+ fnstsw X+ fxch // x : 1.0 : y X+ sahf X+ ja 7f X+ fsub %st(1) // x-1 : 1.0 : y X+ fyl2xp1 // log2(x) : y X+ jmp 8f X+ X+7: fyl2x // log2(x) : y X+8: fmul %st(1) // y*log2(x) : y X+ fxam X+ fnstsw X+ andb $0x45, %ah X+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? X+ je 28f X+ fst %st(1) // y*log2(x) : y*log2(x) X+ frndint // int(y*log2(x)) : y*log2(x) X+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) X+ fxch // fract(y*log2(x)) : int(y*log2(x)) X+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) X+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) X+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) X+ addl $8, %esp X+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) X+ ret X+ X+28: fstp %st(1) // y*log2(x) X+ fldl MO(one) // 1 : y*log2(x) X+ fscale // 2^(y*log2(x)) : y*log2(x) X+ addl $8, %esp X+ fstp %st(1) // 2^(y*log2(x)) X+ ret X+ X+ // pow(x,±0) = 1 X+ .align ALIGNARG(4) X+11: fstp %st(0) // pop y X+ fldl MO(one) X+ ret X+ X+ // y == ±inf X+ .align ALIGNARG(4) X+12: fstp %st(0) // pop y X+ fldt 4(%esp) // x X+ fabs X+ fcompl MO(one) // < 1, == 1, or > 1 X+ fnstsw X+ andb $0x45, %ah X+ cmpb $0x45, %ah X+ je 13f // jump if x is NaN X+ X+ cmpb $0x40, %ah X+ je 14f // jump if |x| == 1 X+ X+ shlb $1, %ah X+ xorb %ah, %dl X+ andl $2, %edx X+ fldl MOX(inf_zero, %edx, 4) X+ ret X+ X+ .align ALIGNARG(4) X+14: fldl MO(one) X+ ret X+ X+ .align ALIGNARG(4) X+13: fldt 4(%esp) // load x == NaN X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±inf X+15: fstp %st(0) // y X+ testb $2, %dh X+ jz 16f // jump if x == +inf X+ X+ // We must find out whether y is an odd integer. X+ fld %st // y : y X+ fistpll (%esp) // y X+ fildll (%esp) // int(y) : y X+ fucompp // X+ fnstsw X+ sahf X+ jne 17f X+ X+ // OK, the value is an integer, but is it odd? X+ popl %eax X+ popl %edx X+ andb $1, %al X+ jz 18f // jump if not odd X+ // It's an odd integer. X+ shrl $31, %edx X+ fldl MOX(minf_mzero, %edx, 8) X+ ret X+ X+ .align ALIGNARG(4) X+16: fcompl MO(zero) X+ addl $8, %esp X+ fnstsw X+ shrl $5, %eax X+ andl $8, %eax X+ fldl MOX(inf_zero, %eax, 1) X+ ret X+ X+ .align ALIGNARG(4) X+17: shll $30, %edx // sign bit for y in right position X+ addl $8, %esp X+18: shrl $31, %edx X+ fldl MOX(inf_zero, %edx, 8) X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±0 X+20: fstp %st(0) // y X+ testb $2, %dl X+ jz 21f // y > 0 X+ X+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. X+ testb $2, %dh X+ jz 25f X+ X+ fld %st // y : y X+ fistpll (%esp) // y X+ fildll (%esp) // int(y) : y X+ fucompp // X+ fnstsw X+ sahf X+ jne 26f X+ X+ // OK, the value is an integer, but is it odd? X+ popl %eax X+ popl %edx X+ andb $1, %al X+ jz 27f // jump if not odd X+ // It's an odd integer. X+ // Raise divide-by-zero exception and get minus infinity value. X+ fldl MO(one) X+ fdivl MO(zero) X+ fchs X+ ret X+ X+25: fstp %st(0) X+26: addl $8, %esp X+27: // Raise divide-by-zero exception and get infinity value. X+ fldl MO(one) X+ fdivl MO(zero) X+ ret X+ X+ .align ALIGNARG(4) X+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. X+21: testb $2, %dh X+ jz 22f X+ X+ fld %st // y : y X+ fistpll (%esp) // y X+ fildll (%esp) // int(y) : y X+ fucompp // X+ fnstsw X+ sahf X+ jne 23f X+ X+ // OK, the value is an integer, but is it odd? X+ popl %eax X+ popl %edx X+ andb $1, %al X+ jz 24f // jump if not odd X+ // It's an odd integer. X+ fldl MO(mzero) X+ ret X+ X+22: fstp %st(0) X+23: addl $8, %esp // Don't use 2 x pop X+24: fldl MO(zero) X+ ret X+ X+END(__ieee754_powl) X+ X+weak_alias(__ieee754_powl,powl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/e_remainderl.S qemu-0.7.0/bsd/i386/e_remainderl.S X--- qemu-0.7.0/bsd.orig/i386/e_remainderl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/e_remainderl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,24 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__ieee754_remainderl) X+ fldt 16(%esp) X+ fldt 4(%esp) X+1: fprem1 X+ fstsw %ax X+ sahf X+ jp 1b X+ fstp %st(1) X+ ret X+END (__ieee754_remainderl) X+ X+weak_alias(__ieee754_remainderl,remainderl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/e_sqrtl.c qemu-0.7.0/bsd/i386/e_sqrtl.c X--- qemu-0.7.0/bsd.orig/i386/e_sqrtl.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/e_sqrtl.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,20 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+ X+long double X+__ieee754_sqrtl (long double x) X+{ X+ long double res; X+ X+ asm ("fsqrt" : "=t" (res) : "0" (x)); X+ X+ return res; X+} X+ X+weak_alias(__ieee754_sqrtl,sqrtl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_ceill.S qemu-0.7.0/bsd/i386/s_ceill.S X--- qemu-0.7.0/bsd.orig/i386/s_ceill.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_ceill.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,27 @@ X+/* X+ * Based on code written by J.T. Conklin . X+ * Public domain. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ENTRY(ceill) X+ pushl %ebp X+ movl %esp,%ebp X+ subl $8,%esp X+ X+ fstcw -4(%ebp) /* store fpu control word */ X+ movw -4(%ebp),%dx X+ orw $0x0800,%dx /* round towards +oo */ X+ andw $0xfbff,%dx X+ movw %dx,-8(%ebp) X+ fldcw -8(%ebp) /* load modfied control word */ X+ X+ fldt 8(%ebp) /* round */ X+ frndint X+ X+ fldcw -4(%ebp) /* restore original control word */ X+ X+ leave X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_cosl.S qemu-0.7.0/bsd/i386/s_cosl.S X--- qemu-0.7.0/bsd.orig/i386/s_cosl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_cosl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,32 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__cosl) X+ fldt 4(%esp) X+ fcos X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ ret X+ .align ALIGNARG(4) X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fcos X+ ret X+END (__cosl) X+weak_alias (__cosl, cosl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_floorl.S qemu-0.7.0/bsd/i386/s_floorl.S X--- qemu-0.7.0/bsd.orig/i386/s_floorl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_floorl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,27 @@ X+/* X+ * Based on code written by J.T. Conklin . X+ * Public domain. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ENTRY(floorl) X+ pushl %ebp X+ movl %esp,%ebp X+ subl $8,%esp X+ X+ fstcw -4(%ebp) /* store fpu control word */ X+ movw -4(%ebp),%dx X+ orw $0x0400,%dx /* round towards -oo */ X+ andw $0xf7ff,%dx X+ movw %dx,-8(%ebp) X+ fldcw -8(%ebp) /* load modfied control word */ X+ X+ fldt 8(%ebp) /* round */ X+ frndint X+ X+ fldcw -4(%ebp) /* restore original control word */ X+ X+ leave X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_isnormal.c qemu-0.7.0/bsd/i386/s_isnormal.c X--- qemu-0.7.0/bsd.orig/i386/s_isnormal.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_isnormal.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,85 @@ X+/*- X+ * Copyright (c) 2003 Mike Barcroft X+ * Copyright (c) 2002-2004 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ * X+ * $FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $ X+ */ X+ X+union IEEEf2bits { X+ float f; X+ struct { X+ unsigned int man :23; X+ unsigned int exp :8; X+ unsigned int sign :1; X+ } bits; X+}; X+ X+union IEEEd2bits { X+ double d; X+ struct { X+ unsigned int manl :32; X+ unsigned int manh :20; X+ unsigned int exp :11; X+ unsigned int sign :1; X+ } bits; X+}; X+ X+union IEEEl2bits { X+ long double e; X+ struct { X+ unsigned int manl :32; X+ unsigned int manh :32; X+ unsigned int exp :15; X+ unsigned int sign :1; X+ unsigned int junk :16; X+ } bits; X+}; X+ X+int X+__isnormal(double d) X+{ X+ union IEEEd2bits u; X+ X+ u.d = d; X+ return (u.bits.exp != 0 && u.bits.exp != 2047); X+} X+ X+int X+__isnormalf(float f) X+{ X+ union IEEEf2bits u; X+ X+ u.f = f; X+ return (u.bits.exp != 0 && u.bits.exp != 255); X+} X+ X+int X+__isnormall(long double e) X+{ X+ union IEEEl2bits u; X+ X+ u.e = e; X+ return (u.bits.exp != 0 && u.bits.exp != 32767); X+} Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_llrint.S qemu-0.7.0/bsd/i386/s_llrint.S X--- qemu-0.7.0/bsd.orig/i386/s_llrint.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_llrint.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,36 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $"); X+ X+ENTRY(llrint) X+ fldl 4(%esp) X+ subl $8,%esp X+ fistpll (%esp) X+ popl %eax X+ popl %edx X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintf.S qemu-0.7.0/bsd/i386/s_llrintf.S X--- qemu-0.7.0/bsd.orig/i386/s_llrintf.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_llrintf.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,36 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ENTRY(llrintf) X+ flds 4(%esp) X+ subl $8,%esp X+ fistpll (%esp) X+ popl %eax X+ popl %edx X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintl.S qemu-0.7.0/bsd/i386/s_llrintl.S X--- qemu-0.7.0/bsd.orig/i386/s_llrintl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_llrintl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,35 @@ X+/* Round argument to nearest integral value according to current rounding X+ direction. X+ Copyright (C) 1997 Free Software Foundation, Inc. X+ This file is part of the GNU C Library. X+ Contributed by Ulrich Drepper , 1997. X+ X+ The GNU C Library is free software; you can redistribute it and/or X+ modify it under the terms of the GNU Lesser General Public X+ License as published by the Free Software Foundation; either X+ version 2.1 of the License, or (at your option) any later version. X+ X+ The GNU C Library is distributed in the hope that it will be useful, X+ but WITHOUT ANY WARRANTY; without even the implied warranty of X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X+ Lesser General Public License for more details. X+ X+ You should have received a copy of the GNU Lesser General Public X+ License along with the GNU C Library; if not, write to the Free X+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA X+ 02111-1307 USA. */ X+ X+#include X+#include X+ X+ .text X+ENTRY(__llrintl) X+ fldt 4(%esp) X+ subl $8, %esp X+ fistpll (%esp) X+ fwait X+ popl %eax X+ popl %edx X+ ret X+END(__llrintl) X+weak_alias (__llrintl, llrintl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_lrint.S qemu-0.7.0/bsd/i386/s_lrint.S X--- qemu-0.7.0/bsd.orig/i386/s_lrint.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_lrint.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,35 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $"); X+ X+ENTRY(lrint) X+ fldl 4(%esp) X+ subl $4,%esp X+ fistpl (%esp) X+ popl %eax X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintf.S qemu-0.7.0/bsd/i386/s_lrintf.S X--- qemu-0.7.0/bsd.orig/i386/s_lrintf.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_lrintf.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,35 @@ X+/*- X+ * Copyright (c) 2005 David Schultz X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice, this list of conditions and the following disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND X+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE X+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X+ * SUCH DAMAGE. X+ */ X+ X+#include X+RCSID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $") X+ X+ENTRY(lrintf) X+ flds 4(%esp) X+ subl $4,%esp X+ fistpl (%esp) X+ popl %eax X+ ret Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintl.S qemu-0.7.0/bsd/i386/s_lrintl.S X--- qemu-0.7.0/bsd.orig/i386/s_lrintl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_lrintl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,34 @@ X+/* Round argument to nearest integral value according to current rounding X+ direction. X+ Copyright (C) 1997 Free Software Foundation, Inc. X+ This file is part of the GNU C Library. X+ Contributed by Ulrich Drepper , 1997. X+ X+ The GNU C Library is free software; you can redistribute it and/or X+ modify it under the terms of the GNU Lesser General Public X+ License as published by the Free Software Foundation; either X+ version 2.1 of the License, or (at your option) any later version. X+ X+ The GNU C Library is distributed in the hope that it will be useful, X+ but WITHOUT ANY WARRANTY; without even the implied warranty of X+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X+ Lesser General Public License for more details. X+ X+ You should have received a copy of the GNU Lesser General Public X+ License along with the GNU C Library; if not, write to the Free X+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA X+ 02111-1307 USA. */ X+ X+#include X+#include X+ X+ .text X+ENTRY(__lrintl) X+ fldt 4(%esp) X+ subl $4, %esp X+ fistpl (%esp) X+ fwait X+ popl %eax X+ ret X+END(__lrintl) X+weak_alias (__lrintl, lrintl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_rintl.c qemu-0.7.0/bsd/i386/s_rintl.c X--- qemu-0.7.0/bsd.orig/i386/s_rintl.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_rintl.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,18 @@ X+/* X+ * Written by J.T. Conklin . X+ * Changes for long double by Ulrich Drepper X+ * Public domain. X+ */ X+ X+#include X+ X+long double X+__rintl (long double x) X+{ X+ long double res; X+ X+ asm ("frndint" : "=t" (res) : "0" (x)); X+ return res; X+} X+ X+weak_alias (__rintl, rintl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_round.c qemu-0.7.0/bsd/i386/s_round.c X--- qemu-0.7.0/bsd.orig/i386/s_round.c Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_round.c Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,51 @@ X+/*- X+ * Copyright (c) 2003, Steven G. Kargl X+ * All rights reserved. X+ * X+ * Redistribution and use in source and binary forms, with or without X+ * modification, are permitted provided that the following conditions X+ * are met: X+ * 1. Redistributions of source code must retain the above copyright X+ * notice unmodified, this list of conditions, and the following X+ * disclaimer. X+ * 2. Redistributions in binary form must reproduce the above copyright X+ * notice, this list of conditions and the following disclaimer in the X+ * documentation and/or other materials provided with the distribution. X+ * X+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES X+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. X+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, X+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT X+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, X+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY X+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT X+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF X+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. X+ */ X+ X+#include X+__FBSDID("$FreeBSD: ports/emulators/qemu-devel/files/patch-libmath,v 1.4 2007/03/10 17:03:05 nox Exp $"); X+ X+#include X+ X+double X+round(double x) X+{ X+ double t; X+ X+ if (!isfinite(x)) X+ return (x); X+ X+ if (x >= 0.0) { X+ t = floor(x); X+ if (t - x <= -0.5) X+ t += 1.0; X+ return (t); X+ } else { X+ t = floor(-x); X+ if (t + x <= -0.5) X+ t += 1.0; X+ return (-t); X+ } X+} Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_sinl.S qemu-0.7.0/bsd/i386/s_sinl.S X--- qemu-0.7.0/bsd.orig/i386/s_sinl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_sinl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,32 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__sinl) X+ fldt 4(%esp) X+ fsin X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ ret X+ .align ALIGNARG(4) X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fsin X+ ret X+END (__sinl) X+weak_alias (__sinl, sinl) Xdiff -Nru qemu-0.7.0/bsd.orig/i386/s_tanl.S qemu-0.7.0/bsd/i386/s_tanl.S X--- qemu-0.7.0/bsd.orig/i386/s_tanl.S Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/i386/s_tanl.S Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,33 @@ X+/* X+ * Written by J.T. Conklin . X+ * Public domain. X+ * X+ * Adapted for `long double' by Ulrich Drepper . X+ */ X+ X+#include X+#include X+ X+RCSID("$NetBSD: $") X+ X+ENTRY(__tanl) X+ fldt 4(%esp) X+ fptan X+ fnstsw %ax X+ testl $0x400,%eax X+ jnz 1f X+ fstp %st(0) X+ ret X+1: fldpi X+ fadd %st(0) X+ fxch %st(1) X+2: fprem1 X+ fstsw %ax X+ testl $0x400,%eax X+ jnz 2b X+ fstp %st(1) X+ fptan X+ fstp %st(0) X+ ret X+END (__tanl) X+weak_alias (__tanl, tanl) Xdiff -Nru qemu-0.7.0/bsd.orig/sysdep.h qemu-0.7.0/bsd/sysdep.h X--- qemu-0.7.0/bsd.orig/sysdep.h Wed Dec 31 19:00:00 1969 X+++ qemu-0.7.0/bsd/sysdep.h Fri Apr 29 02:11:27 2005 X@@ -0,0 +1,20 @@ X+#ifndef _QEMU_BSD_SYSDEP_H_ X+#define _QEMU_BSD_SYSDEP_H_ X+ X+#include X+ X+#define HAVE_ELF X+ X+#ifdef __ASSEMBLER__ X+#define ALIGNARG(log2) 1<qemu-devel/files/patch-libmath2 << 'aeb4aa8bdaef867b1c7732dff1bb6515' XIndex: qemu/bsd/Makefile X@@ -16,7 +16,8 @@ X ${MACHINE_ARCH}/s_rintl.c \ X ${MACHINE_ARCH}/s_round.c \ X ${MACHINE_ARCH}/s_sinl.S \ X- ${MACHINE_ARCH}/s_tanl.S X+ ${MACHINE_ARCH}/s_tanl.S \ X+ ${MACHINE_ARCH}/s_ldexpl.c X X OBJS= ${SRCS:R:S/$/.o/} X XIndex: qemu/bsd/i386/s_ldexpl.c X@@ -0,0 +1,21 @@ X+#include X+#include X+#include X+ X+long double __ldexpl(long double x, int expn) X+{ X+ long double res; X+ if (!isfinite (x) || x == 0.0L) X+ return x; X+ X+ __asm__ ("fscale" X+ : "=t" (res) X+ : "0" (x), "u" ((long double) expn)); X+ X+ if (!isfinite (res) || res == 0.0L) X+ errno = ERANGE; X+ X+ return res; X+} X+ X+weak_alias(__ldexpl,ldexpl) XIndex: qemu/bsd/amd64/s_ldexpl.c X@@ -0,0 +1,21 @@ X+#include X+#include X+#include X+ X+long double __ldexpl(long double x, int expn) X+{ X+ long double res; X+ if (!isfinite (x) || x == 0.0L) X+ return x; X+ X+ __asm__ ("fscale" X+ : "=t" (res) X+ : "0" (x), "u" ((long double) expn)); X+ X+ if (!isfinite (res) || res == 0.0L) X+ errno = ERANGE; X+ X+ return res; X+} X+ X+weak_alias(__ldexpl,ldexpl) aeb4aa8bdaef867b1c7732dff1bb6515 echo x - qemu-devel/files/patch-libmath_FreeBSD-version sed 's/^X//' >qemu-devel/files/patch-libmath_FreeBSD-version << '8cfcd0bdb9ab5e7bf7e35403209bacb1' Xdiff -ru qemu.orig/bsd/Makefile qemu/bsd/Makefile X--- qemu.orig/bsd/Makefile 2009-01-19 23:30:09.124413041 -0600 X+++ qemu/bsd/Makefile 2009-01-19 23:40:20.180704580 -0600 X@@ -1,23 +1,90 @@ X-SRCS= ${MACHINE_ARCH}/e_atan2l.c \ X- ${MACHINE_ARCH}/e_logl.S \ X- ${MACHINE_ARCH}/e_powl.S \ X- ${MACHINE_ARCH}/e_remainderl.S \ X- ${MACHINE_ARCH}/e_sqrtl.c \ X- ${MACHINE_ARCH}/s_ceill.S \ X- ${MACHINE_ARCH}/s_cosl.S \ X- ${MACHINE_ARCH}/s_floorl.S \ X- ${MACHINE_ARCH}/s_isnormal.c \ X- ${MACHINE_ARCH}/s_llrint.S \ X- ${MACHINE_ARCH}/s_llrintf.S \ X- ${MACHINE_ARCH}/s_llrintl.S \ X- ${MACHINE_ARCH}/s_lrint.S \ X- ${MACHINE_ARCH}/s_lrintf.S \ X- ${MACHINE_ARCH}/s_lrintl.S \ X- ${MACHINE_ARCH}/s_rintl.c \ X- ${MACHINE_ARCH}/s_round.c \ X- ${MACHINE_ARCH}/s_sinl.S \ X- ${MACHINE_ARCH}/s_tanl.S \ X- ${MACHINE_ARCH}/s_ldexpl.c X+AWK= /usr/bin/awk X+SYSCTL= /sbin/sysctl X+ X+.if !defined(OSVERSION) X+.if exists(/usr/include/sys/param.h) X+OSVERSION!= ${AWK} '/^\#define[[:blank:]]__FreeBSD_version/ {print $$3}' < /usr/include/sys/param.h X+.elif exists(/usr/src/sys/sys/param.h) X+OSVERSION!= ${AWK} '/^\#define[[:blank::]]__FreeBSD_version/ {print $$3}' < /usr/src/sys/sys/param.h X+.else X+OSVERSION!= ${SYSCTL} -n kern.osreldate X+.endif X+.endif X+ X+# Need to be implemented X+_logl= ${MACHINE_ARCH}/e_logl.S X+_powl= ${MACHINE_ARCH}/e_powl.S X+ X+# Implemented in -CURRENT X+.if ${OSVERSION} < 800042 X+_atan2l= ${MACHINE_ARCH}/e_atan2l.c X+.endif X+ X+.if ${OSVERSION} < 800030 X+_remainderl= ${MACHINE_ARCH}/e_remainderl.S X+.endif X+ X+.if ${OSVERSION} < 800025 X+_sqrtl= ${MACHINE_ARCH}/e_sqrtl.c X+.endif X+ X+.if ${OSVERSION} < 800022 X+_cosl= ${MACHINE_ARCH}/s_cosl.S X+_sinl= ${MACHINE_ARCH}/s_sinl.S X+_tanl= ${MACHINE_ARCH}/s_tanl.S X+.endif X+ X+.if ${OSVERSION} < 800012 X+_lrintl= ${MACHINE_ARCH}/s_lrintl.S X+_llrintl= ${MACHINE_ARCH}/s_llrintl.S X+_rintl= ${MACHINE_ARCH}/s_rintl.c X+.endif X+ X+.if ${OSVERSION} < 600020 X+_ldexpl= ${MACHINE_ARCH}/s_ldexpl.c X+.endif X+ X+.if ${OSVERSION} < 600008 X+_ceill= ${MACHINE_ARCH}/s_ceill.S X+_floorl= ${MACHINE_ARCH}/s_floorl.S X+_llrint= ${MACHINE_ARCH}/s_llrint.S X+_llrintf= ${MACHINE_ARCH}/s_llrintf.S X+_lrint= ${MACHINE_ARCH}/s_lrint.S X+_lrintf= ${MACHINE_ARCH}/s_lrintf.S X+.endif X+ X+.if ${OSVERSION} < 502121 X+_isnormal= ${MACHINE_ARCH}/s_isnormal.c X+.endif X+ X+.if ${OSVERSION} < 502114 X+_round= ${MACHINE_ARCH}/s_round.c X+.endif X+ X+#.if ${OSVERSION} < 501113 X+#_fabsl= ${MACHINE_ARCH}/e_fabsl.c X+#.endif X+ X+SRCS= ${_atan2l} \ X+ ${_logl} \ X+ ${_powl} \ X+ ${_remainderl} \ X+ ${_sqrtl} \ X+ ${_ceill} \ X+ ${_cosl} \ X+ ${_floorl} \ X+ ${_isnormal} \ X+ ${_llrint} \ X+ ${_llrintf} \ X+ ${_llrintl} \ X+ ${_lrint} \ X+ ${_lrintf} \ X+ ${_lrintl} \ X+ ${_rintl} \ X+ ${_round} \ X+ ${_sinl} \ X+ ${_tanl} \ X+ ${_ldexpl} X X OBJS= ${SRCS:R:S/$/.o/} X 8cfcd0bdb9ab5e7bf7e35403209bacb1 echo x - qemu-devel/files/patch-os-posix.c sed 's/^X//' >qemu-devel/files/patch-os-posix.c << 'e3e488c3d6b93bdb96af1a1bbf9db694' X--- a/os-posix.c X+++ b/os-posix.c X@@ -27,6 +27,9 @@ X #include X #include X #include X+#ifdef __FreeBSD__ X+#include X+#endif X #include X /*needed for MAP_POPULATE before including qemu-options.h */ X #include e3e488c3d6b93bdb96af1a1bbf9db694 echo x - qemu-devel/files/patch-ppc.ld sed 's/^X//' >qemu-devel/files/patch-ppc.ld << '69f351360cd43cb0416c797c036f7e54' X--- a/ppc.ld X+++ b/ppc.ld X@@ -79,36 +79,34 @@ X } X .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } X .eh_frame_hdr : { *(.eh_frame_hdr) } X- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } X- .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } X /* Adjust the address for the data segment. We want to adjust up to X the same address within the page on the next page up. */ X . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000); X /* Exception handling */ X- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } X- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } X+ .eh_frame : { KEEP (*(.eh_frame)) } X+ .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } X /* Thread Local Storage sections */ X .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } X .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } X .preinit_array : X { X- PROVIDE_HIDDEN (__preinit_array_start = .); X+ PROVIDE (__preinit_array_start = .); X KEEP (*(.preinit_array)) X- PROVIDE_HIDDEN (__preinit_array_end = .); X+ PROVIDE (__preinit_array_end = .); X } X .init_array : X { X- PROVIDE_HIDDEN (__init_array_start = .); X+ PROVIDE (__init_array_start = .); X KEEP (*(SORT(.init_array.*))) X KEEP (*(.init_array)) X- PROVIDE_HIDDEN (__init_array_end = .); X+ PROVIDE(__init_array_end = .); X } X .fini_array : X { X- PROVIDE_HIDDEN (__fini_array_start = .); X+ PROVIDE (__fini_array_start = .); X KEEP (*(.fini_array)) X KEEP (*(SORT(.fini_array.*))) X- PROVIDE_HIDDEN (__fini_array_end = .); X+ PROVIDE (__fini_array_end = .); X } X .ctors : X { X@@ -142,9 +140,8 @@ X .got1 : { *(.got1) } X .got2 : { *(.got2) } X .dynamic : { *(.dynamic) } X- .got : SPECIAL { *(.got) } X- . = DATA_SEGMENT_RELRO_END (0, .); X- .plt : SPECIAL { *(.plt) } X+ .got : { *(.got) } X+ .plt : { *(.plt) } X .data : X { X *(.data .data.* .gnu.linkonce.d.*) X@@ -152,7 +149,7 @@ X SORT(CONSTRUCTORS) X } X .data1 : { *(.data1) } X- .got : SPECIAL { *(.got) } X+ .got : { *(.got) } X /* We want the small data sections together, so single-instruction offsets X can access them all, and initialized data all before uninitialized, so X we can shorten the on-disk segment size. */ X@@ -171,7 +168,7 @@ X *(.scommon) X PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .); X } X- .plt : SPECIAL { *(.plt) } X+ .plt : { *(.plt) } X .bss : X { X *(.dynbss) 69f351360cd43cb0416c797c036f7e54 echo x - qemu-devel/files/patch-qemu-doc.texi sed 's/^X//' >qemu-devel/files/patch-qemu-doc.texi << '0e74811c62d51065f3777e696c0ccf65' XIndex: qemu/qemu-doc.texi X@@ -985,7 +985,8 @@ X X @c man begin SEEALSO X The HTML documentation of QEMU for more precise information and Linux X-user mode emulator invocation. X+user mode emulator invocation, as well as the FreeBSD host notes in X+@file{pkg-message} in the relevant qemu port directory. X @c man end X X @c man begin AUTHOR 0e74811c62d51065f3777e696c0ccf65 echo x - qemu-devel/files/patch-qemu-timer.h sed 's/^X//' >qemu-devel/files/patch-qemu-timer.h << '58359bcf0b86f9a621e946e7d7c88a3b' X--- a/qemu-timer.h X+++ b/qemu-timer.h X@@ -4,6 +4,10 @@ X #include "qemu-common.h" X #include X #include X+#ifdef __FreeBSD__ /* for __FreeBSD_version */ X+#include X+#endif X+#include X X #ifdef _WIN32 X #include 58359bcf0b86f9a621e946e7d7c88a3b echo x - qemu-devel/files/patch-sgabios-read-only-rom16.ld sed 's/^X//' >qemu-devel/files/patch-sgabios-read-only-rom16.ld << 'c31c66137600a03c0aa49d0e98079e41' XIndex: a/../sgabios-read-only/rom16.ld X=================================================================== X--- sgabios-read-only/rom16.ld (revision 8) X+++ sgabios-read-only/rom16.ld (working copy) X@@ -3,8 +3,8 @@ X */ X X /* Script for -z combreloc: combine and sort reloc sections */ X-OUTPUT_FORMAT("elf32-i386", "elf32-i386", X- "elf32-i386") X+OUTPUT_FORMAT("elf32-i386-freebsd", "elf32-i386-freebsd", X+ "elf32-i386-freebsd") X OUTPUT_ARCH(i386) X EXTERN(_start) X ENTRY(_start) c31c66137600a03c0aa49d0e98079e41 echo x - qemu-devel/files/patch-tapclose sed 's/^X//' >qemu-devel/files/patch-tapclose << '1de0172b01bf928c302141c791630b05' XIndex: qemu/net/tap.c X@@ -287,12 +287,13 @@ static void tap_cleanup(VLANClientState X X qemu_purge_queued_packets(nc); X X- if (s->down_script[0]) X- launch_script(s->down_script, s->down_script_arg, s->fd); X- X tap_read_poll(s, 0); X tap_write_poll(s, 0); X close(s->fd); X+ X+ if (s->down_script[0]) X+ launch_script(s->down_script, s->down_script_arg, s->fd); X+ X s->fd = -1; X } X 1de0172b01bf928c302141c791630b05 echo x - qemu-devel/files/patch-vl.c-serial sed 's/^X//' >qemu-devel/files/patch-vl.c-serial << 'bdfd643573fe671ff5248ba8068e80b4' XIndex: qemu/qemu-char.c X@@ -1606,10 +1606,13 @@ X cfsetospeed(&tty, spd); X X tty.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP X- |INLCR|IGNCR|ICRNL|IXON); X- tty.c_oflag |= OPOST; X+ |INLCR|IGNCR|ICRNL|IXON|IMAXBEL); X+ tty.c_oflag &= ~OPOST; /* Don't do any output processing! */ X tty.c_lflag &= ~(ECHO|ECHONL|ICANON|IEXTEN|ISIG); X tty.c_cflag &= ~(CSIZE|PARENB|PARODD|CRTSCTS|CSTOPB); X+#ifdef __FreeBSD__ X+ cfmakeraw(&tty); X+#endif X switch(data_bits) { X default: X case 8: bdfd643573fe671ff5248ba8068e80b4 echo x - qemu-devel/files/patch-x_keymap.c sed 's/^X//' >qemu-devel/files/patch-x_keymap.c << '7a62da4b0802ab543e8e6376ba0a52ba' XIndex: qemu/ui/x_keymap.c X@@ -41,9 +41,9 @@ X 0xb5, /* 112 Divide */ X 0xb8, /* 113 Alt-R */ X 0xc6, /* 114 Break */ X- 0x0, /* 115 */ X- 0x0, /* 116 */ X- 0x0, /* 117 */ X+ 0xdb, /* 115 left windows key */ X+ 0xdc, /* 116 right windows key */ X+ 0xdd, /* 117 right menu key */ X 0x0, /* 118 */ X 0x0, /* 119 */ X 0x0, /* 120 */ 7a62da4b0802ab543e8e6376ba0a52ba echo x - qemu-devel/files/patch-z-bandaid-usb-current sed 's/^X//' >qemu-devel/files/patch-z-bandaid-usb-current << '3bf3d34db9af174ee02926b22ffce1ea' XIndex: qemu/usb-bsd.c X@@ -35,7 +35,12 @@ X X #include X #ifndef __DragonFly__ X+#include X+#if __FreeBSD_version >= 800064 X+#include X+#else X #include X+#endif X #else X #include X #endif 3bf3d34db9af174ee02926b22ffce1ea echo x - qemu-devel/files/pcap-client-type.sed sed 's/^X//' >qemu-devel/files/pcap-client-type.sed << 'e7e1914f8aac738efa9279abb6c3f3e8' X/^ NET_CLIENT_TYPE_DUMP,$/i\ X\ NET_CLIENT_TYPE_PCAP, e7e1914f8aac738efa9279abb6c3f3e8 echo x - qemu-devel/files/pcap-patch sed 's/^X//' >qemu-devel/files/pcap-patch << '081dd6a60e7cc75f202d76e31dfad7d9' X--- configure.orig 2010-01-29 14:36:00.000000000 -0500 X+++ configure 2010-01-29 14:36:00.000000000 -0500 X@@ -180,6 +180,9 @@ smartcard_nss="" X usb_redir="" X opengl="" X guest_agent="yes" X+pcap="no" X+pcap_create="no" X+bpf="no" X X # parse CC options first X for opt do X@@ -611,6 +614,8 @@ for opt do X ;; X --enable-vnc-thread) vnc_thread="yes" X ;; X+ --enable-pcap) pcap="yes" X+ ;; X --disable-slirp) slirp="no" X ;; X --disable-uuid) uuid="no" X@@ -1438,6 +1443,49 @@ EOF X fi X X ########################################## X+# pcap probe X+ X+if test "$pcap" = "yes" ; then X+ cat > $TMPC << EOF X+#include X+int main(void) { return (pcap_lib_version() == (char *)0 ? 1 : 0); } X+EOF X+ if test "$mingw32" = "no" ; then X+ libpcap=-lpcap X+ else X+ libpcap=-lwpcap X+ fi X+ if ! $cc $ARCH_CFLAGS -o $TMPE $libpcap $TMPC 2> /dev/null ; then X+ echo X+ echo "Error: Could not find pcap" X+ echo "Make sure to have the pcap libs and headers installed." X+ echo X+ exit 1 X+ fi X+ cat > $TMPC << EOF X+#include X+int main(void) X+{ X+ char errbuf[PCAP_ERRBUF_SIZE]; X+ return (pcap_create("foo", errbuf) == (pcap_t *)0 ? 1 : 0); X+} X+EOF X+ if $cc $ARCH_CFLAGS -o $TMPE $libpcap $TMPC 2> /dev/null ; then X+ pcap_create="yes" X+ fi X+ cat > $TMPC << EOF X+#define PCAP_DONT_INCLUDE_PCAP_BPF_H X+#include X+#include X+int main(void) { return (BPF_MAJOR_VERSION); } X+EOF X+ if $cc $ARCH_CFLAGS -o $TMPE $TMPC 2> /dev/null ; then X+ bpf="yes" X+ fi X+ libs_softmmu="$libpcap $libs_softmmu" X+fi # test "$pcap" X+ X+########################################## X # VNC TLS detection X if test "$vnc" = "yes" -a "$vnc_tls" != "no" ; then X cat > $TMPC <> $config_host_mak X fi X+if test "$pcap" = "yes" ; then X+ echo "CONFIG_PCAP=y" >> $config_host_mak X+ if test "$pcap_create" = "yes" ; then X+ echo "CONFIG_PCAP_CREATE=y" >> $config_host_mak X+ fi X+ if test "$bpf" = "yes" ; then X+ echo "CONFIG_BPF=y" >> $config_host_mak X+ fi X+fi X if test "$slirp" = "yes" ; then X echo "CONFIG_SLIRP=y" >> $config_host_mak X QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" XIndex: net.c X@@ -37,6 +37,11 @@ X #include "hw/qdev.h" X #include "iov.h" X X+#include X+#ifdef __FreeBSD__ X+#include X+#endif X+ X static QTAILQ_HEAD(, VLANState) vlans; X static QTAILQ_HEAD(, VLANClientState) non_vlan_clients; X X@@ -797,6 +802,226 @@ static int net_init_nic(QemuOpts *opts, X return idx; X } X X+#if defined(CONFIG_PCAP) X+#if defined(CONFIG_BPF) X+#define PCAP_DONT_INCLUDE_PCAP_BPF_H X+#include X+#endif X+#include X+ X+typedef struct PCAPState { X+ VLANClientState nc; X+ pcap_t *handle; X+ int max_eth_frame_size; X+} PCAPState; X+ X+static ssize_t pcap_receive(VLANClientState *nc, const uint8_t *buf, size_t size) X+{ X+ PCAPState *s = DO_UPCAST(PCAPState, nc, nc); X+ X+ return pcap_inject(s->handle, (u_char*)buf, size); X+} X+ X+static void pcap_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata) X+{ X+ VLANClientState *nc = (VLANClientState *)user; X+ X+ int len = phdr->len; X+#ifdef __FreeBSD__ X+ PCAPState *s = DO_UPCAST(PCAPState, nc, nc); X+ int max_eth_frame_size = s->max_eth_frame_size; X+ X+ if (len > max_eth_frame_size) { X+ fprintf(stderr, X+ "pcap_send: packet size > %d (%d), truncating\n", X+ max_eth_frame_size, len); X+ len = max_eth_frame_size; X+ } X+#endif X+ qemu_send_packet(nc, pdata, len); X+} X+ X+static void pcap_send(void *opaque) X+{ X+ PCAPState *s = (PCAPState *)opaque; X+ X+ for (;;) { X+ if (pcap_dispatch(s->handle, 0, (pcap_handler)&pcap_callback, (u_char *)&s->nc) >= 0) X+ break; X+ } X+} X+ X+static void pcap_cleanup(VLANClientState *nc) X+{ X+ PCAPState *s = DO_UPCAST(PCAPState, nc, nc); X+ X+ pcap_close(s->handle); X+} X+ X+static NetClientInfo net_pcap_info = { X+ .type = NET_CLIENT_TYPE_PCAP, X+ .size = sizeof(PCAPState), X+ .receive = pcap_receive, X+ .cleanup = pcap_cleanup, X+}; X+ X+static int net_pcap_init(VLANState *vlan, const char *model, const char *name, const char *ifname) X+{ X+ VLANClientState *nc; X+ PCAPState *s = NULL; X+ char errbuf[PCAP_ERRBUF_SIZE]; X+#if defined(_WIN32) X+ HANDLE h; X+#endif X+ int i; X+ X+ s = qemu_mallocz(sizeof(PCAPState)); X+ nc = qemu_new_net_client(&net_pcap_info, vlan, NULL, model, name); X+ X+ s = DO_UPCAST(PCAPState, nc, nc); X+ if (!s) X+ return -1; X+ X+ if (ifname == NULL && (ifname = pcap_lookupdev(errbuf)) == NULL) { X+ fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); X+ goto fail; X+ } X+ X+#ifdef __FreeBSD__ X+ /* X+ * We want to avoid passing oversize packets to the guest, which X+ * at least on FreeBSD can happen if the host interface uses tso X+ * (seen with an em(4) in this case) - so find out the host X+ * interface's mtu and assume the guest is configured the same. X+ */ X+ s->max_eth_frame_size = 1514; X+ i = socket(AF_INET, SOCK_DGRAM, 0); X+ if (i >= 0) { X+ struct ifreq ifr; X+ X+ (void) memset(&ifr, 0, sizeof(ifr)); X+ strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); X+ if (ioctl(i, SIOCGIFMTU, &ifr) != -1) X+ s->max_eth_frame_size = ifr.ifr_mtu + 14; X+ close(i); X+ } X+#endif X+#if defined(CONFIG_PCAP_CREATE) || defined(_WIN32) X+ /* X+ * Create pcap handle for the device, set promiscuous mode and activate. X+ */ X+ s->handle = (void *)pcap_create(ifname, errbuf); X+ if (!s->handle) { X+ fprintf(stderr, "qemu: pcap_create: %s\n", errbuf); X+ goto fail; X+ } X+ if (pcap_set_promisc(s->handle, 1) != 0) { X+ pcap_perror(s->handle, (char *)"qemu: pcap_set_promisc:"); X+ goto fail; X+ } X+ if (pcap_activate(s->handle) != 0) { X+ pcap_perror(s->handle, (char *)"qemu: pcap_activate:"); X+ goto fail; X+ } X+#else X+ /* Attempt to connect device. */ X+ s->handle = (void *)pcap_open_live(ifname, 65535, 1, 0, errbuf); X+ if (!s->handle) { X+ fprintf(stderr, "qemu: pcap_open_live: %s\n", errbuf); X+ goto fail; X+ } X+#endif X+ X+ /* Set non-blocking mode. */ X+ if (pcap_setnonblock(s->handle, 1, errbuf) < 0) { X+ fprintf(stderr, "qemu: pcap_setnonblock: %s\n", errbuf); X+ goto fail; X+ } X+ X+#if defined(_WIN32) X+ /* X+ * Tell the kernel that the packet has to be seen immediately. X+ */ X+ if (pcap_setmintocopy(s->handle, 0) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); X+ goto fail; X+ } X+#else /* !_WIN32 */ X+#if defined(CONFIG_BPF) X+#if defined(BIOCIMMEDIATE) X+ /* X+ * Tell the kernel that the packet has to be seen immediately. X+ */ X+ { X+ unsigned int one = 1; X+ if (ioctl(pcap_fileno(s->handle), BIOCIMMEDIATE, &one) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set immediate mode\n"); X+ goto fail; X+ } X+ } X+#endif /* BIOCIMMEDIATE */ X+ X+#if defined(BIOCFEEDBACK) X+ /* X+ * Tell the kernel that the sent packet has to be fed back. X+ * This is necessary to connect host and guest. X+ */ X+ { X+ unsigned int one = 1; X+ if (ioctl(pcap_fileno(s->handle), BIOCFEEDBACK, &one) < 0) { X+ fprintf(stderr, "qemu: pcap failed to set feedback mode\n"); X+ goto fail; X+ } X+ } X+#endif /* BIOCFEEDBACK */ X+#endif /* CONFIG_BPF */ X+#endif /* _WIN32 */ X+ X+ snprintf(s->nc.info_str, sizeof(s->nc.info_str), "pcap redirector"); X+ X+#if defined(_WIN32) X+ if ((h = pcap_getevent(s->handle)) == NULL) { X+ fprintf(stderr, "qemu: pcap_getevent failed\n"); X+ goto fail; X+ } X+ qemu_add_wait_object(h, pcap_send, s); X+#else /* !_WIN32 */ X+ if ((i = pcap_get_selectable_fd(s->handle)) < 0) { X+ fprintf(stderr, "qemu: pcap_get_selectable_fd failed\n"); X+ goto fail; X+ } X+ qemu_set_fd_handler(i, pcap_send, NULL, s); X+#endif /* _WIN32 */ X+ X+ return 0; X+ X+fail: X+ if (s) { X+ if (s->handle) X+ pcap_close(s->handle); X+ qemu_free(s); X+ } X+ X+ return -1; X+} X+ X+static int net_init_pcap(QemuOpts *opts, X+ Monitor *mon, X+ const char *name, X+ VLANState *vlan) X+{ X+ const char *ifname; X+ X+ ifname = qemu_opt_get(opts, "ifname"); X+ X+ if (net_pcap_init(vlan, "pcap", name, ifname) == -1) { X+ return -1; X+ } X+ X+ return 0; X+} X+#endif /* CONFIG_PCAP */ X+ X #define NET_COMMON_PARAMS_DESC \ X { \ X .name = "type", \ X@@ -973,6 +1198,21 @@ static const struct { X { /* end of list */ } X }, X }, X+#ifdef CONFIG_PCAP X+ [NET_CLIENT_TYPE_PCAP] = { X+ .type = "pcap", X+ .init = net_init_pcap, X+ .desc = { X+ NET_COMMON_PARAMS_DESC, X+ { X+ .name = "ifname", X+ .type = QEMU_OPT_STRING, X+ .help = "interface name", X+ }, X+ { /* end of list */ } X+ }, X+ }, X+#endif X [NET_CLIENT_TYPE_SOCKET] = { X .type = "socket", X .init = net_init_socket, X@@ -1343,6 +1583,7 @@ void net_check_clients(void) X case NET_CLIENT_TYPE_TAP: X case NET_CLIENT_TYPE_SOCKET: X case NET_CLIENT_TYPE_VDE: X+ case NET_CLIENT_TYPE_PCAP: X has_host_dev = 1; X break; X default: ; X--- qemu-options.hx.orig 2010-01-14 17:18:00.000000000 -0500 X+++ qemu-options.hx 2010-01-29 14:36:00.000000000 -0500 X@@ -799,6 +799,10 @@ DEF("smb", HAS_ARG, QEMU_OPTION_smb, "") X DEF("net", HAS_ARG, QEMU_OPTION_net, X "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n" X " create a new Network Interface Card and connect it to VLAN 'n'\n" X+#ifdef CONFIG_PCAP X+ "-net pcap[,vlan=n][,name=str][,ifname=name]\n" X+ " connect the host network interface using PCAP to VLAN 'n'\n" X+#endif X #ifdef CONFIG_SLIRP X "-net user[,vlan=n][,name=str][,net=addr[/mask]][,host=addr][,restrict=y|n]\n" X " [,hostname=host][,dhcpstart=addr][,dns=addr][,tftp=dir][,bootfile=f]\n" 081dd6a60e7cc75f202d76e31dfad7d9 echo x - qemu-devel/files/qemu-ifdown.sample sed 's/^X//' >qemu-devel/files/qemu-ifdown.sample << 'c5610f3ee4253c789af1c99e526e3467' X#!/bin/sh Xexec true c5610f3ee4253c789af1c99e526e3467 echo x - qemu-devel/files/qemu-ifup.sample sed 's/^X//' >qemu-devel/files/qemu-ifup.sample << 'cf66960d5c644b03896af578336bf752' X#!/bin/sh Xexec true cf66960d5c644b03896af578336bf752 echo x - qemu-devel/files/revert-fbsd-libmath-patch sed 's/^X//' >qemu-devel/files/revert-fbsd-libmath-patch << '58153de39913c110d7504faa4376b5c7' X--- Makefile.orig 2010-02-06 20:59:24.000000000 +0100 X+++ Makefile 2010-02-06 21:00:17.000000000 +0100 X@@ -62,10 +62,7 @@ X X -include config-all-devices.mak X X-build-all: $(DOCS) $(TOOLS) bsd/libmath.a recurse-all X- X-bsd/libmath.a: X- ( cd bsd ; unset MAKEFLAGS ; $(BSD_MAKE) CC=$(CC) ) X+build-all: $(DOCS) $(TOOLS) recurse-all X X config-host.h: config-host.h-timestamp X config-host.h-timestamp: config-host.mak 58153de39913c110d7504faa4376b5c7 exit