Hello community,
here is the log from the commit of package qemu
checked in at Tue Jul 10 18:55:51 CEST 2007.
--------
--- qemu/qemu.changes 2007-06-20 14:39:20.000000000 +0200
+++ /mounts/work_src_done/STABLE/qemu/qemu.changes 2007-07-10 15:44:15.000000000 +0200
@@ -1,0 +2,24 @@
+Tue Jul 10 15:44:03 CEST 2007 - schwab@suse.de
+
+- Add (incomplete) m68k emulation.
+
+-------------------------------------------------------------------
+Mon Jul 9 17:02:48 CEST 2007 - agraf@suse.de
+
+- included alsa support in qemu-user
+- update to current cvs
+ - TFTP booting from host directory (Anthony Liguori, Erwan Velu)
+ - Tap device emulation for Solaris (Sittichai Palanisong)
+ - Monitor multiplexing to several I/O channels (Jason Wessel)
+ - ds1225y nvram support (Herve Poussineau)
+ - CPU model selection support (J. Mayer, Paul Brook, Herve Poussineau)
+ - Several Sparc fixes (Aurelien Jarno, Blue Swirl)
+ - MIPS 64-bit FPU support (Thiemo Seufer)
+ - Xscale PDA emulation (Andrzei Zaborowski)
+ - ColdFire system emulation (Paul Brook)
+ - Improved SH4 support (Magnus Damm)
+ - MIPS64 support (Aurelien Jarno, Thiemo Seufer)
+ - Preliminary Alpha guest support (J. Mayer)
+ - IPC fixes
+
+-------------------------------------------------------------------
Old:
----
bug-252519_goo-qemu-sec-0.9.0.diff
qemu-0.7.2-kqemu.patch
qemu-0.8.2-alt-mmap.patch
qemu-0.9.0-alt-path.patch
qemu-0.9.0-fadvise64.patch
qemu-0.9.0-fix-cpus-chaining.patch
qemu-0.9.0-fix-x86-fprem.patch
qemu-0.9.0-futex.patch
qemu-0.9.0-initrd.patch
qemu-0.9.0-kernel-option-vga.patch
qemu-0.9.0-mmap.patch
qemu-0.9.0-nonetlink.patch
qemu-0.9.0-nptl2.patch
qemu-0.9.0-nptl.patch
qemu-0.9.0.patch
qemu-0.9.0-robust_list.patch
qemu-0.9.0-sched.patch
qemu-0.9.0-socket.patch
qemu-0.9.0-strace.patch
qemu-0.9.0-syscalls.patch
qemu-0.9.0.tar.bz2
qemu-0.9.0-wine.patch
qemu-0.9.0-x86_64-opts.patch
New:
----
qemu-0.8.3-gcc4.patch
qemu-0.9.0.cvs.tar.bz2
qemu-cvs-alsa_bitfield.patch
qemu-cvs-alsa_ioctl.patch
qemu-cvs-alsa_mmap.patch
qemu-cvs-flash.patch
qemu-cvs-futex.patch
qemu-cvs-gettimeofday.patch
qemu-cvs-ia64.patch
qemu-cvs-img.patch
qemu-cvs-ioctl_debug.patch
qemu-cvs-ioctl_nodirection.patch
qemu-cvs-ipc.patch
qemu-cvs-ipc_semop.patch
qemu-cvs-mmap-amd64.patch
qemu-cvs-mplayer.patch
qemu-cvs-netlink.patch
qemu-cvs-newpath.patch
qemu-cvs-nofadvise64.patch
qemu-cvs-noppcemb.patch
qemu-cvs-pthread.patch
qemu-cvs-sched_getaffinity.patch
qemu-cvs-tls.patch
qemu-m68k.diff
rpmlintrc
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qemu.spec ++++++
--- /var/tmp/diff_new_pack.t10868/_old 2007-07-10 18:55:08.000000000 +0200
+++ /var/tmp/diff_new_pack.t10868/_new 2007-07-10 18:55:08.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package qemu (Version 0.9.0)
+# spec file for package qemu (Version 0.9.0.cvs)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,11 +13,11 @@
Name: qemu
BuildRequires: SDL-devel bison e2fsprogs-devel
URL: http://fabrice.bellard.free.fr/qemu/
-License: BSD License and BSD-like, GNU General Public License (GPL)
-Group: System/Emulators/Other
+License: BSD 3-Clause, GPL v2 or later
+Group: System/Emulators/PC
Summary: Universal CPU emulator
-Version: 0.9.0
-Release: 38
+Version: 0.9.0.cvs
+Release: 1
Source: %name-%version.tar.bz2
#Patch400: qemu-0.7.0-gcc4-dot-syms.patch
#Patch401: qemu-0.8.0-gcc4-hacks.patch
@@ -25,38 +25,39 @@
Patch1: qemu-0.7.0-binfmt.patch
Patch5: qemu-0.7.0-sigaltstackhack.patch
Patch6: qemu-0.7.0-amd64.patch
-Patch8: qemu-0.9.0.patch
+Patch8: qemu-cvs-pthread.patch
Patch10: linkerscripts.patch
-Patch11: qemu-0.7.2-kqemu.patch
Patch14: qemu-0.7.1-jobsignals.patch
-Patch15: qemu-0.9.0-syscalls.patch
Patch16: qemu-0.7.1-armfpaex.patch
Patch19: qemu-0.9.0-nousbdevfs.patch
Patch20: qemu-0.9.0-usbheaders.patch
-Patch21: qemu-0.9.0-initrd.patch
-Patch22: qemu-0.9.0-nptl.patch
-Patch23: qemu-0.9.0-fadvise64.patch
-Patch25: qemu-0.9.0-nptl2.patch
-Patch26: qemu-0.9.0-socket.patch
-Patch27: qemu-0.9.0-strace.patch
-Patch28: qemu-0.9.0-mmap.patch
-Patch29: qemu-0.9.0-alt-path.patch
-Patch30: qemu-0.9.0-nonetlink.patch
-Patch31: qemu-0.9.0-kernel-option-vga.patch
-Patch32: qemu-0.9.0-x86_64-opts.patch
-Patch33: qemu-0.9.0-fix-cpus-chaining.patch
Patch34: qemu-0.9.0-migration.patch
-Patch36: qemu-0.9.0-fix-x86-fprem.patch
Patch37: qemu-0.9.0-kvm.patch
Patch38: qemu-0.9.0-kvm-bios.patch
Patch39: qemu-0.9.0-kvm-kqemu-window-caption.patch
-Patch40: qemu-z80.diff
-Patch41: qemu-0.9.0-sched.patch
-Patch42: qemu-0.8.2-alt-mmap.patch
-Patch43: qemu-0.9.0-futex.patch
-Patch44: qemu-0.9.0-robust_list.patch
-Patch45: qemu-0.9.0-wine.patch
-Patch46: bug-252519_goo-qemu-sec-0.9.0.diff
+Patch48: qemu-z80.diff
+Patch49: qemu-cvs-img.patch
+Patch50: qemu-cvs-newpath.patch
+Patch51: qemu-cvs-tls.patch
+Patch52: qemu-cvs-futex.patch
+Patch53: qemu-cvs-sched_getaffinity.patch
+Patch54: qemu-cvs-mplayer.patch
+Patch55: qemu-cvs-netlink.patch
+Patch56: qemu-cvs-ipc.patch
+Patch57: qemu-cvs-ipc_semop.patch
+Patch58: qemu-cvs-ioctl_debug.patch
+Patch59: qemu-cvs-alsa_bitfield.patch
+Patch60: qemu-cvs-alsa_ioctl.patch
+Patch61: qemu-cvs-ioctl_nodirection.patch
+Patch62: qemu-cvs-alsa_mmap.patch
+Patch63: qemu-cvs-gettimeofday.patch
+Patch64: qemu-cvs-nofadvise64.patch
+Patch65: qemu-cvs-flash.patch
+Patch66: qemu-cvs-mmap-amd64.patch
+Patch67: qemu-cvs-noppcemb.patch
+Patch68: qemu-0.8.3-gcc4.patch
+Patch69: qemu-cvs-ia64.patch
+Patch70: qemu-m68k.diff
Source200: kvm_bios.bin
Source201: zx-rom.bin
Source202: COPYING.zx-rom
@@ -98,6 +99,8 @@
Patch664: gcc-ppc-nof.patch
Patch700: gcc-abuildappease.patch
Patch701: gcc-3.3.5.dif
+# this is to make lint happy
+Source300: rpmlintrc
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 ppc sparc x86_64 ia64
@@ -119,41 +122,45 @@
#%patch400 -p1
#%patch401 -p1
#%patch402 -p1
-%patch1
+%patch1 -p1
%patch5
%patch6
-%patch8
+%patch8 -p1
%patch10
-%patch11
%patch14
-%patch15
%patch16
%patch19
%patch20
-%patch21 -p1
-%patch22 -p1
-%patch23 -p1
-%patch25 -p1
-%patch26 -p1
-%patch27 -p1
-%patch28 -p1
-%patch29 -p1
-%patch30 -p1
-%patch31 -p1
-%patch32 -p1
-%patch33 -p1
-%patch34 -p1
-%patch36 -p1
-%patch37 -p1
-%patch38 -p1
-%patch39 -p1
-%patch40 -p1
-%patch41 -p1
-%patch42 -p1
-%patch43 -p1
-%patch44 -p1
-%patch45 -p1
-%patch46 -p1
+#%patch34 -p1
+#%patch37 -p1
+#%patch38 -p1
+#%patch39 -p1
+%patch48 -p1
+%patch49
+%patch50 -p1
+%patch51 -p1
+%patch52 -p1
+%patch53 -p1
+%patch54 -p1
+%patch55 -p1
+%patch56 -p1
+%patch57 -p1
+%patch58 -p1
+%patch59 -p1
+%patch60 -p1
+%patch61 -p1
+%patch62 -p1
+%patch63 -p1
+%patch64 -p1
+%patch65 -p1
+%patch66 -p1
+%patch67 -p1
+%patch69
+%patch70
+%ifarch ia64 ppc64
+#this is the dyngen for gcc4 patch (does not work on x86)
+%patch68 -p1
+%endif
cp -p %SOURCE200 pc-bios/
cp -p %SOURCE202 .
cd gcc-3.3.5
@@ -192,9 +199,12 @@
cd ..
%build
-QEMU_OPT_FLAGS="$RPM_OPT_FLAGS"
+%ifarch ia64 ppc64
+%define qemucc gcc
+%else
%define gcc33tmp /tmp/gcc33
%define qemucc %{gcc33tmp}/bin/gcc
+QEMU_OPT_FLAGS="$RPM_OPT_FLAGS"
# fix opt flags for gcc3
%ifarch %ix86
QEMU_OPT_FLAGS="${RPM_OPT_FLAGS/-mtune=/-mcpu=}"
@@ -214,57 +224,26 @@
make bootstrap-lean BOOT_CFLAGS="$QEMU_OPT_FLAGS" STAGE1_CFLAGS="$QEMU_OPT_FLAGS" CFLAGS="$QEMU_OPT_FLAGS" %{?jobs:-j%{jobs}}
make install
cd ..
+QEMU_OPT_FLAGS="$QEMU_OPT_FLAGS -fno-strict-aliasing"
+%endif
# build QEMU
+mkdir -p dynamic
+# build qemu-system without kqemu support
+./configure --prefix=/usr \
+ --interp-prefix=/usr/share/qemu/qemu-i386 \
+ --cc=%qemucc --enable-adlib --disable-gcc-check \
+ --extra-cflags="$QEMU_OPT_FLAGS" --enable-system --disable-linux-user
+make %{?jobs:-j%{jobs}}
+mv */qemu */qemu-* dynamic || true
+make clean
+# build qemu-system with kqemu support
# kqemu target
+%ifarch %ix86 x86_64
%ifarch x86_64
target_list_kqemu="x86_64-softmmu"
%else
target_list_kqemu="i386-softmmu"
%endif
-# targets for all platforms
-target_list="ppc-softmmu sparc-softmmu mips-softmmu mipsel-softmmu arm-softmmu z80-softmmu"
-# AMD64 -> i386 without kqemu
-# x86 -> AMD64 without kqemu
-# others -> both without kqemu
-%ifarch x86_64
-target_list="$target_list i386-softmmu"
-%else
-%ifarch %ix86
-target_list="$target_list x86_64-softmmu"
-%else
-target_list="$target_list i386-softmmu x86_64-softmmu"
-%endif
-%endif
-# linux-user targets
-target_list_user=""
-%ifnarch %ix86 x86_64
-target_list_user="$target_list_user i386-linux-user"
-%endif
-%ifnarch armv4l
-target_list_user="$target_list_user arm-linux-user"
-%endif
-%ifnarch armv4b
-target_list_user="$target_list_user armeb-linux-user"
-%endif
-%ifnarch sparc sparc64
-target_list_user="$target_list_user sparc-linux-user"
-%endif
-%ifnarch ppc ppc64
-target_list_user="$target_list_user ppc-linux-user"
-%endif
-%ifnarch mips
-target_list_user="$target_list_user mips-linux-user"
-%endif
-%ifnarch mipsel
-target_list_user="$target_list_user mipsel-linux-user"
-%endif
-%ifnarch m68k
-target_list_user="$target_list_user m68k-linux-user"
-%endif
-QEMU_OPT_FLAGS="$QEMU_OPT_FLAGS -fno-strict-aliasing"
-mkdir -p dynamic
-%ifarch %ix86 x86_64
-# build i386/x86_64 system with kqemu support
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
--target-list="$target_list_kqemu" --cc=%qemucc \
@@ -274,19 +253,12 @@
mv */qemu */qemu-* dynamic || true
make clean
%endif
-# build system emus without kqemu support
-./configure --prefix=/usr \
- --interp-prefix=/usr/share/qemu/qemu-i386 \
- --target-list="$target_list" --cc=%qemucc \
- --enable-adlib --extra-cflags="$QEMU_OPT_FLAGS"
-make %{?jobs:-j%{jobs}}
-mv */qemu *-*/qemu-* dynamic || true
-make clean
# build userland emus
./configure --prefix=/usr \
--interp-prefix=/usr/share/qemu/qemu-i386 \
- --target-list="$target_list_user" --cc=%qemucc \
- --static --extra-cflags="$QEMU_OPT_FLAGS"
+ --enable-linux-user --disable-system --cc=%qemucc \
+ --static --disable-gcc-check \
+ --extra-cflags="$QEMU_OPT_FLAGS"
make %{?jobs:-j%{jobs}}
%install
@@ -299,7 +271,7 @@
install -d -m 755 $RPM_BUILD_ROOT/%{_mandir}/man1
install -m 644 qemu.1 $RPM_BUILD_ROOT/%{_mandir}/man1
install -d -m 755 $RPM_BUILD_ROOT/usr/share/qemu
-install -m 644 pc-bios/*.bin pc-bios/video.x pc-bios/openbios-sparc32 $RPM_BUILD_ROOT/usr/share/qemu
+install -m 644 pc-bios/*.bin pc-bios/video.x pc-bios/openbios-sparc* $RPM_BUILD_ROOT/usr/share/qemu
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -m 755 qemu-binfmt-conf.sh $RPM_BUILD_ROOT/usr/sbin
install -m 755 qemu-img $RPM_BUILD_ROOT/usr/bin
@@ -332,6 +304,24 @@
%endif
%changelog
+* Tue Jul 10 2007 - schwab@suse.de
+- Add (incomplete) m68k emulation.
+* Mon Jul 09 2007 - agraf@suse.de
+- included alsa support in qemu-user
+- update to current cvs
+ - TFTP booting from host directory (Anthony Liguori, Erwan Velu)
+ - Tap device emulation for Solaris (Sittichai Palanisong)
+ - Monitor multiplexing to several I/O channels (Jason Wessel)
+ - ds1225y nvram support (Herve Poussineau)
+ - CPU model selection support (J. Mayer, Paul Brook, Herve Poussineau)
+ - Several Sparc fixes (Aurelien Jarno, Blue Swirl)
+ - MIPS 64-bit FPU support (Thiemo Seufer)
+ - Xscale PDA emulation (Andrzei Zaborowski)
+ - ColdFire system emulation (Paul Brook)
+ - Improved SH4 support (Magnus Damm)
+ - MIPS64 support (Aurelien Jarno, Thiemo Seufer)
+ - Preliminary Alpha guest support (J. Mayer)
+ - IPC fixes
* Wed Jun 20 2007 - agraf@suse.de
- applied proper fix for x86_64 and the MAP_32BIT flag
* Wed Jun 20 2007 - uli@suse.de
++++++ linkerscripts.patch ++++++
--- /var/tmp/diff_new_pack.t10868/_old 2007-07-10 18:55:10.000000000 +0200
+++ /var/tmp/diff_new_pack.t10868/_new 2007-07-10 18:55:10.000000000 +0200
@@ -274,309 +274,3 @@
- /* These must appear regardless of . */
+ /DISCARD/ : { *(.note.GNU-stack) }
}
---- ppc.ld
-+++ ppc.ld
-@@ -1,116 +1,200 @@
--/* ld script to make i386 Linux kernel
-- * Written by Martin Mares ;
-- */
--OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
--OUTPUT_ARCH(powerpc)
--SEARCH_DIR(/lib); SEARCH_DIR(/usr/lib); SEARCH_DIR(/usr/local/lib); SEARCH_DIR(/usr/alpha-unknown-linux-gnu/lib);
-+/* Default linker script, for normal executables */
-+OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
-+ "elf32-powerpc")
-+OUTPUT_ARCH(powerpc:common)
- ENTRY(_start)
-+SEARCH_DIR("/usr/powerpc-suse-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
- SECTIONS
- {
- /* Read-only sections, merged into text segment: */
-- . = 0x60000000 + SIZEOF_HEADERS;
-- .interp : { *(.interp) }
-- .hash : { *(.hash) }
-- .dynsym : { *(.dynsym) }
-- .dynstr : { *(.dynstr) }
-- .gnu.version : { *(.gnu.version) }
-- .gnu.version_d : { *(.gnu.version_d) }
-- .gnu.version_r : { *(.gnu.version_r) }
-- .rel.text :
-- { *(.rel.text) *(.rel.gnu.linkonce.t*) }
-- .rela.text :
-- { *(.rela.text) *(.rela.gnu.linkonce.t*) }
-- .rel.data :
-- { *(.rel.data) *(.rel.gnu.linkonce.d*) }
-- .rela.data :
-- { *(.rela.data) *(.rela.gnu.linkonce.d*) }
-- .rel.rodata :
-- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
-- .rela.rodata :
-- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
-- .rel.got : { *(.rel.got) }
-- .rela.got : { *(.rela.got) }
-- .rel.ctors : { *(.rel.ctors) }
-- .rela.ctors : { *(.rela.ctors) }
-- .rel.dtors : { *(.rel.dtors) }
-- .rela.dtors : { *(.rela.dtors) }
-- .rel.init : { *(.rel.init) }
-- .rela.init : { *(.rela.init) }
-- .rel.fini : { *(.rel.fini) }
-- .rela.fini : { *(.rela.fini) }
-- .rel.bss : { *(.rel.bss) }
-- .rela.bss : { *(.rela.bss) }
-- .rel.plt : { *(.rel.plt) }
-- .rela.plt : { *(.rela.plt) }
-- .init : { *(.init) } =0x47ff041f
-- .text :
-+ PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS;
-+ .interp : { *(.interp) }
-+ .hash : { *(.hash) }
-+ .dynsym : { *(.dynsym) }
-+ .dynstr : { *(.dynstr) }
-+ .gnu.version : { *(.gnu.version) }
-+ .gnu.version_d : { *(.gnu.version_d) }
-+ .gnu.version_r : { *(.gnu.version_r) }
-+ .rel.init : { *(.rel.init) }
-+ .rela.init : { *(.rela.init) }
-+ .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
-+ .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
-+ .rel.fini : { *(.rel.fini) }
-+ .rela.fini : { *(.rela.fini) }
-+ .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
-+ .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
-+ .rel.data.rel.ro : { *(.rel.data.rel.ro*) }
-+ .rela.data.rel.ro : { *(.rel.data.rel.ro*) }
-+ .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
-+ .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
-+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
-+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
-+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
-+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
-+ .rel.ctors : { *(.rel.ctors) }
-+ .rela.ctors : { *(.rela.ctors) }
-+ .rel.dtors : { *(.rel.dtors) }
-+ .rela.dtors : { *(.rela.dtors) }
-+ .rel.got : { *(.rel.got) }
-+ .rela.got : { *(.rela.got) }
-+ .rela.got1 : { *(.rela.got1) }
-+ .rela.got2 : { *(.rela.got2) }
-+ .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
-+ .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
-+ .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
-+ .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
-+ .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
-+ .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
-+ .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
-+ .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
-+ .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
-+ .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
-+ .rel.plt : { *(.rel.plt) }
-+ .rela.plt : { *(.rela.plt) }
-+ .init :
- {
-- *(.text)
-+ KEEP (*(.init))
-+ } =0
-+ .text :
-+ {
-+ *(.text .stub .text.* .gnu.linkonce.t.*)
-+ KEEP (*(.text.*personality*))
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
-- *(.gnu.linkonce.t*)
-- } =0x47ff041f
-- _etext = .;
-+ *(.glink)
-+ } =0
-+ .fini :
-+ {
-+ KEEP (*(.fini))
-+ } =0
-+ PROVIDE (__etext = .);
-+ PROVIDE (_etext = .);
- PROVIDE (etext = .);
-- .fini : { *(.fini) } =0x47ff041f
-- . = ALIGN(32 / 8);
-- PROVIDE (__preinit_array_start = .);
-- .preinit_array : { *(.preinit_array) }
-- PROVIDE (__preinit_array_end = .);
-- PROVIDE (__init_array_start = .);
-- .init_array : { *(.init_array) }
-- PROVIDE (__init_array_end = .);
-- PROVIDE (__fini_array_start = .);
-- .fini_array : { *(.fini_array) }
-- PROVIDE (__fini_array_end = .);
-- .rodata : { *(.rodata) *(.gnu.linkonce.r*) }
-- .rodata1 : { *(.rodata1) }
-- .reginfo : { *(.reginfo) }
-+ .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
-+ .rodata1 : { *(.rodata1) }
-+ .sdata2 :
-+ {
-+ PROVIDE (_SDA2_BASE_ = 32768);
-+ *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
-+ }
-+ .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
-+ .eh_frame_hdr : { *(.eh_frame_hdr) }
-+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
-+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
-- . = ALIGN(0x100000) + (. & (0x100000 - 1));
-- .data :
-+ . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
-+ /* Exception handling */
-+ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
-+ .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
-+ /* Thread Local Storage sections */
-+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
-+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
-+ .preinit_array :
-+ {
-+ PROVIDE_HIDDEN (__preinit_array_start = .);
-+ KEEP (*(.preinit_array))
-+ PROVIDE_HIDDEN (__preinit_array_end = .);
-+ }
-+ .init_array :
-+ {
-+ PROVIDE_HIDDEN (__init_array_start = .);
-+ KEEP (*(.init_array))
-+ PROVIDE_HIDDEN (__init_array_end = .);
-+ }
-+ .fini_array :
- {
-- *(.data)
-- *(.gnu.linkonce.d*)
-- CONSTRUCTORS
-+ PROVIDE_HIDDEN (__fini_array_start = .);
-+ KEEP (*(.fini_array))
-+ PROVIDE_HIDDEN (__fini_array_end = .);
- }
-- .data1 : { *(.data1) }
-- .ctors :
-+ .ctors :
- {
-- *(.ctors)
-+ /* gcc uses crtbegin.o to find the start of
-+ the constructors, so we make sure it is
-+ first. Because this is a wildcard, it
-+ doesn't matter if the user does not
-+ actually link against crtbegin.o; the
-+ linker won't look for a file to match a
-+ wildcard. The wildcard also means that it
-+ doesn't matter which directory crtbegin.o
-+ is in. */
-+ KEEP (*crtbegin*.o(.ctors))
-+ /* We don't want to include the .ctor section from
-+ from the crtend.o file until after the sorted ctors.
-+ The .ctor section from the crtend file contains the
-+ end of ctors marker and it must be last */
-+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
-+ KEEP (*(SORT(.ctors.*)))
-+ KEEP (*(.ctors))
- }
-- .dtors :
-+ .dtors :
- {
-- *(.dtors)
-+ KEEP (*crtbegin*.o(.dtors))
-+ KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
-+ KEEP (*(SORT(.dtors.*)))
-+ KEEP (*(.dtors))
- }
-- .plt : { *(.plt) }
-- .got : { *(.got.plt) *(.got) }
-- .dynamic : { *(.dynamic) }
-+ .jcr : { KEEP (*(.jcr)) }
-+ .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }
-+ .got1 : { *(.got1) }
-+ .got2 : { *(.got2) }
-+ .dynamic : { *(.dynamic) }
-+ .got : SPECIAL { *(.got) }
-+ . = DATA_SEGMENT_RELRO_END (0, .);
-+ .plt : SPECIAL { *(.plt) }
-+ .data :
-+ {
-+ *(.data .data.* .gnu.linkonce.d.*)
-+ KEEP (*(.gnu.linkonce.d.*personality*))
-+ SORT(CONSTRUCTORS)
-+ }
-+ .data1 : { *(.data1) }
-+ .got : SPECIAL { *(.got) }
- /* We want the small data sections together, so single-instruction offsets
- can access them all, and initialized data all before uninitialized, so
- we can shorten the on-disk segment size. */
-- .sdata : { *(.sdata) }
-- _edata = .;
-- PROVIDE (edata = .);
-+ .sdata :
-+ {
-+ PROVIDE (_SDA_BASE_ = 32768);
-+ *(.sdata .sdata.* .gnu.linkonce.s.*)
-+ }
-+ _edata = .; PROVIDE (edata = .);
- __bss_start = .;
-- .sbss : { *(.sbss) *(.scommon) }
-- .bss :
-+ .sbss :
-+ {
-+ PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
-+ *(.dynsbss)
-+ *(.sbss .sbss.* .gnu.linkonce.sb.*)
-+ *(.scommon)
-+ PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
-+ }
-+ .plt : SPECIAL { *(.plt) }
-+ .bss :
- {
- *(.dynbss)
-- *(.bss)
-+ *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
-+ /* Align here to ensure that the .bss section occupies space up to
-+ _end. Align after .bss to ensure correct alignment even if the
-+ .bss section disappears because there are no input sections.
-+ FIXME: Why do we need it? When there is no .bss section, we don't
-+ pad the .data section. */
-+ . = ALIGN(. != 0 ? 32 / 8 : 1);
- }
-- _end = . ;
-+ . = ALIGN(32 / 8);
-+ . = ALIGN(32 / 8);
-+ _end = .;
- PROVIDE (end = .);
-+ . = DATA_SEGMENT_END (.);
- /* Stabs debugging sections. */
-- .stab 0 : { *(.stab) }
-- .stabstr 0 : { *(.stabstr) }
-- .stab.excl 0 : { *(.stab.excl) }
-- .stab.exclstr 0 : { *(.stab.exclstr) }
-- .stab.index 0 : { *(.stab.index) }
-+ .stab 0 : { *(.stab) }
-+ .stabstr 0 : { *(.stabstr) }
-+ .stab.excl 0 : { *(.stab.excl) }
-+ .stab.exclstr 0 : { *(.stab.exclstr) }
-+ .stab.index 0 : { *(.stab.index) }
- .stab.indexstr 0 : { *(.stab.indexstr) }
-- .comment 0 : { *(.comment) }
-+ .comment 0 : { *(.comment) }
- /* DWARF debug sections.
- Symbols in the DWARF debugging sections are relative to the beginning
- of the section so we begin them at 0. */
-@@ -124,7 +208,7 @@
- .debug_aranges 0 : { *(.debug_aranges) }
- .debug_pubnames 0 : { *(.debug_pubnames) }
- /* DWARF 2 */
-- .debug_info 0 : { *(.debug_info) }
-+ .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
- .debug_abbrev 0 : { *(.debug_abbrev) }
- .debug_line 0 : { *(.debug_line) }
- .debug_frame 0 : { *(.debug_frame) }
-@@ -136,5 +220,6 @@
- .debug_funcnames 0 : { *(.debug_funcnames) }
- .debug_typenames 0 : { *(.debug_typenames) }
- .debug_varnames 0 : { *(.debug_varnames) }
-- /* These must appear regardless of . */
-+ /DISCARD/ : { *(.fixup) }
-+ /DISCARD/ : { *(.note.GNU-stack) }
- }
++++++ qemu-0.7.0-binfmt.patch ++++++
--- /var/tmp/diff_new_pack.t10868/_old 2007-07-10 18:55:10.000000000 +0200
+++ /var/tmp/diff_new_pack.t10868/_new 2007-07-10 18:55:10.000000000 +0200
@@ -1,17 +1,8 @@
---- qemu-binfmt-conf.sh
-+++ qemu-binfmt-conf.sh
-@@ -2,38 +2,46 @@
- # enable automatic i386/ARM/SPARC/PPC program execution by the kernel
-
- # load the binfmt_misc module
--/sbin/modprobe binfmt_misc
-+
-+if test ! -e /proc/sys/fs/binfmt_misc/register
-+then
-+ /sbin/modprobe binfmt_misc
-+ mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
-+fi
-
+Index: qemu-0.9.0/qemu-binfmt-conf.sh
+===================================================================
+--- qemu-0.9.0.orig/qemu-binfmt-conf.sh
++++ qemu-0.9.0/qemu-binfmt-conf.sh
+@@ -12,7 +12,7 @@ fi
# probe cpu type
cpu=`uname -m`
case "$cpu" in
@@ -19,6 +10,8 @@
+ i386|i486|i586|i686|i86pc|BePC|x86_64)
cpu="i386"
;;
+ m68k)
+@@ -24,32 +24,34 @@ case "$cpu" in
"Power Macintosh"|ppc|ppc64)
cpu="ppc"
;;
@@ -28,7 +21,6 @@
;;
+ sparc*)
+ cpu="sparc"
-+ ;;
esac
# register the interpreter for each cpu except for the native one
@@ -52,7 +44,13 @@
- echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
+ echo ':ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc:' > /proc/sys/fs/binfmt_misc/register
fi
+ if [ $cpu != "m68k" ] ; then
+ echo 'Please check cpu value and header information for m68k!'
+- echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register
++ echo ':m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k:' > /proc/sys/fs/binfmt_misc/register
+ fi
if [ $cpu != "mips" ] ; then
+ # FIXME: We could use the other endianness on a MIPS host.
- echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
- echo ':mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
+ echo ':mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips:' > /proc/sys/fs/binfmt_misc/register
++++++ qemu-0.8.3-gcc4.patch ++++++
++++ 901 lines (skipped)
++++++ qemu-cvs-alsa_bitfield.patch ++++++
Index: qemu/thunk.h
===================================================================
--- qemu.orig/thunk.h
+++ qemu/thunk.h
@@ -38,6 +38,7 @@ typedef enum argtype {
TYPE_PTR,
TYPE_ARRAY,
TYPE_STRUCT,
+ TYPE_INTBITFIELD,
} argtype;
#define MK_PTR(type) TYPE_PTR, type
@@ -87,6 +88,7 @@ static inline int thunk_type_size(const
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
@@ -124,6 +126,7 @@ static inline int thunk_type_align(const
case TYPE_SHORT:
return 2;
case TYPE_INT:
+ case TYPE_INTBITFIELD:
return 4;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
Index: qemu/thunk.c
===================================================================
--- qemu.orig/thunk.c
+++ qemu/thunk.c
@@ -40,6 +40,7 @@ static inline const argtype *thunk_type_
case TYPE_CHAR:
case TYPE_SHORT:
case TYPE_INT:
+ case TYPE_INTBITFIELD:
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
case TYPE_LONG:
@@ -132,6 +133,26 @@ const argtype *thunk_convert(void *dst,
case TYPE_INT:
*(uint32_t *)dst = tswap32(*(uint32_t *)src);
break;
+ case TYPE_INTBITFIELD:
+#if defined(TARGET_I386) && defined(__powerpc__)
+ /* powerpc uses the MSB, whereas i386 uses the LSB
+ * to store the first bit in a field */
+ {
+ unsigned char byte = *(uint8_t *)src;
+ *(uint8_t *)dst = ((byte >> 7) & 1)
+ | ((byte >> 5) & 2)
+ | ((byte >> 3) & 4)
+ | ((byte >> 1) & 8)
+ | ((byte << 1) & 16)
+ | ((byte << 3) & 32)
+ | ((byte << 5) & 64)
+ | ((byte << 7) & 128);
+ /* FIXME: implement for bitfields > 1 byte and other archs */
+ }
+#else
+ *(uint32_t *)dst = tswap32(*(uint32_t *)src);
+#endif
+ break;
case TYPE_LONGLONG:
case TYPE_ULONGLONG:
*(uint64_t *)dst = tswap64(*(uint64_t *)src);
++++++ qemu-cvs-alsa_ioctl.patch ++++++
++++ 3592 lines (skipped)
++++++ qemu-cvs-alsa_mmap.patch ++++++
Index: qemu/linux-user/mmap.c
===================================================================
--- qemu.orig/linux-user/mmap.c
+++ qemu/linux-user/mmap.c
@@ -152,6 +152,9 @@ static int mmap_frag(target_ulong real_s
return 0;
}
+#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
+
/* NOTE: all the constants are the HOST ones */
long target_mmap(target_ulong start, target_ulong len, int prot,
int flags, int fd, target_ulong offset)
@@ -192,6 +195,17 @@ long target_mmap(target_ulong start, tar
}
#endif
+ /* Alsa tries to communcate with the kernel via mmap. This usually
+ * is a good idea when user- and kernelspace are running on the
+ * same architecture but does not work out when not. To make alsa
+ * not to use mmap, we can just have it fail on the mmap calls that
+ * would initiate this.
+ */
+ if(offset == SNDRV_PCM_MMAP_OFFSET_STATUS || offset == SNDRV_PCM_MMAP_OFFSET_CONTROL) {
+ errno = EINVAL;
+ return -1;
+ }
+
if (offset & ~TARGET_PAGE_MASK) {
errno = EINVAL;
return -1;
++++++ qemu-cvs-flash.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1736,6 +1736,8 @@ static long do_ipc(long call, long first
switch (call) {
case IPCOP_semop:
+ ret = -EINVAL;
+ break;
{
struct sembuf *target_sops;
int i;
++++++ qemu-cvs-futex.patch ++++++
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
@@ -17,6 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+
+#define __user
#include
#include
#include
@@ -60,6 +62,7 @@
#define tchars host_tchars /* same as target */
#define ltchars host_ltchars /* same as target */
+#include
#include
#include
#include
@@ -2554,6 +2557,91 @@ static inline void host_to_target_timesp
unlock_user_struct(target_ts, target_addr, 1);
}
+#ifdef BSWAP_NEEDED
+static int futex_op(int oldval, int op, int oparg)
+{
+ int retval = oparg;
+ switch(op) {
+ case FUTEX_OP_SET: break;
+ case FUTEX_OP_ADD: retval += oparg; break;
+ case FUTEX_OP_OR: retval |= oparg; break;
+ case FUTEX_OP_ANDN: retval &= oparg; break;
+ case FUTEX_OP_XOR: retval ^= oparg; break;
+ }
+ return retval;
+}
+
+static int futex_cmp(int oldval, int cmp, int cmparg)
+{
+ switch(cmp) {
+ case FUTEX_OP_CMP_EQ: return oldval == cmparg;
+ case FUTEX_OP_CMP_NE: return oldval != cmparg;
+ case FUTEX_OP_CMP_LT: return oldval < cmparg;
+ case FUTEX_OP_CMP_LE: return oldval <= cmparg;
+ case FUTEX_OP_CMP_GT: return oldval > cmparg;
+ case FUTEX_OP_CMP_GE: return oldval >= cmparg;
+ }
+ return -1;
+}
+#endif
+
+static long do_futex(target_ulong uaddr, int op, uint32_t val,
+ target_ulong utime, target_ulong uaddr2,
+ uint32_t val3)
+{
+ struct timespec host_utime;
+ unsigned long val2 = utime;
+ long retval;
+
+ if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) {
+ target_to_host_timespec(&host_utime, utime);
+ val2 = (unsigned long)&host_utime;
+ }
+
+#ifdef BSWAP_NEEDED
+ switch(op) {
+ case FUTEX_CMP_REQUEUE:
+ val3 = tswap32(val3);
+ case FUTEX_REQUEUE:
+ val2 = tswap32(val2);
+ case FUTEX_WAIT:
+ case FUTEX_WAKE:
+ case FUTEX_WAKE_OP:
+ val = tswap32(val);
+ case FUTEX_LOCK_PI: /* This one's icky, but comes out OK */
+ case FUTEX_UNLOCK_PI:
+ break;
+ default:
+ gemu_log("qemu: Unsupported futex op %d\n", op);
+ return -ENOSYS;
+ }
+ if (op == FUTEX_WAKE_OP) {
+ /* Need to munge the secondary operation (val3) */
+ gemu_log("qemu: Tricky FUTEX_WAKE_OP - trying to emulate it\n");
+ val3 = tswap32(val3);
+ int op2 = (val3 >> 28) & 0xf;
+ int cmp = (val3 >> 24) & 0xf;
+ int oparg = (val3 >> 12) & 0xfff;
+ int cmparg = val3 & 0xfff;
+ int shift = val3 & (FUTEX_OP_OPARG_SHIFT << 28);
+ int oldval = tget32(uaddr2);
+ if (shift)
+ oparg = 1 << oparg;
+
+ tput32(uaddr2,futex_op(oldval, op2, oparg));
+ retval = syscall(__NR_futex, g2h(uaddr), FUTEX_WAKE, val, 0, 0, 0);
+ if(futex_cmp(oldval, cmp, cmparg)) {
+ retval = syscall(__NR_futex, g2h(uaddr2), FUTEX_WAKE, val2, 0, 0, 0);
+ }
+ } else {
+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
+ }
+#else
+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
+#endif
+ return retval;
+}
+
long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
long arg4, long arg5, long arg6)
{
@@ -4713,6 +4801,11 @@ long do_syscall(void *cpu_env, int num,
}
#endif
+#ifdef TARGET_NR_futex
+ case TARGET_NR_futex:
+ ret = get_errno(do_futex(arg1, arg2, arg3, arg4, arg5, arg6));
+ break;
+#endif
#if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address)
case TARGET_NR_set_tid_address:
ret = get_errno(set_tid_address((int *) arg1));
++++++ qemu-cvs-gettimeofday.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -3596,6 +3596,7 @@ long do_syscall(void *cpu_env, int num,
case TARGET_NR_gettimeofday:
{
struct timeval tv;
+ target_to_host_timeval(&tv, arg1);
ret = get_errno(gettimeofday(&tv, NULL));
if (!is_error(ret)) {
host_to_target_timeval(arg1, &tv);
Index: qemu/linux-user/signal.c
===================================================================
--- qemu.orig/linux-user/signal.c
+++ qemu/linux-user/signal.c
@@ -207,6 +207,8 @@ static inline void host_to_target_siginf
/* should never come here, but who knows. The information for
the target is irrelevant */
tinfo->_sifields._sigfault._addr = 0;
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = info->si_fd;
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = info->si_pid;
tinfo->_sifields._rt._uid = info->si_uid;
@@ -228,6 +230,8 @@ static void tswap_siginfo(target_siginfo
sig == SIGBUS || sig == SIGTRAP) {
tinfo->_sifields._sigfault._addr =
tswapl(info->_sifields._sigfault._addr);
+ } else if (sig == SIGIO) {
+ tinfo->_sifields._sigpoll._fd = tswap32(info->_sifields._sigpoll._fd);
} else if (sig >= TARGET_SIGRTMIN) {
tinfo->_sifields._rt._pid = tswap32(info->_sifields._rt._pid);
tinfo->_sifields._rt._uid = tswap32(info->_sifields._rt._uid);
++++++ qemu-cvs-ia64.patch ++++++
--- Makefile.target.~1.186.~ 2007-07-02 17:08:34.000000000 +0200
+++ Makefile.target 2007-07-09 19:13:35.000000000 +0200
@@ -92,6 +92,8 @@ cc-option = $(shell if $(CC) $(OP_CFLAGS
OP_CFLAGS+=$(call cc-option, -fno-reorder-blocks, "")
OP_CFLAGS+=$(call cc-option, -fno-gcse, "")
OP_CFLAGS+=$(call cc-option, -fno-tree-ch, "")
+OP_CFLAGS+=$(call cc-option, -fno-tree-dominator-opts, "")
+OP_CFLAGS+=$(call cc-option, -fno-tree-vrp, "")
OP_CFLAGS+=$(call cc-option, -fno-optimize-sibling-calls, "")
OP_CFLAGS+=$(call cc-option, -fno-crossjumping, "")
OP_CFLAGS+=$(call cc-option, -fno-align-labels, "")
@@ -165,8 +167,9 @@ BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)
endif
ifeq ($(ARCH),ia64)
-BASE_CFLAGS+=-mno-sdata
-OP_CFLAGS+=-mno-sdata
+OP_CFLAGS+=$(call cc-option, -mno-sched-ar-data-spec, "")
+BASE_CFLAGS+=-G0 -mno-sdata
+OP_CFLAGS+=-G0 -mno-sdata
BASE_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/$(ARCH).ld
endif
--- target-alpha/op.c.~1.1.~ 2007-04-05 08:58:33.000000000 +0200
+++ target-alpha/op.c 2007-07-09 20:11:42.000000000 +0200
@@ -18,8 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#define DEBUG_OP
-
#include "config.h"
#include "exec.h"
@@ -125,8 +123,12 @@
void OPPROTO op_no_op (void)
{
#if !defined (DEBUG_OP)
+#ifdef __ia64__
+ __asm__ __volatile__("nop 0" : : : "memory");
+#else
__asm__ __volatile__("nop" : : : "memory");
#endif
+#endif
RETURN();
}
++++++ qemu-cvs-img.patch ++++++
--- Makefile.orig 2007-07-05 14:43:40.000000000 +0000
+++ Makefile 2007-07-05 14:46:50.000000000 +0000
@@ -33,7 +33,7 @@
recurse-all: $(patsubst %,subdir-%, $(TARGET_DIRS))
qemu-img$(EXESUF): qemu-img.c cutils.c block.c block-raw.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 block-qcow2.c
- $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) $(BASE_LDFLAGS) -o $@ $^ -lz $(LIBS)
+ $(CC) -DQEMU_TOOL $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) $(LDFLAGS) -o $@ $^ -lz $(LIBS)
dyngen$(EXESUF): dyngen.c
$(HOST_CC) $(CFLAGS) $(CPPFLAGS) $(BASE_CFLAGS) -o $@ $^
++++++ qemu-cvs-ioctl_debug.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1950,7 +1950,12 @@ static long do_ioctl(long fd, long cmd,
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", cmd);
+ int i;
+ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", cmd, (cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ for(i=0;ioctl_entries[i].target_cmd;i++) {
+ if((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)))
+ gemu_log("%p\t->\t%s (%x)\n", ioctl_entries[i].host_cmd, ioctl_entries[i].name, (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ }
return -ENOSYS;
}
if (ie->target_cmd == cmd)
++++++ qemu-cvs-ioctl_nodirection.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1980,6 +1980,11 @@ static long do_ioctl(long fd, long cmd,
arg_type++;
target_size = thunk_type_size(arg_type, 0);
switch(ie->access) {
+ /* FIXME: actually the direction given in the ioctl should be
+ * correct so we can assume the communication is uni-directional.
+ * The alsa developers did not like this concept though and
+ * declared ioctls IOC_R and IOC_W even though they were IOC_RW.*/
+/*
case IOC_R:
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
if (!is_error(ret)) {
@@ -1994,6 +1999,7 @@ static long do_ioctl(long fd, long cmd,
unlock_user(argptr, arg, 0);
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
break;
+*/
default:
case IOC_RW:
argptr = lock_user(arg, target_size, 1);
++++++ qemu-cvs-ipc.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -29,7 +29,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -46,6 +46,9 @@
#include
#include
#include
+#include
+#include
+#include
#include
#include
#include
@@ -150,6 +153,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_tgkill __NR_tgkill
#define __NR_sys_clone __NR_clone
#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
+#define __NR_sys_ipc __NR_ipc
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -172,6 +176,10 @@ _syscall3(int,sys_rt_sigqueueinfo,int,pi
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
+#ifdef __NR_ipc
+_syscall6(int,sys_ipc, long, call, long, first, long, second, long, third, void *, ptr, long, fifth)
+#define semctl(a,b,c,d) sys_ipc(IPCOP_semctl,a,b,c,&d,0l)
+#endif
_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
@@ -1255,6 +1263,21 @@ struct target_ipc_perm
target_ulong __unused2;
};
+struct target_ipc64_perm
+{
+ int key;
+ unsigned int uid;
+ unsigned int gid;
+ unsigned int cuid;
+ unsigned int cgid;
+ unsigned short mode;
+ unsigned short __pad1;
+ unsigned short seq;
+ unsigned short __pad2;
+ target_ulong __unused1;
+ target_ulong __unused2;
+};
+
struct target_semid_ds
{
struct target_ipc_perm sem_perm;
@@ -1267,6 +1290,18 @@ struct target_semid_ds
target_ulong __unused4;
};
+struct target_semid64_ds
+{
+ struct target_ipc64_perm sem_perm;
+ target_ulong sem_otime;
+ target_ulong __unused1;
+ target_ulong sem_ctime;
+ target_ulong __unused2;
+ target_ulong sem_nsems;
+ target_ulong __unused3;
+ target_ulong __unused4;
+};
+
static inline void target_to_host_ipc_perm(struct ipc_perm *host_ip,
target_ulong target_addr)
{
@@ -1301,6 +1336,41 @@ static inline void host_to_target_ipc_pe
unlock_user_struct(target_sd, target_addr, 1);
}
+static inline void target_to_host_ipc64_perm( struct ipc64_perm *host_ip, target_ulong target_addr )
+{
+ struct target_ipc64_perm *target_ip;
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 1);
+ target_ip=&(target_sd->sem_perm);
+ host_ip->key = tswapl(target_ip->key);
+ host_ip->uid = tswapl(target_ip->uid);
+ host_ip->gid = tswapl(target_ip->gid);
+ host_ip->cuid = tswapl(target_ip->cuid);
+ host_ip->cgid = tswapl(target_ip->cgid);
+ host_ip->mode = tswap16(target_ip->mode);
+ host_ip->seq = tswap16(target_ip->seq);
+ unlock_user_struct(target_sd, target_addr, 1);
+}
+
+static inline void host_to_target_ipc64_perm(target_ulong target_addr,
+ struct ipc64_perm *host_ip)
+{
+ struct target_ipc64_perm *target_ip;
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 0);
+ target_ip = &(target_sd->sem_perm);
+ target_ip->key = tswapl(host_ip->key);
+ target_ip->uid = tswapl(host_ip->uid);
+ target_ip->gid = tswapl(host_ip->gid);
+ target_ip->cuid = tswapl(host_ip->cuid);
+ target_ip->cgid = tswapl(host_ip->cgid);
+ target_ip->mode = tswap16(host_ip->mode);
+ target_ip->seq = tswap16(host_ip->seq);
+ unlock_user_struct(target_sd, target_addr, 1);
+}
+
static inline void target_to_host_semid_ds(struct semid_ds *host_sd,
target_ulong target_addr)
{
@@ -1327,6 +1397,32 @@ static inline void host_to_target_semid_
unlock_user_struct(target_sd, target_addr, 1);
}
+static inline void target_to_host_semid64_ds(struct semid64_ds *host_sd,
+ target_ulong target_addr)
+{
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 1);
+ target_to_host_ipc64_perm(&(host_sd->sem_perm),target_addr);
+ host_sd->sem_nsems = tswapl(target_sd->sem_nsems);
+ host_sd->sem_otime = tswapl(target_sd->sem_otime);
+ host_sd->sem_ctime = tswapl(target_sd->sem_ctime);
+ unlock_user_struct(target_sd, target_addr, 0);
+}
+
+static inline void host_to_target_semid64_ds(target_ulong target_addr,
+ struct semid64_ds *host_sd)
+{
+ struct target_semid64_ds *target_sd;
+
+ lock_user_struct(target_sd, target_addr, 0);
+ host_to_target_ipc64_perm(target_addr,&(host_sd->sem_perm));
+ target_sd->sem_nsems = tswapl(host_sd->sem_nsems);
+ target_sd->sem_otime = tswapl(host_sd->sem_otime);
+ target_sd->sem_ctime = tswapl(host_sd->sem_ctime);
+ unlock_user_struct(target_sd, target_addr, 1);
+}
+
union semun {
int val;
struct semid_ds *buf;
@@ -1339,6 +1435,10 @@ union target_semun {
unsigned short int *array;
};
+#ifndef IPC_64
+#define IPC_64 0x100
+#endif
+
static inline void target_to_host_semun(unsigned long cmd,
union semun *host_su,
target_ulong target_addr,
@@ -1350,7 +1450,16 @@ static inline void target_to_host_semun(
case IPC_STAT:
case IPC_SET:
lock_user_struct(target_su, target_addr, 1);
- target_to_host_semid_ds(ds,target_su->buf);
+ target_to_host_semid_ds(ds,tswapl(target_su->buf));
+ host_su->buf = ds;
+ unlock_user_struct(target_su, target_addr, 0);
+ break;
+ case IPC_STAT + IPC_64:
+ case IPC_SET + IPC_64:
+ lock_user_struct(target_su, target_addr, 1);
+
+ //target_to_host_semid_ds(ds,tswapl(target_su->buf));
+ target_to_host_semid64_ds((struct semid64_ds *)ds,tswapl(target_su->buf));
host_su->buf = ds;
unlock_user_struct(target_su, target_addr, 0);
break;
@@ -1382,7 +1491,14 @@ static inline void host_to_target_semun(
case IPC_STAT:
case IPC_SET:
lock_user_struct(target_su, target_addr, 0);
- host_to_target_semid_ds(target_su->buf,ds);
+ host_to_target_semid_ds(tswapl(target_su->buf),ds);
+ unlock_user_struct(target_su, target_addr, 1);
+ break;
+ case IPC_STAT + IPC_64:
+ case IPC_SET + IPC_64:
+ lock_user_struct(target_su, target_addr, 0);
+ //host_to_target_semid_ds(tswapl(target_su->buf),ds);
+ host_to_target_semid64_ds(tswapl(target_su->buf),(struct semid64_ds *)ds);
unlock_user_struct(target_su, target_addr, 1);
break;
case GETVAL:
@@ -1406,7 +1522,8 @@ static inline long do_semctl(long first,
{
union semun arg;
struct semid_ds dsarg;
- int cmd = third&0xff;
+ struct semid64_ds dsarg64;
+ int cmd = third; // & 0xff;
long ret = 0;
switch( cmd ) {
@@ -1435,13 +1552,23 @@ static inline long do_semctl(long first,
ret = get_errno(semctl(first, second, cmd, arg));
host_to_target_semun(cmd,ptr,&arg,&dsarg);
break;
+ case IPC_STAT + IPC_64:
+ target_to_host_semun(cmd,&arg,ptr,(struct semid_ds *)&dsarg64);
+ ret = get_errno(semctl(first, second, cmd, arg));
+ host_to_target_semun(cmd,ptr,&arg,(struct semid_ds *)&dsarg64);
+ break;
case IPC_SET:
target_to_host_semun(cmd,&arg,ptr,&dsarg);
ret = get_errno(semctl(first, second, cmd, arg));
host_to_target_semun(cmd,ptr,&arg,&dsarg);
break;
- default:
+ case IPC_SET + IPC_64:
+ target_to_host_semun(cmd,&arg,ptr,(struct semid_ds *)&dsarg64);
ret = get_errno(semctl(first, second, cmd, arg));
+ host_to_target_semun(cmd,ptr,&arg,(struct semid_ds *)&dsarg64);
+ break;
+ default:
+ ret = get_errno(semctl(first, second, cmd & 0xff, arg));
}
return ret;
@@ -1465,6 +1592,42 @@ struct target_msqid_ds
target_ulong __unused5;
};
+
+struct target_shmid64_ds {
+ struct target_ipc64_perm shm_perm; /* operation perms */
+ target_ulong shm_segsz; /* size of segment (bytes) */
+ target_ulong shm_atime; /* last attach time */
+ target_ulong __unused1;
+ target_ulong shm_dtime; /* last detach time */
+ target_ulong __unused2;
+ target_ulong shm_ctime; /* last change time */
+ target_ulong __unused3;
+ int32_t shm_cpid; /* pid of creator */
+ int32_t shm_lpid; /* pid of last operator */
+ target_ulong shm_nattch; /* no. of current attaches */
+ target_ulong __unused4;
+ target_ulong __unused5;
+};
+
+/* Data structure describing a set of semaphores. */
+struct target_shmid_ds
+ {
+ struct target_ipc_perm shm_perm; /* operation permission struct */
+ unsigned int __unused1;
+ target_ulong shm_atime; /* time of last shmat() */
+ unsigned int __unused2;
+ target_ulong shm_dtime; /* time of last shmdt() */
+ unsigned int __unused3;
+ target_ulong shm_ctime; /* time of last change by shmctl() */
+ unsigned int __unused4;
+ target_ulong shm_segsz; /* size of segment in bytes */
+ unsigned int shm_cpid; /* pid of creator */
+ unsigned int shm_lpid; /* pid of last shmop */
+ target_ulong shm_nattch; /* number of current attaches */
+ unsigned long __unused5;
+ unsigned long __unused6;
+ };
+
static inline void target_to_host_msqid_ds(struct msqid_ds *host_md,
target_ulong target_addr)
{
@@ -1665,11 +1828,59 @@ static long do_ipc(long call, long first
case IPCOP_shmctl:
switch(second) {
case IPC_RMID:
+ case IPC_RMID + IPC_64:
case SHM_LOCK:
+ case SHM_LOCK + IPC_64:
case SHM_UNLOCK:
+ case SHM_UNLOCK + IPC_64:
ret = get_errno(shmctl(first, second, NULL));
break;
+ case IPC_STAT + IPC_64:
+ {
+ struct shmid64_ds buf;
+ struct target_shmid64_ds *target_buf;
+#ifdef DEBUG
+ gemu_log("qemu: doing IPC_STAT\n");
+#endif
+ lock_user_struct(target_buf, ptr, 1);
+ ret = get_errno(shmctl(first, second, (struct shmid_ds*)&buf));
+
+ host_to_target_ipc64_perm(ptr, &buf.shm_perm);
+ target_buf->shm_atime = tswapl(buf.shm_atime);
+ target_buf->shm_dtime = tswapl(buf.shm_dtime);
+ target_buf->shm_ctime = tswapl(buf.shm_ctime);
+ target_buf->shm_segsz = tswapl(buf.shm_segsz);
+ target_buf->shm_cpid = tswap32(buf.shm_cpid);
+ target_buf->shm_lpid = tswap32(buf.shm_lpid);
+ target_buf->shm_nattch = tswapl(buf.shm_nattch);
+ unlock_user_struct(target_buf, ptr, 0);
+ break;
+ }
+ case IPC_SET + IPC_64:
+ {
+ struct shmid64_ds buf;
+ struct target_shmid64_ds *target_buf;
+#ifdef DEBUG
+ gemu_log("qemu: doing IPC_SET\n");
+#endif
+ lock_user_struct(target_buf, ptr, 1);
+
+ target_to_host_ipc64_perm(&buf.shm_perm, ptr);
+ buf.shm_atime = tswapl(target_buf->shm_atime);
+ buf.shm_dtime = tswapl(target_buf->shm_dtime);
+ buf.shm_ctime = tswapl(target_buf->shm_ctime);
+ buf.shm_segsz = tswapl(target_buf->shm_segsz);
+ buf.shm_cpid = tswap32(target_buf->shm_cpid);
+ buf.shm_lpid = tswap32(target_buf->shm_lpid);
+ buf.shm_nattch = tswapl(target_buf->shm_nattch);
+
+ ret = get_errno(shmctl(first, second, (struct shmid_ds*)&buf));
+
+ unlock_user_struct(target_buf, ptr, 0);
+ break;
+ }
default:
+ gemu_log("Unsopported shmctl(%ld,%#lx)\n", second, second);
goto unimplemented;
}
break;
++++++ qemu-cvs-ipc_semop.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -1573,9 +1732,19 @@ static long do_ipc(long call, long first
switch (call) {
case IPCOP_semop:
- ret = get_errno(semop(first,(struct sembuf *) ptr, second));
+ {
+ struct sembuf *target_sops;
+ int i;
+ lock_user_struct(target_sops, ptr, 0);
+ for(i=0; i %#x)\n", prot, prot & (PROT_READ | PROT_WRITE | PROT_EXEC));
+ prot &= (PROT_READ | PROT_WRITE | PROT_EXEC);
+ }
if (len == 0)
return 0;
++++++ qemu-cvs-netlink.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -898,6 +906,7 @@ static long do_socket(int domain, int ty
break;
}
#endif
+ if(domain == PF_NETLINK) return -EAFNOSUPPORT; /* do not make NETLINK socket connections possible */
return get_errno(socket(domain, type, protocol));
}
++++++ qemu-cvs-newpath.patch ++++++
Index: qemu.bkp/linux-user/path.c
===================================================================
--- qemu.bkp.orig/linux-user/path.c
+++ qemu.bkp/linux-user/path.c
@@ -1,159 +1,81 @@
/* Code to mangle pathnames into those matching a given prefix.
eg. open("/lib/foo.so") => open("/usr/gnemul/i386-linux/lib/foo.so");
-
- The assumption is that this area does not change.
*/
#include
-#include
+#include
#include
-#include
#include
-#include
#include
#include "qemu.h"
-struct pathelem
-{
- /* Name of this, eg. lib */
- char *name;
- /* Full path name, eg. /usr/gnemul/x86-linux/lib. */
- char *pathname;
- struct pathelem *parent;
- /* Children */
- unsigned int num_entries;
- struct pathelem *entries[0];
+struct path_list_head {
+ struct path_list_head *next;
+ char* path;
};
-static struct pathelem *base;
-
-/* First N chars of S1 match S2, and S2 is N chars long. */
-static int strneq(const char *s1, unsigned int n, const char *s2)
-{
- unsigned int i;
-
- for (i = 0; i < n; i++)
- if (s1[i] != s2[i])
- return 0;
- return s2[i] == 0;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name);
-
-static struct pathelem *new_entry(const char *root,
- struct pathelem *parent,
- const char *name)
-{
- struct pathelem *new = malloc(sizeof(*new));
- new->name = strdup(name);
- asprintf(&new->pathname, "%s/%s", root, name);
- new->num_entries = 0;
- return new;
-}
-
-#define streq(a,b) (strcmp((a), (b)) == 0)
-
-static struct pathelem *add_dir_maybe(struct pathelem *path)
-{
- DIR *dir;
-
- if ((dir = opendir(path->pathname)) != NULL) {
- struct dirent *dirent;
-
- while ((dirent = readdir(dir)) != NULL) {
- if (!streq(dirent->d_name,".") && !streq(dirent->d_name,"..")){
- path = add_entry(path, dirent->d_name);
- }
- }
- closedir(dir);
- }
- return path;
-}
-
-static struct pathelem *add_entry(struct pathelem *root, const char *name)
-{
- root->num_entries++;
-
- root = realloc(root, sizeof(*root)
- + sizeof(root->entries[0])*root->num_entries);
-
- root->entries[root->num_entries-1] = new_entry(root->pathname, root, name);
- root->entries[root->num_entries-1]
- = add_dir_maybe(root->entries[root->num_entries-1]);
- return root;
-}
-
-/* This needs to be done after tree is stabalized (ie. no more reallocs!). */
-static void set_parents(struct pathelem *child, struct pathelem *parent)
-{
- unsigned int i;
-
- child->parent = parent;
- for (i = 0; i < child->num_entries; i++)
- set_parents(child->entries[i], child);
-}
-
-/* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */
-static const char *
-follow_path(const struct pathelem *cursor, const char *name)
-{
- unsigned int i, namelen;
-
- name += strspn(name, "/");
- namelen = strcspn(name, "/");
-
- if (namelen == 0)
- return cursor->pathname;
-
- if (strneq(name, namelen, ".."))
- return follow_path(cursor->parent, name + namelen);
-
- if (strneq(name, namelen, "."))
- return follow_path(cursor, name + namelen);
-
- for (i = 0; i < cursor->num_entries; i++)
- if (strneq(name, namelen, cursor->entries[i]->name))
- return follow_path(cursor->entries[i], name + namelen);
-
- /* Not found */
- return NULL;
-}
+static struct path_list_head* list_head;
void init_paths(const char *prefix)
{
- char pref_buf[PATH_MAX];
-
- if (prefix[0] == '\0' ||
- !strcmp(prefix, "/"))
+ if (prefix[0] != '/' ||
+ prefix[0] == '\0' ||
+ !strcmp(prefix, "/"))
return;
- if (prefix[0] != '/') {
- char *cwd = get_current_dir_name();
- if (!cwd)
- abort();
- strcpy(pref_buf, cwd);
- strcat(pref_buf, "/");
- strcat(pref_buf, prefix);
- free(cwd);
- } else
- strcpy(pref_buf,prefix + 1);
-
- base = new_entry("", NULL, pref_buf);
- base = add_dir_maybe(base);
- if (base->num_entries == 0) {
- free (base);
- base = NULL;
- } else {
- set_parents(base, base);
- }
+ list_head = malloc(sizeof(struct path_list_head));
+
+ /* first element of list is prefix */
+ list_head->path = strdup(prefix);
+ list_head->next = NULL;
}
/* Look for path in emulation dir, otherwise return name. */
const char *path(const char *name)
{
+ struct path_list_head *list = list_head;
+ int path_length = strlen(list_head->path) + strlen(name) + 1;
+ char *newname = malloc(path_length);
+ struct stat buf;
+ const char * result = name;
+
/* Only do absolute paths: quick and dirty, but should mostly be OK.
Could do relative by tracking cwd. */
- if (!base || name[0] != '/')
- return name;
+ if (!list_head || result[0] != '/')
+ goto exit;
+
+ strncpy(newname, list_head->path, path_length);
+ strncat(newname, name, path_length);
- return follow_path(base, name) ?: name;
+ /* look for place where path should be present */
+ while ( list->next && (strcmp(list->next->path, newname) < 0) )
+ list = list->next;
+
+ /* if there is no path in list */
+ if ( !list->next || strcmp(list->next->path, newname) ) {
+ /* add element to list if path exist in emulation dir */
+ if ( !stat(newname, &buf) )
+ {
+ struct path_list_head *new;
+
+ new = malloc(sizeof(struct path_list_head));
+ new->path = strdup(newname);
+ new->next = list->next;
+ list->next = new;
+ result = new->path;
+ }
+
+ } else if ( stat(list->next->path, &buf) ) {
+ /* remove element from list if path doesn't exist in emulation dir */
+ struct path_list_head* tmp;
+
+ tmp = list->next;
+ list->next = tmp->next;
+ free(tmp->path);
+ free(tmp);
+ } else
+ result = list->next->path;
+
+exit:
+ free(newname);
+ return result;
}
++++++ qemu-cvs-nofadvise64.patch ++++++
Index: qemu/linux-user/syscall.c
===================================================================
--- qemu.orig/linux-user/syscall.c
+++ qemu/linux-user/syscall.c
@@ -5059,6 +5059,11 @@ long do_syscall(void *cpu_env, int num,
goto unimplemented_nowarn;
#endif
+#ifdef TARGET_NR_fadvise64
+ case TARGET_NR_fadvise64:
+ goto unimplemented_nowarn;
+#endif
+
#ifdef TARGET_NR_sched_getaffinity
case TARGET_NR_sched_getaffinity:
{
++++++ qemu-cvs-noppcemb.patch ++++++
Index: qemu-0.9.0/configure
===================================================================
--- qemu-0.9.0.orig/configure
+++ qemu-0.9.0/configure
@@ -473,7 +473,7 @@ fi
if test -z "$target_list" ; then
# these targets are portable
if [ "$softmmu" = "yes" ] ; then
- target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu ppcemb-softmmu m68k-softmmu z80-softmmu"
+ target_list="i386-softmmu ppc-softmmu sparc-softmmu x86_64-softmmu mips-softmmu mipsel-softmmu mips64-softmmu mips64el-softmmu arm-softmmu ppc64-softmmu m68k-softmmu z80-softmmu"
fi
# the following are Linux specific
if [ "$linux_user" = "yes" ] ; then
++++++ qemu-cvs-pthread.patch ++++++
Index: qemu-0.9.0/Makefile
===================================================================
--- qemu-0.9.0.orig/Makefile
+++ qemu-0.9.0/Makefile
@@ -12,7 +12,7 @@ BASE_CFLAGS += $(OS_CFLAGS) $(ARCH_CFLAG
BASE_LDFLAGS += $(OS_LDFLAGS) $(ARCH_LDFLAGS)
CPPFLAGS += -I. -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-LIBS=
+LIBS=-lpthread
TOOLS=qemu-img$(EXESUF)
ifdef CONFIG_STATIC
BASE_LDFLAGS += -static
++++++ qemu-cvs-sched_getaffinity.patch ++++++
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
@@ -149,6 +149,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_syslog __NR_syslog
#define __NR_sys_tgkill __NR_tgkill
#define __NR_sys_clone __NR_clone
+#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -171,6 +172,7 @@ _syscall3(int,sys_rt_sigqueueinfo,int,pi
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
+_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -4823,6 +4825,17 @@ long do_syscall(void *cpu_env, int num,
goto unimplemented_nowarn;
#endif
+#ifdef TARGET_NR_sched_getaffinity
+ case TARGET_NR_sched_getaffinity:
+ {
+ cpu_set_t *mask;
+ lock_user_struct(mask, arg3, 1);
+ ret = get_errno(sys_sched_getaffinity((pid_t)arg1, (unsigned int)arg2, mask));
+ unlock_user_struct(mask, arg3, 0);
+ break;
+ }
+#endif
+
default:
unimplemented:
gemu_log("qemu: Unsupported syscall: %d\n", num);
++++++ qemu-cvs-tls.patch ++++++
Index: qemu.bkp/linux-user/main.c
===================================================================
--- qemu.bkp.orig/linux-user/main.c
+++ qemu.bkp/linux-user/main.c
@@ -156,7 +156,7 @@ static void set_gate(void *ptr, unsigned
p[1] = tswapl(e2);
}
-uint64_t gdt_table[6];
+uint64_t gdt_table[9];
uint64_t idt_table[256];
/* only dpl matters as we do only user space emulation */
Index: qemu.bkp/linux-user/syscall.c
===================================================================
--- qemu.bkp.orig/linux-user/syscall.c
+++ qemu.bkp/linux-user/syscall.c
@@ -145,6 +145,7 @@ type name (type1 arg1,type2 arg2,type3 a
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
#define __NR_sys_syslog __NR_syslog
#define __NR_sys_tgkill __NR_tgkill
+#define __NR_sys_clone __NR_clone
#if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__)
#define __NR__llseek __NR_lseek
@@ -166,6 +167,7 @@ _syscall5(int, _llseek, uint, fd, ulon
_syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo)
_syscall3(int,sys_syslog,int,type,char*,bufp,int,len)
_syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
+_syscall5(int,sys_clone, int, flags, void *, child_stack, int *, parent_tidptr, void *, newtls, int *, child_tidptr)
#ifdef __NR_exit_group
_syscall1(int,exit_group,int,error_code)
#endif
@@ -2115,29 +2117,107 @@ int do_modify_ldt(CPUX86State *env, int
return ret;
}
+int do_set_thread_area(CPUX86State *env, target_ulong ptr)
+{
+ uint64_t *gdt_table = g2h(env->gdt.base);
+ struct target_modify_ldt_ldt_s ldt_info;
+ struct target_modify_ldt_ldt_s *target_ldt_info;
+ int seg_32bit, contents, read_exec_only, limit_in_pages;
+ int seg_not_present, useable;
+ uint32_t *lp, entry_1, entry_2;
+ int i;
+
+ lock_user_struct(target_ldt_info, ptr, 1);
+ ldt_info.entry_number = tswap32(target_ldt_info->entry_number);
+ ldt_info.base_addr = tswapl(target_ldt_info->base_addr);
+ ldt_info.limit = tswap32(target_ldt_info->limit);
+ ldt_info.flags = tswap32(target_ldt_info->flags);
+ if (ldt_info.entry_number == -1) {
+ for (i=6; i<8; i++)
+ if (gdt_table[i] == 0) {
+ ldt_info.entry_number = i;
+ target_ldt_info->entry_number = tswap32(i);
+ break;
+ }
+ }
+ unlock_user_struct(target_ldt_info, ptr, 0);
+
+ if (ldt_info.entry_number < 6 || ldt_info.entry_number > 8)
+ return -EINVAL;
+ seg_32bit = ldt_info.flags & 1;
+ contents = (ldt_info.flags >> 1) & 3;
+ read_exec_only = (ldt_info.flags >> 3) & 1;
+ limit_in_pages = (ldt_info.flags >> 4) & 1;
+ seg_not_present = (ldt_info.flags >> 5) & 1;
+ useable = (ldt_info.flags >> 6) & 1;
+
+ if (contents == 3) {
+ if (seg_not_present == 0)
+ return -EINVAL;
+ }
+
+ /* NOTE: same code as Linux kernel */
+ /* Allow LDTs to be cleared by the user. */
+ if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
+ if ((contents == 0 &&
+ read_exec_only == 1 &&
+ seg_32bit == 0 &&
+ limit_in_pages == 0 &&
+ seg_not_present == 1 &&
+ useable == 0 )) {
+ entry_1 = 0;
+ entry_2 = 0;
+ goto install;
+ }
+ }
+
+ entry_1 = ((ldt_info.base_addr & 0x0000ffff) << 16) |
+ (ldt_info.limit & 0x0ffff);
+ entry_2 = (ldt_info.base_addr & 0xff000000) |
+ ((ldt_info.base_addr & 0x00ff0000) >> 16) |
+ (ldt_info.limit & 0xf0000) |
+ ((read_exec_only ^ 1) << 9) |
+ (contents << 10) |
+ ((seg_not_present ^ 1) << 15) |
+ (seg_32bit << 22) |
+ (limit_in_pages << 23) |
+ (useable << 20) |
+ 0x7000;
+
+ /* Install the new entry ... */
+install:
+ lp = (uint32_t *)(gdt_table + ldt_info.entry_number);
+ lp[0] = tswap32(entry_1);
+ lp[1] = tswap32(entry_2);
+ return 0;
+}
#endif /* defined(TARGET_I386) */
/* this stack is the equivalent of the kernel stack associated with a
thread/process */
#define NEW_STACK_SIZE 8192
-static int clone_func(void *arg)
+static int clone_func(void *cloneenv)
{
- CPUState *env = arg;
- cpu_loop(env);
+ cpu_loop((CPUState *)cloneenv);
/* never exits */
return 0;
}
-int do_fork(CPUState *env, unsigned int flags, unsigned long newsp)
+int do_fork(CPUState *env, unsigned int flags, target_ulong newsp, target_ulong parent_tidptr, target_ulong newtls, target_ulong child_tidptr)
{
int ret;
+ unsigned long parent_tid=gettid();
TaskState *ts;
uint8_t *new_stack;
CPUState *new_env;
-
+#if defined(TARGET_I386)
+ uint64_t *new_gdt_table;
+#endif
if (flags & CLONE_VM) {
ts = malloc(sizeof(TaskState) + NEW_STACK_SIZE);
+ if (!ts)
+ return -ENOMEM;
memset(ts, 0, sizeof(TaskState));
new_stack = ts->stack;
ts->used = 1;
@@ -2149,6 +2229,27 @@ int do_fork(CPUState *env, unsigned int
#if defined(TARGET_I386)
if (!newsp)
newsp = env->regs[R_ESP];
+ new_gdt_table = malloc(9 * 8);
+ if (!new_gdt_table) {
+ free(new_env);
+ return -ENOMEM;
+ }
+ /* Copy main GDT table from parent, but clear TLS entries */
+ memcpy(new_gdt_table, g2h(env->gdt.base), 6 * 8);
+ memset(&new_gdt_table[6], 0, 3 * 8);
+ new_env->gdt.base = h2g(new_gdt_table);
+ if (flags & CLONE_SETTLS) {
+ ret = do_set_thread_area(new_env, newtls);
+ if (ret) {
+ free(new_gdt_table);
+ free(new_env);
+ return ret;
+ }
+ }
+
+ cpu_x86_load_seg(new_env, R_FS, new_env->segs[R_FS].selector);
+ cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
+
new_env->regs[R_ESP] = newsp;
new_env->regs[R_EAX] = 0;
#elif defined(TARGET_ARM)
@@ -2202,15 +2303,27 @@ int do_fork(CPUState *env, unsigned int
#endif
new_env->opaque = ts;
#ifdef __ia64__
- ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
+ ret = __clone2(clone_func, new_stack + NEW_STACK_SIZE, flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), new_env);
#else
- ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
+ ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), new_env);
#endif
} else {
/* if no CLONE_VM, we consider it is a fork */
- if ((flags & ~CSIGNAL) != 0)
- return -EINVAL;
- ret = fork();
+ ret = sys_clone(flags & ~(CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID), 0, g2h(parent_tidptr), NULL, g2h(child_tidptr));
+ }
+ /* Store child thread ID at location parent_tidptr in parent and child memory.
+ Currently this is only done in client memory */
+ if(flags & CLONE_PARENT_SETTID) {
+ tput32(parent_tidptr, parent_tid);
+ }
+
+ /* Store child thread ID at location child_tidptr in child memory. */
+ if(flags & CLONE_CHILD_SETTID) {
+ if(ret==0) { /* only in client memory for fork() */
+ tput32(child_tidptr, gettid());
+ } else if(flags & CLONE_VM) { /* real threads need it too */
+ tput32(child_tidptr, ret);
+ }
}
return ret;
}
@@ -2458,7 +2571,7 @@ long do_syscall(void *cpu_env, int num,
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
- /* XXX: should free thread stack and CPU env */
+ /* XXX: should free thread stack, GDT and CPU env */
_exit(arg1);
ret = 0; /* avoid warning */
break;
@@ -2487,7 +2600,7 @@ long do_syscall(void *cpu_env, int num,
ret = do_brk(arg1);
break;
case TARGET_NR_fork:
- ret = get_errno(do_fork(cpu_env, SIGCHLD, 0));
+ ret = get_errno(do_fork(cpu_env, SIGCHLD, 0, 0,0,0));
break;
#ifdef TARGET_NR_waitpid
case TARGET_NR_waitpid:
@@ -3651,7 +3764,7 @@ long do_syscall(void *cpu_env, int num,
ret = get_errno(fsync(arg1));
break;
case TARGET_NR_clone:
- ret = get_errno(do_fork(cpu_env, arg1, arg2));
+ ret = get_errno(do_fork(cpu_env, arg1, arg2,arg3,arg4,arg5));
break;
#ifdef __NR_exit_group
/* new thread calls */
@@ -4039,7 +4152,7 @@ long do_syscall(void *cpu_env, int num,
#endif
#ifdef TARGET_NR_vfork
case TARGET_NR_vfork:
- ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0));
+ ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0, 0,0,0));
break;
#endif
#ifdef TARGET_NR_ugetrlimit
@@ -4561,12 +4674,12 @@ long do_syscall(void *cpu_env, int num,
#ifdef TARGET_NR_set_thread_area
case TARGET_NR_set_thread_area:
#ifdef TARGET_MIPS
- ((CPUMIPSState *) cpu_env)->tls_value = arg1;
- ret = 0;
- break;
+ ((CPUMIPSState *) cpu_env)->tls_value = arg1;
+ ret = 0;
#else
- goto unimplemented_nowarn;
+ ret = get_errno(do_set_thread_area(cpu_env, arg1));
#endif
+ break;
#endif
#ifdef TARGET_NR_get_thread_area
case TARGET_NR_get_thread_area:
++++++ qemu-m68k.diff ++++++
++++ 2766 lines (skipped)
++++++ qemu-z80.diff ++++++
++++ 797 lines (skipped)
++++ between qemu/qemu-z80.diff
++++ and /mounts/work_src_done/STABLE/qemu/qemu-z80.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org