add qemu user
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
From 4af9300d36f0975213b0fb967131629ad6b4c550 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:17:39 +0200
|
||||
Subject: [PATCH 01/17] qemu-0.7.0-amd64
|
||||
|
||||
No clue why this is necessary or useful, nothing found in any changelogs.
|
||||
---
|
||||
x86_64.ld | 6 ++----
|
||||
1 files changed, 2 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: qemu-0.14.1/x86_64.ld
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/x86_64.ld
|
||||
+++ qemu-0.14.1/x86_64.ld
|
||||
@@ -70,8 +70,6 @@ SECTIONS
|
||||
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
||||
.rodata1 : { *(.rodata1) }
|
||||
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
||||
- .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
|
||||
- .gcc_except_table : ONLY_IF_RO { *(.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 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000);
|
||||
@@ -97,8 +95,8 @@ SECTIONS
|
||||
.data1 : { *(.data1) }
|
||||
.tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
|
||||
.tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
|
||||
- .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
|
||||
- .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table) }
|
||||
+ .eh_frame : { KEEP (*(.eh_frame)) }
|
||||
+ .gcc_except_table : { *(.gcc_except_table) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
.ctors :
|
||||
{
|
||||
@@ -0,0 +1,82 @@
|
||||
From 8f16efecc00d3ee4615dcd2d5381b23df4465698 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:18:44 +0200
|
||||
Subject: [PATCH 02/17] qemu-0.9.0.cvs-binfmt
|
||||
|
||||
Fixes binfmt_misc setup script:
|
||||
- x86_64 is i386-compatible
|
||||
- m68k signature fixed
|
||||
- path to QEMU
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
scripts/qemu-binfmt-conf.sh | 35 +++++++++++++++++++----------------
|
||||
1 files changed, 19 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
|
||||
index c50beb7..335ab05 100644
|
||||
--- a/scripts/qemu-binfmt-conf.sh
|
||||
+++ b/scripts/qemu-binfmt-conf.sh
|
||||
@@ -27,40 +27,43 @@ case "$cpu" in
|
||||
armv[4-9]*)
|
||||
cpu="arm"
|
||||
;;
|
||||
+ sparc*)
|
||||
+ cpu="sparc"
|
||||
+ ;;
|
||||
esac
|
||||
|
||||
# register the interpreter for each cpu except for the native one
|
||||
if [ $cpu != "i386" ] ; then
|
||||
- echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "alpha" ] ; then
|
||||
- echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "arm" ] ; then
|
||||
- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\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-arm:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sparc" ] ; then
|
||||
- echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "ppc" ] ; then
|
||||
- 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\x02\x00\x04:\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 ':mipsn32: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-mipsn32:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mipsn32el: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-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mips64:M::\x7fELF\x02\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-mips64:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mips64el:M::\x7fELF\x02\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-mips64el:' > /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
|
||||
+ 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/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mipsn32: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-mipsn32:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mipsn32el: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/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mips64:M::\x7fELF\x02\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-mips64:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mips64el:M::\x7fELF\x02\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/bin/qemu-mips64el:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sh" ] ; then
|
||||
- echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/local/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
From 8a88b86cc9a3ad0bb6da52fb0f938fe5a085c027 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:20:50 +0200
|
||||
Subject: [PATCH 03/17] qemu-cvs-alsa_bitfield
|
||||
|
||||
Implements TYPE_INTBITFIELD partially. (required for ALSA support)
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
thunk.c | 21 +++++++++++++++++++++
|
||||
thunk.h | 3 +++
|
||||
2 files changed, 24 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/thunk.c b/thunk.c
|
||||
index 0657188..5638b2c 100644
|
||||
--- a/thunk.c
|
||||
+++ b/thunk.c
|
||||
@@ -41,6 +41,7 @@ static inline const argtype *thunk_type_next(const argtype *type_ptr)
|
||||
case TYPE_CHAR:
|
||||
case TYPE_SHORT:
|
||||
case TYPE_INT:
|
||||
+ case TYPE_INTBITFIELD:
|
||||
case TYPE_LONGLONG:
|
||||
case TYPE_ULONGLONG:
|
||||
case TYPE_LONG:
|
||||
@@ -139,6 +140,26 @@ const argtype *thunk_convert(void *dst, const void *src,
|
||||
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);
|
||||
diff --git a/thunk.h b/thunk.h
|
||||
index 109c541..55890f3 100644
|
||||
--- a/thunk.h
|
||||
+++ b/thunk.h
|
||||
@@ -37,6 +37,7 @@ typedef enum argtype {
|
||||
TYPE_PTR,
|
||||
TYPE_ARRAY,
|
||||
TYPE_STRUCT,
|
||||
+ TYPE_INTBITFIELD,
|
||||
} argtype;
|
||||
|
||||
#define MK_PTR(type) TYPE_PTR, type
|
||||
@@ -90,6 +91,7 @@ static inline int thunk_type_size(const argtype *type_ptr, int is_host)
|
||||
case TYPE_SHORT:
|
||||
return 2;
|
||||
case TYPE_INT:
|
||||
+ case TYPE_INTBITFIELD:
|
||||
return 4;
|
||||
case TYPE_LONGLONG:
|
||||
case TYPE_ULONGLONG:
|
||||
@@ -127,6 +129,7 @@ static inline int thunk_type_align(const argtype *type_ptr, int is_host)
|
||||
case TYPE_SHORT:
|
||||
return 2;
|
||||
case TYPE_INT:
|
||||
+ case TYPE_INTBITFIELD:
|
||||
return 4;
|
||||
case TYPE_LONGLONG:
|
||||
case TYPE_ULONGLONG:
|
||||
--
|
||||
1.7.1
|
||||
|
||||
3626
app-emulation/qemu-user/files/0.14.1/0004-qemu-cvs-alsa_ioctl.patch
Normal file
3626
app-emulation/qemu-user/files/0.14.1/0004-qemu-cvs-alsa_ioctl.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
From 3848cba4ed22ebef70e59cbb542e71a37fe74d1d Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:24:15 +0200
|
||||
Subject: [PATCH 05/17] qemu-cvs-alsa_mmap
|
||||
|
||||
Hack to prevent ALSA from using mmap() interface to simplify emulation.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
linux-user/mmap.c | 14 ++++++++++++++
|
||||
1 files changed, 14 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
|
||||
index abf21f6..e18c228 100644
|
||||
--- a/linux-user/mmap.c
|
||||
+++ b/linux-user/mmap.c
|
||||
@@ -360,6 +360,9 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
|
||||
}
|
||||
}
|
||||
|
||||
+#define SNDRV_PCM_MMAP_OFFSET_STATUS 0x80000000
|
||||
+#define SNDRV_PCM_MMAP_OFFSET_CONTROL 0x81000000
|
||||
+
|
||||
/* NOTE: all the constants are the HOST ones */
|
||||
abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
int flags, int fd, abi_ulong offset)
|
||||
@@ -395,6 +398,17 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
}
|
||||
#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;
|
||||
goto fail;
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
From da6cdca6cdbfccb4936f5df5e297a87fe1e4baa8 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:25:41 +0200
|
||||
Subject: [PATCH 06/17] qemu-cvs-gettimeofday
|
||||
|
||||
No clue what this is for.
|
||||
---
|
||||
linux-user/syscall.c | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index 499c4d7..92f2aa6 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -5399,6 +5399,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
case TARGET_NR_gettimeofday:
|
||||
{
|
||||
struct timeval tv;
|
||||
+ if(copy_from_user_timeval(&tv, arg1))
|
||||
+ goto efault;
|
||||
ret = get_errno(gettimeofday(&tv, NULL));
|
||||
if (!is_error(ret)) {
|
||||
if (copy_to_user_timeval(arg1, &tv))
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 1a883714ac7e953bab2bbdeba651d0696f49dd81 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:26:33 +0200
|
||||
Subject: [PATCH 07/17] qemu-cvs-ioctl_debug
|
||||
|
||||
Extends unsupported ioctl debug output.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
linux-user/syscall.c | 7 ++++++-
|
||||
1 files changed, 6 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index 92f2aa6..04f77ef 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -3100,7 +3100,12 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
|
||||
ie = ioctl_entries;
|
||||
for(;;) {
|
||||
if (ie->target_cmd == 0) {
|
||||
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
|
||||
+ int i;
|
||||
+ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd, (unsigned int)(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", (void *)(unsigned long)ioctl_entries[i].host_cmd, ioctl_entries[i].name, (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
|
||||
+ }
|
||||
return -TARGET_ENOSYS;
|
||||
}
|
||||
if (ie->target_cmd == cmd)
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
From d03d586aabc9000cabc56de7e327c5b5640f3179 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:27:36 +0200
|
||||
Subject: [PATCH 08/17] qemu-cvs-ioctl_nodirection
|
||||
|
||||
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.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
linux-user/syscall.c | 6 ++++++
|
||||
1 files changed, 6 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index 04f77ef..b51634b 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -3134,6 +3134,11 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
|
||||
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)) {
|
||||
@@ -3152,6 +3157,7 @@ static abi_long do_ioctl(int fd, abi_long cmd, abi_long arg)
|
||||
unlock_user(argptr, arg, 0);
|
||||
ret = get_errno(ioctl(fd, ie->host_cmd, buf_temp));
|
||||
break;
|
||||
+*/
|
||||
default:
|
||||
case IOC_RW:
|
||||
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
From 026ee1029cfeb6c802ee715372992fb3c847bd27 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:30:16 +0200
|
||||
Subject: [PATCH 09/17] qemu-cvs-sched_getaffinity
|
||||
|
||||
Implements sched_getaffinity syscall.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
linux-user/syscall.c | 16 ++++++++++++++++
|
||||
1 files changed, 16 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index b51634b..81bf1f0 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -164,6 +164,7 @@ static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \
|
||||
}
|
||||
|
||||
|
||||
+#define __NR_sys_sched_getaffinity __NR_sched_getaffinity
|
||||
#define __NR_sys_uname __NR_uname
|
||||
#define __NR_sys_faccessat __NR_faccessat
|
||||
#define __NR_sys_fchmodat __NR_fchmodat
|
||||
@@ -223,6 +224,9 @@ _syscall3(int,sys_tgkill,int,tgid,int,pid,int,sig)
|
||||
#if defined(TARGET_NR_tkill) && defined(__NR_tkill)
|
||||
_syscall2(int,sys_tkill,int,tid,int,sig)
|
||||
#endif
|
||||
+#ifdef __NR_sys_sched_getaffinity
|
||||
+_syscall3(int,sys_sched_getaffinity,pid_t,pid,unsigned int,cpusetsize,void*,mask)
|
||||
+#endif
|
||||
#ifdef __NR_exit_group
|
||||
_syscall1(int,exit_group,int,error_code)
|
||||
#endif
|
||||
@@ -7505,6 +7509,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
+
|
||||
+#ifdef TARGET_NR_sched_getaffinity
|
||||
+ case TARGET_NR_sched_getaffinity:
|
||||
+ {
|
||||
+ cpu_set_t *mask;
|
||||
+ lock_user_struct(VERIFY_READ, 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);
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
|
||||
When executing 32-bit guest binaries on 64-bit hosts, mmap() can return
|
||||
a 64-bit pointer. Tell mmap() to always map in 32-bit address space, so
|
||||
we make 32-bit guest applications happy.
|
||||
|
||||
This is a hack and should not go upstream in its current form!
|
||||
|
||||
Signed-off-by: Alexander Graf <agraf@suse.de>
|
||||
---
|
||||
linux-user/mmap.c | 12 ++++++------
|
||||
1 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
|
||||
index 994c02b..e24b63a 100644
|
||||
--- a/linux-user/mmap.c
|
||||
+++ b/linux-user/mmap.c
|
||||
@@ -169,7 +169,7 @@ static int mmap_frag(abi_ulong real_start,
|
||||
if (prot1 == 0) {
|
||||
/* no page was there, so we allocate one */
|
||||
void *p = mmap(host_start, qemu_host_page_size, prot,
|
||||
- flags | MAP_ANONYMOUS, -1, 0);
|
||||
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
|
||||
if (p == MAP_FAILED)
|
||||
return -1;
|
||||
prot1 = prot;
|
||||
@@ -292,7 +292,7 @@ abi_ulong mmap_find_vma(abi_ulong start, abi_ulong size)
|
||||
* - shmat() with SHM_REMAP flag
|
||||
*/
|
||||
ptr = mmap(g2h(addr), size, PROT_NONE,
|
||||
- MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE, -1, 0);
|
||||
+ MAP_ANONYMOUS|MAP_PRIVATE|MAP_NORESERVE|MAP_32BIT, -1, 0);
|
||||
|
||||
/* ENOMEM, if host address space has no memory */
|
||||
if (ptr == MAP_FAILED) {
|
||||
@@ -454,14 +454,14 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
especially important if qemu_host_page_size >
|
||||
qemu_real_host_page_size */
|
||||
p = mmap(g2h(mmap_start),
|
||||
- host_len, prot, flags | MAP_FIXED | MAP_ANONYMOUS, -1, 0);
|
||||
+ host_len, prot, flags | MAP_FIXED | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
|
||||
if (p == MAP_FAILED)
|
||||
goto fail;
|
||||
/* update start so that it points to the file position at 'offset' */
|
||||
host_start = (unsigned long)p;
|
||||
if (!(flags & MAP_ANONYMOUS)) {
|
||||
p = mmap(g2h(mmap_start), len, prot,
|
||||
- flags | MAP_FIXED, fd, host_offset);
|
||||
+ flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
|
||||
host_start += offset - host_offset;
|
||||
}
|
||||
start = h2g(host_start);
|
||||
@@ -547,7 +547,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
|
||||
else
|
||||
offset1 = offset + real_start - start;
|
||||
p = mmap(g2h(real_start), real_end - real_start,
|
||||
- prot, flags, fd, offset1);
|
||||
+ prot, flags | MAP_32BIT, fd, offset1);
|
||||
if (p == MAP_FAILED)
|
||||
goto fail;
|
||||
}
|
||||
@@ -603,7 +603,7 @@ static void mmap_reserve(abi_ulong start, abi_ulong size)
|
||||
}
|
||||
if (real_start != real_end) {
|
||||
mmap(g2h(real_start), real_end - real_start, PROT_NONE,
|
||||
- MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE,
|
||||
+ MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE | MAP_NORESERVE | MAP_32BIT,
|
||||
-1, 0);
|
||||
}
|
||||
}
|
||||
--
|
||||
1.6.0.2
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
From 09686f619707ec98e073bf671b0334a2f65934ad Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:37:42 +0200
|
||||
Subject: [PATCH 11/17] qemu-img-vmdk-scsi
|
||||
|
||||
Support creation of SCSI VMDK images in qemu-img.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
block.c | 5 ++++-
|
||||
block/vmdk.c | 7 +++++--
|
||||
block_int.h | 2 ++
|
||||
qemu-img.c | 8 +++++++-
|
||||
4 files changed, 18 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/block.c b/block.c
|
||||
index b476479..b77f09b 100644
|
||||
--- a/block.c
|
||||
+++ b/block.c
|
||||
@@ -2792,7 +2792,7 @@ int bdrv_img_create(const char *filename, const char *fmt,
|
||||
char *options, uint64_t img_size, int flags)
|
||||
{
|
||||
QEMUOptionParameter *param = NULL, *create_options = NULL;
|
||||
- QEMUOptionParameter *backing_fmt, *backing_file;
|
||||
+ QEMUOptionParameter *backing_fmt, *backing_file, *scsi;
|
||||
BlockDriverState *bs = NULL;
|
||||
BlockDriver *drv, *proto_drv;
|
||||
BlockDriver *backing_drv = NULL;
|
||||
@@ -2901,6 +2901,9 @@ int bdrv_img_create(const char *filename, const char *fmt,
|
||||
|
||||
printf("Formatting '%s', fmt=%s ", filename, fmt);
|
||||
print_option_parameters(param);
|
||||
+ scsi = get_option_parameter(param, BLOCK_OPT_SCSI);
|
||||
+ if (scsi && scsi->value.n)
|
||||
+ printf(", SCSI");
|
||||
puts("");
|
||||
|
||||
ret = bdrv_create(drv, filename, param);
|
||||
diff --git a/block/vmdk.c b/block/vmdk.c
|
||||
index 8fc9d67..8944173 100644
|
||||
--- a/block/vmdk.c
|
||||
+++ b/block/vmdk.c
|
||||
@@ -685,7 +685,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
|
||||
"ddb.geometry.cylinders = \"%" PRId64 "\"\n"
|
||||
"ddb.geometry.heads = \"16\"\n"
|
||||
"ddb.geometry.sectors = \"63\"\n"
|
||||
- "ddb.adapterType = \"ide\"\n";
|
||||
+ "ddb.adapterType = \"%s\"\n";
|
||||
char desc[1024];
|
||||
const char *real_filename, *temp_str;
|
||||
int64_t total_size = 0;
|
||||
@@ -701,6 +701,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
|
||||
backing_file = options->value.s;
|
||||
} else if (!strcmp(options->name, BLOCK_OPT_COMPAT6)) {
|
||||
flags |= options->value.n ? BLOCK_FLAG_COMPAT6: 0;
|
||||
+ } else if (!strcmp(options->name, BLOCK_OPT_SCSI)) {
|
||||
+ flags |= options->value.n ? BLOCK_FLAG_SCSI: 0;
|
||||
}
|
||||
options++;
|
||||
}
|
||||
@@ -798,7 +800,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options)
|
||||
snprintf(desc, sizeof(desc), desc_template, (unsigned int)time(NULL),
|
||||
total_size, real_filename,
|
||||
(flags & BLOCK_FLAG_COMPAT6 ? 6 : 4),
|
||||
- total_size / (int64_t)(63 * 16));
|
||||
+ total_size / (int64_t)(63 * 16),
|
||||
+ flags & BLOCK_FLAG_SCSI ? "lsilogic" : "ide");
|
||||
|
||||
/* write the descriptor */
|
||||
lseek(fd, le64_to_cpu(header.desc_offset) << 9, SEEK_SET);
|
||||
diff --git a/block_int.h b/block_int.h
|
||||
index 545ad11..771fd91 100644
|
||||
--- a/block_int.h
|
||||
+++ b/block_int.h
|
||||
@@ -30,10 +30,12 @@
|
||||
|
||||
#define BLOCK_FLAG_ENCRYPT 1
|
||||
#define BLOCK_FLAG_COMPAT6 4
|
||||
+#define BLOCK_FLAG_SCSI 8
|
||||
|
||||
#define BLOCK_OPT_SIZE "size"
|
||||
#define BLOCK_OPT_ENCRYPT "encryption"
|
||||
#define BLOCK_OPT_COMPAT6 "compat6"
|
||||
+#define BLOCK_OPT_SCSI "scsi"
|
||||
#define BLOCK_OPT_BACKING_FILE "backing_file"
|
||||
#define BLOCK_OPT_BACKING_FMT "backing_fmt"
|
||||
#define BLOCK_OPT_CLUSTER_SIZE "cluster_size"
|
||||
diff --git a/qemu-img.c b/qemu-img.c
|
||||
index 4a37358..ed8cc08 100644
|
||||
--- a/qemu-img.c
|
||||
+++ b/qemu-img.c
|
||||
@@ -572,7 +572,7 @@ static int img_convert(int argc, char **argv)
|
||||
const uint8_t *buf1;
|
||||
BlockDriverInfo bdi;
|
||||
QEMUOptionParameter *param = NULL, *create_options = NULL;
|
||||
- QEMUOptionParameter *out_baseimg_param;
|
||||
+ QEMUOptionParameter *out_baseimg_param, *scsi;
|
||||
char *options = NULL;
|
||||
const char *snapshot_name = NULL;
|
||||
|
||||
@@ -727,6 +727,12 @@ static int img_convert(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
+ if ((scsi = get_option_parameter(param, BLOCK_OPT_SCSI)) && scsi->value.n && strcmp(drv->format_name, "vmdk")) {
|
||||
+ error_report("SCSI devices not supported for this file format");
|
||||
+ ret = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
/* Create the new image */
|
||||
ret = bdrv_create(drv, out_filename, param);
|
||||
if (ret < 0) {
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 75c51f45c127ebe4f549041aae98f510480429ae Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Tue, 14 Apr 2009 16:38:20 +0200
|
||||
Subject: [PATCH 12/17] qemu-nonvoid_return
|
||||
|
||||
Squelches GCC warnings about undefined return values.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
hw/mpcore.c | 1 +
|
||||
target-m68k/translate.c | 1 +
|
||||
2 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/hw/mpcore.c b/hw/mpcore.c
|
||||
index fc05215..7bdb495 100644
|
||||
--- a/hw/mpcore.c
|
||||
+++ b/hw/mpcore.c
|
||||
@@ -104,6 +104,7 @@ static uint32_t mpcore_timer_read(mpcore_timer_state *s, int offset)
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static void mpcore_timer_write(mpcore_timer_state *s, int offset,
|
||||
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
|
||||
index 6f72a2b..7d9492b 100644
|
||||
--- a/target-m68k/translate.c
|
||||
+++ b/target-m68k/translate.c
|
||||
@@ -440,6 +440,7 @@ static inline int opsize_bytes(int opsize)
|
||||
qemu_assert(0, "bad operand size");
|
||||
return 0;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/* Assign value to a register. If the width is less than the register width
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
From f44ecd4fcdb8e02e6bd58201a81f047d1e109508 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Thu, 16 Apr 2009 15:14:12 +0200
|
||||
Subject: [PATCH 13/17] i386-linux-user NPTL support
|
||||
|
||||
Makes NPTL binaries run by implementing TLS.
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
configure | 1 +
|
||||
linux-user/syscall.c | 16 ++++++++++++++--
|
||||
2 files changed, 15 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 598e8e1..95de763 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -2910,6 +2910,7 @@ TARGET_ABI_DIR=""
|
||||
case "$target_arch2" in
|
||||
i386)
|
||||
target_phys_bits=32
|
||||
+ target_nptl="yes"
|
||||
;;
|
||||
x86_64)
|
||||
TARGET_BASE_ARCH=i386
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index 81bf1f0..1a98433 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -3792,8 +3792,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
|
||||
ts->child_tidptr = child_tidptr;
|
||||
}
|
||||
|
||||
- if (nptl_flags & CLONE_SETTLS)
|
||||
+ if (nptl_flags & CLONE_SETTLS) {
|
||||
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
|
||||
+ do_set_thread_area(new_env, newtls);
|
||||
+ cpu_x86_load_seg(new_env, R_GS, new_env->segs[R_GS].selector);
|
||||
+#else
|
||||
cpu_set_tls (new_env, newtls);
|
||||
+#endif
|
||||
+ }
|
||||
|
||||
/* Grab a mutex so that thread setup appears atomic. */
|
||||
pthread_mutex_lock(&clone_lock);
|
||||
@@ -3867,8 +3873,14 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,
|
||||
if (flags & CLONE_PARENT_SETTID)
|
||||
put_user_u32(gettid(), parent_tidptr);
|
||||
ts = (TaskState *)env->opaque;
|
||||
- if (flags & CLONE_SETTLS)
|
||||
+ if (flags & CLONE_SETTLS) {
|
||||
+#if defined(TARGET_I386) && defined(TARGET_ABI32)
|
||||
+ do_set_thread_area(env, newtls);
|
||||
+ cpu_x86_load_seg(env, R_GS, env->segs[R_GS].selector);
|
||||
+#else
|
||||
cpu_set_tls (env, newtls);
|
||||
+#endif
|
||||
+ }
|
||||
if (flags & CLONE_CHILD_CLEARTID)
|
||||
ts->child_tidptr = child_tidptr;
|
||||
#endif
|
||||
--
|
||||
1.7.1
|
||||
|
||||
6757
app-emulation/qemu-user/files/0.14.1/0015-S-390-support.patch
Normal file
6757
app-emulation/qemu-user/files/0.14.1/0015-S-390-support.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,58 @@
|
||||
From 4569b209989e09bdebcb6cce809b3fed0f94142c Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Wed, 25 Aug 2010 14:23:43 +0200
|
||||
Subject: [PATCH 16/17] fix mipsn32*-linux-user builds
|
||||
|
||||
Signed-off-by: Ulrich Hecht <uli@suse.de>
|
||||
---
|
||||
configure | 2 ++
|
||||
default-configs/mipsn32-linux-user.mak | 1 +
|
||||
default-configs/mipsn32el-linux-user.mak | 1 +
|
||||
linux-user/mipsn32/syscall.h | 3 ++-
|
||||
4 files changed, 6 insertions(+), 1 deletions(-)
|
||||
create mode 100644 default-configs/mipsn32-linux-user.mak
|
||||
create mode 100644 default-configs/mipsn32el-linux-user.mak
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index bd1484b..6513d91 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -1010,6 +1010,8 @@ m68k-linux-user \
|
||||
microblaze-linux-user \
|
||||
mips-linux-user \
|
||||
mipsel-linux-user \
|
||||
+mipsn32-linux-user \
|
||||
+mipsn32el-linux-user \
|
||||
ppc-linux-user \
|
||||
ppc64-linux-user \
|
||||
ppc64abi32-linux-user \
|
||||
diff --git a/default-configs/mipsn32-linux-user.mak b/default-configs/mipsn32-linux-user.mak
|
||||
new file mode 100644
|
||||
index 0000000..31df570
|
||||
--- /dev/null
|
||||
+++ b/default-configs/mipsn32-linux-user.mak
|
||||
@@ -0,0 +1 @@
|
||||
+# Default configuration for mips-linux-user
|
||||
diff --git a/default-configs/mipsn32el-linux-user.mak b/default-configs/mipsn32el-linux-user.mak
|
||||
new file mode 100644
|
||||
index 0000000..4d0e4af
|
||||
--- /dev/null
|
||||
+++ b/default-configs/mipsn32el-linux-user.mak
|
||||
@@ -0,0 +1 @@
|
||||
+# Default configuration for mipsel-linux-user
|
||||
diff --git a/linux-user/mipsn32/syscall.h b/linux-user/mipsn32/syscall.h
|
||||
index 4ec506c..beeeb3c 100644
|
||||
--- a/linux-user/mipsn32/syscall.h
|
||||
+++ b/linux-user/mipsn32/syscall.h
|
||||
@@ -216,6 +216,7 @@ struct target_pt_regs {
|
||||
#undef TARGET_ENOTRECOVERABLE
|
||||
#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */
|
||||
|
||||
-
|
||||
+/* Nasty hack: define a fake errno value for use by sigreturn. */
|
||||
+#define TARGET_QEMU_ESIGRETURN 255
|
||||
|
||||
#define UNAME_MACHINE "mips64"
|
||||
--
|
||||
1.7.1
|
||||
|
||||
129
app-emulation/qemu-user/files/0.14.1/0017-S-390-build-fix.patch
Normal file
129
app-emulation/qemu-user/files/0.14.1/0017-S-390-build-fix.patch
Normal file
@@ -0,0 +1,129 @@
|
||||
From 024f781ab4af31ba5e14882b5661d4586ae26988 Mon Sep 17 00:00:00 2001
|
||||
From: Ulrich Hecht <uli@suse.de>
|
||||
Date: Wed, 9 Feb 2011 18:35:21 +0100
|
||||
Subject: [PATCH 17/17] S/390 build fix
|
||||
|
||||
---
|
||||
target-s390x/op_helper.c | 22 +++++++++++-----------
|
||||
target-s390x/translate.c | 2 +-
|
||||
2 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/target-s390x/op_helper.c b/target-s390x/op_helper.c
|
||||
index 20c83c5..46b71fc 100644
|
||||
--- a/target-s390x/op_helper.c
|
||||
+++ b/target-s390x/op_helper.c
|
||||
@@ -738,7 +738,7 @@ uint32_t HELPER(tmxx)(uint64_t val, uint32_t mask)
|
||||
uint32_t HELPER(abs_i32)(uint32_t reg, int32_t val)
|
||||
{
|
||||
uint32_t cc;
|
||||
- if (val == 0x80000000UL) cc = 3;
|
||||
+ if ((uint32_t)val == 0x80000000UL) cc = 3;
|
||||
else if (val) cc = 1;
|
||||
else cc = 0;
|
||||
|
||||
@@ -996,7 +996,7 @@ uint32_t HELPER(slbg)(uint32_t cc, uint32_t r1, uint64_t v1, uint64_t v2)
|
||||
/* condition codes for binary FP ops */
|
||||
static uint32_t set_cc_f32(float32 v1, float32 v2)
|
||||
{
|
||||
- if (float32_is_nan(v1) || float32_is_nan(v2)) return 3;
|
||||
+ if (float32_is_any_nan(v1) || float32_is_any_nan(v2)) return 3;
|
||||
else if (float32_eq(v1, v2, &env->fpu_status)) return 0;
|
||||
else if (float32_lt(v1, v2, &env->fpu_status)) return 1;
|
||||
else return 2;
|
||||
@@ -1004,7 +1004,7 @@ static uint32_t set_cc_f32(float32 v1, float32 v2)
|
||||
|
||||
static uint32_t set_cc_f64(float64 v1, float64 v2)
|
||||
{
|
||||
- if (float64_is_nan(v1) || float64_is_nan(v2)) return 3;
|
||||
+ if (float64_is_any_nan(v1) || float64_is_any_nan(v2)) return 3;
|
||||
else if (float64_eq(v1, v2, &env->fpu_status)) return 0;
|
||||
else if (float64_lt(v1, v2, &env->fpu_status)) return 1;
|
||||
else return 2;
|
||||
@@ -1013,7 +1013,7 @@ static uint32_t set_cc_f64(float64 v1, float64 v2)
|
||||
/* condition codes for unary FP ops */
|
||||
static uint32_t set_cc_nz_f32(float32 v)
|
||||
{
|
||||
- if (float32_is_nan(v)) return 3;
|
||||
+ if (float32_is_any_nan(v)) return 3;
|
||||
else if (float32_is_zero(v)) return 0;
|
||||
else if (float32_is_neg(v)) return 1;
|
||||
else return 2;
|
||||
@@ -1021,7 +1021,7 @@ static uint32_t set_cc_nz_f32(float32 v)
|
||||
|
||||
static uint32_t set_cc_nz_f64(float64 v)
|
||||
{
|
||||
- if (float64_is_nan(v)) return 3;
|
||||
+ if (float64_is_any_nan(v)) return 3;
|
||||
else if (float64_is_zero(v)) return 0;
|
||||
else if (float64_is_neg(v)) return 1;
|
||||
else return 2;
|
||||
@@ -1029,7 +1029,7 @@ static uint32_t set_cc_nz_f64(float64 v)
|
||||
|
||||
static uint32_t set_cc_nz_f128(float128 v)
|
||||
{
|
||||
- if (float128_is_nan(v)) return 3;
|
||||
+ if (float128_is_any_nan(v)) return 3;
|
||||
else if (float128_is_zero(v)) return 0;
|
||||
else if (float128_is_neg(v)) return 1;
|
||||
else return 2;
|
||||
@@ -1350,7 +1350,7 @@ uint32_t HELPER(cxbr)(uint32_t f1, uint32_t f2)
|
||||
CPU_QuadU v2;
|
||||
v2.ll.upper = env->fregs[f2].ll;
|
||||
v2.ll.lower = env->fregs[f2 + 2].ll;
|
||||
- if (float128_is_nan(v1.q) || float128_is_nan(v2.q)) return 3;
|
||||
+ if (float128_is_any_nan(v1.q) || float128_is_any_nan(v2.q)) return 3;
|
||||
else if (float128_eq(v1.q, v2.q, &env->fpu_status)) return 0;
|
||||
else if (float128_lt(v1.q, v2.q, &env->fpu_status)) return 1;
|
||||
else return 2;
|
||||
@@ -1463,7 +1463,7 @@ uint32_t HELPER(cgxbr)(uint32_t r1, uint32_t f2, uint32_t m3)
|
||||
v2.ll.lower = env->fregs[f2 + 2].ll;
|
||||
set_round_mode(m3);
|
||||
env->regs[r1] = float128_to_int64(v2.q, &env->fpu_status);
|
||||
- if (float128_is_nan(v2.q)) return 3;
|
||||
+ if (float128_is_any_nan(v2.q)) return 3;
|
||||
else if (float128_is_zero(v2.q)) return 0;
|
||||
else if (float128_is_neg(v2.q)) return 1;
|
||||
else return 2;
|
||||
@@ -1611,7 +1611,7 @@ uint32_t HELPER(tceb)(uint32_t f1, uint64_t m2)
|
||||
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
|
||||
if (float32_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
|
||||
else if (float32_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
|
||||
- else if (float32_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
+ else if (float32_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
else if (float32_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
|
||||
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
|
||||
/* FIXME: denormalized? */
|
||||
@@ -1627,7 +1627,7 @@ uint32_t HELPER(tcdb)(uint32_t f1, uint64_t m2)
|
||||
HELPER_LOG("%s: v1 0x%lx m2 0x%lx neg %d\n", __FUNCTION__, v1, m2, neg);
|
||||
if (float64_is_zero(v1) && (m2 & (1 << (11-neg)))) cc = 1;
|
||||
else if (float64_is_infinity(v1) && (m2 & (1 << (5-neg)))) cc = 1;
|
||||
- else if (float64_is_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
+ else if (float64_is_quiet_nan(v1) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
else if (float64_is_signaling_nan(v1) && (m2 & (1 << (1-neg)))) cc = 1;
|
||||
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
|
||||
/* FIXME: denormalized? */
|
||||
@@ -1645,7 +1645,7 @@ uint32_t HELPER(tcxb)(uint32_t f1, uint64_t m2)
|
||||
int neg = float128_is_neg(v1.q);
|
||||
if (float128_is_zero(v1.q) && (m2 & (1 << (11-neg)))) cc = 1;
|
||||
else if (float128_is_infinity(v1.q) && (m2 & (1 << (5-neg)))) cc = 1;
|
||||
- else if (float128_is_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
+ else if (float128_is_quiet_nan(v1.q) && (m2 & (1 << (3-neg)))) cc = 1;
|
||||
else if (float128_is_signaling_nan(v1.q) && (m2 & (1 << (1-neg)))) cc = 1;
|
||||
else /* assume normalized number */ if (m2 & (1 << (9-neg))) cc = 1;
|
||||
/* FIXME: denormalized? */
|
||||
diff --git a/target-s390x/translate.c b/target-s390x/translate.c
|
||||
index e08dcf4..189a60b 100644
|
||||
--- a/target-s390x/translate.c
|
||||
+++ b/target-s390x/translate.c
|
||||
@@ -67,7 +67,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
}
|
||||
}
|
||||
for (i = 0; i < 16; i++) {
|
||||
- cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].i);
|
||||
+ cpu_fprintf(f, "F%02d=%016lx", i, (long)env->fregs[i].ll);
|
||||
if ((i % 4) == 3) {
|
||||
cpu_fprintf(f, "\n");
|
||||
} else {
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,289 @@
|
||||
diff -uNr old-qemu-0.14.1//block/raw-win32.c qemu-0.14.1/block/raw-win32.c
|
||||
--- old-qemu-0.14.1//block/raw-win32.c 2011-05-06 21:01:43.000000000 +0200
|
||||
+++ qemu-0.14.1/block/raw-win32.c 2011-05-11 15:41:45.744749392 +0200
|
||||
@@ -93,7 +93,7 @@
|
||||
else if (!(flags & BDRV_O_CACHE_WB))
|
||||
overlapped |= FILE_FLAG_WRITE_THROUGH;
|
||||
s->hfile = CreateFile(filename, access_flags,
|
||||
- FILE_SHARE_READ, NULL,
|
||||
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||
OPEN_EXISTING, overlapped, NULL);
|
||||
if (s->hfile == INVALID_HANDLE_VALUE) {
|
||||
int err = GetLastError();
|
||||
@@ -354,7 +354,7 @@
|
||||
else if (!(flags & BDRV_O_CACHE_WB))
|
||||
overlapped |= FILE_FLAG_WRITE_THROUGH;
|
||||
s->hfile = CreateFile(filename, access_flags,
|
||||
- FILE_SHARE_READ, NULL,
|
||||
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
|
||||
create_flags, overlapped, NULL);
|
||||
if (s->hfile == INVALID_HANDLE_VALUE) {
|
||||
int err = GetLastError();
|
||||
diff -uNr old-qemu-0.14.1//hw/e1000.c qemu-0.14.1/hw/e1000.c
|
||||
--- old-qemu-0.14.1//hw/e1000.c 2011-05-06 21:01:43.000000000 +0200
|
||||
+++ qemu-0.14.1/hw/e1000.c 2011-05-11 15:41:45.744749392 +0200
|
||||
@@ -573,7 +573,7 @@
|
||||
if (rctl & E1000_RCTL_UPE) // promiscuous
|
||||
return 1;
|
||||
|
||||
- if ((buf[0] & 1) && (rctl & E1000_RCTL_MPE)) // promiscuous mcast
|
||||
+ if ((buf[0] & 1)) //&& (rctl & E1000_RCTL_MPE)) // promiscuous mcast
|
||||
return 1;
|
||||
|
||||
if ((rctl & E1000_RCTL_BAM) && !memcmp(buf, bcast, sizeof bcast))
|
||||
diff -uNr old-qemu-0.14.1//Makefile.objs qemu-0.14.1/Makefile.objs
|
||||
--- old-qemu-0.14.1//Makefile.objs 2011-05-06 21:01:43.000000000 +0200
|
||||
+++ qemu-0.14.1/Makefile.objs 2011-05-11 15:41:45.751749392 +0200
|
||||
@@ -34,6 +34,7 @@
|
||||
net-nested-y = queue.o checksum.o util.o
|
||||
net-nested-y += socket.o
|
||||
net-nested-y += dump.o
|
||||
+net-nested-y += udp.o
|
||||
net-nested-$(CONFIG_POSIX) += tap.o
|
||||
net-nested-$(CONFIG_LINUX) += tap-linux.o
|
||||
net-nested-$(CONFIG_WIN32) += tap-win32.o
|
||||
diff -uNr old-qemu-0.14.1//net/udp.c qemu-0.14.1/net/udp.c
|
||||
--- old-qemu-0.14.1//net/udp.c 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ qemu-0.14.1/net/udp.c 2011-05-11 15:41:45.752749392 +0200
|
||||
@@ -0,0 +1,138 @@
|
||||
+/*
|
||||
+ * QEMU System Emulator
|
||||
+ *
|
||||
+ * Copyright (c) 2003-2008 Fabrice Bellard
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this software and associated documentation files (the "Software"), to deal
|
||||
+ * in the Software without restriction, including without limitation the rights
|
||||
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
+ * copies of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
+ * THE SOFTWARE.
|
||||
+ */
|
||||
+#include "net/udp.h"
|
||||
+
|
||||
+#include "config-host.h"
|
||||
+
|
||||
+#ifndef _WIN32
|
||||
+#include <arpa/inet.h>
|
||||
+#include <netinet/in.h>
|
||||
+#include <netinet/udp.h>
|
||||
+#endif
|
||||
+
|
||||
+#include "net.h"
|
||||
+#include "qemu-char.h"
|
||||
+#include "qemu-common.h"
|
||||
+#include "qemu-option.h"
|
||||
+#include "qemu_socket.h"
|
||||
+#include "sysemu.h"
|
||||
+
|
||||
+
|
||||
+typedef struct UDPState {
|
||||
+ VLANClientState nc;
|
||||
+ int rfd;
|
||||
+ struct sockaddr_in sender;
|
||||
+} UDPState;
|
||||
+
|
||||
+static void udp_to_qemu(void *opaque)
|
||||
+{
|
||||
+ UDPState *s = opaque;
|
||||
+ uint8_t buf[4096];
|
||||
+ int size;
|
||||
+
|
||||
+ size = recvfrom(s->rfd, (char *)buf, sizeof(buf), 0, NULL, NULL);
|
||||
+ if (size > 0) {
|
||||
+ qemu_send_packet(&s->nc, buf, size);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static ssize_t udp_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
|
||||
+{
|
||||
+ UDPState *s = DO_UPCAST(UDPState, nc, nc);
|
||||
+ int ret;
|
||||
+
|
||||
+ do {
|
||||
+ ret = sendto(s->rfd, (const char *)buf, size, 0, (struct sockaddr *)&s->sender, sizeof (s->sender));
|
||||
+ } while (ret < 0 && errno == EINTR);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void udp_cleanup(VLANClientState *nc)
|
||||
+{
|
||||
+ UDPState *s = DO_UPCAST(UDPState, nc, nc);
|
||||
+ qemu_set_fd_handler(s->rfd, NULL, NULL, NULL);
|
||||
+ close(s->rfd);
|
||||
+}
|
||||
+
|
||||
+static NetClientInfo net_udp_info = {
|
||||
+ .type = NET_CLIENT_TYPE_UDP,
|
||||
+ .size = sizeof(UDPState),
|
||||
+ .receive = udp_receive,
|
||||
+ .cleanup = udp_cleanup,
|
||||
+};
|
||||
+
|
||||
+static int net_udp_init(VLANState *vlan, const char *model,
|
||||
+ const char *name, int sport,
|
||||
+ const char *daddr, int dport)
|
||||
+{
|
||||
+ VLANClientState *nc;
|
||||
+ UDPState *s;
|
||||
+ struct sockaddr_in receiver;
|
||||
+ int ret;
|
||||
+
|
||||
+ nc = qemu_new_net_client(&net_udp_info, vlan, NULL, model, name);
|
||||
+
|
||||
+ snprintf(nc->info_str, sizeof(nc->info_str),"udp: %i->%s:%i",
|
||||
+ sport, daddr, dport);
|
||||
+
|
||||
+ s = DO_UPCAST(UDPState, nc, nc);
|
||||
+
|
||||
+ s->rfd = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
|
||||
+ receiver.sin_family = AF_INET;
|
||||
+ receiver.sin_addr.s_addr = INADDR_ANY;
|
||||
+ receiver.sin_port = htons(sport);
|
||||
+ ret = bind(s->rfd, (struct sockaddr *)&receiver, sizeof(receiver));
|
||||
+
|
||||
+ if (ret == -1) {
|
||||
+ fprintf (stderr, "bind error:%s\n", strerror(errno));
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ memset((char*)&s->sender, 0,sizeof(s->sender));
|
||||
+ s->sender.sin_family = AF_INET;
|
||||
+ s->sender.sin_port = htons(dport);
|
||||
+ inet_aton(daddr, &s->sender.sin_addr);
|
||||
+
|
||||
+ qemu_set_fd_handler(s->rfd, udp_to_qemu, NULL, s);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan)
|
||||
+{
|
||||
+ const char *daddr;
|
||||
+ int sport, dport;
|
||||
+
|
||||
+ daddr = qemu_opt_get(opts, "daddr");
|
||||
+
|
||||
+ sport = qemu_opt_get_number(opts, "sport", 0);
|
||||
+ dport = qemu_opt_get_number(opts, "dport", 0);
|
||||
+
|
||||
+ if (net_udp_init(vlan, "udp", name, sport, daddr, dport) == -1) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff -uNr old-qemu-0.14.1//net/udp.h qemu-0.14.1/net/udp.h
|
||||
--- old-qemu-0.14.1//net/udp.h 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ qemu-0.14.1/net/udp.h 2011-05-11 15:41:45.752749392 +0200
|
||||
@@ -0,0 +1,32 @@
|
||||
+/*
|
||||
+ * QEMU System Emulator
|
||||
+ *
|
||||
+ * Copyright (c) 2003-2008 Fabrice Bellard
|
||||
+ *
|
||||
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
+ * of this software and associated documentation files (the "Software"), to deal
|
||||
+ * in the Software without restriction, including without limitation the rights
|
||||
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
+ * copies of the Software, and to permit persons to whom the Software is
|
||||
+ * furnished to do so, subject to the following conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be included in
|
||||
+ * all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
+ * THE SOFTWARE.
|
||||
+ */
|
||||
+#ifndef QEMU_NET_UDP_H
|
||||
+#define QEMU_NET_UDP_H
|
||||
+
|
||||
+#include "qemu-common.h"
|
||||
+#include "qemu-option.h"
|
||||
+
|
||||
+int net_init_udp(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan);
|
||||
+
|
||||
+#endif /* QEMU_NET_UDP_H */
|
||||
diff -uNr old-qemu-0.14.1//net.c qemu-0.14.1/net.c
|
||||
--- old-qemu-0.14.1//net.c 2011-05-06 21:01:44.000000000 +0200
|
||||
+++ qemu-0.14.1/net.c 2011-05-11 15:42:53.145749408 +0200
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "net/dump.h"
|
||||
#include "net/slirp.h"
|
||||
#include "net/vde.h"
|
||||
+#include "net/udp.h"
|
||||
#include "net/util.h"
|
||||
#include "monitor.h"
|
||||
#include "sysemu.h"
|
||||
@@ -1085,9 +1086,31 @@
|
||||
.help = "permissions for socket",
|
||||
},
|
||||
{ /* end of list */ }
|
||||
- },
|
||||
+ },
|
||||
#endif
|
||||
}, {
|
||||
+
|
||||
+ .type = "udp",
|
||||
+ .init = net_init_udp,
|
||||
+ .desc = {
|
||||
+ NET_COMMON_PARAMS_DESC,
|
||||
+ {
|
||||
+ .name = "sport",
|
||||
+ .type = QEMU_OPT_NUMBER,
|
||||
+
|
||||
+ .help = "source port number",
|
||||
+ }, {
|
||||
+ .name = "daddr",
|
||||
+ .type = QEMU_OPT_STRING,
|
||||
+ .help = "destination IP address",
|
||||
+ }, {
|
||||
+ .name = "dport",
|
||||
+ .type = QEMU_OPT_NUMBER,
|
||||
+ .help = "destination port number",
|
||||
+ },
|
||||
+ { /* end of list */ }
|
||||
+ },
|
||||
+ }, {
|
||||
.type = "dump",
|
||||
.init = net_init_dump,
|
||||
.desc = {
|
||||
diff -uNr old-qemu-0.14.1//net.h qemu-0.14.1/net.h
|
||||
--- old-qemu-0.14.1//net.h 2011-05-06 21:01:44.000000000 +0200
|
||||
+++ qemu-0.14.1/net.h 2011-05-11 15:41:45.754749392 +0200
|
||||
@@ -35,6 +35,7 @@
|
||||
NET_CLIENT_TYPE_TAP,
|
||||
NET_CLIENT_TYPE_SOCKET,
|
||||
NET_CLIENT_TYPE_VDE,
|
||||
+ NET_CLIENT_TYPE_UDP,
|
||||
NET_CLIENT_TYPE_DUMP
|
||||
} net_client_type;
|
||||
|
||||
diff -uNr old-qemu-0.14.1//qemu-options.hx qemu-0.14.1/qemu-options.hx
|
||||
--- old-qemu-0.14.1//qemu-options.hx 2011-05-06 21:01:44.000000000 +0200
|
||||
+++ qemu-0.14.1/qemu-options.hx 2011-05-11 15:41:45.755749392 +0200
|
||||
@@ -1070,6 +1070,8 @@
|
||||
"-net socket[,vlan=n][,name=str][,fd=h][,mcast=maddr:port[,localaddr=addr]]\n"
|
||||
" connect the vlan 'n' to multicast maddr and port\n"
|
||||
" use 'localaddr=addr' to specify the host address to send packets from\n"
|
||||
+ "-net udp[,vlan=n]sport=sport,dport=dport,daddr=host\n"
|
||||
+ " connect the vlan 'n' to a UDP tunnel (for Dynamips/GNS3)\n"
|
||||
#ifdef CONFIG_VDE
|
||||
"-net vde[,vlan=n][,name=str][,sock=socketpath][,port=n][,group=groupname][,mode=octalmode]\n"
|
||||
" connect the vlan 'n' to port 'n' of a vde switch running\n"
|
||||
@@ -0,0 +1,52 @@
|
||||
From 39c6bee3d5023a3e339bafd8073bc2c920cd79c5 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
Date: Sun, 25 Sep 2011 06:21:28 +0200
|
||||
Subject: [PATCH] linux-user: fix openat
|
||||
|
||||
When running openat using qemu-arm, we stumbled over invalid permissions
|
||||
on the created files. The reason for this is that the mode parameter gets
|
||||
treates as an O_... flag, which it isn't - it's a permission bitmask.
|
||||
|
||||
This patch removes the needless translation of the mode parameter,
|
||||
rendering permission passing of openat() to work with linux-user.
|
||||
|
||||
Reported-by: Dirk Mueller <dmueller@suse.de>
|
||||
Signed-off-by: Alexander Graf <agraf@suse.de>
|
||||
---
|
||||
linux-user/syscall.c | 14 +-------------
|
||||
1 files changed, 1 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
|
||||
index 6b73769..27970a4 100644
|
||||
--- a/linux-user/syscall.c
|
||||
+++ b/linux-user/syscall.c
|
||||
@@ -376,25 +376,13 @@ static int sys_mknodat(int dirfd, const char *pathname, mode_t mode,
|
||||
}
|
||||
#endif
|
||||
#ifdef TARGET_NR_openat
|
||||
-static int sys_openat(int dirfd, const char *pathname, int flags, ...)
|
||||
+static int sys_openat(int dirfd, const char *pathname, int flags, mode_t mode)
|
||||
{
|
||||
/*
|
||||
* open(2) has extra parameter 'mode' when called with
|
||||
* flag O_CREAT.
|
||||
*/
|
||||
if ((flags & O_CREAT) != 0) {
|
||||
- va_list ap;
|
||||
- mode_t mode;
|
||||
-
|
||||
- /*
|
||||
- * Get the 'mode' parameter and translate it to
|
||||
- * host bits.
|
||||
- */
|
||||
- va_start(ap, flags);
|
||||
- mode = va_arg(ap, mode_t);
|
||||
- mode = target_to_host_bitmask(mode, fcntl_flags_tbl);
|
||||
- va_end(ap);
|
||||
-
|
||||
return (openat(dirfd, pathname, flags, mode));
|
||||
}
|
||||
return (openat(dirfd, pathname, flags));
|
||||
--
|
||||
1.6.0.2
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
|
||||
For OBS, we're running a full cross-guest inside of a VM. When a build
|
||||
is done there, we reboot the guest as shutdown mechanism.
|
||||
|
||||
Unfortunately, reboot is not implemented in linux-user. So this mechanism
|
||||
fails, spilling unpretty warnings. This patch implements sys_reboot()
|
||||
emulation.
|
||||
|
||||
Signed-off-by: Alexander Graf <agraf@suse.de>
|
||||
---
|
||||
linux-user/syscall.c | 8 +++++++-
|
||||
1 files changed, 7 insertions(+), 1 deletions(-)
|
||||
|
||||
Index: qemu-0.14.1/linux-user/syscall.c
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/linux-user/syscall.c
|
||||
+++ qemu-0.14.1/linux-user/syscall.c
|
||||
@@ -239,6 +239,8 @@ _syscall6(int,sys_futex,int *,uaddr,int,
|
||||
const struct timespec *,timeout,int *,uaddr2,int,val3)
|
||||
#endif
|
||||
#endif
|
||||
+_syscall4(int, reboot, int, magic1, int, magic2, unsigned int, cmd,
|
||||
+ void *, arg);
|
||||
|
||||
static bitmask_transtbl fcntl_flags_tbl[] = {
|
||||
{ TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, },
|
||||
@@ -5536,7 +5538,11 @@ abi_long do_syscall(void *cpu_env, int n
|
||||
break;
|
||||
#endif
|
||||
case TARGET_NR_reboot:
|
||||
- goto unimplemented;
|
||||
+ if (!(p = lock_user_string(arg4)))
|
||||
+ goto efault;
|
||||
+ ret = reboot(arg1, arg2, arg3, p);
|
||||
+ unlock_user(p, arg4, 0);
|
||||
+ break;
|
||||
#ifdef TARGET_NR_readdir
|
||||
case TARGET_NR_readdir:
|
||||
goto unimplemented;
|
||||
@@ -0,0 +1,117 @@
|
||||
From agraf@suse.de Thu, 29 Sep 2011 11:00:25 +0200
|
||||
Return-Path: <agraf@suse.de>
|
||||
Received: from imap.suse.de ([unix socket])
|
||||
by imap-int (Cyrus v2.2.12) with LMTPA;
|
||||
Thu, 29 Sep 2011 11:07:10 +0200
|
||||
X-Sieve: CMU Sieve 2.2
|
||||
Received: from relay2.suse.de (relay2.suse.de [149.44.160.134])
|
||||
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
|
||||
(Client CN "relay.suse.de", Issuer "CAcert Class 3 Root" (verified OK))
|
||||
by imap.suse.de (Postfix) with ESMTPS id AF8563C539A9
|
||||
for <adrian@imap.suse.de>; Thu, 29 Sep 2011 11:07:10 +0200 (CEST)
|
||||
Received: by relay2.suse.de (Postfix)
|
||||
id A639118552E6; Thu, 29 Sep 2011 11:07:10 +0200 (CEST)
|
||||
Received: from imap.suse.de (loadbalancer1.suse.de [149.44.160.248])
|
||||
(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by relay2.suse.de (Postfix) with ESMTPS id A573518552E1;
|
||||
Thu, 29 Sep 2011 11:07:10 +0200 (CEST)
|
||||
Received: from localhost.localdomain (charybdis-ext.suse.de [195.135.221.2])
|
||||
(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
|
||||
(Client did not present a certificate)
|
||||
by imap.suse.de (Postfix) with ESMTPSA id 7AD993C539A9;
|
||||
Thu, 29 Sep 2011 11:07:10 +0200 (CEST)
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
To: adrian@suse.de
|
||||
Cc: Peter Maydell <peter.maydell@linaro.org>, Riku Voipio <riku.voipio@linaro.org>
|
||||
Subject: [PATCH] linux-user: Implement prlimit64 syscall
|
||||
Date: Thu, 29 Sep 2011 11:00:25 +0200
|
||||
Message-Id: <1317286825-2033-1-git-send-email-agraf@suse.de>
|
||||
X-Mailer: git-send-email 1.6.0.2
|
||||
|
||||
From: Peter Maydell <peter.maydell@linaro.org>
|
||||
|
||||
Implement the prlimit64 syscall.
|
||||
|
||||
Slightly modified to apply upstream -Riku
|
||||
|
||||
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
|
||||
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
|
||||
|
||||
Index: qemu-0.14.1/linux-user/syscall.c
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/linux-user/syscall.c
|
||||
+++ qemu-0.14.1/linux-user/syscall.c
|
||||
@@ -524,6 +524,21 @@ static int sys_inotify_init1(int flags)
|
||||
#endif /* CONFIG_INOTIFY */
|
||||
|
||||
|
||||
+#if defined(TARGET_NR_prlimit64)
|
||||
+#ifndef __NR_prlimit64
|
||||
+# define __NR_prlimit64 -1
|
||||
+#endif
|
||||
+#define __NR_sys_prlimit64 __NR_prlimit64
|
||||
+/* The glibc rlimit structure may not be that used by the underlying syscall */
|
||||
+struct host_rlimit64 {
|
||||
+ uint64_t rlim_cur;
|
||||
+ uint64_t rlim_max;
|
||||
+};
|
||||
+_syscall4(int, sys_prlimit64, pid_t, pid, int, resource,
|
||||
+ const struct host_rlimit64 *, new_limit,
|
||||
+ struct host_rlimit64 *, old_limit)
|
||||
+#endif
|
||||
+
|
||||
extern int personality(int);
|
||||
extern int flock(int, int);
|
||||
extern int setfsuid(int);
|
||||
@@ -7620,6 +7635,34 @@ abi_long do_syscall(void *cpu_env, int n
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
+#ifdef TARGET_NR_prlimit64
|
||||
+ case TARGET_NR_prlimit64:
|
||||
+ {
|
||||
+ /* args: pid, resource number, ptr to new rlimit, ptr to old rlimit */
|
||||
+ struct target_rlimit64 *target_rnew, *target_rold;
|
||||
+ struct host_rlimit64 rnew, rold, *rnewp = 0;
|
||||
+ if (arg3) {
|
||||
+ if (!lock_user_struct(VERIFY_READ, target_rnew, arg3, 1)) {
|
||||
+ goto efault;
|
||||
+ }
|
||||
+ rnew.rlim_cur = tswap64(target_rnew->rlim_cur);
|
||||
+ rnew.rlim_max = tswap64(target_rnew->rlim_max);
|
||||
+ unlock_user_struct(target_rnew, arg3, 0);
|
||||
+ rnewp = &rnew;
|
||||
+ }
|
||||
+
|
||||
+ ret = get_errno(sys_prlimit64(arg1, arg2, rnewp, arg4 ? &rold : 0));
|
||||
+ if (!is_error(ret) && arg4) {
|
||||
+ if (!lock_user_struct(VERIFY_WRITE, target_rold, arg4, 1)) {
|
||||
+ goto efault;
|
||||
+ }
|
||||
+ target_rold->rlim_cur = tswap64(rold.rlim_cur);
|
||||
+ target_rold->rlim_max = tswap64(rold.rlim_max);
|
||||
+ unlock_user_struct(target_rold, arg4, 1);
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
default:
|
||||
unimplemented:
|
||||
Index: qemu-0.14.1/linux-user/syscall_defs.h
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/linux-user/syscall_defs.h
|
||||
+++ qemu-0.14.1/linux-user/syscall_defs.h
|
||||
@@ -2237,6 +2237,11 @@ struct target_mq_attr {
|
||||
abi_long mq_curmsgs;
|
||||
};
|
||||
|
||||
+struct target_rlimit64 {
|
||||
+ uint64_t rlim_cur;
|
||||
+ uint64_t rlim_max;
|
||||
+};
|
||||
+
|
||||
#include "socket.h"
|
||||
|
||||
#include "errno_defs.h"
|
||||
@@ -0,0 +1,34 @@
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
|
||||
fixes some SMP races
|
||||
---
|
||||
cpu-all.h | 2 +-
|
||||
exec.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: qemu-0.14.1/cpu-all.h
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/cpu-all.h
|
||||
+++ qemu-0.14.1/cpu-all.h
|
||||
@@ -775,7 +775,7 @@ void cpu_dump_statistics(CPUState *env,
|
||||
void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...)
|
||||
GCC_FMT_ATTR(2, 3);
|
||||
extern CPUState *first_cpu;
|
||||
-extern CPUState *cpu_single_env;
|
||||
+extern __thread CPUState *cpu_single_env;
|
||||
|
||||
#define CPU_INTERRUPT_HARD 0x02 /* hardware interrupt pending */
|
||||
#define CPU_INTERRUPT_EXITTB 0x04 /* exit the current TB (use for x86 a20 case) */
|
||||
Index: qemu-0.14.1/exec.c
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/exec.c
|
||||
+++ qemu-0.14.1/exec.c
|
||||
@@ -112,7 +112,7 @@ RAMList ram_list = { .blocks = QLIST_HEA
|
||||
CPUState *first_cpu;
|
||||
/* current CPU in the current thread. It is only valid inside
|
||||
cpu_exec() */
|
||||
-CPUState *cpu_single_env;
|
||||
+__thread CPUState *cpu_single_env;
|
||||
/* 0 = Do not count executed instructions.
|
||||
1 = Precise instruction counting.
|
||||
2 = Adaptive rate instruction counting. */
|
||||
@@ -0,0 +1,167 @@
|
||||
From 864b2c7da05bc29a94b3e792b100dd5189576942 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander Graf <agraf@suse.de>
|
||||
Date: Fri, 30 Sep 2011 19:40:36 +0200
|
||||
Subject: [PATCH] linux-user: add binfmt wrapper for argv[0] handling
|
||||
|
||||
When using qemu's linux-user binaries through binfmt, argv[0] gets lost
|
||||
along the execution because qemu only gets passed in the full file name
|
||||
to the executable while argv[0] can be something completely different.
|
||||
|
||||
This breaks in some subtile situations, such as the grep and make test
|
||||
suites.
|
||||
|
||||
This patch adds a wrapper binary called qemu-$TARGET-binfmt that can be
|
||||
used with binfmt's P flag which passes the full path _and_ argv[0] to
|
||||
the binfmt handler.
|
||||
|
||||
The binary would be smart enough to be versatile and only exist in the
|
||||
system once, creating the qemu binary path names from its own argv[0].
|
||||
However, this seemed like it didn't fit the make system too well, so
|
||||
we're currently creating a new binary for each target archictecture.
|
||||
|
||||
CC: Reinhard Max <max@suse.de>
|
||||
Signed-off-by: Alexander Graf <agraf@suse.de>
|
||||
---
|
||||
Makefile.target | 8 ++++++++
|
||||
linux-user/binfmt.c | 42 ++++++++++++++++++++++++++++++++++++++++++
|
||||
scripts/qemu-binfmt-conf.sh | 34 +++++++++++++++++-----------------
|
||||
3 files changed, 67 insertions(+), 17 deletions(-)
|
||||
create mode 100644 linux-user/binfmt.c
|
||||
|
||||
Index: qemu-0.14.1/Makefile.target
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/Makefile.target
|
||||
+++ qemu-0.14.1/Makefile.target
|
||||
@@ -33,6 +33,10 @@ endif
|
||||
PROGS=$(QEMU_PROG)
|
||||
STPFILES=
|
||||
|
||||
+ifdef CONFIG_LINUX_USER
|
||||
+PROGS+=$(QEMU_PROG)-binfmt
|
||||
+endif
|
||||
+
|
||||
ifndef CONFIG_HAIKU
|
||||
LIBS+=-lm
|
||||
endif
|
||||
@@ -131,6 +135,8 @@ obj-y += $(addprefix ../libuser/, $(user
|
||||
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
|
||||
obj-y += $(libobj-y)
|
||||
|
||||
+obj-binfmt-y += binfmt.o
|
||||
+
|
||||
endif #CONFIG_LINUX_USER
|
||||
|
||||
#########################################################
|
||||
@@ -346,6 +352,8 @@ obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml
|
||||
$(QEMU_PROG): $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y)
|
||||
$(call LINK,$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y))
|
||||
|
||||
+$(QEMU_PROG)-binfmt: $(obj-binfmt-y)
|
||||
+ $(call LINK,$^)
|
||||
|
||||
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
|
||||
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES)," GEN $(TARGET_DIR)$@")
|
||||
Index: qemu-0.14.1/linux-user/binfmt.c
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ qemu-0.14.1/linux-user/binfmt.c
|
||||
@@ -0,0 +1,42 @@
|
||||
+#include <stdio.h>
|
||||
+#include <stdarg.h>
|
||||
+#include <unistd.h>
|
||||
+#include <libgen.h>
|
||||
+#include <string.h>
|
||||
+#include <stdlib.h>
|
||||
+
|
||||
+
|
||||
+int main(int argc, char **argv, char **envp)
|
||||
+{
|
||||
+ char *binfmt;
|
||||
+ char **new_argv;
|
||||
+
|
||||
+ /*
|
||||
+ * Check if our file name ends with -binfmt
|
||||
+ */
|
||||
+ binfmt = argv[0] + strlen(argv[0]) - strlen("-binfmt");
|
||||
+ if (strcmp(binfmt, "-binfmt")) {
|
||||
+ fprintf(stderr, "%s: Invalid executable name\n", argv[0]);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+ if (argc < 3) {
|
||||
+ fprintf(stderr, "%s: Please use me through binfmt with P flag\n",
|
||||
+ argv[0]);
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ binfmt[0] = '\0';
|
||||
+ /* Now argv[0] is the real qemu binary name */
|
||||
+
|
||||
+ new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv));
|
||||
+ if (argc > 3) {
|
||||
+ memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv));
|
||||
+ }
|
||||
+ new_argv[0] = argv[0];
|
||||
+ new_argv[1] = (char *)"-0";
|
||||
+ new_argv[2] = argv[2];
|
||||
+ new_argv[3] = argv[1];
|
||||
+ new_argv[argc + 1] = NULL;
|
||||
+
|
||||
+ return execve(new_argv[0], new_argv, envp);
|
||||
+}
|
||||
Index: qemu-0.14.1/scripts/qemu-binfmt-conf.sh
|
||||
===================================================================
|
||||
--- qemu-0.14.1.orig/scripts/qemu-binfmt-conf.sh
|
||||
+++ qemu-0.14.1/scripts/qemu-binfmt-conf.sh
|
||||
@@ -34,36 +34,36 @@ esac
|
||||
|
||||
# register the interpreter for each cpu except for the native one
|
||||
if [ $cpu != "i386" ] ; then
|
||||
- echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "alpha" ] ; then
|
||||
- echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "arm" ] ; then
|
||||
- echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sparc" ] ; then
|
||||
- echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "ppc" ] ; then
|
||||
- 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
|
||||
+ 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-binfmt:P' > /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/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-binfmt:P' > /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/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/bin/qemu-mipsel:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mipsn32: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-mipsn32:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mipsn32el: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/bin/qemu-mipsn32el:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mips64:M::\x7fELF\x02\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-mips64:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':mips64el:M::\x7fELF\x02\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/bin/qemu-mips64el:' > /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-binfmt:P' > /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/bin/qemu-mipsel-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mipsn32: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-mipsn32-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mipsn32el: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/bin/qemu-mipsn32el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mips64:M::\x7fELF\x02\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-mips64-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':mips64el:M::\x7fELF\x02\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/bin/qemu-mips64el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sh" ] ; then
|
||||
- echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4:' > /proc/sys/fs/binfmt_misc/register
|
||||
- echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb:' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
+ echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
@@ -0,0 +1,357 @@
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/alpha/syscall_nr.h qemu-0.14.1/linux-user/alpha/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/alpha/syscall_nr.h 2011-11-24 22:21:09.636856616 +0100
|
||||
+++ qemu-0.14.1/linux-user/alpha/syscall_nr.h 2011-11-24 22:22:04.528478368 +0100
|
||||
@@ -411,7 +411,28 @@
|
||||
#define TARGET_NR_signalfd 476
|
||||
#define TARGET_NR_timerfd 477
|
||||
#define TARGET_NR_eventfd 478
|
||||
-
|
||||
+#define TARGET_NR_recvmmsg 479
|
||||
+#define TARGET_NR_fallocate 480
|
||||
+#define TARGET_NR_timerfd_create 481
|
||||
+#define TARGET_NR_timerfd_settime 482
|
||||
+#define TARGET_NR_timerfd_gettime 483
|
||||
+#define TARGET_NR_signalfd4 484
|
||||
+#define TARGET_NR_eventfd2 485
|
||||
+#define TARGET_NR_epoll_create1 486
|
||||
+#define TARGET_NR_dup3 487
|
||||
+#define TARGET_NR_pipe2 488
|
||||
+#define TARGET_NR_inotify_init1 489
|
||||
+#define TARGET_NR_preadv 490
|
||||
+#define TARGET_NR_pwritev 491
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 492
|
||||
+#define TARGET_NR_perf_event_open 493
|
||||
+#define TARGET_NR_fanotify_init 494
|
||||
+#define TARGET_NR_fanotify_mark 495
|
||||
+#define TARGET_NR_prlimit64 496
|
||||
+#define TARGET_NR_name_to_handle_at 497
|
||||
+#define TARGET_NR_open_by_handle_at 498
|
||||
+#define TARGET_NR_clock_adjtime 499
|
||||
+#define TARGET_NR_syncfs 500
|
||||
/* The following aliases are defined in order to match up with the
|
||||
standard i386 syscalls implemented in syscalls.c. */
|
||||
#define TARGET_NR_chown32 TARGET_NR_chown
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/arm/syscall_nr.h qemu-0.14.1/linux-user/arm/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/arm/syscall_nr.h 2011-11-24 22:21:09.627597287 +0100
|
||||
+++ qemu-0.14.1/linux-user/arm/syscall_nr.h 2011-11-24 22:21:41.762101277 +0100
|
||||
@@ -365,3 +365,16 @@
|
||||
#define TARGET_NR_dup3 (358)
|
||||
#define TARGET_NR_pipe2 (359)
|
||||
#define TARGET_NR_inotify_init1 (360)
|
||||
+#define TARGET_NR_preadv (361)
|
||||
+#define TARGET_NR_pwritev (362)
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo (363)
|
||||
+#define TARGET_NR_perf_event_open (364)
|
||||
+#define TARGET_NR_recvmmsg (365)
|
||||
+#define TARGET_NR_accept4 (366)
|
||||
+#define TARGET_NR_fanotify_init (367)
|
||||
+#define TARGET_NR_fanotify_mark (368)
|
||||
+#define TARGET_NR_prlimit64 (369)
|
||||
+#define TARGET_NR_name_to_handle_at (370)
|
||||
+#define TARGET_NR_open_by_handle_at (371)
|
||||
+#define TARGET_NR_clock_adjtime (372)
|
||||
+#define TARGET_NR_syncfs (373)
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/cris/syscall_nr.h qemu-0.14.1/linux-user/cris/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/cris/syscall_nr.h 2011-11-24 22:21:09.625282454 +0100
|
||||
+++ qemu-0.14.1/linux-user/cris/syscall_nr.h 2011-11-24 22:21:41.762101277 +0100
|
||||
@@ -333,3 +333,5 @@
|
||||
#define TARGET_NR_dup3 330
|
||||
#define TARGET_NR_pipe2 331
|
||||
#define TARGET_NR_inotify_init1 332
|
||||
+#define TARGET_NR_preadv 333
|
||||
+#define TARGET_NR_pwritev 334
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/i386/syscall_nr.h qemu-0.14.1/linux-user/i386/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/i386/syscall_nr.h 2011-11-24 22:21:09.632226952 +0100
|
||||
+++ qemu-0.14.1/linux-user/i386/syscall_nr.h 2011-11-24 22:21:41.764416110 +0100
|
||||
@@ -335,3 +335,15 @@
|
||||
#define TARGET_NR_dup3 330
|
||||
#define TARGET_NR_pipe2 331
|
||||
#define TARGET_NR_inotify_init1 332
|
||||
+#define TARGET_NR_preadv 333
|
||||
+#define TARGET_NR_pwritev 334
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 335
|
||||
+#define TARGET_NR_perf_event_open 336
|
||||
+#define TARGET_NR_recvmmsg 337
|
||||
+#define TARGET_NR_fanotify_init 338
|
||||
+#define TARGET_NR_fanotify_mark 339
|
||||
+#define TARGET_NR_prlimit64 340
|
||||
+#define TARGET_NR_name_to_handle_at 341
|
||||
+#define TARGET_NR_open_by_handle_at 342
|
||||
+#define TARGET_NR_clock_adjtime 343
|
||||
+#define TARGET_NR_syncfs 344
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/m68k/syscall_nr.h qemu-0.14.1/linux-user/m68k/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/m68k/syscall_nr.h 2011-11-24 22:21:09.629912120 +0100
|
||||
+++ qemu-0.14.1/linux-user/m68k/syscall_nr.h 2011-11-24 22:21:41.764416110 +0100
|
||||
@@ -328,3 +328,19 @@
|
||||
#define TARGET_NR_dup3 326
|
||||
#define TARGET_NR_pipe2 327
|
||||
#define TARGET_NR_inotify_init1 328
|
||||
+#define TARGET_NR_inotify_init1 328
|
||||
+#define TARGET_NR_preadv 329
|
||||
+#define TARGET_NR_pwritev 330
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 331
|
||||
+#define TARGET_NR_perf_event_open 332
|
||||
+#define TARGET_NR_get_thread_area 333
|
||||
+#define TARGET_NR_set_thread_area 334
|
||||
+#define TARGET_NR_atomic_cmpxchg_32 335
|
||||
+#define TARGET_NR_atomic_barrier 336
|
||||
+#define TARGET_NR_fanotify_init 337
|
||||
+#define TARGET_NR_fanotify_mark 338
|
||||
+#define TARGET_NR_prlimit64 339
|
||||
+#define TARGET_NR_name_to_handle_at 340
|
||||
+#define TARGET_NR_open_by_handle_at 341
|
||||
+#define TARGET_NR_clock_adjtime 342
|
||||
+#define TARGET_NR_syncfs 343
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/main.c qemu-0.14.1/linux-user/main.c
|
||||
--- qemu-0.14.1.orig/linux-user/main.c 2011-11-24 22:21:09.632226952 +0100
|
||||
+++ qemu-0.14.1/linux-user/main.c 2011-11-24 22:21:41.766730943 +0100
|
||||
@@ -1922,6 +1922,33 @@
|
||||
MIPS_SYS(sys_epoll_pwait, 6)
|
||||
MIPS_SYS(sys_ioprio_set, 3)
|
||||
MIPS_SYS(sys_ioprio_get, 2)
|
||||
+ MIPS_SYS(sys_utimensat, 4)
|
||||
+ MIPS_SYS(sys_signalfd, 3)
|
||||
+ MIPS_SYS(sys_ni_syscall, 0) /* was timerfd */
|
||||
+ MIPS_SYS(sys_eventfd, 1)
|
||||
+ MIPS_SYS(sys_fallocate, 6) /* 4320 */
|
||||
+ MIPS_SYS(sys_timerfd_create, 2)
|
||||
+ MIPS_SYS(sys_timerfd_gettime, 2)
|
||||
+ MIPS_SYS(sys_timerfd_settime, 4)
|
||||
+ MIPS_SYS(sys_signalfd4, 4)
|
||||
+ MIPS_SYS(sys_eventfd2, 2) /* 4325 */
|
||||
+ MIPS_SYS(sys_epoll_create1, 1)
|
||||
+ MIPS_SYS(sys_dup3, 3)
|
||||
+ MIPS_SYS(sys_pipe2, 2)
|
||||
+ MIPS_SYS(sys_inotify_init1, 1)
|
||||
+ MIPS_SYS(sys_preadv, 6) /* 4330 */
|
||||
+ MIPS_SYS(sys_pwritev, 6)
|
||||
+ MIPS_SYS(sys_rt_tgsigqueueinfo, 4)
|
||||
+ MIPS_SYS(sys_perf_event_open, 5)
|
||||
+ MIPS_SYS(sys_accept4, 4)
|
||||
+ MIPS_SYS(sys_recvmmsg, 5) /* 4335 */
|
||||
+ MIPS_SYS(sys_fanotify_init, 2)
|
||||
+ MIPS_SYS(sys_fanotify_mark, 6)
|
||||
+ MIPS_SYS(sys_prlimit64, 4)
|
||||
+ MIPS_SYS(sys_name_to_handle_at, 5)
|
||||
+ MIPS_SYS(sys_open_by_handle_at, 3) /* 4340 */
|
||||
+ MIPS_SYS(sys_clock_adjtime, 2)
|
||||
+ MIPS_SYS(sys_syncfs, 1)
|
||||
};
|
||||
|
||||
#undef MIPS_SYS
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/microblaze/syscall_nr.h qemu-0.14.1/linux-user/microblaze/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/microblaze/syscall_nr.h 2011-11-24 22:21:09.629912120 +0100
|
||||
+++ qemu-0.14.1/linux-user/microblaze/syscall_nr.h 2011-11-24 22:21:41.766730943 +0100
|
||||
@@ -364,6 +364,16 @@
|
||||
#define TARGET_NR_sendmsg 360 /* new */
|
||||
#define TARGET_NR_recvmsg 361 /* new */
|
||||
#define TARGET_NR_accept04 362 /* new */
|
||||
-
|
||||
-#define TARGET_NR_syscalls 363
|
||||
+#define TARGET_NR_preadv 363 /* new */
|
||||
+#define TARGET_NR_pwritev 364 /* new */
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 365 /* new */
|
||||
+#define TARGET_NR_perf_event_open 366 /* new */
|
||||
+#define TARGET_NR_recvmmsg 367 /* new */
|
||||
+#define TARGET_NR_fanotify_init 368
|
||||
+#define TARGET_NR_fanotify_mark 369
|
||||
+#define TARGET_NR_prlimit64 370
|
||||
+#define TARGET_NR_name_to_handle_at 371
|
||||
+#define TARGET_NR_open_by_handle_at 372
|
||||
+#define TARGET_NR_clock_adjtime 373
|
||||
+#define TARGET_NR_syncfs 374
|
||||
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/mips/syscall_nr.h qemu-0.14.1/linux-user/mips/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/mips/syscall_nr.h 2011-11-24 22:21:09.632226952 +0100
|
||||
+++ qemu-0.14.1/linux-user/mips/syscall_nr.h 2011-11-24 22:21:41.766730943 +0100
|
||||
@@ -332,3 +332,16 @@
|
||||
#define TARGET_NR_dup3 (TARGET_NR_Linux + 327)
|
||||
#define TARGET_NR_pipe2 (TARGET_NR_Linux + 328)
|
||||
#define TARGET_NR_inotify_init1 (TARGET_NR_Linux + 329)
|
||||
+#define TARGET_NR_preadv (TARGET_NR_Linux + 330)
|
||||
+#define TARGET_NR_pwritev (TARGET_NR_Linux + 331)
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo (TARGET_NR_Linux + 332)
|
||||
+#define TARGET_NR_perf_event_open (TARGET_NR_Linux + 333)
|
||||
+#define TARGET_NR_accept4 (TARGET_NR_Linux + 334)
|
||||
+#define TARGET_NR_recvmmsg (TARGET_NR_Linux + 335)
|
||||
+#define TARGET_NR_fanotify_init (TARGET_NR_Linux + 336)
|
||||
+#define TARGET_NR_fanotify_mark (TARGET_NR_Linux + 337)
|
||||
+#define TARGET_NR_prlimit64 (TARGET_NR_Linux + 338)
|
||||
+#define TARGET_NR_name_to_handle_at (TARGET_NR_Linux + 339)
|
||||
+#define TARGET_NR_open_by_handle_at (TARGET_NR_Linux + 340)
|
||||
+#define TARGET_NR_clock_adjtime (TARGET_NR_Linux + 341)
|
||||
+#define TARGET_NR_syncfs (TARGET_NR_Linux + 342)
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/mips64/syscall_nr.h qemu-0.14.1/linux-user/mips64/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/mips64/syscall_nr.h 2011-11-24 22:21:09.627597287 +0100
|
||||
+++ qemu-0.14.1/linux-user/mips64/syscall_nr.h 2011-11-24 22:21:41.769045776 +0100
|
||||
@@ -291,3 +291,16 @@
|
||||
#define TARGET_NR_dup3 (TARGET_NR_Linux + 286)
|
||||
#define TARGET_NR_pipe2 (TARGET_NR_Linux + 287)
|
||||
#define TARGET_NR_inotify_init1 (TARGET_NR_Linux + 288)
|
||||
+#define TARGET_NR_preadv (TARGET_NR_Linux + 289)
|
||||
+#define TARGET_NR_pwritev (TARGET_NR_Linux + 290)
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo (TARGET_NR_Linux + 291)
|
||||
+#define TARGET_NR_perf_event_open (TARGET_NR_Linux + 292)
|
||||
+#define TARGET_NR_accept4 (TARGET_NR_Linux + 293)
|
||||
+#define TARGET_NR_recvmmsg (TARGET_NR_Linux + 294)
|
||||
+#define TARGET_NR_fanotify_init (TARGET_NR_Linux + 295)
|
||||
+#define TARGET_NR_fanotify_mark (TARGET_NR_Linux + 296)
|
||||
+#define TARGET_NR_prlimit64 (TARGET_NR_Linux + 297)
|
||||
+#define TARGET_NR_name_to_handle_at (TARGET_NR_Linux + 298)
|
||||
+#define TARGET_NR_open_by_handle_at (TARGET_NR_Linux + 299)
|
||||
+#define TARGET_NR_clock_adjtime (TARGET_NR_Linux + 300)
|
||||
+#define TARGET_NR_syncfs (TARGET_NR_Linux + 301)
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/mipsn32/syscall_nr.h qemu-0.14.1/linux-user/mipsn32/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/mipsn32/syscall_nr.h 2011-11-24 22:21:09.634541784 +0100
|
||||
+++ qemu-0.14.1/linux-user/mipsn32/syscall_nr.h 2011-11-24 22:21:41.769045776 +0100
|
||||
@@ -295,3 +295,17 @@
|
||||
#define TARGET_NR_dup3 (TARGET_NR_Linux + 290)
|
||||
#define TARGET_NR_pipe2 (TARGET_NR_Linux + 291)
|
||||
#define TARGET_NR_inotify_init1 (TARGET_NR_Linux + 292)
|
||||
+#define TARGET_NR_preadv (TARGET_NR_Linux + 293)
|
||||
+#define TARGET_NR_pwritev (TARGET_NR_Linux + 294)
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo (TARGET_NR_Linux + 295)
|
||||
+#define TARGET_NR_perf_event_open (TARGET_NR_Linux + 296)
|
||||
+#define TARGET_NR_accept4 (TARGET_NR_Linux + 297)
|
||||
+#define TARGET_NR_recvmmsg (TARGET_NR_Linux + 298)
|
||||
+#define TARGET_NR_getdents64 (TARGET_NR_Linux + 299)
|
||||
+#define TARGET_NR_fanotify_init (TARGET_NR_Linux + 300)
|
||||
+#define TARGET_NR_fanotify_mark (TARGET_NR_Linux + 301)
|
||||
+#define TARGET_NR_prlimit64 (TARGET_NR_Linux + 302)
|
||||
+#define TARGET_NR_name_to_handle_at (TARGET_NR_Linux + 303)
|
||||
+#define TARGET_NR_open_by_handle_at (TARGET_NR_Linux + 304)
|
||||
+#define TARGET_NR_clock_adjtime (TARGET_NR_Linux + 305)
|
||||
+#define TARGET_NR_syncfs (TARGET_NR_Linux + 306)
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/ppc/syscall_nr.h qemu-0.14.1/linux-user/ppc/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/ppc/syscall_nr.h 2011-11-24 22:21:09.627597287 +0100
|
||||
+++ qemu-0.14.1/linux-user/ppc/syscall_nr.h 2011-11-24 22:21:41.769045776 +0100
|
||||
@@ -332,3 +332,33 @@
|
||||
#define TARGET_NR_dup3 316
|
||||
#define TARGET_NR_pipe2 317
|
||||
#define TARGET_NR_inotify_init1 318
|
||||
+#define TARGET_NR_perf_event_open 319
|
||||
+#define TARGET_NR_preadv 320
|
||||
+#define TARGET_NR_pwritev 321
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 322
|
||||
+#define TARGET_NR_fanotify_init 323
|
||||
+#define TARGET_NR_fanotify_mark 324
|
||||
+#define TARGET_NR_prlimit64 325
|
||||
+#define TARGET_NR_socket 326
|
||||
+#define TARGET_NR_bind 327
|
||||
+#define TARGET_NR_connect 328
|
||||
+#define TARGET_NR_listen 329
|
||||
+#define TARGET_NR_accept 330
|
||||
+#define TARGET_NR_getsockname 331
|
||||
+#define TARGET_NR_getpeername 332
|
||||
+#define TARGET_NR_socketpair 333
|
||||
+#define TARGET_NR_send 334
|
||||
+#define TARGET_NR_sendto 335
|
||||
+#define TARGET_NR_recv 336
|
||||
+#define TARGET_NR_recvfrom 337
|
||||
+#define TARGET_NR_shutdown 338
|
||||
+#define TARGET_NR_setsockopt 339
|
||||
+#define TARGET_NR_getsockopt 340
|
||||
+#define TARGET_NR_sendmsg 341
|
||||
+#define TARGET_NR_recvmsg 342
|
||||
+#define TARGET_NR_recvmmsg 343
|
||||
+#define TARGET_NR_accept4 344
|
||||
+#define TARGET_NR_name_to_handle_at 345
|
||||
+#define TARGET_NR_open_by_handle_at 346
|
||||
+#define TARGET_NR_clock_adjtime 347
|
||||
+#define TARGET_NR_syncfs 348
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/sh4/syscall_nr.h qemu-0.14.1/linux-user/sh4/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/sh4/syscall_nr.h 2011-11-24 22:21:09.634541784 +0100
|
||||
+++ qemu-0.14.1/linux-user/sh4/syscall_nr.h 2011-11-24 22:21:41.769045776 +0100
|
||||
@@ -334,3 +334,35 @@
|
||||
#define TARGET_NR_dup3 330
|
||||
#define TARGET_NR_pipe2 331
|
||||
#define TARGET_NR_inotify_init1 332
|
||||
+#define TARGET_NR_preadv 333
|
||||
+#define TARGET_NR_pwritev 334
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 335
|
||||
+#define TARGET_NR_perf_event_open 336
|
||||
+#define TARGET_NR_fanotify_init 337
|
||||
+#define TARGET_NR_fanotify_mark 338
|
||||
+#define TARGET_NR_prlimit64 339
|
||||
+
|
||||
+/* Non-multiplexed socket family */
|
||||
+#define TARGET_NR_socket 340
|
||||
+#define TARGET_NR_bind 341
|
||||
+#define TARGET_NR_connect 342
|
||||
+#define TARGET_NR_listen 343
|
||||
+#define TARGET_NR_accept 344
|
||||
+#define TARGET_NR_getsockname 345
|
||||
+#define TARGET_NR_getpeername 346
|
||||
+#define TARGET_NR_socketpair 347
|
||||
+#define TARGET_NR_send 348
|
||||
+#define TARGET_NR_sendto 349
|
||||
+#define TARGET_NR_recv 350
|
||||
+#define TARGET_NR_recvfrom 351
|
||||
+#define TARGET_NR_shutdown 352
|
||||
+#define TARGET_NR_setsockopt 353
|
||||
+#define TARGET_NR_getsockopt 354
|
||||
+#define TARGET_NR_sendmsg 355
|
||||
+#define TARGET_NR_recvmsg 356
|
||||
+#define TARGET_NR_recvmmsg 357
|
||||
+#define TARGET_NR_accept4 358
|
||||
+#define TARGET_NR_name_to_handle_at 359
|
||||
+#define TARGET_NR_open_by_handle_at 360
|
||||
+#define TARGET_NR_clock_adjtime 361
|
||||
+#define TARGET_NR_syncfs 362
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/sparc/syscall_nr.h qemu-0.14.1/linux-user/sparc/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/sparc/syscall_nr.h 2011-11-24 22:21:09.629912120 +0100
|
||||
+++ qemu-0.14.1/linux-user/sparc/syscall_nr.h 2011-11-24 22:21:41.769045776 +0100
|
||||
@@ -285,3 +285,15 @@
|
||||
#define TARGET_NR_pipe2 321
|
||||
#define TARGET_NR_inotify_init1 322
|
||||
#define TARGET_NR_accept4 323
|
||||
+#define TARGET_NR_preadv 324
|
||||
+#define TARGET_NR_pwritev 325
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 326
|
||||
+#define TARGET_NR_perf_event_open 327
|
||||
+#define TARGET_NR_recvmmsg 328
|
||||
+#define TARGET_NR_fanotify_init 329
|
||||
+#define TARGET_NR_fanotify_mark 330
|
||||
+#define TARGET_NR_prlimit64 331
|
||||
+#define TARGET_NR_name_to_handle_at 332
|
||||
+#define TARGET_NR_open_by_handle_at 333
|
||||
+#define TARGET_NR_clock_adjtime 334
|
||||
+#define TARGET_NR_syncfs 335
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/sparc64/syscall_nr.h qemu-0.14.1/linux-user/sparc64/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/sparc64/syscall_nr.h 2011-11-24 22:21:09.632226952 +0100
|
||||
+++ qemu-0.14.1/linux-user/sparc64/syscall_nr.h 2011-11-24 22:21:41.771360608 +0100
|
||||
@@ -322,3 +322,15 @@
|
||||
#define TARGET_NR_pipe2 321
|
||||
#define TARGET_NR_inotify_init1 322
|
||||
#define TARGET_NR_accept4 323
|
||||
+#define TARGET_NR_preadv 324
|
||||
+#define TARGET_NR_pwritev 325
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 326
|
||||
+#define TARGET_NR_perf_event_open 327
|
||||
+#define TARGET_NR_recvmmsg 328
|
||||
+#define TARGET_NR_fanotify_init 329
|
||||
+#define TARGET_NR_fanotify_mark 330
|
||||
+#define TARGET_NR_prlimit64 331
|
||||
+#define TARGET_NR_name_to_handle_at 332
|
||||
+#define TARGET_NR_open_by_handle_at 333
|
||||
+#define TARGET_NR_clock_adjtime 334
|
||||
+#define TARGET_NR_syncfs 335
|
||||
diff -uNr qemu-0.14.1.orig/linux-user/x86_64/syscall_nr.h qemu-0.14.1/linux-user/x86_64/syscall_nr.h
|
||||
--- qemu-0.14.1.orig/linux-user/x86_64/syscall_nr.h 2011-11-24 22:21:09.625282454 +0100
|
||||
+++ qemu-0.14.1/linux-user/x86_64/syscall_nr.h 2011-11-24 22:21:41.771360608 +0100
|
||||
@@ -293,3 +293,15 @@
|
||||
#define TARGET_NR_dup3 292
|
||||
#define TARGET_NR_pipe2 293
|
||||
#define TARGET_NR_inotify_init1 294
|
||||
+#define TARGET_NR_preadv 295
|
||||
+#define TARGET_NR_pwritev 296
|
||||
+#define TARGET_NR_rt_tgsigqueueinfo 297
|
||||
+#define TARGET_NR_perf_event_open 298
|
||||
+#define TARGET_NR_recvmmsg 299
|
||||
+#define TARGET_NR_fanotify_init 300
|
||||
+#define TARGET_NR_fanotify_mark 301
|
||||
+#define TARGET_NR_prlimit64 302
|
||||
+#define TARGET_NR_name_to_handle_at 303
|
||||
+#define TARGET_NR_open_by_handle_at 304
|
||||
+#define TARGET_NR_clock_adjtime 305
|
||||
+#define TARGET_NR_syncfs 306
|
||||
46
app-emulation/qemu-user/files/qemu-chroot.patch
Normal file
46
app-emulation/qemu-user/files/qemu-chroot.patch
Normal file
@@ -0,0 +1,46 @@
|
||||
diff --git a/linux-user/main.c b/linux-user/main.c
|
||||
index 124b98c..b010fd2 100644
|
||||
--- a/linux-user/main.c
|
||||
+++ b/linux-user/main.c
|
||||
@@ -1905,6 +1905,10 @@ void usage(void)
|
||||
"-cpu model select CPU (-cpu ? for list)\n"
|
||||
"-drop-ld-preload drop LD_PRELOAD for target process\n"
|
||||
"\n"
|
||||
+ "Root options:\n"
|
||||
+ "-chroot dir chroot to dir\n"
|
||||
+ "-su uid:gid set numeric user and group IDs\n"
|
||||
+ "\n"
|
||||
"Debug options:\n"
|
||||
"-d options activate log (logfile=%s)\n"
|
||||
"-p pagesize set the host page size to 'pagesize'\n"
|
||||
@@ -2011,6 +2015,28 @@ int main(int argc, char **argv)
|
||||
drop_ld_preload = 1;
|
||||
} else if (!strcmp(r, "strace")) {
|
||||
do_strace = 1;
|
||||
+ } else if (!strcmp(r, "chroot")) {
|
||||
+ if (chdir(argv[optind++]) || chroot(".")) {
|
||||
+ fprintf(stderr, "Can't chroot to '%s' (are you root?)\n",
|
||||
+ argv[--optind]);
|
||||
+ _exit(1);
|
||||
+ }
|
||||
+ } else if (!strcmp(r, "su")) {
|
||||
+ int temp;
|
||||
+ char *gid = strchr(argv[optind], ':');
|
||||
+ if (gid) {
|
||||
+ temp = atoi(++gid);
|
||||
+ if (setresgid(temp, temp, temp)) {
|
||||
+ fprintf(stderr, "Can't set gid to %d (are you root?)\n",
|
||||
+ temp);
|
||||
+ _exit(1);
|
||||
+ }
|
||||
+ }
|
||||
+ temp = atoi(argv[optind++]);
|
||||
+ if (setresuid(temp, temp, temp)) {
|
||||
+ fprintf(stderr, "Can't set uid to %d (are you root?)\n", temp);
|
||||
+ _exit(1);
|
||||
+ }
|
||||
} else
|
||||
{
|
||||
usage();
|
||||
|
||||
|
||||
137
app-emulation/qemu-user/files/qemu-user.initd
Normal file
137
app-emulation/qemu-user/files/qemu-user.initd
Normal file
@@ -0,0 +1,137 @@
|
||||
#!/sbin/runscript
|
||||
# Copyright 1999-2006 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# $Header: $
|
||||
|
||||
# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390 program execution by the kernel
|
||||
|
||||
depend() {
|
||||
after procfs
|
||||
}
|
||||
|
||||
start() {
|
||||
ebegin "Registering qemu-user binaries"
|
||||
|
||||
if [[ ! -d /proc/sys/fs/binfmt_misc ]] ; then
|
||||
eerror "You need support for \"misc binaries\" in your kernel!"
|
||||
eend 1
|
||||
fi
|
||||
|
||||
if [[ $(mount | grep -c binfmt_misc) -eq 0 ]] ; then
|
||||
mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc &> /dev/null
|
||||
local result=$?
|
||||
|
||||
if [[ $result -ne 0 ]] ; then
|
||||
eend $result
|
||||
fi
|
||||
fi
|
||||
|
||||
# probe cpu type
|
||||
cpu=`uname -m`
|
||||
case "$cpu" in
|
||||
i386|i486|i586|i686|i86pc|BePC|x86_64)
|
||||
cpu="i386"
|
||||
;;
|
||||
m68k)
|
||||
cpu="m68k"
|
||||
;;
|
||||
mips*)
|
||||
cpu="mips"
|
||||
;;
|
||||
"Power Macintosh"|ppc|ppc64)
|
||||
cpu="ppc"
|
||||
;;
|
||||
armv[4-9]*)
|
||||
cpu="arm"
|
||||
;;
|
||||
sparc*)
|
||||
cpu="sparc"
|
||||
;;
|
||||
esac
|
||||
|
||||
# register the interpreter for each cpu except for the native one
|
||||
if [ $cpu != "i386" ] ; then
|
||||
echo ':i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "alpha" ] ; then
|
||||
echo ':alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "arm" ] ; then
|
||||
echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sparc" ] ; then
|
||||
echo ':sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "ppc" ] ; then
|
||||
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-binfmt:P' > /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/bin/qemu-m68k-binfmt:P' > /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/bin/qemu-mips-binfmt:P' > /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/bin/qemu-mipsel-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':mipsn32: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-mipsn32-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':mipsn32el: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/bin/qemu-mipsn32el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':mips64:M::\x7fELF\x02\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-mips64-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':mips64el:M::\x7fELF\x02\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/bin/qemu-mips64el-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "sh" ] ; then
|
||||
echo ':sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
echo ':sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
if [ $cpu != "s390x" ] ; then
|
||||
echo ':s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/local/bin/qemu-s390x-binfmt:P' > /proc/sys/fs/binfmt_misc/register
|
||||
fi
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Unregistering qemu-user binaries"
|
||||
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/i386 ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/i386
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/i486
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/alpha ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/alpha
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/arm ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/arm
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/armeb
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/sparc ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/sparc
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/ppc ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/ppc
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/m68k ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/m68k
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/misp ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mips
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mipsel
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mipsn32
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mipsn32el
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mips64
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/mips64el
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/sh4 ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/sh4
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/sh4eb
|
||||
fi
|
||||
if [[ -f /proc/sys/fs/binfmt_misc/s390x ]] ; then
|
||||
echo '-1' > /proc/sys/fs/binfmt_misc/s390x
|
||||
fi
|
||||
|
||||
eend $?
|
||||
}
|
||||
|
||||
# vim: ts=4 :
|
||||
|
||||
|
||||
Reference in New Issue
Block a user