Package: qemu
Version: 0.8.0-2
Severity: important
Tags: patch

New patch with some more bugs fixed, including a bugfix from Ulrich
Hecht, not in QEMU CVS yet. I'm also increasing bug severity to
"important" as (1) there is a patch available, so it's not a
"wishlist" anymore and (2) the patch has some fixes for real bugs
included.

I can also send separate bug reports for the bugs fixed in this patch
if necessary.

Changelog:

  * Fix package build/clean/build bugs.
  * Remove "--enable-slirp" configure flag, as it's default now.
  * Add build-stamp target to workaround "patch" target bug where "build" is
    run twice.
  * Fix ARM floating point emulation bug.
    - debian/patches/41_nwfpe_cpsr.patch: New file.
    Thanks to Ulrich Hecht.
  * Implement syscalls necessary to run debootstrap.
    - debian/patches/35_syscall_prctl.patch: New file.
    - debian/patches/36_syscall_mount.patch: New file.
    - debian/patches/37_syscall_arm_statfs64.patch: New file.
  * Add binfmt-support hooks, allowing "transparent" user emulation. Idea
    borrowed from qemu-binfmt-conf.sh.
  * Change default interpreter prefix to match dpkg-cross crossdir.
  * Add qemu-user-static package.
diff -u qemu-0.8.0/debian/control qemu-0.8.0/debian/control
--- qemu-0.8.0/debian/control
+++ qemu-0.8.0/debian/control
@@ -14,7 +14,7 @@
 Architecture: amd64 i386 powerpc alpha sparc arm s390
 Depends: ${shlibs:Depends}, vgabios (>= 0.5a-1), bochsbios (>= 2.2.1-1),
  proll, openhackware
-Recommends: debootstrap, sharutils
+Recommends: debootstrap, sharutils, binfmt-support, dpkg-cross
 Suggests: sudo
 Description: fast processor emulator
  QEMU is a FAST! processor emulator: currently the package supports
@@ -34,0 +35,21 @@
+Package: qemu-user-static
+Architecture: amd64 i386 powerpc alpha sparc arm s390
+Depends: ${shlibs:Depends}
+Recommends: qemu
+Description: fast processor emulator (static version)
+ QEMU is a FAST! processor emulator: currently the package supports
+ arm, powerpc, sparc and x86 emulation. By using dynamic translation
+ it achieves reasonable speed while being easy to port on new host
+ CPUs. QEMU has two operating modes:
+ .
+  * User mode emulation: QEMU can launch Linux processes compiled for
+    one CPU on another CPU.
+  * Full system emulation: QEMU emulates a full system, including a
+    processor and various peripherials. It enables easier testing and
+    debugging of system code. It can also be used to provide virtual
+    hosting of several virtual PC on a single server.
+ .
+ As QEMU requires no host kernel patches to run, it is very safe and
+ easy to use.
+ .
+ This package contains statically linked versions of user mode emulators.
diff -u qemu-0.8.0/debian/changelog qemu-0.8.0/debian/changelog
--- qemu-0.8.0/debian/changelog
+++ qemu-0.8.0/debian/changelog
@@ -1,3 +1,24 @@
+qemu (0.8.0-2.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix package build/clean/build bugs.
+  * Remove "--enable-slirp" configure flag, as it's default now.
+  * Add build-stamp target to workaround "patch" target bug where "build" is
+    run twice.
+  * Fix ARM floating point emulation bug.
+    - debian/patches/41_nwfpe_cpsr.patch: New file.
+    Thanks to Ulrich Hecht.
+  * Implement syscalls necessary to run debootstrap.
+    - debian/patches/35_syscall_prctl.patch: New file.
+    - debian/patches/36_syscall_mount.patch: New file.
+    - debian/patches/37_syscall_arm_statfs64.patch: New file.
+  * Add binfmt-support hooks, allowing "transparent" user emulation. Idea
+    borrowed from qemu-binfmt-conf.sh.
+  * Change default interpreter prefix to match dpkg-cross crossdir.
+  * Add qemu-user-static package.
+
+ -- Anderson Lizardo <[EMAIL PROTECTED]>  Tue,  7 Mar 2006 13:23:56 -0400
+
 qemu (0.8.0-2) unstable; urgency=low
 
   [ Guillem Jover ]
diff -u qemu-0.8.0/debian/rules qemu-0.8.0/debian/rules
--- qemu-0.8.0/debian/rules
+++ qemu-0.8.0/debian/rules
@@ -7,6 +7,9 @@
 # WARNING: Removing no-strict-aliasing will make qemu insta-segfault.
 CFLAGS = -Wall -g -fno-strict-aliasing
 
+DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)
+DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM)
+
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CFLAGS += -O0
 else
