diff options
Diffstat (limited to 'emulators/qemu-devel/files')
-rw-r--r-- | emulators/qemu-devel/files/BSDmakefile | 9 | ||||
-rw-r--r-- | emulators/qemu-devel/files/kmod_bsd.c | 642 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-aa | 12 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-ac | 10 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-audio::audio.c | 12 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-audio::ossaudio.c | 11 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bc | 12 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bd | 10 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-be | 16 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bf | 37 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bg | 25 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bh | 26 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bk | 190 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-bt | 103 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-fbsd | 165 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-libmath | 2524 | ||||
-rw-r--r-- | emulators/qemu-devel/files/patch-osdep.c | 40 |
17 files changed, 0 insertions, 3844 deletions
diff --git a/emulators/qemu-devel/files/BSDmakefile b/emulators/qemu-devel/files/BSDmakefile deleted file mode 100644 index 41be88583cda..000000000000 --- a/emulators/qemu-devel/files/BSDmakefile +++ /dev/null @@ -1,9 +0,0 @@ -KMOD= kqemu -SRCS= kmod_bsd.c -OBJS= kqemu-mod-i386.o -.if ${OSVERSION} >= 500000 -CC= cc -.endif -WERROR= - -.include <bsd.kmod.mk> diff --git a/emulators/qemu-devel/files/kmod_bsd.c b/emulators/qemu-devel/files/kmod_bsd.c deleted file mode 100644 index 9e51b7cedf89..000000000000 --- a/emulators/qemu-devel/files/kmod_bsd.c +++ /dev/null @@ -1,642 +0,0 @@ -/* - * FreeBSD kernel wrapper for KQEMU - * Copyright (c) 2005 Antony T Curtis - * - * Based upon the Linux wrapper by Fabrice Bellard - */ - -#include <sys/param.h> -#include <sys/systm.h> -#include <sys/kernel.h> -#if __FreeBSD_version < 500000 -#include <sys/buf.h> -#endif -#include <sys/uio.h> -#include <sys/conf.h> -#include <sys/ctype.h> -#include <sys/fcntl.h> -#include <sys/malloc.h> -#include <sys/proc.h> -#if __FreeBSD_version > 500000 -#include <sys/ktr.h> -#include <sys/sched.h> -#endif -#include <sys/ioccom.h> -#include <sys/signalvar.h> -#include <sys/resourcevar.h> -#include <sys/module.h> - -#include <vm/vm.h> -#include <vm/vm_param.h> -#include <vm/pmap.h> -#include <vm/vm_map.h> -#include <vm/vm_page.h> -#include <vm/vm_kern.h> -#include <vm/vm_extern.h> - -#include <machine/stdarg.h> - -#define __KERNEL__ - -#include "kqemu.h" - -static unsigned long cache_page(vm_offset_t paddr, caddr_t addr); -static caddr_t find_page(vm_offset_t paddr, int free); - -static MALLOC_DEFINE(M_KQEMU, "KQEMU", "KQEMU Resources"); - -struct pagecache { - caddr_t addr; -}; - -static struct pagecache **pagecache; -#if __FreeBSD_version > 500000 -static struct mtx cache_lock; -#endif - -static unsigned long cache_page(vm_offset_t paddr, caddr_t addr) -{ - unsigned long ppn = (unsigned long)(paddr >> PAGE_SHIFT); - int pci = (int)(ppn >> 10); - struct pagecache *cache; -#if __FreeBSD_version > 500000 - mtx_lock_spin(&cache_lock); -#endif - if (!(cache = pagecache[pci])) { - if (!addr) { -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - return 0; - } - cache = pagecache[pci] = (struct pagecache *) - kqemu_vmalloc(1024 * sizeof(struct pagecache)); - - memset(cache, 0, 1024 * sizeof(struct pagecache)); - } - if (!addr) { - int i; - cache[ppn & 1023].addr = (caddr_t) 0; - for (i = 1023; i >= 0; i--, cache++) - if (cache->addr) - break; - if (i < 0) { - kqemu_vfree(pagecache[pci]); - pagecache[pci] = 0; - } -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - return 0; - } - cache[ppn & 1023].addr = (caddr_t) (((unsigned long) addr) & ~PAGE_MASK); -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - return ppn; -} - -static caddr_t find_page(vm_offset_t paddr, int free) -{ - unsigned long ppn = (unsigned long)(paddr >> PAGE_SHIFT); - struct pagecache *cache; - caddr_t addr; -#if __FreeBSD_version > 500000 - mtx_lock_spin(&cache_lock); -#endif - if (!(cache = pagecache[ppn >> 10])) { -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - return 0; - } - addr = (caddr_t)(((unsigned long)cache[ppn & 1023].addr) - | ((unsigned long)paddr & PAGE_MASK)); -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - if (free && addr) - cache_page(paddr, 0); - return addr; -} - -/* lock the page at virtual address 'user_addr' and return its - page index. Return -1 if error */ -unsigned long CDECL kqemu_lock_user_page(unsigned long user_addr) -{ - int rc; - caddr_t addr = (caddr_t) user_addr; - vm_page_t m; - vm_offset_t paddr; - - /*kqemu_log("kqemu_lock_user_page(0x%08x)\n", addr);*/ - - rc = vm_fault_quick(addr, VM_PROT_READ|VM_PROT_WRITE); - if (rc < 0) { - /*kqemu_log("vm_fault_quick failed rc=%d\n",rc);*/ - return -1; - } - paddr = vtophys(addr); - m = PHYS_TO_VM_PAGE(paddr); - vm_page_wire(m); - - return cache_page(paddr, addr); -} - -void CDECL kqemu_unlock_user_page(unsigned long page_index) -{ - vm_page_t m; - vm_offset_t paddr; - /*kqemu_log("kqemu_unlock_user_page(0x%08x)\n",page_index);*/ - - paddr = (vm_offset_t)(page_index << PAGE_SHIFT); - m = PHYS_TO_VM_PAGE(paddr); - vm_page_unwire(m, 1); - cache_page(paddr, 0); -} - -unsigned long CDECL kqemu_alloc_zeroed_page(void) -{ - void *addr; - vm_offset_t paddr; - - /*kqemu_log("kqemu_alloc_zeroed_page()\n");*/ - addr = contigmalloc(PAGE_SIZE, M_KQEMU, M_WAITOK, 0, ~0ul, PAGE_SIZE, 0); - if (!addr) { - /*kqemu_log("contigmalloc failed\n");*/ - return -1; - } - memset(addr, 0, PAGE_SIZE); - paddr = vtophys(addr); - return cache_page(paddr, addr); -} - -void CDECL kqemu_free_page(unsigned long page_index) -{ - vm_offset_t paddr; - caddr_t addr; - /*kqemu_log("kqemu_free_page(0x%08x)\n", page_index);*/ - paddr = (vm_offset_t) (page_index << PAGE_SHIFT); - if ((addr = find_page(paddr,1))) { - contigfree((void *) addr, PAGE_SIZE, M_KQEMU); - } -} - -void * CDECL kqemu_page_kaddr(unsigned long page_index) -{ - vm_offset_t paddr; - /*kqemu_log("kqemu_page_kaddr(0x%08x)\n", page_index);*/ - paddr = (vm_offset_t) (page_index << PAGE_SHIFT); - return (void *) find_page(paddr, 0); -} - -/* contraint: each page of the vmalloced area must be in the first 4 - GB of physical memory */ -void * CDECL kqemu_vmalloc(unsigned int size) -{ - /*kqemu_log("kqemu_vmalloc(0x%08x)\n", size);*/ - return malloc(size, M_KQEMU, M_WAITOK); -} - -void CDECL kqemu_vfree(void *ptr) -{ - /*kqemu_log("kqemu_vfree(0x%08x)\n", ptr);*/ - return free(ptr, M_KQEMU); -} - -unsigned long CDECL kqemu_vmalloc_to_phys(const void *vaddr) -{ - caddr_t addr = (caddr_t)vaddr; - vm_offset_t paddr = vtophys(addr); - return cache_page(paddr, addr); -} - -#if __FreeBSD_version < 500000 -static int -curpriority_cmp(struct proc *p) -{ - int c_class, p_class; - - c_class = RTP_PRIO_BASE(curproc->p_rtprio.type); - p_class = RTP_PRIO_BASE(p->p_rtprio.type); - if (p_class != c_class) - return (p_class - c_class); - if (p_class == RTP_PRIO_NORMAL) - return (((int)p->p_priority - (int)curpriority) / PPQ); - return ((int)p->p_rtprio.prio - (int)curproc->p_rtprio.prio); -} - -/* return TRUE if a signal is pending (i.e. the guest must stop - execution) */ -int CDECL kqemu_schedule(void) -{ - struct proc *p = curproc; - if (curpriority_cmp(p) > 0) { - int s = splhigh(); - p->p_priority = MAXPRI; - setrunqueue(p); - p->p_stats->p_ru.ru_nvcsw++; - mi_switch(); - splx(s); - } - return issignal(curproc) != 0; -} - -#else - -/* return TRUE if a signal is pending (i.e. the guest must stop - execution) */ -int CDECL kqemu_schedule(void) -{ - struct thread *td = curthread; - struct proc *p = td->td_proc; - int rc; - mtx_lock_spin(&sched_lock); - sched_prio(td, td->td_ksegrp->kg_user_pri); - mi_switch(SW_INVOL, NULL); - mtx_unlock_spin(&sched_lock); - - PROC_LOCK(p); - mtx_lock(&p->p_sigacts->ps_mtx); - rc = cursig(td); - mtx_unlock(&p->p_sigacts->ps_mtx); - PROC_UNLOCK(p); - return rc; -} - -#endif - - -static char log_buf[4096]; - -void CDECL kqemu_log(const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - vsnprintf(log_buf, sizeof(log_buf), fmt, ap); - printf("kqemu: %s", log_buf); - va_end(ap); -} - -/*********************************************************/ - - -#define KQEMU_MAX_INSTANCES 4 - -struct kqemu_instance { -#if __FreeBSD_version > 500000 - TAILQ_ENTRY(kqemu_instance) kqemu_ent; - struct cdev *kqemu_dev; -#endif - struct kqemu_state *state; -}; - -static int kqemu_ref_count = 0; -static int max_locked_pages; -#if __FreeBSD_version < 500000 -static dev_t kqemu_dev; -#else -static struct clonedevs *kqemuclones; -static TAILQ_HEAD(,kqemu_instance) kqemuhead = TAILQ_HEAD_INITIALIZER(kqemuhead); -static eventhandler_tag clonetag; -#endif - - -static d_open_t kqemu_open; -static d_close_t kqemu_close; -static d_ioctl_t kqemu_ioctl; - -static struct cdevsw kqemu_cdevsw = { -#if __FreeBSD_version < 500000 - /* open */ kqemu_open, - /* close */ kqemu_close, - /* read */ noread, - /* write */ nowrite, - /* ioctl */ kqemu_ioctl, - /* poll */ nopoll, - /* mmap */ nommap, - /* strategy */ nostrategy, - /* name */ "kqemu", - /* maj */ KQEMU_MAJOR, - /* dump */ nodump, - /* psize */ nopsize, - /* flags */ 0, - /* bmaj */ -1 -#else - .d_version = D_VERSION, - .d_open = kqemu_open, - .d_close = kqemu_close, - .d_ioctl = kqemu_ioctl, - .d_name = "kqemu", -#ifdef D_NEEDGIANT - .d_flags = D_NEEDGIANT, -#endif -#endif -}; - -#if __FreeBSD_version > 500000 -static void -kqemu_clone(void *arg, char *name, int namelen, struct cdev **dev) -{ - int unit, r; - if (*dev != NULL) - return; - - if (strcmp(name, "kqemu") == 0) - unit = -1; - else if (dev_stdclone(name, NULL, "kqemu", &unit) != 1) - return; /* Bad name */ - if (unit != -1 && unit > KQEMU_MAX_INSTANCES) - return; - - r = clone_create(&kqemuclones, &kqemu_cdevsw, &unit, dev, 0); - if (r) { - *dev = make_dev(&kqemu_cdevsw, unit2minor(unit), - UID_ROOT, GID_WHEEL, 0660, "kqemu%d", unit); - if (*dev != NULL) { - dev_ref(*dev); - (*dev)->si_flags |= SI_CHEAPCLONE; - } - } -} -#endif - -static void kqemu_destroy(struct kqemu_instance *ks) -{ - struct cdev *dev = ks->kqemu_dev; - - if (ks->state) { - kqemu_delete(ks->state); - ks->state = NULL; - } - - free(ks, M_KQEMU); - dev->si_drv1 = NULL; -#if __FreeBSD_version > 500000 - mtx_lock_spin(&cache_lock); - TAILQ_REMOVE(&kqemuhead, ks, kqemu_ent); -#endif - if (!--kqemu_ref_count) { - int i; - for (i = 1023; i >= 0; i--) - kqemu_vfree(pagecache[i]); - memset(pagecache, 0, 1024 * sizeof(void *)); - } -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); - - destroy_dev(dev); -#endif -} - -int -#if __FreeBSD_version < 500000 -kqemu_open(dev, flags, fmt, p) - dev_t dev; - int flags, fmt; - struct proc *p; -{ -#else -kqemu_open(dev, flags, fmt, td) - struct cdev *dev; - int flags, fmt; - struct thread *td; -{ - struct proc *p = td->td_proc; -#endif - struct kqemu_instance *ks; - - if (dev->si_drv1 || kqemu_ref_count >= KQEMU_MAX_INSTANCES) - return(EBUSY); - - if ((flags & (FREAD|FWRITE)) == FREAD) - return(EPERM); - - ks = (struct kqemu_instance *) malloc(sizeof(*ks), M_KQEMU, M_WAITOK); - if (ks == NULL) - return(ENOMEM); - memset(ks, 0, sizeof *ks); - - dev->si_drv1 = ks; -#if __FreeBSD_version > 500000 - ks->kqemu_dev = dev; - mtx_lock_spin(&cache_lock); - TAILQ_INSERT_TAIL(&kqemuhead, ks, kqemu_ent); -#endif - kqemu_ref_count++; -#if __FreeBSD_version > 500000 - mtx_unlock_spin(&cache_lock); -#endif - kqemu_log("opened by pid=%d\n", p->p_pid); - return(0); -} - -int -#if __FreeBSD_version < 500000 -kqemu_close(dev, flags, fmt, p) - dev_t dev; - int flags, fmt; - struct proc *p; -{ -#else -kqemu_close(dev, flags, fmt, td) - struct cdev *dev; - int flags, fmt; - struct thread *td; -{ - struct proc *p = td->td_proc; -#endif - struct kqemu_instance *ks = (struct kqemu_instance *) dev->si_drv1; - - kqemu_destroy(ks); - - kqemu_log("closed by pid=%d\n", p->p_pid); - return(0); -} - -int -#if __FreeBSD_version < 500000 -kqemu_ioctl(dev, cmd, cmdarg, flags, p) - dev_t dev; - unsigned long cmd; - caddr_t cmdarg; - int flags; - struct proc *p; -{ -#else -kqemu_ioctl(dev, cmd, cmdarg, flags, td) - struct cdev *dev; - unsigned long cmd; - caddr_t cmdarg; - int flags; - struct thread *td; -{ -#endif - struct kqemu_instance *ks = (struct kqemu_instance *) dev->si_drv1; - struct kqemu_state *s = ks->state; - long ret; - int error = 0; - - switch (cmd) { - case KQEMU_INIT: - /*kqemu_log("KQEMU_INIT data=0x%08x\n",cmdarg);*/ - { - if (s) { - error = (EIO); - break; - } - - if (!(s = kqemu_init((struct kqemu_init *)cmdarg, max_locked_pages))) { - error = (ENOMEM); - break; - } - - ks->state = s; - break; - } - case KQEMU_EXEC: - /*kqemu_log("KQEMU_EXEC data=0x%08x\n",cmdarg);*/ - { - struct kqemu_cpu_state *ctx; - - if (!s) { - error = (EIO); - break; - } - - ctx = kqemu_get_cpu_state(s); - memcpy((void *)ctx, (void *)cmdarg, sizeof(struct kqemu_cpu_state)); - - ret = kqemu_exec(s); -#if __FreeBSD_version > 500000 - td->td_retval[0] = ret; -#else - p->p_retval[0] = ret; -#endif - memcpy((void *)cmdarg, (void *)ctx, sizeof(struct kqemu_cpu_state)); - - break; - } - case KQEMU_GET_VERSION: - /*kqemu_log("KQEMU_GET_VERSION data=0x%08x\n",cmdarg);*/ - { - *(int *)cmdarg = KQEMU_VERSION; - break; - } - default: - /*kqemu_log("ioctl unknown 0x%08x\n",cmd);*/ - error = (ENXIO); - } - return(error); -} - -static int -init_module(void) -{ -#if __FreeBSD_version < 500000 - int rc; -#endif - printf("QEMU Accelerator Module version %d.%d.%d, Copyright (c) 2005 Fabrice Bellard\n" - "FreeBSD wrapper port, Copyright (c) 2005 Antony T Curtis\n" - "This is a proprietary product. Read the LICENSE file for more information\n" - "Redistribution of this module is prohibited without authorization\n", - (KQEMU_VERSION >> 16), - (KQEMU_VERSION >> 8) & 0xff, - (KQEMU_VERSION) & 0xff); - - if (!(pagecache = (struct pagecache **) - kqemu_vmalloc(1024 * sizeof(void *)))) - return(ENOMEM); - memset(pagecache, 0, 1024 * sizeof(void *)); - -#if __FreeBSD_version > 500000 - mtx_init(&cache_lock, "pagecache lock", NULL, MTX_SPIN); -#endif - - max_locked_pages = physmem / (2 * KQEMU_MAX_INSTANCES); - if (max_locked_pages > 32768) - max_locked_pages = 32768; - -#if __FreeBSD_version < 500000 - if ((rc = cdevsw_add(&kqemu_cdevsw))) { - kqemu_log("error registering cdevsw, rc=%d\n", rc); - return(ENOENT); - } - - kqemu_dev = make_dev(&kqemu_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "kqemu"); -#else - clone_setup(&kqemuclones); - clonetag = EVENTHANDLER_REGISTER(dev_clone, kqemu_clone, 0, 1000); - if (!clonetag) - return ENOMEM; -#endif - - kqemu_log("KQEMU installed, max_instances=%d max_locked_mem=%dkB.\n", - KQEMU_MAX_INSTANCES, max_locked_pages * 4); - - kqemu_ref_count = 0; - return 0; -} - -static void -cleanup_module(void) -{ -#if __FreeBSD_version < 500000 - int rc; -#else - struct kqemu_instance *ks; -#endif - -#if __FreeBSD_version < 500000 - destroy_dev(kqemu_dev); - if ((rc = cdevsw_remove(&kqemu_cdevsw))) - kqemu_log("error unregistering, rc=%d\n", rc); -#else - EVENTHANDLER_DEREGISTER(dev_clone, clonetag); - mtx_lock_spin(&cache_lock); - while ((ks = TAILQ_FIRST(&kqemuhead)) != NULL) { - mtx_unlock_spin(&cache_lock); - kqemu_destroy(ks); - mtx_lock_spin(&cache_lock); - } - mtx_unlock_spin(&cache_lock); - mtx_destroy(&cache_lock); - clone_cleanup(&kqemuclones); -#endif - - kqemu_vfree(pagecache); - pagecache = 0; -} - -static int -kqemu_modevent(module_t mod, int type, void *data) -{ - int err = 0; - switch (type) { - case MOD_LOAD: - err = init_module(); - break; - case MOD_UNLOAD: - if (kqemu_ref_count > 0) { - err = EBUSY; - break; - } - /* fall through */ - case MOD_SHUTDOWN: - cleanup_module(); - break; - default: - err = EINVAL; - break; - } - return(err); -} - -static moduledata_t kqemu_mod = { - "kqemu_driver", - kqemu_modevent, - NULL -}; - -DECLARE_MODULE(kqemu, kqemu_mod, SI_SUB_DRIVERS, SI_ORDER_MIDDLE); - diff --git a/emulators/qemu-devel/files/patch-aa b/emulators/qemu-devel/files/patch-aa deleted file mode 100644 index 25eaa72ab235..000000000000 --- a/emulators/qemu-devel/files/patch-aa +++ /dev/null @@ -1,12 +0,0 @@ -diff -urd --exclude=CVS ../cvs/qemu/Makefile qemu-0.5.5/Makefile ---- ../cvs/qemu/Makefile Mon May 17 21:06:42 2004 -+++ qemu-0.5.5/Makefile Sun May 30 05:26:19 2004 -@@ -70,7 +70,7 @@ - - # documentation - %.html: %.texi -- texi2html -monolithic -number $< -+ -texi2html -monolithic -number $< - - qemu.1: qemu-doc.texi - ./texi2pod.pl $< qemu.pod diff --git a/emulators/qemu-devel/files/patch-ac b/emulators/qemu-devel/files/patch-ac deleted file mode 100644 index 8adf3dbd9637..000000000000 --- a/emulators/qemu-devel/files/patch-ac +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -204,7 +204,7 @@ - - if test -z "$sdl" ; then - --sdl_config="sdl-config" -+sdl_config="${SDL_CONFIG}" - sdl=no - sdl_static=no - diff --git a/emulators/qemu-devel/files/patch-audio::audio.c b/emulators/qemu-devel/files/patch-audio::audio.c deleted file mode 100644 index 0b50a522e6fd..000000000000 --- a/emulators/qemu-devel/files/patch-audio::audio.c +++ /dev/null @@ -1,12 +0,0 @@ -Index: qemu/audio/audio.c -@@ -28,6 +28,10 @@ - - #include "audio/audio_int.h" - -+#ifndef INT16_MAX -+#define INT16_MAX 0x7fff -+#endif -+ - #define dolog(...) AUD_log ("audio", __VA_ARGS__) - #ifdef DEBUG - #define ldebug(...) dolog (__VA_ARGS__) diff --git a/emulators/qemu-devel/files/patch-audio::ossaudio.c b/emulators/qemu-devel/files/patch-audio::ossaudio.c deleted file mode 100644 index 8fc9e99b9153..000000000000 --- a/emulators/qemu-devel/files/patch-audio::ossaudio.c +++ /dev/null @@ -1,11 +0,0 @@ -Index: qemu/audio/ossaudio.c -@@ -21,8 +21,8 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ --#include <sys/mman.h> - #include <sys/types.h> -+#include <sys/mman.h> - #include <sys/ioctl.h> - #include <sys/soundcard.h> - #include <assert.h> diff --git a/emulators/qemu-devel/files/patch-bc b/emulators/qemu-devel/files/patch-bc deleted file mode 100644 index 7ad83440d48b..000000000000 --- a/emulators/qemu-devel/files/patch-bc +++ /dev/null @@ -1,12 +0,0 @@ -Index: qemu/i386-dis.c -@@ -2896,6 +2896,10 @@ - OP_E (bytemode, sizeflag); - } - -+#ifndef PRIx64 -+#define PRIx64 "llx" -+#endif -+ - static void - print_operand_value (buf, hex, disp) - char *buf; diff --git a/emulators/qemu-devel/files/patch-bd b/emulators/qemu-devel/files/patch-bd deleted file mode 100644 index 3f85d63c03a1..000000000000 --- a/emulators/qemu-devel/files/patch-bd +++ /dev/null @@ -1,10 +0,0 @@ -Index: qemu/configure -@@ -286,7 +286,7 @@ - if test -z "$prefix" ; then - prefix="/usr/local" - fi --mandir="$prefix/share/man" -+mandir="$prefix/man" - datadir="$prefix/share/qemu" - docdir="$prefix/share/doc/qemu" - bindir="$prefix/bin" diff --git a/emulators/qemu-devel/files/patch-be b/emulators/qemu-devel/files/patch-be deleted file mode 100644 index 6de47db9eaf9..000000000000 --- a/emulators/qemu-devel/files/patch-be +++ /dev/null @@ -1,16 +0,0 @@ -Index: qemu/vl.c -@@ -662,6 +662,14 @@ - case QEMU_TIMER_REALTIME: - #ifdef _WIN32 - return GetTickCount(); -+#elif defined(_BSD) -+ { -+ struct timeval r; -+ if (!gettimeofday(&r, NULL)) { -+ return ((timer_freq * 1000LL) * (int64_t)r.tv_sec -+ + ((int64_t)r.tv_usec * timer_freq) / 1000) / timer_freq; -+ } -+ } - #else - { - struct tms tp; diff --git a/emulators/qemu-devel/files/patch-bf b/emulators/qemu-devel/files/patch-bf deleted file mode 100644 index 57cc889e3119..000000000000 --- a/emulators/qemu-devel/files/patch-bf +++ /dev/null @@ -1,37 +0,0 @@ -Index: qemu/slirp/slirp_config.h -@@ -86,7 +86,7 @@ - #undef BAD_SPRINTF - - /* Define if you have readv */ --#undef HAVE_READV -+#define HAVE_READV - - /* Define if iovec needs to be declared */ - #undef DECLARE_IOVEC -@@ -95,7 +95,7 @@ - #undef DECLARE_SPRINTF - - /* Define if you have a POSIX.1 sys/wait.h */ --#undef HAVE_SYS_WAIT_H -+#define HAVE_SYS_WAIT_H - - /* Define if you have sys/select.h */ - #define HAVE_SYS_SELECT_H -@@ -107,7 +107,7 @@ - #define HAVE_ARPA_INET_H - - /* Define if you have sys/signal.h */ --#undef HAVE_SYS_SIGNAL_H -+#define HAVE_SYS_SIGNAL_H - - /* Define if you have sys/stropts.h */ - #undef HAVE_SYS_STROPTS_H -@@ -180,7 +180,7 @@ - #undef HAVE_GRANTPT - - /* Define if you have fchmod */ --#undef HAVE_FCHMOD -+#define HAVE_FCHMOD - - /* Define if you have <sys/type32.h> */ - #undef HAVE_SYS_TYPES32_H diff --git a/emulators/qemu-devel/files/patch-bg b/emulators/qemu-devel/files/patch-bg deleted file mode 100644 index 57a9ef32df97..000000000000 --- a/emulators/qemu-devel/files/patch-bg +++ /dev/null @@ -1,25 +0,0 @@ -Index: qemu/Makefile.target -@@ -179,7 +179,7 @@ - - ######################################################### - --DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -+DEFINES+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DSMBD=\"${LOCALBASE}/sbin/smbd\" - LIBS+=-lm - ifndef CONFIG_USER_ONLY - LIBS+=-lz -Index: qemu/vl.c -@@ -1560,8 +1560,13 @@ - fclose(f); - atexit(smb_exit); - -+#ifdef __FreeBSD__ -+ snprintf(smb_cmdline, sizeof(smb_cmdline), SMBD " -s %s", -+ smb_conf); -+#else - snprintf(smb_cmdline, sizeof(smb_cmdline), "/usr/sbin/smbd -s %s", - smb_conf); -+#endif - - slirp_add_exec(0, smb_cmdline, 4, 139); - } diff --git a/emulators/qemu-devel/files/patch-bh b/emulators/qemu-devel/files/patch-bh deleted file mode 100644 index 1218bb4656c5..000000000000 --- a/emulators/qemu-devel/files/patch-bh +++ /dev/null @@ -1,26 +0,0 @@ -Index: qemu/dyngen-exec.h -=================================================================== -RCS file: /cvsroot/qemu/qemu/dyngen-exec.h,v -retrieving revision 1.12 -diff -w -u -d -r1.12 dyngen-exec.h ---- dyngen-exec.h 12 May 2004 19:32:15 -0000 1.12 -+++ dyngen-exec.h 21 May 2004 15:00:41 -0000 -@@ -21,6 +21,8 @@ - #define __DYNGEN_EXEC_H__ - - #include <stddef.h> -+#include <stdio.h> -+#include "config.h" - - typedef unsigned char uint8_t; - typedef unsigned short uint16_t; -@@ -54,9 +56,6 @@ - #define UINT32_MAX (4294967295U) - #define UINT64_MAX ((uint64_t)(18446744073709551615)) - --typedef struct FILE FILE; --extern int fprintf(FILE *, const char *, ...); --extern int printf(const char *, ...); - #undef NULL - #define NULL 0 - #ifdef _BSD diff --git a/emulators/qemu-devel/files/patch-bk b/emulators/qemu-devel/files/patch-bk deleted file mode 100644 index 09281f31aef2..000000000000 --- a/emulators/qemu-devel/files/patch-bk +++ /dev/null @@ -1,190 +0,0 @@ -Index: qemu/slirp/bootp.c -@@ -29,11 +29,12 @@ - - #define START_ADDR 15 - --#define LEASE_TIME (24 * 3600) -+#define LEASE_TIME (120) - - typedef struct { - uint8_t allocated; - uint8_t macaddr[6]; -+ int time; - } BOOTPClient; - - BOOTPClient bootp_clients[NB_ADDR]; -@@ -68,26 +69,54 @@ - { - BOOTPClient *bc; - int i; -+ int now=time(NULL); - - for(i = 0; i < NB_ADDR; i++) { - if (!memcmp(macaddr, bootp_clients[i].macaddr, 6)) - goto found; - } -+ for(i = 0; i < NB_ADDR; i++) { -+ if (now-bootp_clients[i].time > 3*LEASE_TIME) -+ goto found; -+ } - return NULL; - found: - bc = &bootp_clients[i]; -- bc->allocated = 1; - paddr->s_addr = htonl(ntohl(special_addr.s_addr) | (i + START_ADDR)); - return bc; - } - -+static BOOTPClient *find_reqaddr(struct in_addr *paddr, struct in_addr *reqaddr, const uint8_t *macaddr) -+{ -+ BOOTPClient *bc=NULL; -+ int i; -+ /*check the net prefix*/ -+ if ((ntohl(reqaddr->s_addr) & 0xffffff00) == -+ (ntohl(special_addr.s_addr) & 0xffffff00)) { -+ i=(ntohl(reqaddr->s_addr) & 0xff) - START_ADDR; -+ if (i>=0 && i< NB_ADDR) { -+ bc = &bootp_clients[i]; -+ if (bc->allocated && -+ (memcmp(macaddr, bootp_clients[i].macaddr, 6)==0)) { -+ paddr->s_addr = reqaddr->s_addr; -+ return bc; -+ } -+ else -+ bc=NULL; -+ } -+ } -+ return bc; -+} -+ -+ - static void dhcp_decode(const uint8_t *buf, int size, -- int *pmsg_type) -+ int *pmsg_type, struct sockaddr_in *preqaddr) - { - const uint8_t *p, *p_end; - int len, tag; - - *pmsg_type = 0; -+ preqaddr->sin_addr.s_addr=htonl(0L); - - p = buf; - p_end = buf + size; -@@ -114,6 +143,10 @@ - if (len >= 1) - *pmsg_type = p[0]; - break; -+ case RFC2132_REQ_ADDR: -+ if (len == 4) { -+ memcpy(&(preqaddr->sin_addr),p,4); -+ } - default: - break; - } -@@ -127,14 +160,14 @@ - BOOTPClient *bc; - struct mbuf *m; - struct bootp_t *rbp; -- struct sockaddr_in saddr, daddr; -+ struct sockaddr_in saddr, daddr, reqaddr; - struct in_addr dns_addr; - int dhcp_msg_type, val; -- uint8_t *q; -+ uint8_t *q,replytype; - - /* extract exact DHCP msg type */ -- dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type); -- dprintf("bootp packet op=%d msgtype=%d\n", bp->bp_op, dhcp_msg_type); -+ dhcp_decode(bp->bp_vend, DHCP_OPT_LEN, &dhcp_msg_type,&reqaddr); -+ dprintf("bootp packet op=%d msgtype=%d reqaddr=%x\n", bp->bp_op, dhcp_msg_type,ntohl(reqaddr.sin_addr.s_addr)); - - if (dhcp_msg_type == 0) - dhcp_msg_type = DHCPREQUEST; /* Force reply for old BOOTP clients */ -@@ -152,21 +185,18 @@ - m->m_data += sizeof(struct udpiphdr); - memset(rbp, 0, sizeof(struct bootp_t)); - -- if (dhcp_msg_type == DHCPDISCOVER) { -- new_addr: -- bc = get_new_addr(&daddr.sin_addr); -- if (!bc) { -- dprintf("no address left\n"); -- return; -- } -- memcpy(bc->macaddr, client_ethaddr, 6); -- } else { -- bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -- if (!bc) { -- /* if never assigned, behaves as if it was already -- assigned (windows fix because it remembers its address) */ -- goto new_addr; -- } -+ bc=NULL; -+ daddr.sin_addr.s_addr=htonl(0L); -+ if (dhcp_msg_type == DHCPREQUEST) { -+ if (reqaddr.sin_addr.s_addr != htonl(0L)) -+ bc = find_reqaddr(&daddr.sin_addr, &reqaddr.sin_addr, bp->bp_hwaddr); -+ else -+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -+ } -+ else if (dhcp_msg_type == DHCPDISCOVER) { -+ bc = find_addr(&daddr.sin_addr, bp->bp_hwaddr); -+ if (!bc) -+ bc = get_new_addr(&daddr.sin_addr); - } - dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); - -@@ -181,25 +211,27 @@ - rbp->bp_hlen = 6; - memcpy(rbp->bp_hwaddr, bp->bp_hwaddr, 6); - -- rbp->bp_yiaddr = daddr.sin_addr; /* Client IP address */ -- rbp->bp_siaddr = saddr.sin_addr; /* Server IP address */ -+ rbp->bp_yiaddr = daddr.sin_addr; /* IP address */ - - q = rbp->bp_vend; - memcpy(q, rfc1533_cookie, 4); - q += 4; - -- if (dhcp_msg_type == DHCPDISCOVER) { -- *q++ = RFC2132_MSG_TYPE; -- *q++ = 1; -- *q++ = DHCPOFFER; -- } else if (dhcp_msg_type == DHCPREQUEST) { -+ if (bc != NULL) { -+ memcpy(bc->macaddr, client_ethaddr, 6); -+ bc->allocated = 1; -+ bc->time = time(NULL); -+ replytype=(dhcp_msg_type == DHCPDISCOVER)?DHCPOFFER:DHCPACK; -+ } -+ else -+ replytype=DHCPNACK; -+ - *q++ = RFC2132_MSG_TYPE; - *q++ = 1; -- *q++ = DHCPACK; -- } -+ *q++ = replytype; - -- if (dhcp_msg_type == DHCPDISCOVER || -- dhcp_msg_type == DHCPREQUEST) { -+ if ((dhcp_msg_type == DHCPDISCOVER || -+ dhcp_msg_type == DHCPREQUEST) && replytype!=DHCPNACK) { - *q++ = RFC2132_SRV_ID; - *q++ = 4; - memcpy(q, &saddr.sin_addr, 4); -Index: qemu/slirp/bootp.h -=================================================================== -RCS file: /cvsroot/qemu/qemu/slirp/bootp.h,v -retrieving revision 1.1 -diff -u -r1.1 bootp.h ---- slirp/bootp.h 22 Apr 2004 00:10:47 -0000 1.1 -+++ slirp/bootp.h 5 Jun 2004 19:34:22 -0000 -@@ -71,6 +71,7 @@ - #define DHCPOFFER 2 - #define DHCPREQUEST 3 - #define DHCPACK 5 -+#define DHCPNACK 6 - - #define RFC1533_VENDOR_MAJOR 0 - #define RFC1533_VENDOR_MINOR 0 diff --git a/emulators/qemu-devel/files/patch-bt b/emulators/qemu-devel/files/patch-bt deleted file mode 100644 index 62e8924722b3..000000000000 --- a/emulators/qemu-devel/files/patch-bt +++ /dev/null @@ -1,103 +0,0 @@ -Index: qemu/vl.c -@@ -43,6 +43,9 @@ - #ifndef __APPLE__ - #include <libutil.h> - #endif -+#ifdef __FreeBSD__ -+#include <sys/module.h> -+#endif - #else - #include <linux/if.h> - #include <linux/if_tun.h> -@@ -1059,6 +1062,34 @@ - - #endif /* CONFIG_SLIRP */ - -+#ifdef __FreeBSD__ -+#define LOAD_QUIETLY 1 -+#define LOAD_VERBOSLY 2 -+ -+int -+loadmodules(int how, const char *module, ...) -+{ -+ int loaded = 0; -+ va_list ap; -+ -+ va_start(ap, module); -+#ifndef NO_MODULES -+ while (module != NULL) { -+ if (modfind(module) == -1) { -+ if (kldload(module) == -1) { -+ if (how == LOAD_VERBOSLY) -+ fprintf(stderr, "%s: Cannot load module\n", module); -+ } else -+ loaded++; -+ } -+ module = va_arg(ap, const char *); -+ } -+ va_end(ap); -+#endif -+ return loaded; -+} -+#endif -+ - #if !defined(_WIN32) - #ifdef _BSD - static int tun_open(char *ifname, int ifname_size) -@@ -1067,11 +1098,55 @@ - char *dev; - struct stat s; - -+#ifdef __FreeBSD__ -+ int i, kldtried = 0, enoentcount = 0, err = 0; -+ char dname[100]; -+#ifdef USE_DEVTAP -+ /* -+ * 5.x has /dev/tap, but that seems to just blindly increase its -+ * couter on every open() for some people(??), i.e. on every qemu run. -+ */ -+ i = -1; -+#else -+ i = 0; -+#endif -+ for (; i < 10; i++) { -+ if (i == -1) -+ strcpy(dname, "/dev/tap"); -+ else -+ snprintf(dname, sizeof dname, "%s%d", -+ "/dev/tap", i); -+ fd = open(dname, O_RDWR); -+ if (fd >= 0) -+ break; -+ else if (errno == ENXIO || errno == ENOENT) { -+ if (i == 0 && !kldtried++) { -+ /* -+ * Attempt to load the tunnel interface KLD if it isn't loaded -+ * already. -+ */ -+ if (loadmodules(LOAD_VERBOSLY, "if_tap", NULL)) -+ i = -1; -+ continue; -+ } -+ if (errno != ENOENT || ++enoentcount > 3) { -+ err = errno; -+ break; -+ } -+ } else -+ err = errno; -+ } -+ if (fd < 0) { -+ fprintf(stderr, "warning: could not open %s (%s): no virtual network emulation\n", dname, strerror(err)); -+ return -1; -+ } -+#else - fd = open("/dev/tap", O_RDWR); - if (fd < 0) { -- fprintf(stderr, "warning: could not open /dev/tap: no virtual network emulation\n"); -+ fprintf(stderr, "warning: could not open /dev/tap (%s): no virtual network emulation\n", strerror(errno)); - return -1; - } -+#endif - - fstat(fd, &s); - dev = devname(s.st_rdev, S_IFCHR); diff --git a/emulators/qemu-devel/files/patch-fbsd b/emulators/qemu-devel/files/patch-fbsd deleted file mode 100644 index 76e950045de7..000000000000 --- a/emulators/qemu-devel/files/patch-fbsd +++ /dev/null @@ -1,165 +0,0 @@ -Index: qemu/Makefile -@@ -13,7 +13,7 @@ - endif - DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 - --all: dyngen$(EXESUF) $(TOOLS) $(DOCS) -+all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) - for d in $(TARGET_DIRS); do \ - $(MAKE) -C $$d $@ || exit 1 ; \ - done -@@ -21,10 +21,13 @@ - ifdef CONFIG_WIN32 - $(MAKE) -C kqemu -f Makefile.winnt - else -- $(MAKE) -C kqemu -+ cd kqemu && $(BSD_MAKE) - endif - endif - -+bsd/libmath.a: -+ ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) -+ - qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c block-vvfat.c - $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) - -@@ -33,6 +36,7 @@ - - clean: - # avoid old build problems by removing potentially incorrect old files -+ ( cd bsd ; $(BSD_MAKE) clean ) - rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h - rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ - $(MAKE) -C tests clean -@@ -40,7 +44,7 @@ - $(MAKE) -C $$d $@ || exit 1 ; \ - done - ifdef CONFIG_KQEMU -- $(MAKE) -C kqemu clean -+ cd kqemu && $(BSD_MAKE) clean - endif - - distclean: clean -@@ -73,9 +77,6 @@ - for d in $(TARGET_DIRS); do \ - $(MAKE) -C $$d $@ || exit 1 ; \ - done --ifdef CONFIG_KQEMU -- cd kqemu ; ./install.sh --endif - - # various test targets - test speed test2: all -Index: qemu/Makefile.target -@@ -391,8 +391,8 @@ - VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld - endif - --$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a -- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) -+$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a -+ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a - - cocoa.o: cocoa.m - $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< -Index: qemu/fpu/softfloat-native.c -@@ -2,11 +2,15 @@ - context is supported */ - #include "softfloat.h" - #include <math.h> -+#if defined(__FreeBSD__) && __FreeBSD_version < 500000 -+#include <ieeefp.h> -+#endif - - void set_float_rounding_mode(int val STATUS_PARAM) - { - STATUS(float_rounding_mode) = val; --#if defined(_BSD) && !defined(__APPLE__) -+#if defined(_BSD) && !defined(__APPLE__) && \ -+ (defined(__FreeBSD__) && __FreeBSD_version < 500000) - fpsetround(val); - #elif defined(__arm__) - /* nothing to do */ -@@ -22,7 +26,7 @@ - } - #endif - --#if defined(_BSD) -+#if defined(_BSD) && !defined(__FreeBSD__) - #define lrint(d) ((int32_t)rint(d)) - #define llrint(d) ((int64_t)rint(d)) - #endif -Index: qemu/fpu/softfloat-native.h -@@ -1,7 +1,17 @@ - /* Native implementation of soft float functions */ - #include <math.h> --#if defined(_BSD) && !defined(__APPLE__) -+#if defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) - #include <ieeefp.h> -+#if defined(__FreeBSD__) -+#define isgreater(x, y) __builtin_isgreater((x), (y)) -+#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) -+#define isless(x, y) __builtin_isless((x), (y)) -+#define islessequal(x, y) __builtin_islessequal((x), (y)) -+#define islessgreater(x, y) __builtin_islessgreater((x), (y)) -+#define isunordered(x, y) __builtin_isunordered((x), (y)) -+long double fabsl(long double x); -+#endif - #else - #include <fenv.h> - #endif -@@ -33,12 +43,13 @@ - /*---------------------------------------------------------------------------- - | Software IEC/IEEE floating-point rounding mode. - *----------------------------------------------------------------------------*/ --#if defined(_BSD) && !defined(__APPLE__) -+#if defined(_BSD) && !defined(__APPLE__) && \ -+ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) - enum { - float_round_nearest_even = FP_RN, -- float_round_down = FE_RM, -- float_round_up = FE_RP, -- float_round_to_zero = FE_RZ -+ float_round_down = FP_RM, -+ float_round_up = FP_RP, -+ float_round_to_zero = FP_RZ - }; - #elif defined(__arm__) - enum { -Index: qemu/fpu/softfloat.h -@@ -84,7 +84,8 @@ - #define FLOAT128 - #else - /* native float support */ --#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) -+#if (defined(__i386__) || defined(__x86_64__)) && \ -+ (!defined(_BSD) || defined(__FreeBSD__)) - #define FLOATX80 - #endif - #endif /* !CONFIG_SOFTFLOAT */ -Index: qemu/target-ppc/op_helper.c -@@ -303,6 +303,13 @@ - FT0 = sqrt(FT0); - } - -+#ifndef isnormal -+#define isnormal(x) \ -+ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ -+ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ -+ : __isnormall(x)) -+#endif -+ - void do_fres (void) - { - union { -Index: qemu/x86_64.ld -@@ -2,7 +2,7 @@ - OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") - OUTPUT_ARCH(i386:x86-64) - ENTRY(_start) --SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); -+SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); - SECTIONS - { - /* Read-only sections, merged into text segment: */ diff --git a/emulators/qemu-devel/files/patch-libmath b/emulators/qemu-devel/files/patch-libmath deleted file mode 100644 index d0c4cbaa363c..000000000000 --- a/emulators/qemu-devel/files/patch-libmath +++ /dev/null @@ -1,2524 +0,0 @@ -diff -Nru qemu-0.7.0/bsd.orig/Makefile qemu-0.7.0/bsd/Makefile ---- qemu-0.7.0/bsd.orig/Makefile Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/Makefile Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+SRCS= ${MACHINE_ARCH}/e_atan2l.c \ -+ ${MACHINE_ARCH}/e_logl.S \ -+ ${MACHINE_ARCH}/e_powl.S \ -+ ${MACHINE_ARCH}/e_remainderl.S \ -+ ${MACHINE_ARCH}/e_sqrtl.c \ -+ ${MACHINE_ARCH}/s_ceill.S \ -+ ${MACHINE_ARCH}/s_cosl.S \ -+ ${MACHINE_ARCH}/s_floorl.S \ -+ ${MACHINE_ARCH}/s_isnormal.c \ -+ ${MACHINE_ARCH}/s_llrint.S \ -+ ${MACHINE_ARCH}/s_llrintf.S \ -+ ${MACHINE_ARCH}/s_llrintl.S \ -+ ${MACHINE_ARCH}/s_lrint.S \ -+ ${MACHINE_ARCH}/s_lrintf.S \ -+ ${MACHINE_ARCH}/s_lrintl.S \ -+ ${MACHINE_ARCH}/s_rintl.c \ -+ ${MACHINE_ARCH}/s_round.c \ -+ ${MACHINE_ARCH}/s_sinl.S \ -+ ${MACHINE_ARCH}/s_tanl.S -+ -+OBJS= ${SRCS:R:S/$/.o/} -+ -+CFLAGS= -O2 -Wall -I. -+ -+all: libmath.a -+ -+libmath.a: ${OBJS} -+ rm -f $@ -+ ${AR} rcs $@ ${OBJS:T} -+ -+clean: -+ rm -f ${OBJS:T} libmath.a -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_atan2l.c qemu-0.7.0/bsd/amd64/e_atan2l.c ---- qemu-0.7.0/bsd.orig/amd64/e_atan2l.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_atan2l.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_atan2l (long double y, long double x) -+{ -+ long double res; -+ -+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_atan2l, atan2l) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_logl.S qemu-0.7.0/bsd/amd64/e_logl.S ---- qemu-0.7.0/bsd.orig/amd64/e_logl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_logl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,59 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ /* It is not important that this constant is precise. It is only -+ a value which is known to be on the safe side for using the -+ fyl2xp1 instruction. */ -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ -+ -+#ifdef PIC -+#define MO(op) op##(%rip) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_logl) -+ fldln2 // log(2) -+ fldt 8(%rsp) // x : log(2) -+ fld %st // x : x : log(2) -+ fsubl MO(one) // x-1 : x : log(2) -+ fld %st // x-1 : x-1 : x : log(2) -+ fabs // |x-1| : x-1 : x : log(2) -+ fcompl MO(limit) // x-1 : x : log(2) -+ fnstsw // x-1 : x : log(2) -+ andb $0x45, %ah -+ jz 2f -+ fstp %st(1) // x-1 : log(2) -+ fyl2xp1 // log(x) -+ ret -+ -+2: fstp %st(0) // x : log(2) -+ fyl2x // log(x) -+ ret -+END (__ieee754_logl) -+ -+weak_alias(__ieee754_logl,logl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_powl.S qemu-0.7.0/bsd/amd64/e_powl.S ---- qemu-0.7.0/bsd.orig/amd64/e_powl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_powl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,341 @@ -+/* ix87 specific implementation of pow function. -+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(infinity,@object) -+inf_zero: -+infinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f -+ ASM_SIZE_DIRECTIVE(infinity) -+ ASM_TYPE_DIRECTIVE(zero,@object) -+zero: .double 0.0 -+ ASM_SIZE_DIRECTIVE(zero) -+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) -+minf_mzero: -+minfinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff -+mzero: -+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 -+ ASM_SIZE_DIRECTIVE(minf_mzero) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ ASM_TYPE_DIRECTIVE(p63,@object) -+p63: -+ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 -+ ASM_SIZE_DIRECTIVE(p63) -+ -+#ifdef PIC -+#define MO(op) op##(%rip) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_powl) -+ fldt 24(%rsp) // y -+ fxam -+ -+ -+ fnstsw -+ movb %ah, %dl -+ andb $0x45, %ah -+ cmpb $0x40, %ah // is y == 0 ? -+ je 11f -+ -+ cmpb $0x05, %ah // is y == ±inf ? -+ je 12f -+ -+ cmpb $0x01, %ah // is y == NaN ? -+ je 30f -+ -+ fldt 8(%rsp) // x : y -+ -+ fxam -+ fnstsw -+ movb %ah, %dh -+ andb $0x45, %ah -+ cmpb $0x40, %ah -+ je 20f // x is ±0 -+ -+ cmpb $0x05, %ah -+ je 15f // x is ±inf -+ -+ fxch // y : x -+ -+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ -+ fldl MO(p63) // 1L<<63 : y : x -+ fld %st(1) // y : 1L<<63 : y : x -+ fabs // |y| : 1L<<63 : y : x -+ fcomip %st(1), %st // 1L<<63 : y : x -+ fstp %st(0) // y : x -+ jnc 2f -+ -+ /* First see whether `y' is a natural number. In this case we -+ can use a more precise algorithm. */ -+ fld %st // y : y : x -+ fistpll -8(%rsp) // y : x -+ fildll -8(%rsp) // int(y) : y : x -+ fucomip %st(1),%st // y : x -+ jne 2f -+ -+ /* OK, we have an integer value for y. */ -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ orl $0, %edx -+ fstp %st(0) // x -+ jns 4f // y >= 0, jump -+ fdivrl MO(one) // 1/x (now referred to as x) -+ negl %eax -+ adcl $0, %edx -+ negl %edx -+4: fldl MO(one) // 1 : x -+ fxch -+ -+6: shrdl $1, %edx, %eax -+ jnc 5f -+ fxch -+ fmul %st(1) // x : ST*x -+ fxch -+5: fmul %st(0), %st // x*x : ST*x -+ shrl $1, %edx -+ movl %eax, %ecx -+ orl %edx, %ecx -+ jnz 6b -+ fstp %st(0) // ST*x -+ ret -+ -+ /* y is ±NAN */ -+30: fldt 8(%rsp) // x : y -+ fldl MO(one) // 1.0 : x : y -+ fucomip %st(1),%st // x : y -+ je 31f -+ fxch // y : x -+31: fstp %st(1) -+ ret -+ -+ .align ALIGNARG(4) -+2: /* y is a real number. */ -+ fxch // x : y -+ fldl MO(one) // 1.0 : x : y -+ fld %st(1) // x : 1.0 : x : y -+ fsub %st(1) // x-1 : 1.0 : x : y -+ fabs // |x-1| : 1.0 : x : y -+ fcompl MO(limit) // 1.0 : x : y -+ fnstsw -+ fxch // x : 1.0 : y -+ test $4500,%eax -+ jz 7f -+ fsub %st(1) // x-1 : 1.0 : y -+ fyl2xp1 // log2(x) : y -+ jmp 8f -+ -+7: fyl2x // log2(x) : y -+8: fmul %st(1) // y*log2(x) : y -+ fxam -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? -+ je 28f -+ fst %st(1) // y*log2(x) : y*log2(x) -+ frndint // int(y*log2(x)) : y*log2(x) -+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) -+ fxch // fract(y*log2(x)) : int(y*log2(x)) -+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) -+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) -+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) -+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) -+ ret -+ -+28: fstp %st(1) // y*log2(x) -+ fldl MO(one) // 1 : y*log2(x) -+ fscale // 2^(y*log2(x)) : y*log2(x) -+ fstp %st(1) // 2^(y*log2(x)) -+ ret -+ -+ // pow(x,±0) = 1 -+ .align ALIGNARG(4) -+11: fstp %st(0) // pop y -+ fldl MO(one) -+ ret -+ -+ // y == ±inf -+ .align ALIGNARG(4) -+12: fstp %st(0) // pop y -+ fldt 8(%rsp) // x -+ fabs -+ fcompl MO(one) // < 1, == 1, or > 1 -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x45, %ah -+ je 13f // jump if x is NaN -+ -+ cmpb $0x40, %ah -+ je 14f // jump if |x| == 1 -+ -+ shlb $1, %ah -+ xorb %ah, %dl -+ andl $2, %edx -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rdx, 4) -+#else -+ fldl inf_zero(,%rdx, 4) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+14: fldl MO(one) -+ ret -+ -+ .align ALIGNARG(4) -+13: fldt 8(%rsp) // load x == NaN -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±inf -+15: fstp %st(0) // y -+ testb $2, %dh -+ jz 16f // jump if x == +inf -+ -+ // We must find out whether y is an odd integer. -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 17f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp), %eax -+ mov -4(%rsp), %edx -+ andb $1, %al -+ jz 18f // jump if not odd -+ // It's an odd integer. -+ shrl $31, %edx -+#ifdef PIC -+ lea minf_mzero(%rip),%rcx -+ fldl (%rcx, %rdx, 8) -+#else -+ fldl minf_mzero(,%rdx, 8) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+16: fcompl MO(zero) -+ fnstsw -+ shrl $5, %eax -+ andl $8, %eax -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rax, 1) -+#else -+ fldl inf_zero(,%rax, 1) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+17: shll $30, %edx // sign bit for y in right position -+18: shrl $31, %edx -+#ifdef PIC -+ lea inf_zero(%rip),%rcx -+ fldl (%rcx, %rdx, 8) -+#else -+ fldl inf_zero(,%rdx, 8) -+#endif -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 -+20: fstp %st(0) // y -+ testb $2, %dl -+ jz 21f // y > 0 -+ -+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. -+ testb $2, %dh -+ jz 25f -+ -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 26f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ andb $1, %al -+ jz 27f // jump if not odd -+ // It's an odd integer. -+ // Raise divide-by-zero exception and get minus infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ fchs -+ ret -+ -+25: fstp %st(0) -+26: -+27: // Raise divide-by-zero exception and get infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. -+21: testb $2, %dh -+ jz 22f -+ -+ fld %st // y : y -+ fistpll -8(%rsp) // y -+ fildll -8(%rsp) // int(y) : y -+ fucomip %st(1),%st -+ ffreep %st // <empty> -+ jne 23f -+ -+ // OK, the value is an integer, but is it odd? -+ mov -8(%rsp),%eax -+ mov -4(%rsp),%edx -+ andb $1, %al -+ jz 24f // jump if not odd -+ // It's an odd integer. -+ fldl MO(mzero) -+ ret -+ -+22: fstp %st(0) -+23: -+24: fldl MO(zero) -+ ret -+ -+END(__ieee754_powl) -+ -+weak_alias(__ieee754_powl,powl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_remainderl.S qemu-0.7.0/bsd/amd64/e_remainderl.S ---- qemu-0.7.0/bsd.orig/amd64/e_remainderl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_remainderl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,23 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ENTRY(__ieee754_remainderl) -+ fldt 24(%rsp) -+ fldt 8(%rsp) -+1: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 1b -+ fstp %st(1) -+ ret -+END (__ieee754_remainderl) -+ -+weak_alias(__ieee754_remainderl,remainderl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c qemu-0.7.0/bsd/amd64/e_sqrtl.c ---- qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/e_sqrtl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_sqrtl (long double x) -+{ -+ long double res; -+ -+ asm ("fsqrt" : "=t" (res) : "0" (x)); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_sqrtl,sqrtl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_ceill.S qemu-0.7.0/bsd/amd64/s_ceill.S ---- qemu-0.7.0/bsd.orig/amd64/s_ceill.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_ceill.S Fri Apr 29 02:22:18 2005 -@@ -0,0 +1,246 @@ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunPro, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ * -+ * From: @(#)s_ceil.c 5.1 93/09/24 -+ */ -+/* XXX: generated from src/lib/msun/src/s_ceill.c */ -+ -+#include <machine/asm.h> -+ -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ .file "s_ceill.c" -+ .section .rodata.cst8,"aM",@progbits,8 -+ .p2align 3 -+.LC0: -+ .long 2281731484 -+ .long 2117592124 -+ .text -+ .p2align 4,,15 -+.globl ceill -+ .type ceill, @function -+ceill: -+.LFB17: -+ pushq %rbp -+.LCFI0: -+ pushq %rbx -+.LCFI1: -+ fldt 24(%rsp) -+ movq $0, -16(%rsp) -+ fld %st(0) -+ fstpt -40(%rsp) -+ movl -32(%rsp), %edi -+ movq -40(%rsp), %rsi -+ movl %edi, -16(%rsp) -+ movl -16(%rsp), %r11d -+ movq %rsi, -24(%rsp) -+ movl %r11d, %r10d -+ andl $32767, %r10d -+ leal -16383(%r10), %r8d -+ cmpl $30, %r8d -+ jg .L2 -+ testl %r8d, %r8d -+ js .L38 -+ movl -20(%rsp), %r9d -+ leal 1(%r8), %ecx -+ mov -24(%rsp), %eax -+ movl $4294967295, %ebp -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbp -+ mov %r9d, %ebx -+ movq %rbx, %rdx -+ andq %rbp, %rdx -+ orq %rax, %rdx -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ jne .L12 -+ movl $31, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ addl %eax, %r9d -+ mov %r9d, %eax -+ cmpq %rbx, %rax -+ jae .L32 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %r9d -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L32: -+ movl %r9d, -20(%rsp) -+.L12: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebp, %eax -+ movl $0, -24(%rsp) -+ notl %eax -+ andl %eax, %r9d -+ movl %r9d, -20(%rsp) -+ .p2align 4,,7 -+.L31: -+ movq -24(%rsp), %rsi -+ movl -16(%rsp), %edi -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L2: -+ cmpl $62, %r8d -+ jle .L45 -+.L44: -+ ffreep %st(0) -+.L17: -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L45: -+ movl -24(%rsp), %edx -+ leal 1(%r8), %ecx -+ movq $-1, %rbx -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbx -+ mov %edx, %r9d -+ testq %rbx, %r9 -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ jne .L20 -+ cmpl $31, %r8d -+ je .L36 -+ movl $63, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ leal (%rdx,%rax), %eax -+ movl %eax, -24(%rsp) -+ mov %eax, %eax -+ cmpq %r9, %rax -+ jae .L20 -+.L36: -+ movl -20(%rsp), %eax -+ leal 1(%rax), %ecx -+ cmpl %eax, %ecx -+ jae .L34 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %ecx -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L34: -+ movl %ecx, -20(%rsp) -+ .p2align 4,,7 -+.L20: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebx, %eax -+ notl %eax -+ andl %eax, -24(%rsp) -+ jmp .L31 -+ .p2align 4,,7 -+.L42: -+ fstp %st(1) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L38: -+ fldl .LC0(%rip) -+ faddp %st, %st(1) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ jbe .L44 -+ testl %r10d, %r10d -+ jle .L39 -+.L7: -+ movabsq $-9223372036854775808, %rsi -+ movl $16383, %edi -+ testb $-128, -15(%rsp) -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ fcmovne %st(1), %st -+ fstp %st(1) -+ fstpt -40(%rsp) -+ movq -40(%rsp), %rsi -+ movl -32(%rsp), %edi -+ movq %rsi, -24(%rsp) -+ movl %edi, -16(%rsp) -+ jmp .L17 -+.L39: -+ movl -24(%rsp), %eax -+ orl -20(%rsp), %eax -+ je .L44 -+ jmp .L7 -+.LFE17: -+ .size ceill, .-ceill -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .p2align 3 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .quad .LFB17 -+ .quad .LFE17-.LFB17 -+ .byte 0x4 -+ .long .LCFI0-.LFB17 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xe -+ .uleb128 0x18 -+ .byte 0x83 -+ .uleb128 0x3 -+ .byte 0x86 -+ .uleb128 0x2 -+ .p2align 3 -+.LEFDE1: -+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_cosl.S qemu-0.7.0/bsd/amd64/s_cosl.S ---- qemu-0.7.0/bsd.orig/amd64/s_cosl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_cosl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,33 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__cosl) -+ fldt 8(%rsp) -+ fcos -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fcos -+ ret -+END (__cosl) -+weak_alias (__cosl, cosl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_floorl.S qemu-0.7.0/bsd/amd64/s_floorl.S ---- qemu-0.7.0/bsd.orig/amd64/s_floorl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_floorl.S Fri Apr 29 02:24:32 2005 -@@ -0,0 +1,247 @@ -+/* -+ * ==================================================== -+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. -+ * -+ * Developed at SunPro, a Sun Microsystems, Inc. business. -+ * Permission to use, copy, modify, and distribute this -+ * software is freely granted, provided that this notice -+ * is preserved. -+ * ==================================================== -+ * -+ * From: @(#)s_floor.c 5.1 93/09/24 -+ */ -+/* XXX: generated from src/lib/msun/src/s_floorl.c */ -+ -+#include <machine/asm.h> -+ -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ .file "s_floorl.c" -+ .section .rodata.cst8,"aM",@progbits,8 -+ .p2align 3 -+.LC0: -+ .long 2281731484 -+ .long 2117592124 -+ .section .rodata.cst4,"aM",@progbits,4 -+ .p2align 2 -+.LC2: -+ .long 3212836864 -+ .text -+ .p2align 4,,15 -+.globl floorl -+ .type floorl, @function -+floorl: -+.LFB17: -+ pushq %rbp -+.LCFI0: -+ pushq %rbx -+.LCFI1: -+ fldt 24(%rsp) -+ movq $0, -16(%rsp) -+ fld %st(0) -+ fstpt -40(%rsp) -+ movl -32(%rsp), %edi -+ movq -40(%rsp), %rsi -+ movl %edi, -16(%rsp) -+ movl -16(%rsp), %r11d -+ movq %rsi, -24(%rsp) -+ movl %r11d, %r10d -+ andl $32767, %r10d -+ leal -16383(%r10), %r8d -+ cmpl $30, %r8d -+ jg .L2 -+ testl %r8d, %r8d -+ js .L38 -+ movl -20(%rsp), %r9d -+ leal 1(%r8), %ecx -+ mov -24(%rsp), %eax -+ movl $4294967295, %ebp -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbp -+ mov %r9d, %ebx -+ movq %rbx, %rdx -+ andq %rbp, %rdx -+ orq %rax, %rdx -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ je .L12 -+ movl $31, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ addl %eax, %r9d -+ mov %r9d, %eax -+ cmpq %rbx, %rax -+ jae .L32 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %r9d -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L32: -+ movl %r9d, -20(%rsp) -+.L12: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebp, %eax -+ movl $0, -24(%rsp) -+ notl %eax -+ andl %eax, %r9d -+ movl %r9d, -20(%rsp) -+ .p2align 4,,7 -+.L31: -+ movq -24(%rsp), %rsi -+ movl -16(%rsp), %edi -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L2: -+ cmpl $62, %r8d -+ jle .L45 -+.L44: -+ ffreep %st(0) -+.L17: -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ fldt -40(%rsp) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L45: -+ movl -24(%rsp), %edx -+ leal 1(%r8), %ecx -+ movq $-1, %rbx -+ movq %rsi, -40(%rsp) -+ movl %edi, -32(%rsp) -+ shrq %cl, %rbx -+ mov %edx, %r9d -+ testq %rbx, %r9 -+ fldt -40(%rsp) -+ je .L42 -+ ffreep %st(0) -+ testb $-128, -15(%rsp) -+ je .L20 -+ cmpl $31, %r8d -+ je .L36 -+ movl $63, %ecx -+ movl $1, %eax -+ subl %r8d, %ecx -+ salq %cl, %rax -+ leal (%rdx,%rax), %eax -+ movl %eax, -24(%rsp) -+ mov %eax, %eax -+ cmpq %r9, %rax -+ jae .L20 -+.L36: -+ movl -20(%rsp), %eax -+ leal 1(%rax), %ecx -+ cmpl %eax, %ecx -+ jae .L34 -+ leal 1(%r10), %edx -+ movl %r11d, %eax -+ orl $-2147483648, %ecx -+ andw $-32768, %ax -+ andw $32767, %dx -+ orl %edx, %eax -+ movw %ax, -16(%rsp) -+.L34: -+ movl %ecx, -20(%rsp) -+ .p2align 4,,7 -+.L20: -+ faddl .LC0(%rip) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ fstp %st(0) -+ jbe .L31 -+ movl %ebx, %eax -+ notl %eax -+ andl %eax, -24(%rsp) -+ jmp .L31 -+ .p2align 4,,7 -+.L42: -+ fstp %st(1) -+ popq %rbx -+ popq %rbp -+ ret -+ .p2align 4,,7 -+.L38: -+ fldl .LC0(%rip) -+ faddp %st, %st(1) -+ fldz -+ fxch %st(1) -+ fucomip %st(1), %st -+ jbe .L44 -+ testl %r10d, %r10d -+ jle .L39 -+.L7: -+ testb $-128, -15(%rsp) -+ je .L9 -+ ffreep %st(0) -+ flds .LC2(%rip) -+.L9: -+ fstpt -40(%rsp) -+ movq -40(%rsp), %rsi -+ movl -32(%rsp), %edi -+ movq %rsi, -24(%rsp) -+ movl %edi, -16(%rsp) -+ jmp .L17 -+.L39: -+ movl -24(%rsp), %eax -+ orl -20(%rsp), %eax -+ je .L44 -+ jmp .L7 -+.LFE17: -+ .size floorl, .-floorl -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .p2align 3 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .quad .LFB17 -+ .quad .LFE17-.LFB17 -+ .byte 0x4 -+ .long .LCFI0-.LFB17 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xe -+ .uleb128 0x18 -+ .byte 0x83 -+ .uleb128 0x3 -+ .byte 0x86 -+ .uleb128 0x2 -+ .p2align 3 -+.LEFDE1: -+ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_isnormal.c qemu-0.7.0/bsd/amd64/s_isnormal.c ---- qemu-0.7.0/bsd.orig/amd64/s_isnormal.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_isnormal.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,85 @@ -+/*- -+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org> -+ * Copyright (c) 2002-2004 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $ -+ */ -+ -+union IEEEf2bits { -+ float f; -+ struct { -+ unsigned int man :23; -+ unsigned int exp :8; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEd2bits { -+ double d; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :20; -+ unsigned int exp :11; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEl2bits { -+ long double e; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :32; -+ unsigned int exp :15; -+ unsigned int sign :1; -+ unsigned int junk :16; -+ } bits; -+}; -+ -+int -+__isnormal(double d) -+{ -+ union IEEEd2bits u; -+ -+ u.d = d; -+ return (u.bits.exp != 0 && u.bits.exp != 2047); -+} -+ -+int -+__isnormalf(float f) -+{ -+ union IEEEf2bits u; -+ -+ u.f = f; -+ return (u.bits.exp != 0 && u.bits.exp != 255); -+} -+ -+int -+__isnormall(long double e) -+{ -+ union IEEEl2bits u; -+ -+ u.e = e; -+ return (u.bits.exp != 0 && u.bits.exp != 32767); -+} -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrint.S qemu-0.7.0/bsd/amd64/s_llrint.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,6 @@ -+#include <machine/asm.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+/* sizeof(long) == sizeof(long long) */ -+#define fn llrint -+#include "s_lrint.S" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintf.S qemu-0.7.0/bsd/amd64/s_llrintf.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,6 @@ -+#include <machine/asm.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+/* sizeof(long) == sizeof(long long) */ -+#define fn llrintf -+#include "s_lrintf.S" -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintl.S qemu-0.7.0/bsd/amd64/s_llrintl.S ---- qemu-0.7.0/bsd.orig/amd64/s_llrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_llrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997, 2002 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__llrintl) -+ fldt 8(%rsp) -+ fistpll -8(%rsp) -+ fwait -+ movq -8(%rsp),%rax -+ ret -+END(__llrintl) -+weak_alias (__llrintl, llrintl) -+strong_alias (__llrintl, __lrintl) -+weak_alias (__llrintl, lrintl) -+ -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrint.S qemu-0.7.0/bsd/amd64/s_lrint.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+ -+#ifndef fn -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+#define fn lrint -+#endif -+ -+ENTRY(fn) -+ cvtsd2si %xmm0, %rax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintf.S qemu-0.7.0/bsd/amd64/s_lrintf.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+ -+#ifndef fn -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+#define fn lrintf -+#endif -+ -+ENTRY(fn) -+ cvtss2si %xmm0, %rax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintl.S qemu-0.7.0/bsd/amd64/s_lrintl.S ---- qemu-0.7.0/bsd.orig/amd64/s_lrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_lrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1 @@ -+/* Not needed, see s_llrintl.S. */ -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_rintl.c qemu-0.7.0/bsd/amd64/s_rintl.c ---- qemu-0.7.0/bsd.orig/amd64/s_rintl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_rintl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,18 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com> -+ * Public domain. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__rintl (long double x) -+{ -+ long double res; -+ -+ asm ("frndint" : "=t" (res) : "0" (x)); -+ return res; -+} -+ -+weak_alias (__rintl, rintl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_round.c qemu-0.7.0/bsd/amd64/s_round.c ---- qemu-0.7.0/bsd.orig/amd64/s_round.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_round.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,51 @@ -+/*- -+ * Copyright (c) 2003, Steven G. Kargl -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice unmodified, this list of conditions, and the following -+ * disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include <sys/cdefs.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $"); -+ -+#include <math.h> -+ -+double -+round(double x) -+{ -+ double t; -+ -+ if (!isfinite(x)) -+ return (x); -+ -+ if (x >= 0.0) { -+ t = ceil(x); -+ if (t - x > 0.5) -+ t -= 1.0; -+ return (t); -+ } else { -+ t = ceil(-x); -+ if (t + x > 0.5) -+ t -= 1.0; -+ return (-t); -+ } -+} -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_sinl.S qemu-0.7.0/bsd/amd64/s_sinl.S ---- qemu-0.7.0/bsd.orig/amd64/s_sinl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_sinl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,31 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ENTRY(__sinl) -+ fldt 8(%rsp) -+ fsin -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fsin -+ ret -+END (__sinl) -+weak_alias (__sinl, sinl) -diff -Nru qemu-0.7.0/bsd.orig/amd64/s_tanl.S qemu-0.7.0/bsd/amd64/s_tanl.S ---- qemu-0.7.0/bsd.orig/amd64/s_tanl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/amd64/s_tanl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,34 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ * Adapted for x86-64 by Andreas Jaeger <aj@suse.de>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__tanl) -+ fldt 8(%rsp) -+ fptan -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ fstp %st(0) -+ ret -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fptan -+ fstp %st(0) -+ ret -+END (__tanl) -+weak_alias (__tanl, tanl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_atan2l.c qemu-0.7.0/bsd/i386/e_atan2l.c ---- qemu-0.7.0/bsd.orig/i386/e_atan2l.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_atan2l.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_atan2l (long double y, long double x) -+{ -+ long double res; -+ -+ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_atan2l, atan2l) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_logl.S qemu-0.7.0/bsd/i386/e_logl.S ---- qemu-0.7.0/bsd.orig/i386/e_logl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_logl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,63 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ /* It is not important that this constant is precise. It is only -+ a value which is known to be on the safe side for using the -+ fyl2xp1 instruction. */ -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ -+ -+#ifdef PIC -+#define MO(op) op##@GOTOFF(%edx) -+#else -+#define MO(op) op -+#endif -+ -+ .text -+ENTRY(__ieee754_logl) -+ fldln2 // log(2) -+ fldt 4(%esp) // x : log(2) -+#ifdef PIC -+ call 1f -+1: popl %edx -+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx -+#endif -+ fld %st // x : x : log(2) -+ fsubl MO(one) // x-1 : x : log(2) -+ fld %st // x-1 : x-1 : x : log(2) -+ fabs // |x-1| : x-1 : x : log(2) -+ fcompl MO(limit) // x-1 : x : log(2) -+ fnstsw // x-1 : x : log(2) -+ andb $0x45, %ah -+ jz 2f -+ fstp %st(1) // x-1 : log(2) -+ fyl2xp1 // log(x) -+ ret -+ -+2: fstp %st(0) // x : log(2) -+ fyl2x // log(x) -+ ret -+END (__ieee754_logl) -+ -+weak_alias(__ieee754_logl,logl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_powl.S qemu-0.7.0/bsd/i386/e_powl.S ---- qemu-0.7.0/bsd.orig/i386/e_powl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_powl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,341 @@ -+/* ix87 specific implementation of pow function. -+ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 -+ Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+#ifdef __ELF__ -+ .section .rodata -+#else -+ .text -+#endif -+ -+ .align ALIGNARG(4) -+ ASM_TYPE_DIRECTIVE(infinity,@object) -+inf_zero: -+infinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f -+ ASM_SIZE_DIRECTIVE(infinity) -+ ASM_TYPE_DIRECTIVE(zero,@object) -+zero: .double 0.0 -+ ASM_SIZE_DIRECTIVE(zero) -+ ASM_TYPE_DIRECTIVE(minf_mzero,@object) -+minf_mzero: -+minfinity: -+ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff -+mzero: -+ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 -+ ASM_SIZE_DIRECTIVE(minf_mzero) -+ ASM_TYPE_DIRECTIVE(one,@object) -+one: .double 1.0 -+ ASM_SIZE_DIRECTIVE(one) -+ ASM_TYPE_DIRECTIVE(limit,@object) -+limit: .double 0.29 -+ ASM_SIZE_DIRECTIVE(limit) -+ ASM_TYPE_DIRECTIVE(p63,@object) -+p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 -+ ASM_SIZE_DIRECTIVE(p63) -+ -+#ifdef PIC -+#define MO(op) op##@GOTOFF(%ecx) -+#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) -+#else -+#define MO(op) op -+#define MOX(op,x,f) op(,x,f) -+#endif -+ -+ .text -+ENTRY(__ieee754_powl) -+ fldt 16(%esp) // y -+ fxam -+ -+#ifdef PIC -+ call 1f -+1: popl %ecx -+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx -+#endif -+ -+ fnstsw -+ movb %ah, %dl -+ andb $0x45, %ah -+ cmpb $0x40, %ah // is y == 0 ? -+ je 11f -+ -+ cmpb $0x05, %ah // is y == ±inf ? -+ je 12f -+ -+ cmpb $0x01, %ah // is y == NaN ? -+ je 30f -+ -+ fldt 4(%esp) // x : y -+ -+ subl $8,%esp -+ -+ fxam -+ fnstsw -+ movb %ah, %dh -+ andb $0x45, %ah -+ cmpb $0x40, %ah -+ je 20f // x is ±0 -+ -+ cmpb $0x05, %ah -+ je 15f // x is ±inf -+ -+ fxch // y : x -+ -+ /* fistpll raises invalid exception for |y| >= 1L<<63. */ -+ fld %st // y : y : x -+ fabs // |y| : y : x -+ fcompl MO(p63) // y : x -+ fnstsw -+ sahf -+ jnc 2f -+ -+ /* First see whether `y' is a natural number. In this case we -+ can use a more precise algorithm. */ -+ fld %st // y : y : x -+ fistpll (%esp) // y : x -+ fildll (%esp) // int(y) : y : x -+ fucomp %st(1) // y : x -+ fnstsw -+ sahf -+ jne 2f -+ -+ /* OK, we have an integer value for y. */ -+ popl %eax -+ popl %edx -+ orl $0, %edx -+ fstp %st(0) // x -+ jns 4f // y >= 0, jump -+ fdivrl MO(one) // 1/x (now referred to as x) -+ negl %eax -+ adcl $0, %edx -+ negl %edx -+4: fldl MO(one) // 1 : x -+ fxch -+ -+6: shrdl $1, %edx, %eax -+ jnc 5f -+ fxch -+ fmul %st(1) // x : ST*x -+ fxch -+5: fmul %st(0), %st // x*x : ST*x -+ shrl $1, %edx -+ movl %eax, %ecx -+ orl %edx, %ecx -+ jnz 6b -+ fstp %st(0) // ST*x -+ ret -+ -+ /* y is ±NAN */ -+30: fldt 4(%esp) // x : y -+ fldl MO(one) // 1.0 : x : y -+ fucomp %st(1) // x : y -+ fnstsw -+ sahf -+ je 31f -+ fxch // y : x -+31: fstp %st(1) -+ ret -+ -+ .align ALIGNARG(4) -+2: /* y is a real number. */ -+ fxch // x : y -+ fldl MO(one) // 1.0 : x : y -+ fld %st(1) // x : 1.0 : x : y -+ fsub %st(1) // x-1 : 1.0 : x : y -+ fabs // |x-1| : 1.0 : x : y -+ fcompl MO(limit) // 1.0 : x : y -+ fnstsw -+ fxch // x : 1.0 : y -+ sahf -+ ja 7f -+ fsub %st(1) // x-1 : 1.0 : y -+ fyl2xp1 // log2(x) : y -+ jmp 8f -+ -+7: fyl2x // log2(x) : y -+8: fmul %st(1) // y*log2(x) : y -+ fxam -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x05, %ah // is y*log2(x) == ±inf ? -+ je 28f -+ fst %st(1) // y*log2(x) : y*log2(x) -+ frndint // int(y*log2(x)) : y*log2(x) -+ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) -+ fxch // fract(y*log2(x)) : int(y*log2(x)) -+ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) -+ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) -+ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) -+ addl $8, %esp -+ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) -+ ret -+ -+28: fstp %st(1) // y*log2(x) -+ fldl MO(one) // 1 : y*log2(x) -+ fscale // 2^(y*log2(x)) : y*log2(x) -+ addl $8, %esp -+ fstp %st(1) // 2^(y*log2(x)) -+ ret -+ -+ // pow(x,±0) = 1 -+ .align ALIGNARG(4) -+11: fstp %st(0) // pop y -+ fldl MO(one) -+ ret -+ -+ // y == ±inf -+ .align ALIGNARG(4) -+12: fstp %st(0) // pop y -+ fldt 4(%esp) // x -+ fabs -+ fcompl MO(one) // < 1, == 1, or > 1 -+ fnstsw -+ andb $0x45, %ah -+ cmpb $0x45, %ah -+ je 13f // jump if x is NaN -+ -+ cmpb $0x40, %ah -+ je 14f // jump if |x| == 1 -+ -+ shlb $1, %ah -+ xorb %ah, %dl -+ andl $2, %edx -+ fldl MOX(inf_zero, %edx, 4) -+ ret -+ -+ .align ALIGNARG(4) -+14: fldl MO(one) -+ ret -+ -+ .align ALIGNARG(4) -+13: fldt 4(%esp) // load x == NaN -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±inf -+15: fstp %st(0) // y -+ testb $2, %dh -+ jz 16f // jump if x == +inf -+ -+ // We must find out whether y is an odd integer. -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 17f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 18f // jump if not odd -+ // It's an odd integer. -+ shrl $31, %edx -+ fldl MOX(minf_mzero, %edx, 8) -+ ret -+ -+ .align ALIGNARG(4) -+16: fcompl MO(zero) -+ addl $8, %esp -+ fnstsw -+ shrl $5, %eax -+ andl $8, %eax -+ fldl MOX(inf_zero, %eax, 1) -+ ret -+ -+ .align ALIGNARG(4) -+17: shll $30, %edx // sign bit for y in right position -+ addl $8, %esp -+18: shrl $31, %edx -+ fldl MOX(inf_zero, %edx, 8) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 -+20: fstp %st(0) // y -+ testb $2, %dl -+ jz 21f // y > 0 -+ -+ // x is ±0 and y is < 0. We must find out whether y is an odd integer. -+ testb $2, %dh -+ jz 25f -+ -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 26f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 27f // jump if not odd -+ // It's an odd integer. -+ // Raise divide-by-zero exception and get minus infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ fchs -+ ret -+ -+25: fstp %st(0) -+26: addl $8, %esp -+27: // Raise divide-by-zero exception and get infinity value. -+ fldl MO(one) -+ fdivl MO(zero) -+ ret -+ -+ .align ALIGNARG(4) -+ // x is ±0 and y is > 0. We must find out whether y is an odd integer. -+21: testb $2, %dh -+ jz 22f -+ -+ fld %st // y : y -+ fistpll (%esp) // y -+ fildll (%esp) // int(y) : y -+ fucompp // <empty> -+ fnstsw -+ sahf -+ jne 23f -+ -+ // OK, the value is an integer, but is it odd? -+ popl %eax -+ popl %edx -+ andb $1, %al -+ jz 24f // jump if not odd -+ // It's an odd integer. -+ fldl MO(mzero) -+ ret -+ -+22: fstp %st(0) -+23: addl $8, %esp // Don't use 2 x pop -+24: fldl MO(zero) -+ ret -+ -+END(__ieee754_powl) -+ -+weak_alias(__ieee754_powl,powl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_remainderl.S qemu-0.7.0/bsd/i386/e_remainderl.S ---- qemu-0.7.0/bsd.orig/i386/e_remainderl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_remainderl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,24 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__ieee754_remainderl) -+ fldt 16(%esp) -+ fldt 4(%esp) -+1: fprem1 -+ fstsw %ax -+ sahf -+ jp 1b -+ fstp %st(1) -+ ret -+END (__ieee754_remainderl) -+ -+weak_alias(__ieee754_remainderl,remainderl) -diff -Nru qemu-0.7.0/bsd.orig/i386/e_sqrtl.c qemu-0.7.0/bsd/i386/e_sqrtl.c ---- qemu-0.7.0/bsd.orig/i386/e_sqrtl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/e_sqrtl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__ieee754_sqrtl (long double x) -+{ -+ long double res; -+ -+ asm ("fsqrt" : "=t" (res) : "0" (x)); -+ -+ return res; -+} -+ -+weak_alias(__ieee754_sqrtl,sqrtl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_ceill.S qemu-0.7.0/bsd/i386/s_ceill.S ---- qemu-0.7.0/bsd.orig/i386/s_ceill.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_ceill.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,27 @@ -+/* -+ * Based on code written by J.T. Conklin <jtc@NetBSD.org>. -+ * Public domain. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ENTRY(ceill) -+ pushl %ebp -+ movl %esp,%ebp -+ subl $8,%esp -+ -+ fstcw -4(%ebp) /* store fpu control word */ -+ movw -4(%ebp),%dx -+ orw $0x0800,%dx /* round towards +oo */ -+ andw $0xfbff,%dx -+ movw %dx,-8(%ebp) -+ fldcw -8(%ebp) /* load modfied control word */ -+ -+ fldt 8(%ebp) /* round */ -+ frndint -+ -+ fldcw -4(%ebp) /* restore original control word */ -+ -+ leave -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_cosl.S qemu-0.7.0/bsd/i386/s_cosl.S ---- qemu-0.7.0/bsd.orig/i386/s_cosl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_cosl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__cosl) -+ fldt 4(%esp) -+ fcos -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fcos -+ ret -+END (__cosl) -+weak_alias (__cosl, cosl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_floorl.S qemu-0.7.0/bsd/i386/s_floorl.S ---- qemu-0.7.0/bsd.orig/i386/s_floorl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_floorl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,27 @@ -+/* -+ * Based on code written by J.T. Conklin <jtc@NetBSD.org>. -+ * Public domain. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ENTRY(floorl) -+ pushl %ebp -+ movl %esp,%ebp -+ subl $8,%esp -+ -+ fstcw -4(%ebp) /* store fpu control word */ -+ movw -4(%ebp),%dx -+ orw $0x0400,%dx /* round towards -oo */ -+ andw $0xf7ff,%dx -+ movw %dx,-8(%ebp) -+ fldcw -8(%ebp) /* load modfied control word */ -+ -+ fldt 8(%ebp) /* round */ -+ frndint -+ -+ fldcw -4(%ebp) /* restore original control word */ -+ -+ leave -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_isnormal.c qemu-0.7.0/bsd/i386/s_isnormal.c ---- qemu-0.7.0/bsd.orig/i386/s_isnormal.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_isnormal.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,85 @@ -+/*- -+ * Copyright (c) 2003 Mike Barcroft <mike@FreeBSD.org> -+ * Copyright (c) 2002-2004 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ * -+ * $FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $ -+ */ -+ -+union IEEEf2bits { -+ float f; -+ struct { -+ unsigned int man :23; -+ unsigned int exp :8; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEd2bits { -+ double d; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :20; -+ unsigned int exp :11; -+ unsigned int sign :1; -+ } bits; -+}; -+ -+union IEEEl2bits { -+ long double e; -+ struct { -+ unsigned int manl :32; -+ unsigned int manh :32; -+ unsigned int exp :15; -+ unsigned int sign :1; -+ unsigned int junk :16; -+ } bits; -+}; -+ -+int -+__isnormal(double d) -+{ -+ union IEEEd2bits u; -+ -+ u.d = d; -+ return (u.bits.exp != 0 && u.bits.exp != 2047); -+} -+ -+int -+__isnormalf(float f) -+{ -+ union IEEEf2bits u; -+ -+ u.f = f; -+ return (u.bits.exp != 0 && u.bits.exp != 255); -+} -+ -+int -+__isnormall(long double e) -+{ -+ union IEEEl2bits u; -+ -+ u.e = e; -+ return (u.bits.exp != 0 && u.bits.exp != 32767); -+} -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrint.S qemu-0.7.0/bsd/i386/s_llrint.S ---- qemu-0.7.0/bsd.orig/i386/s_llrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $"); -+ -+ENTRY(llrint) -+ fldl 4(%esp) -+ subl $8,%esp -+ fistpll (%esp) -+ popl %eax -+ popl %edx -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintf.S qemu-0.7.0/bsd/i386/s_llrintf.S ---- qemu-0.7.0/bsd.orig/i386/s_llrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,36 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ENTRY(llrintf) -+ flds 4(%esp) -+ subl $8,%esp -+ fistpll (%esp) -+ popl %eax -+ popl %edx -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintl.S qemu-0.7.0/bsd/i386/s_llrintl.S ---- qemu-0.7.0/bsd.orig/i386/s_llrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_llrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__llrintl) -+ fldt 4(%esp) -+ subl $8, %esp -+ fistpll (%esp) -+ fwait -+ popl %eax -+ popl %edx -+ ret -+END(__llrintl) -+weak_alias (__llrintl, llrintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrint.S qemu-0.7.0/bsd/i386/s_lrint.S ---- qemu-0.7.0/bsd.orig/i386/s_lrint.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrint.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $"); -+ -+ENTRY(lrint) -+ fldl 4(%esp) -+ subl $4,%esp -+ fistpl (%esp) -+ popl %eax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintf.S qemu-0.7.0/bsd/i386/s_lrintf.S ---- qemu-0.7.0/bsd.orig/i386/s_lrintf.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrintf.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,35 @@ -+/*- -+ * Copyright (c) 2005 David Schultz <das@FreeBSD.ORG> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#include <machine/asm.h> -+RCSID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $") -+ -+ENTRY(lrintf) -+ flds 4(%esp) -+ subl $4,%esp -+ fistpl (%esp) -+ popl %eax -+ ret -diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintl.S qemu-0.7.0/bsd/i386/s_lrintl.S ---- qemu-0.7.0/bsd.orig/i386/s_lrintl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_lrintl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,34 @@ -+/* Round argument to nearest integral value according to current rounding -+ direction. -+ Copyright (C) 1997 Free Software Foundation, Inc. -+ This file is part of the GNU C Library. -+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. -+ -+ The GNU C Library is free software; you can redistribute it and/or -+ modify it under the terms of the GNU Lesser General Public -+ License as published by the Free Software Foundation; either -+ version 2.1 of the License, or (at your option) any later version. -+ -+ The GNU C Library is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ Lesser General Public License for more details. -+ -+ You should have received a copy of the GNU Lesser General Public -+ License along with the GNU C Library; if not, write to the Free -+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -+ 02111-1307 USA. */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+ .text -+ENTRY(__lrintl) -+ fldt 4(%esp) -+ subl $4, %esp -+ fistpl (%esp) -+ fwait -+ popl %eax -+ ret -+END(__lrintl) -+weak_alias (__lrintl, lrintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_rintl.c qemu-0.7.0/bsd/i386/s_rintl.c ---- qemu-0.7.0/bsd.orig/i386/s_rintl.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_rintl.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,18 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Changes for long double by Ulrich Drepper <drepper@cygnus.com> -+ * Public domain. -+ */ -+ -+#include <sysdep.h> -+ -+long double -+__rintl (long double x) -+{ -+ long double res; -+ -+ asm ("frndint" : "=t" (res) : "0" (x)); -+ return res; -+} -+ -+weak_alias (__rintl, rintl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_round.c qemu-0.7.0/bsd/i386/s_round.c ---- qemu-0.7.0/bsd.orig/i386/s_round.c Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_round.c Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,51 @@ -+/*- -+ * Copyright (c) 2003, Steven G. Kargl -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice unmodified, this list of conditions, and the following -+ * disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ */ -+ -+#include <sys/cdefs.h> -+__FBSDID("$FreeBSD: /tmp/pcvs/ports/emulators/qemu-devel/files/Attic/patch-libmath,v 1.1 2005-05-03 04:02:46 nork Exp $"); -+ -+#include <math.h> -+ -+double -+round(double x) -+{ -+ double t; -+ -+ if (!isfinite(x)) -+ return (x); -+ -+ if (x >= 0.0) { -+ t = ceil(x); -+ if (t - x > 0.5) -+ t -= 1.0; -+ return (t); -+ } else { -+ t = ceil(-x); -+ if (t + x > 0.5) -+ t -= 1.0; -+ return (-t); -+ } -+} -diff -Nru qemu-0.7.0/bsd.orig/i386/s_sinl.S qemu-0.7.0/bsd/i386/s_sinl.S ---- qemu-0.7.0/bsd.orig/i386/s_sinl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_sinl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,32 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__sinl) -+ fldt 4(%esp) -+ fsin -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ ret -+ .align ALIGNARG(4) -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fsin -+ ret -+END (__sinl) -+weak_alias (__sinl, sinl) -diff -Nru qemu-0.7.0/bsd.orig/i386/s_tanl.S qemu-0.7.0/bsd/i386/s_tanl.S ---- qemu-0.7.0/bsd.orig/i386/s_tanl.S Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/i386/s_tanl.S Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,33 @@ -+/* -+ * Written by J.T. Conklin <jtc@netbsd.org>. -+ * Public domain. -+ * -+ * Adapted for `long double' by Ulrich Drepper <drepper@cygnus.com>. -+ */ -+ -+#include <machine/asm.h> -+#include <sysdep.h> -+ -+RCSID("$NetBSD: $") -+ -+ENTRY(__tanl) -+ fldt 4(%esp) -+ fptan -+ fnstsw %ax -+ testl $0x400,%eax -+ jnz 1f -+ fstp %st(0) -+ ret -+1: fldpi -+ fadd %st(0) -+ fxch %st(1) -+2: fprem1 -+ fstsw %ax -+ testl $0x400,%eax -+ jnz 2b -+ fstp %st(1) -+ fptan -+ fstp %st(0) -+ ret -+END (__tanl) -+weak_alias (__tanl, tanl) -diff -Nru qemu-0.7.0/bsd.orig/sysdep.h qemu-0.7.0/bsd/sysdep.h ---- qemu-0.7.0/bsd.orig/sysdep.h Wed Dec 31 19:00:00 1969 -+++ qemu-0.7.0/bsd/sysdep.h Fri Apr 29 02:11:27 2005 -@@ -0,0 +1,20 @@ -+#ifndef _QEMU_BSD_SYSDEP_H_ -+#define _QEMU_BSD_SYSDEP_H_ -+ -+#include <sys/cdefs.h> -+ -+#define HAVE_ELF -+ -+#ifdef __ASSEMBLER__ -+#define ALIGNARG(log2) 1<<log2 -+#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg; -+#define ASM_SIZE_DIRECTIVE(name) .size name,.-name; -+#define END(x) -+#define strong_alias(sym,alias) .set alias,sym; -+#define weak_alias(sym,alias) .weak alias; .equ alias,sym; -+#else -+#define strong_alias(sym,alias) __strong_reference(sym,alias); -+#define weak_alias(sym,alias) __weak_reference(sym,alias); -+#endif -+ -+#endif diff --git a/emulators/qemu-devel/files/patch-osdep.c b/emulators/qemu-devel/files/patch-osdep.c deleted file mode 100644 index 3d5382b50c51..000000000000 --- a/emulators/qemu-devel/files/patch-osdep.c +++ /dev/null @@ -1,40 +0,0 @@ -Index: qemu/osdep.c -@@ -323,7 +323,9 @@ - - #elif defined(USE_KQEMU) - -+#ifndef __FreeBSD__ - #include <sys/vfs.h> -+#endif - #include <sys/mman.h> - #include <fcntl.h> - -@@ -334,6 +336,7 @@ - const char *tmpdir; - char phys_ram_file[1024]; - void *ptr; -+#ifndef __FreeBSD__ - struct statfs stfs; - - if (phys_ram_fd < 0) { -@@ -389,12 +392,20 @@ - } - unlink(phys_ram_file); - } -+#endif - size = (size + 4095) & ~4095; -+#ifndef __FreeBSD__ - ftruncate(phys_ram_fd, phys_ram_size + size); - ptr = mmap(NULL, - size, - PROT_WRITE | PROT_READ, MAP_SHARED, - phys_ram_fd, phys_ram_size); -+#else -+ ptr = mmap(NULL, -+ size, -+ PROT_WRITE | PROT_READ, MAP_PRIVATE|MAP_ANON, -+ -1, 0); -+#endif - if (ptr == MAP_FAILED) { - fprintf(stderr, "Could not map physical memory\n"); - exit(1); |