@@ -23,27 +26,87 @@
 	ppc_rom.bin \
 	proll.elf
 
+qemu_docs = \
+	qemu-doc.html \
+	qemu-tech.html \
+	qemu.1 \
+	qemu-img.1
+
+qemu_static_list = \
+	i386-user \
+	arm-user armeb-user \
+	sparc-user \
+	ppc-user \
+	mips-user mipsel-user
+
 include debian/patch.mk
 
-config-host.mak: configure
+config-host.mak.shared: configure
 	dh_testdir
 	
 	CFLAGS="$(CFLAGS)" ./configure \
 	  --prefix=/usr \
-	  --enable-slirp \
-	  --cc=$(CC)
+	  --cc=$(CC) \
+	  --interp-prefix=/usr/%M-$(DEB_HOST_GNU_SYSTEM)
+	
+	mv config-host.mak config-host.mak.shared
+	mv config-host.h config-host.h.shared
+
+config-host.mak.static: configure
+	CFLAGS="$(CFLAGS)" ./configure \
+	  --prefix=/usr \
+	  --cc=$(CC) \
+	  --interp-prefix=/usr/%M-$(DEB_HOST_GNU_SYSTEM) \
+	  --static \
+	  --target-list="$(qemu_static_list)"
+	
+	mv config-host.mak config-host.mak.static
+	mv config-host.h config-host.h.static
 
-build: patch config-host.mak
+build: patch build-stamp
+build-stamp: config-host.mak.shared config-host.mak.static
 	dh_testdir
 	
+	# Force documentation rebuild
+	-for i in $(qemu_docs); do \
+	  test ! -f $$i.keep && mv $$i $$i.keep; \
+	done
+	
+	# First build static qemu executables
+	cp -a config-host.mak.static config-host.mak
+	cp -a config-host.h.static config-host.h
+	$(MAKE)
+	for i in $(qemu_static_list); do \
+	  cp -a $$i $$i-static; \
+	done
+	
+	$(MAKE) clean
+	
+	# Next the shared ones
+	cp -a config-host.mak.shared config-host.mak
+	cp -a config-host.h.shared config-host.h
 	$(MAKE)
+	
+	touch build-stamp
 
 clean: unpatch
 	dh_testdir
 	dh_testroot
+	rm -f build-stamp
 	
-	-$(MAKE) clean
-	rm -f qemu-doc.html qemu.1 qemu-img.1 qemu-tech.html
+	-mv config-host.mak.shared config-host.mak
+	-mv config-host.h.shared config-host.h
+	-$(MAKE) distclean
+	
+	-mv config-host.mak.static config-host.mak
+	-mv config-host.h.static config-host.h
+	-$(MAKE) distclean \
+	  TARGET_DIRS="$(patsubst %,%-static,$(qemu_static_list))"
+	
+	# Move original qemu docs back
+	-for i in $(qemu_docs); do \
+	  test -f $$i.keep && mv $$i.keep $$i; \
+	done
 	
 	dh_clean
 
@@ -58,6 +121,8 @@
 	  touch pc-bios/$$i; \
 	done
 	
+	cp -a config-host.mak.shared config-host.mak
+	cp -a config-host.h.shared config-host.h
 	-$(MAKE) install \
 	  bindir=$(D)/usr/bin \
 	  datadir=$(D)/usr/share/qemu \
@@ -69,6 +134,46 @@
 	for i in $(qemu_bios_files); do \
 	  rm -f pc-bios/$$i $(D)/usr/share/qemu/$$i; \
 	done
+	
+	cp -a config-host.mak.static config-host.mak
+	cp -a config-host.h.static config-host.h
+	install -m755 -d $(D)-user-static/usr/bin
+	for i in $(patsubst %,%-static,$(qemu_static_list)); do \
+	  $(MAKE) -C $$i install \
+	    bindir=$(D)-user-static/usr/bin; \
+	done
+	for i in $(D)-user-static/usr/bin/qemu-*; do \
+	  mv $$i $$i-static; \
+	done
+
+	# Install binfmt-support format files (except for DEB_HOST_ARCH_CPU)
+	install -m755 -d $(D)/usr/share/binfmts
+ifneq ($(DEB_HOST_ARCH_CPU),i386)
+	install -m644 $(CURDIR)/debian/binfmts/qemu-i386.binfmt \
+	  $(D)/usr/share/binfmts/qemu-i386
+	install -m644 $(CURDIR)/debian/binfmts/qemu-i486.binfmt \
+	  $(D)/usr/share/binfmts/qemu-i486
+endif
+ifneq ($(DEB_HOST_ARCH_CPU),arm)
+	install -m644 $(CURDIR)/debian/binfmts/qemu-arm.binfmt \
+	  $(D)/usr/share/binfmts/qemu-arm
+	install -m644 $(CURDIR)/debian/binfmts/qemu-armeb.binfmt \
+	  $(D)/usr/share/binfmts/qemu-armeb
+endif
+ifneq ($(DEB_HOST_ARCH_CPU),sparc)
+	install -m644 $(CURDIR)/debian/binfmts/qemu-sparc.binfmt \
+	  $(D)/usr/share/binfmts/qemu-sparc
+endif
+ifneq ($(DEB_HOST_ARCH_CPU),powerpc)
+	install -m644 $(CURDIR)/debian/binfmts/qemu-ppc.binfmt \
+	  $(D)/usr/share/binfmts/qemu-ppc
+endif
+ifneq ($(DEB_HOST_ARCH_CPU),mips)
+	install -m644 $(CURDIR)/debian/binfmts/qemu-mips.binfmt \
+	  $(D)/usr/share/binfmts/qemu-mips
+	install -m644 $(CURDIR)/debian/binfmts/qemu-mipsel.binfmt \
+	  $(D)/usr/share/binfmts/qemu-mipsel
+endif
 
 binary-indep:
 # Nothing to do.
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/qemu.prerm
+++ qemu-0.8.0/debian/qemu.prerm
@@ -0,0 +1,44 @@
+#! /bin/sh
+# prerm script for qemu
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <prerm> `remove'
+#        * <old-prerm> `upgrade' <new-version>
+#        * <new-prerm> `failed-upgrade' <old-version>
+#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+#        * <deconfigured's-prerm> `deconfigure' `in-favour'
+#          <package-being-installed> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+binfmt_files="qemu-arm qemu-armeb qemu-i386 qemu-i486 qemu-mips qemu-mipsel \
+ qemu-ppc qemu-sparc"
+
+case "$1" in
+    remove|upgrade|deconfigure)
+        if [ -x /usr/sbin/update-binfmts ]; then
+            for i in $binfmt_files; do
+                test -f /usr/share/binfmts/$i &&
+                  update-binfmts --package qemu --remove $i /usr/bin/$i || true
+            done
+        fi
+    ;;
+    failed-upgrade)
+    ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/qemu.postinst
+++ qemu-0.8.0/debian/qemu.postinst
@@ -0,0 +1,48 @@
+#! /bin/sh
+# postinst script for qemu
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+#        * <old-postinst> `abort-upgrade' <new version>
+#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+#          <new-version>
+#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+#          <failed-install-package> <version> `removing'
+#          <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+#
+
+binfmt_files="qemu-arm qemu-armeb qemu-i386 qemu-i486 qemu-mips qemu-mipsel \
+ qemu-ppc qemu-sparc"
+
+case "$1" in
+    configure)
+        if [ -x /usr/sbin/update-binfmts ]; then
+            for i in $binfmt_files; do
+                test -f /usr/share/binfmts/$i &&
+                  update-binfmts --import $i || true
+            done
+        fi
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-arm.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-arm.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-arm
+magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00
+mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-armeb.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-armeb.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-armeb
+magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28
+mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-i386.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-i386.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-i386
+magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00
+mask \xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-i486.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-i486.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-i386
+magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00
+mask \xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-mips.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-mips.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-mips
+magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08
+mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-mipsel.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-mipsel.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-mipsel
+magic \x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00
+mask \xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-ppc.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-ppc.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-ppc
+magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14
+mask \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/binfmts/qemu-sparc.binfmt
+++ qemu-0.8.0/debian/binfmts/qemu-sparc.binfmt
@@ -0,0 +1,4 @@
+package qemu
+interpreter /usr/bin/qemu-sparc
+magic \x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02
+mask \xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/patches/35_syscall_prctl.patch
+++ qemu-0.8.0/debian/patches/35_syscall_prctl.patch
@@ -0,0 +1,21 @@
+#DPATCHLEVEL=0
+--- linux-user/syscall.c	2005-12-19 22:51:53.000000000 +0000
++++ linux-user/syscall.c	2006-03-01 02:29:30.000000000 +0000
+@@ -32,6 +32,7 @@
+ #include <sys/time.h>
+ #include <sys/stat.h>
+ #include <sys/mount.h>
++#include <sys/prctl.h>
+ #include <sys/resource.h>
+ #include <sys/mman.h>
+ #include <sys/swap.h>
+@@ -2795,7 +2796,8 @@ long do_syscall(void *cpu_env, int num, 
+     case TARGET_NR_nfsservctl:
+         goto unimplemented;
+     case TARGET_NR_prctl:
+-        goto unimplemented;
++        ret = get_errno(prctl(arg1, arg2, arg3, arg4, arg5));
++        break;
+ #ifdef TARGET_NR_pread
+     case TARGET_NR_pread:
+         page_unprotect_range((void *)arg2, arg3);
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/patches/36_syscall_mount.patch
+++ qemu-0.8.0/debian/patches/36_syscall_mount.patch
@@ -0,0 +1,15 @@
+#DPATCHLEVEL=0
+--- linux-user/syscall.c	2005-12-19 22:51:53.000000000 +0000
++++ linux-user/syscall.c	2006-03-01 02:38:38.000000000 +0000
+@@ -1771,8 +1771,9 @@ long do_syscall(void *cpu_env, int num, 
+         ret = get_errno(getpid());
+         break;
+     case TARGET_NR_mount:
+-        /* need to look at the data field */
+-        goto unimplemented;
++	ret = get_errno(mount((const char *)arg1, (const char *)arg2,
++	    (const char *)arg3, (unsigned long)arg4, (const void *)arg5));
++	break;
+     case TARGET_NR_umount:
+         ret = get_errno(umount((const char *)arg1));
+         break;
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/patches/41_nwfpe_cpsr.patch
+++ qemu-0.8.0/debian/patches/41_nwfpe_cpsr.patch
@@ -0,0 +1,103 @@
+#DPATCHLEVEL=1
+diff -ru qemu-0.8.0/linux-user/main.c qemu-0.8.0.fixed/linux-user/main.c
+--- qemu-0.8.0/linux-user/main.c	2005-12-19 23:51:53.000000000 +0100
++++ qemu-0.8.0.fixed/linux-user/main.c	2006-03-06 14:21:49.000000000 +0100
+@@ -345,7 +345,7 @@
+                 /* we get the opcode */
+                 opcode = ldl_raw((uint8_t *)env->regs[15]);
+                 
+-                if ((rc=EmulateAll(opcode, &ts->fpa, env->regs)) == 0) { /* illegal instruction */
++                if ((rc=EmulateAll(opcode, &ts->fpa, env)) == 0) { /* illegal instruction */
+                     info.si_signo = SIGILL;
+                     info.si_errno = 0;
+                     info.si_code = TARGET_ILL_ILLOPN;
+diff -ru qemu-0.8.0/target-arm/nwfpe/fpa11.c qemu-0.8.0.fixed/target-arm/nwfpe/fpa11.c
+--- qemu-0.8.0/target-arm/nwfpe/fpa11.c	2005-12-19 23:51:53.000000000 +0100
++++ qemu-0.8.0.fixed/target-arm/nwfpe/fpa11.c	2006-03-06 14:19:43.000000000 +0100
+@@ -36,7 +36,7 @@
+ unsigned int EmulateCPRT(const unsigned int);
+ 
+ FPA11* qemufpa=0;
+-unsigned int* user_registers=0;
++CPUARMState* user_registers=0;
+ 
+ /* Reset the FPA11 chip.  Called to initialize and reset the emulator. */
+ void resetFPA11(void)
+@@ -137,7 +137,7 @@
+ }
+ 
+ /* Emulate the instruction in the opcode. */
+-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, unsigned int* qregs)
++unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs)
+ {
+   unsigned int nRc = 0;
+ //  unsigned long flags;
+diff -ru qemu-0.8.0/target-arm/nwfpe/fpa11.h qemu-0.8.0.fixed/target-arm/nwfpe/fpa11.h
+--- qemu-0.8.0/target-arm/nwfpe/fpa11.h	2005-12-19 23:51:53.000000000 +0100
++++ qemu-0.8.0.fixed/target-arm/nwfpe/fpa11.h	2006-03-06 14:58:21.000000000 +0100
+@@ -26,6 +26,8 @@
+ #include <stdio.h>
+ #include <errno.h>
+ 
++#include <cpu.h>
++
+ #define GET_FPA11() (qemufpa)
+ 
+ /*
+@@ -33,7 +35,7 @@
+  * stack+task struct.  Use the same method as 'current' uses to
+  * reach them.
+  */
+-extern unsigned int *user_registers;
++extern CPUARMState *user_registers;
+ 
+ #define GET_USERREG() (user_registers)
+ 
+@@ -94,7 +96,7 @@
+ 
+ static inline unsigned int readRegister(unsigned int reg)
+ {
+-    return (user_registers[(reg)]);
++    return (user_registers->regs[(reg)]);
+ }
+ 
+ static inline void writeRegister(unsigned int x, unsigned int y)
+@@ -102,34 +104,17 @@
+ #if 0
+ 	printf("writing %d to r%d\n",y,x);
+ #endif
+-        user_registers[(x)]=(y);
++        user_registers->regs[(x)]=(y);
+ }
+ 
+ static inline void writeConditionCodes(unsigned int x)
+ {
+-#if 0
+-unsigned	int y;
+-unsigned    int ZF;
+-	printf("setting flags to %x from %x\n",x,user_registers[16]);
+-#endif
+-	user_registers[16]=(x);	// cpsr
+-	user_registers[17]=(x>>29)&1;	// cf
+-	user_registers[18]=(x<<3)&(1<<31);	// vf
+-	user_registers[19]=x&(1<<31);	// nzf
+-	if(!(x&(1<<30))) user_registers[19]++;	// nzf must be non-zero for zf to be cleared
+-
+-#if 0
+-        ZF = (user_registers[19] == 0);
+-        y=user_registers[16] | (user_registers[19] & 0x80000000) | (ZF << 30) | 
+-                    (user_registers[17] << 29) | ((user_registers[18] & 0x80000000) >> 3);
+-        if(y != x)
+-        	printf("GODDAM SHIIIIIIIIIIIIIIIIT! %x %x nzf %x zf %x\n",x,y,user_registers[19],ZF);
+-#endif                    
++        cpsr_write(user_registers,x,~CPSR_M);
+ }
+ 
+ #define REG_PC 15
+ 
+-unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, unsigned int* qregs);
++unsigned int EmulateAll(unsigned int opcode, FPA11* qfpa, CPUARMState* qregs);
+ 
+ /* included only for get_user/put_user macros */
+ #include "qemu.h"
+
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/patches/37_syscall_arm_statfs64.patch
+++ qemu-0.8.0/debian/patches/37_syscall_arm_statfs64.patch
@@ -0,0 +1,10 @@
+#DPATCHLEVEL=0
+--- linux-user/arm/syscall_nr.h.orig	2006-03-07 17:24:22.000000000 +0000
++++ linux-user/arm/syscall_nr.h	2006-03-07 17:44:37.000000000 +0000
+@@ -260,4 +260,6 @@
+ 					/* 255 for get_thread_area */
+ 					/* 256 for set_tid_address */
+ #define TARGET_NR_clock_gettime			(263)
++#define TARGET_NR_statfs64			(266)
++#define TARGET_NR_fstatfs64			(267)
+ #define TARGET_NR_utimes		        (269)
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/overrides/qemu-user-static
+++ qemu-0.8.0/debian/overrides/qemu-user-static
@@ -0,0 +1,7 @@
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-i386-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-ppc-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-arm-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-armeb-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-mips-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-mipsel-static
+qemu-user-static: shlib-with-non-pic-code usr/bin/qemu-sparc-static
only in patch2:
unchanged:
--- qemu-0.8.0.orig/debian/qemu-user-static.install
+++ qemu-0.8.0/debian/qemu-user-static.install
@@ -0,0 +1 @@
+debian/overrides/qemu-user-static usr/share/lintian/overrides/

Reply via email to