qemu-arm-eabi-devel Mailing List for Qemu ARM EABI
Status: Beta
Brought to you by:
laurov
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
(19) |
Nov
|
Dec
|
|
From: <la...@us...> - 2008-10-15 18:30:33
|
Revision: 46
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=46&view=rev
Author: laurov
Date: 2008-10-15 18:30:23 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Add the qemu-arm-eabi-0.3 tag.
Added Paths:
-----------
tags/qemu-arm-eabi-0.3/
tags/qemu-arm-eabi-0.3/README
tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh
tags/qemu-arm-eabi-0.3/get-qemu.sh
tags/qemu-arm-eabi-0.3/patches/01_fix_srs_rfe.patch
tags/qemu-arm-eabi-0.3/patches/02_fix_page_range_check.patch
tags/qemu-arm-eabi-0.3/patches/04_shmat_strace.patch
tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch
tags/qemu-arm-eabi-0.3/patches/22_IPCOP_msg.patch
tags/qemu-arm-eabi-0.3/patches/23_msg_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/24_IPCOP_sem.patch
tags/qemu-arm-eabi-0.3/patches/25_sem_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/26_IPCOP_shm.patch
tags/qemu-arm-eabi-0.3/patches/27_shm_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/30_check_host_to_target_sockaddr_return_value.patch
tags/qemu-arm-eabi-0.3/patches/31_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/32_syscall_sysctl.patch
tags/qemu-arm-eabi-0.3/patches/33_fix_getdents_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/34_fix_siocatmark.patch
tags/qemu-arm-eabi-0.3/patches/35_syscall_sockaddr.patch
tags/qemu-arm-eabi-0.3/patches/36_fix_iovec.patch
tags/qemu-arm-eabi-0.3/patches/37_check_target_to_host_sockaddr_return_value.patch
tags/qemu-arm-eabi-0.3/patches/38_fix_recvmsg_return_value.patch
tags/qemu-arm-eabi-0.3/patches/39_fix_exit_syscall.patch
tags/qemu-arm-eabi-0.3/patches/40_clone_child_cleartid.patch
tags/qemu-arm-eabi-0.3/patches/44_socklen_t_check.patch
tags/qemu-arm-eabi-0.3/patches/series
Removed Paths:
-------------
tags/qemu-arm-eabi-0.3/README
tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh
tags/qemu-arm-eabi-0.3/get-qemu.sh
tags/qemu-arm-eabi-0.3/patches/00_build_fix.patch
tags/qemu-arm-eabi-0.3/patches/01_static_build.patch
tags/qemu-arm-eabi-0.3/patches/02_snapshot_use_tmpdir.patch
tags/qemu-arm-eabi-0.3/patches/19_zero_null.1.getgroups.patch
tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch
tags/qemu-arm-eabi-0.3/patches/23_futimesat.patch
tags/qemu-arm-eabi-0.3/patches/30_syscall_ipc.patch
tags/qemu-arm-eabi-0.3/patches/31_syscalls.patch
tags/qemu-arm-eabi-0.3/patches/32_syscall_sysctl.patch
tags/qemu-arm-eabi-0.3/patches/34_syscalls_types.patch
tags/qemu-arm-eabi-0.3/patches/35_syscall_sockaddr.patch
tags/qemu-arm-eabi-0.3/patches/39_syscall_fadvise64.patch
tags/qemu-arm-eabi-0.3/patches/41_arm_fpa_sigfpe.patch
tags/qemu-arm-eabi-0.3/patches/42_arm_tls.patch
tags/qemu-arm-eabi-0.3/patches/43_arm_cpustate.patch
tags/qemu-arm-eabi-0.3/patches/44_socklen_t_check.patch
tags/qemu-arm-eabi-0.3/patches/55_unmux_socketcall.patch
tags/qemu-arm-eabi-0.3/patches/66_tls_ld.patch
tags/qemu-arm-eabi-0.3/patches/69_arm_kmb.patch
tags/qemu-arm-eabi-0.3/patches/90_evil_dlclose.patch
tags/qemu-arm-eabi-0.3/patches/96_futex.patch
tags/qemu-arm-eabi-0.3/patches/97_inotify.patch
tags/qemu-arm-eabi-0.3/patches/series
Deleted: tags/qemu-arm-eabi-0.3/README
===================================================================
--- trunk/README 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/README 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,53 +0,0 @@
-HOW TO GET:
-export QUILT_PATCHES=../patches
-svn co -r4993 svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
-cd qemu-arm-eabi
-quilt push -a
-
-or run the script
-./get-qemu.sh
-
-HOWTO COMPILE:
-In Debian/Ubuntu you will need the packages:
-build-essential gcc-3.4 subversion zlib1g-dev libsdl1.2-dev
-
-$ ./configure --target-list=arm-linux-user --static
-$ make
-
-or run the script
-./build-qemu-arm-eabi.sh
-
-INSTALLING ON SCRATCHBOX
-1. Copy the compiled qemu to scratchbox
-$ sudo cp qemu-arm-eabi/arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi
-
-2. Edit /scratchbox/devkits/cputransp/etc/cputransp-methods and add this line:
-qemu-arm-eabi
-
-3. Edit all the files that match /scratchbox/users/$USERNAME/targets/*.config
-that describe an armel target, and change this line
-
-SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-WHATEVER
-
-to
-
-SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi
-
-4. Apply the fakeroot patch to fix the path separator bug (scratchbox uses ','
-as path separator to the standard qemu versions, the qemu-arm-eabi only
-accepts ':', as any normal person would)
-patch < fakeroot.patch
-
-or run the script
-./install-on-scratchbox.sh
-
-HOWTO UPDATE QEMU-ARM-EABI
-This version of qemu-arm-eabi was based on the latest qemu version at the time of its doing, which was svn trunk in revision 4993.
-To update proceed like this:
-$ cd qemu-arm-eabi-0.2/qemu-arm-eabi
-$ rm * .pc -rf
-$ svn up
-$ export QUILT_PATCHES=../patches
-$ quilt push -a
-Solve the possible conflicts.
-
Copied: tags/qemu-arm-eabi-0.3/README (from rev 45, trunk/README)
===================================================================
--- tags/qemu-arm-eabi-0.3/README (rev 0)
+++ tags/qemu-arm-eabi-0.3/README 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,40 @@
+HOW TO GET:
+Run the script
+./get-qemu.sh
+
+HOWTO COMPILE:
+In Debian/Ubuntu you will need the packages:
+build-essential gcc-3.4 zlib1g-dev libsdl1.2-dev
+
+Run the script
+./build-qemu-arm-eabi.sh
+
+INSTALLING ON SCRATCHBOX
+Run the script
+./install-on-scratchbox.sh
+
+or
+
+1. Copy the compiled qemu to scratchbox
+$ sudo cp qemu-arm-eabi/arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi
+
+2. Edit /scratchbox/devkits/cputransp/etc/cputransp-methods and add this line:
+qemu-arm-eabi
+
+3. Edit all the files that match /scratchbox/users/$USERNAME/targets/*.config
+that describe an armel target, and change this line
+
+SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-WHATEVER
+
+to
+
+SBOX_CPUTRANSPARENCY_METHOD=/scratchbox/devkits/cputransp/bin/qemu-arm-eabi
+
+4. Apply the fakeroot patch to fix the path separator bug (scratchbox uses ','
+as path separator to the standard qemu versions, the qemu-arm-eabi only
+accepts ':', as any normal person would)
+patch < fakeroot.patch
+
+
+
+
Deleted: tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh
===================================================================
--- trunk/build-qemu-arm-eabi.sh 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-echo "** Build qemu-arm-eabi **"
-
-sudo apt-get install -y --force-yes build-essential gcc-3.4 subversion zlib1g-dev libsdl1.2-dev
-
-cd qemu-arm-eabi
-./configure --target-list=arm-linux-user --static
-make
-
-
-
Copied: tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh (from rev 44, trunk/build-qemu-arm-eabi.sh)
===================================================================
--- tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh (rev 0)
+++ tags/qemu-arm-eabi-0.3/build-qemu-arm-eabi.sh 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+echo "** Build qemu-arm-eabi **"
+
+cd qemu-arm-eabi
+./configure --target-list=arm-linux-user --static
+make
+
+
+
Deleted: tags/qemu-arm-eabi-0.3/get-qemu.sh
===================================================================
--- trunk/get-qemu.sh 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/get-qemu.sh 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-echo "** Get the qemu code from svn and apply arm-eabi patches **"
-
-quilt 2> /dev/null 1>/dev/null
-
-# 127: command not found.
-if [ "$?" -eq "127" ]; then
- echo "You need to install quilt to apply the patches."
- echo "If in Debian/Ubuntu: sudo apt-get install quilt"
- exit 1
-fi
-
-export QUILT_PATCHES=../patches
-
-svn co -r4993 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
-cd qemu-arm-eabi
-quilt push -a
-
Copied: tags/qemu-arm-eabi-0.3/get-qemu.sh (from rev 28, trunk/get-qemu.sh)
===================================================================
--- tags/qemu-arm-eabi-0.3/get-qemu.sh (rev 0)
+++ tags/qemu-arm-eabi-0.3/get-qemu.sh 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+echo "** Get the qemu code from svn and apply arm-eabi patches **"
+
+quilt 2> /dev/null 1>/dev/null
+
+# 127: command not found.
+if [ "$?" -eq "127" ]; then
+ echo "You need to install quilt to apply the patches."
+ echo "If in Debian/Ubuntu: sudo apt-get install quilt"
+ exit 1
+fi
+
+export QUILT_PATCHES=../patches
+
+svn co -r5391 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
+cd qemu-arm-eabi
+quilt push -a
+
Deleted: tags/qemu-arm-eabi-0.3/patches/00_build_fix.patch
===================================================================
--- trunk/patches/00_build_fix.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/00_build_fix.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,13 +0,0 @@
-Index: qemu/Makefile.target
-===================================================================
---- qemu.orig/Makefile.target 2007-11-12 16:40:12.000000000 -0300
-+++ qemu/Makefile.target 2007-11-12 16:42:34.000000000 -0300
-@@ -128,7 +128,7 @@
- USE_I386_LD=y
- endif
- ifdef USE_I386_LD
--BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-+#BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- else
- ifdef CONFIG_LINUX_USER
- # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
Copied: tags/qemu-arm-eabi-0.3/patches/01_fix_srs_rfe.patch (from rev 31, trunk/patches/01_fix_srs_rfe.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/01_fix_srs_rfe.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/01_fix_srs_rfe.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,115 @@
+From: Hans(Hyeonseung) Jang <hs...@ok...>
+To: qem...@no...
+Subject: [Qemu-devel] [Patch] ARMv6: Fix SRS/RFE instruction
+
+We are in the process of implementing a KZM (i.MX31) ARMv6 machine
+port in order to run the OKL4 kernel. We found the new CPS/SRS/RFE
+instructions were broken.
+Vincent Palatin released a patch recently which fixes the CPS problem.
+Attached is a patch to fix the SRS/RFE bugs. Could this patch please
+be applied to the main trunk.
+Thanks
+- Hyeonsung Jang.
+
+
+- The encoding of 'IA' condition must be '01' instead of '02'.
+- SRS instruction must store banked SPSR instead of CPSR at the specific address.
+- 'return' statements are missing
+
+
+Index: target-arm/translate.c
+===================================================================
+--- target-arm/translate.c.orig 2008-10-03 16:00:06.000000000 -0300
++++ target-arm/translate.c 2008-10-03 16:00:08.000000000 -0300
+@@ -5692,7 +5692,7 @@
+ }
+ } else if ((insn & 0x0e5fffe0) == 0x084d0500) {
+ /* srs */
+- uint32_t offset;
++ int32_t offset;
+ if (IS_USER(s))
+ goto illegal_op;
+ ARCH(6);
+@@ -5706,8 +5706,8 @@
+ i = (insn >> 23) & 3;
+ switch (i) {
+ case 0: offset = -4; break; /* DA */
+- case 1: offset = -8; break; /* DB */
+- case 2: offset = 0; break; /* IA */
++ case 1: offset = 0; break; /* IA */
++ case 2: offset = -8; break; /* DB */
+ case 3: offset = 4; break; /* IB */
+ default: abort();
+ }
+@@ -5715,32 +5715,33 @@
+ tcg_gen_addi_i32(addr, addr, offset);
+ tmp = load_reg(s, 14);
+ gen_st32(tmp, addr, 0);
+- tmp = new_tmp();
+- gen_helper_cpsr_read(tmp);
++ tmp = load_cpu_field(spsr);
+ tcg_gen_addi_i32(addr, addr, 4);
+ gen_st32(tmp, addr, 0);
+ if (insn & (1 << 21)) {
+ /* Base writeback. */
+ switch (i) {
+ case 0: offset = -8; break;
+- case 1: offset = -4; break;
+- case 2: offset = 4; break;
++ case 1: offset = 4; break;
++ case 2: offset = -4; break;
+ case 3: offset = 0; break;
+ default: abort();
+ }
+ if (offset)
+- tcg_gen_addi_i32(addr, tmp, offset);
++ tcg_gen_addi_i32(addr, addr, offset);
+ if (op1 == (env->uncached_cpsr & CPSR_M)) {
+- gen_movl_reg_T1(s, 13);
++ store_reg(s, 13, addr);
+ } else {
+- gen_helper_set_r13_banked(cpu_env, tcg_const_i32(op1), cpu_T[1]);
++ gen_helper_set_r13_banked(cpu_env, tcg_const_i32(op1), addr);
++ dead_tmp(addr);
+ }
+ } else {
+ dead_tmp(addr);
+ }
++ return;
+ } else if ((insn & 0x0e5fffe0) == 0x081d0a00) {
+ /* rfe */
+- uint32_t offset;
++ int32_t offset;
+ if (IS_USER(s))
+ goto illegal_op;
+ ARCH(6);
+@@ -5749,8 +5750,8 @@
+ i = (insn >> 23) & 3;
+ switch (i) {
+ case 0: offset = -4; break; /* DA */
+- case 1: offset = -8; break; /* DB */
+- case 2: offset = 0; break; /* IA */
++ case 1: offset = 0; break; /* IA */
++ case 2: offset = -8; break; /* DB */
+ case 3: offset = 4; break; /* IB */
+ default: abort();
+ }
+@@ -5764,8 +5765,8 @@
+ /* Base writeback. */
+ switch (i) {
+ case 0: offset = -8; break;
+- case 1: offset = -4; break;
+- case 2: offset = 4; break;
++ case 1: offset = 4; break;
++ case 2: offset = -4; break;
+ case 3: offset = 0; break;
+ default: abort();
+ }
+@@ -5776,6 +5777,7 @@
+ dead_tmp(addr);
+ }
+ gen_rfe(s, tmp, tmp2);
++ return;
+ } else if ((insn & 0x0e000000) == 0x0a000000) {
+ /* branch link and change to thumb (blx <offset>) */
+ int32_t offset;
Deleted: tags/qemu-arm-eabi-0.3/patches/01_static_build.patch
===================================================================
--- trunk/patches/01_static_build.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/01_static_build.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,23 +0,0 @@
-Index: qemu/Makefile.target
-===================================================================
---- qemu.orig/Makefile.target 2007-11-12 14:47:19.000000000 -0300
-+++ qemu/Makefile.target 2007-11-12 15:31:04.000000000 -0300
-@@ -128,7 +128,7 @@
- USE_I386_LD=y
- endif
- ifdef USE_I386_LD
--BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-+#BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- else
- ifdef CONFIG_LINUX_USER
- # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
-@@ -538,6 +538,9 @@
- ifndef CONFIG_WIN32
- ifndef CONFIG_SOLARIS
- VL_LIBS+=-lutil
-+ifdef CONFIG_STATIC
-+LIBS+=-pthread
-+endif
- endif
- endif
- endif
Copied: tags/qemu-arm-eabi-0.3/patches/02_fix_page_range_check.patch (from rev 37, trunk/patches/02_fix_page_range_check.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/02_fix_page_range_check.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/02_fix_page_range_check.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,21 @@
+Index: exec.c
+===================================================================
+--- exec.c (revision 5391)
++++ exec.c (working copy)
+@@ -2068,12 +2068,13 @@
+ target_ulong end;
+ target_ulong addr;
+
++ if( start + len < start )
++ /* we've wrapped around */
++ return -1;
++
+ end = TARGET_PAGE_ALIGN(start+len); /* must do before we loose bits in the next step */
+ start = start & TARGET_PAGE_MASK;
+
+- if( end < start )
+- /* we've wrapped around */
+- return -1;
+ for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
+ p = page_find(addr >> TARGET_PAGE_BITS);
+ if( !p )
Deleted: tags/qemu-arm-eabi-0.3/patches/02_snapshot_use_tmpdir.patch
===================================================================
--- trunk/patches/02_snapshot_use_tmpdir.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/02_snapshot_use_tmpdir.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,19 +0,0 @@
-#DPATCHLEVEL=0
-Index: block.c
-===================================================================
---- block.c.orig 2007-11-12 15:27:49.000000000 -0300
-+++ block.c 2007-11-12 16:45:57.000000000 -0300
-@@ -192,8 +192,12 @@
- void get_tmp_filename(char *filename, int size)
- {
- int fd;
-+ char *tmpdir;
- /* XXX: race condition possible */
-- pstrcpy(filename, size, "/tmp/vl.XXXXXX");
-+ tmpdir = getenv("TMPDIR");
-+ if (!tmpdir)
-+ tmpdir = "/tmp";
-+ snprintf(filename, size, "%s/vl.XXXXXX", tmpdir);
- fd = mkstemp(filename);
- close(fd);
- }
Copied: tags/qemu-arm-eabi-0.3/patches/04_shmat_strace.patch (from rev 38, trunk/patches/04_shmat_strace.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/04_shmat_strace.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/04_shmat_strace.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,13 @@
+Index: linux-user/strace.list
+===================================================================
+--- linux-user/strace.list (revision 5391)
++++ linux-user/strace.list (working copy)
+@@ -1250,7 +1250,7 @@
+ { TARGET_NR_sgetmask, "sgetmask" , NULL, NULL, NULL },
+ #endif
+ #ifdef TARGET_NR_shmat
+-{ TARGET_NR_shmat, "shmat" , NULL, NULL, NULL },
++{ TARGET_NR_shmat, "shmat" , NULL, NULL, print_syscall_ret_addr },
+ #endif
+ #ifdef TARGET_NR_shmctl
+ { TARGET_NR_shmctl, "shmctl" , NULL, NULL, NULL },
Deleted: tags/qemu-arm-eabi-0.3/patches/19_zero_null.1.getgroups.patch
===================================================================
--- trunk/patches/19_zero_null.1.getgroups.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/19_zero_null.1.getgroups.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,22 +0,0 @@
-Index: qemu/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:30:13.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:30:15.000000000 -0300
-@@ -5246,7 +5246,7 @@
-
- grouplist = alloca(gidsetsize * sizeof(gid_t));
- ret = get_errno(getgroups(gidsetsize, grouplist));
-- if (!is_error(ret)) {
-+ if (!is_error(ret) && arg1) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 2, 0);
- if (!target_grouplist)
- goto efault;
-@@ -5396,7 +5396,7 @@
-
- grouplist = alloca(gidsetsize * sizeof(gid_t));
- ret = get_errno(getgroups(gidsetsize, grouplist));
-- if (!is_error(ret)) {
-+ if (!is_error(ret) && arg1) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
- if (!target_grouplist) {
- ret = -TARGET_EFAULT;
Deleted: tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch
===================================================================
--- trunk/patches/21_net_soopts.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,208 +0,0 @@
-Index: qemu-arm-eabi/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:31:02.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:31:04.000000000 -0300
-@@ -802,6 +802,32 @@
- return 0;
- }
-
-+static inline abi_long host_to_target_linger(target_ulong target_addr,
-+ struct linger *host_l)
-+{
-+ struct target_linger *target_l;
-+
-+ if (!lock_user_struct(VERIFY_WRITE, target_l, target_addr, 0))
-+ return -TARGET_EFAULT;
-+ target_l->l_onoff = tswapl(host_l->l_onoff);
-+ target_l->l_linger = tswapl(host_l->l_linger);
-+ unlock_user_struct(target_l, target_addr, 1);
-+ return 0;
-+}
-+
-+static inline abi_long target_to_host_linger(struct linger *host_l,
-+ target_ulong target_addr)
-+{
-+ struct target_linger *target_l;
-+
-+ if (!lock_user_struct(VERIFY_WRITE, target_l, target_addr, 1))
-+ return -TARGET_EFAULT;
-+ host_l->l_onoff = tswapl(target_l->l_onoff);
-+ host_l->l_linger = tswapl(target_l->l_linger);
-+ unlock_user_struct(target_l, target_addr, 0);
-+ return 0;
-+}
-+
- /* do_setsockopt() Must return target values and target errnos. */
- static abi_long do_setsockopt(int sockfd, int level, int optname,
- abi_ulong optval_addr, socklen_t optlen)
-@@ -852,7 +878,6 @@
- break;
- case TARGET_SOL_SOCKET:
- switch (optname) {
-- /* Options with 'int' argument. */
- case TARGET_SO_DEBUG:
- optname = SO_DEBUG;
- break;
-@@ -909,17 +934,44 @@
- case TARGET_SO_SNDTIMEO:
- optname = SO_SNDTIMEO;
- break;
-- break;
-+ case TARGET_SO_LINGER:
-+ optname = SO_LINGER;
-+ break;
- default:
- goto unimplemented;
- }
-- if (optlen < sizeof(uint32_t))
-- return -TARGET_EINVAL;
--
-- if (get_user_u32(val, optval_addr))
-- return -TARGET_EFAULT;
-- ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
-- break;
-+ switch (optname) {
-+ /* Options with non-'int' argument. */
-+ case SO_RCVTIMEO:
-+ case SO_SNDTIMEO:
-+ {
-+ struct timeval tval;
-+ if(optlen < sizeof(struct target_timeval))
-+ return -TARGET_EINVAL;
-+ copy_from_user_timeval(&tval,optval_addr);
-+ ret = get_errno(setsockopt(sockfd, level, optname, &tval,sizeof(tval)));
-+ }
-+ break;
-+ case SO_LINGER:
-+ {
-+ struct linger tmp;
-+ if (optlen < sizeof(struct target_linger))
-+ return -TARGET_EINVAL;
-+ optname = SO_LINGER;
-+ target_to_host_linger(&tmp,optval_addr);
-+ ret = get_errno(setsockopt(sockfd, level, optname, &tmp, sizeof(tmp)));
-+ }
-+ break;
-+ /* All remaning options take an 'int' argument. */
-+ default:
-+ {
-+ if (optlen < sizeof(uint32_t))
-+ return -TARGET_EINVAL;
-+ val = get_user_u32(val, optval_addr);
-+ ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
-+ }
-+ break;
-+ }
- default:
- unimplemented:
- gemu_log("Unsupported setsockopt level=%d optname=%d \n", level, optname);
-@@ -939,10 +991,55 @@
- case TARGET_SOL_SOCKET:
- level = SOL_SOCKET;
- switch (optname) {
-- case TARGET_SO_LINGER:
-+ case TARGET_SO_LINGER: {
-+ if (get_user_u32(len, optlen))
-+ return -TARGET_EFAULT;
-+ if(len < sizeof(struct target_linger))
-+ return -TARGET_EINVAL;
-+ struct linger l;
-+ len=sizeof(l);
-+
-+ ret = get_errno(getsockopt(sockfd, level, optname, &l, &len));
-+ host_to_target_linger(optval_addr,&l);
-+ if (put_user_u32(sizeof(struct target_linger), optlen))
-+ return -TARGET_EFAULT;
-+ }
-+ break;
-+
- case TARGET_SO_RCVTIMEO:
-- case TARGET_SO_SNDTIMEO:
-- case TARGET_SO_PEERCRED:
-+ case TARGET_SO_SNDTIMEO: {
-+ if (get_user_u32(len, optlen))
-+ return -TARGET_EFAULT;
-+
-+ if(len < sizeof(struct target_timeval))
-+ return -TARGET_EINVAL;
-+ struct timeval tval;
-+ len=sizeof(tval);
-+
-+ ret = get_errno(getsockopt(sockfd, level, optname, &tval, &len));
-+ if (copy_to_user_timeval(optval_addr,&tval))
-+ return -TARGET_EFAULT;
-+
-+ if (put_user_u32(sizeof(struct target_timeval), optlen))
-+ return -TARGET_EFAULT;
-+ }
-+ break;
-+
-+ case TARGET_SO_PEERCRED: {
-+ struct ucred caller;
-+ socklen_t optlen = sizeof (caller);
-+ ret = get_errno(getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED,
-+ &caller, &optlen));
-+
-+ if (optlen != 0 && optval_addr != 0) {
-+ if (put_user_u32(caller.pid, optval_addr + 0) ||
-+ put_user_u32(caller.uid, optval_addr + 4) ||
-+ put_user_u32(caller.gid, optval_addr + 8))
-+ return -TARGET_EFAULT;
-+ }
-+ }
-+ break;
-+
- case TARGET_SO_PEERNAME:
- /* These don't just return a single integer */
- goto unimplemented;
-@@ -1193,17 +1290,25 @@
- void *addr;
- abi_long ret;
-
-- if (get_user_u32(addrlen, target_addrlen_addr))
-- return -TARGET_EINVAL;
--
-- addr = alloca(addrlen);
-+ if (target_addrlen_addr != (abi_ulong)NULL &&
-+ target_addr != (abi_ulong)NULL) {
-+ if (get_user_u32(addrlen, target_addrlen_addr))
-+ return -TARGET_EINVAL;
-+ addr = alloca(addrlen);
-+ ret = get_errno(accept(fd, addr, &addrlen));
-+ } else {
-+ ret = get_errno(accept(fd, NULL, NULL));
-+ return ret;
-+ }
-
-- ret = get_errno(accept(fd, addr, &addrlen));
- if (!is_error(ret)) {
-- host_to_target_sockaddr(target_addr, addr, addrlen);
-- if (put_user_u32(addrlen, target_addrlen_addr))
-- ret = -TARGET_EFAULT;
-- }
-+ if (target_addr != (abi_ulong)NULL)
-+ host_to_target_sockaddr(target_addr, addr, addrlen);
-+ if (target_addrlen_addr != (abi_ulong)NULL)
-+ if (put_user_u32(addrlen, target_addrlen_addr))
-+ ret = -TARGET_EFAULT;
-+ }
-+
- return ret;
- }
-
-Index: qemu/linux-user/syscall_defs.h
-===================================================================
---- qemu.orig/linux-user/syscall_defs.h 2008-08-11 12:02:12.000000000 -0300
-+++ qemu/linux-user/syscall_defs.h 2008-08-11 12:31:04.000000000 -0300
-@@ -114,6 +114,11 @@
- abi_long tv_nsec;
- };
-
-+struct target_linger {
-+ target_long l_onoff;
-+ target_long l_linger;
-+};
-+
- struct target_itimerval {
- struct target_timeval it_interval;
- struct target_timeval it_value;
Copied: tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch (from rev 43, trunk/patches/21_net_soopts.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/21_net_soopts.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,207 @@
+Index: qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-15 14:04:16.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-15 14:06:03.000000000 -0300
+@@ -828,6 +828,32 @@
+ return 0;
+ }
+
++static inline abi_long host_to_target_linger(target_ulong target_addr,
++ struct linger *host_l)
++{
++ struct target_linger *target_l;
++
++ if (!lock_user_struct(VERIFY_WRITE, target_l, target_addr, 0))
++ return -TARGET_EFAULT;
++ target_l->l_onoff = tswapl(host_l->l_onoff);
++ target_l->l_linger = tswapl(host_l->l_linger);
++ unlock_user_struct(target_l, target_addr, 1);
++ return 0;
++}
++
++static inline abi_long target_to_host_linger(struct linger *host_l,
++ target_ulong target_addr)
++{
++ struct target_linger *target_l;
++
++ if (!lock_user_struct(VERIFY_WRITE, target_l, target_addr, 1))
++ return -TARGET_EFAULT;
++ host_l->l_onoff = tswapl(target_l->l_onoff);
++ host_l->l_linger = tswapl(target_l->l_linger);
++ unlock_user_struct(target_l, target_addr, 0);
++ return 0;
++}
++
+ /* do_setsockopt() Must return target values and target errnos. */
+ static abi_long do_setsockopt(int sockfd, int level, int optname,
+ abi_ulong optval_addr, socklen_t optlen)
+@@ -878,7 +904,6 @@
+ break;
+ case TARGET_SOL_SOCKET:
+ switch (optname) {
+- /* Options with 'int' argument. */
+ case TARGET_SO_DEBUG:
+ optname = SO_DEBUG;
+ break;
+@@ -935,16 +960,44 @@
+ case TARGET_SO_SNDTIMEO:
+ optname = SO_SNDTIMEO;
+ break;
+- break;
++ case TARGET_SO_LINGER:
++ optname = SO_LINGER;
++ break;
+ default:
+ goto unimplemented;
+ }
+- if (optlen < sizeof(uint32_t))
+- return -TARGET_EINVAL;
+-
+- if (get_user_u32(val, optval_addr))
+- return -TARGET_EFAULT;
+- ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
++ switch (optname) {
++ /* Options with non-'int' argument. */
++ case SO_RCVTIMEO:
++ case SO_SNDTIMEO:
++ {
++ struct timeval tval;
++ if(optlen < sizeof(struct target_timeval))
++ return -TARGET_EINVAL;
++ copy_from_user_timeval(&tval,optval_addr);
++ ret = get_errno(setsockopt(sockfd, level, optname, &tval,sizeof(tval)));
++ }
++ break;
++ case SO_LINGER:
++ {
++ struct linger tmp;
++ if (optlen < sizeof(struct target_linger))
++ return -TARGET_EINVAL;
++ optname = SO_LINGER;
++ target_to_host_linger(&tmp,optval_addr);
++ ret = get_errno(setsockopt(sockfd, level, optname, &tmp, sizeof(tmp)));
++ }
++ break;
++ /* All remaning options take an 'int' argument. */
++ default:
++ {
++ if (optlen < sizeof(uint32_t))
++ return -TARGET_EINVAL;
++ val = get_user_u32(val, optval_addr);
++ ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
++ }
++ break;
++ }
+ break;
+ default:
+ unimplemented:
+@@ -966,10 +1019,55 @@
+ case TARGET_SOL_SOCKET:
+ level = SOL_SOCKET;
+ switch (optname) {
+- case TARGET_SO_LINGER:
++ case TARGET_SO_LINGER: {
++ if (get_user_u32(len, optlen))
++ return -TARGET_EFAULT;
++ if(len < sizeof(struct target_linger))
++ return -TARGET_EINVAL;
++ struct linger l;
++ len=sizeof(l);
++
++ ret = get_errno(getsockopt(sockfd, level, optname, &l, &len));
++ host_to_target_linger(optval_addr,&l);
++ if (put_user_u32(sizeof(struct target_linger), optlen))
++ return -TARGET_EFAULT;
++ }
++ break;
++
+ case TARGET_SO_RCVTIMEO:
+- case TARGET_SO_SNDTIMEO:
+- case TARGET_SO_PEERCRED:
++ case TARGET_SO_SNDTIMEO: {
++ if (get_user_u32(len, optlen))
++ return -TARGET_EFAULT;
++
++ if(len < sizeof(struct target_timeval))
++ return -TARGET_EINVAL;
++ struct timeval tval;
++ len=sizeof(tval);
++
++ ret = get_errno(getsockopt(sockfd, level, optname, &tval, &len));
++ if (copy_to_user_timeval(optval_addr,&tval))
++ return -TARGET_EFAULT;
++
++ if (put_user_u32(sizeof(struct target_timeval), optlen))
++ return -TARGET_EFAULT;
++ }
++ break;
++
++ case TARGET_SO_PEERCRED: {
++ struct ucred caller;
++ socklen_t optlen = sizeof (caller);
++ ret = get_errno(getsockopt(sockfd, SOL_SOCKET, SO_PEERCRED,
++ &caller, &optlen));
++
++ if (optlen != 0 && optval_addr != 0) {
++ if (put_user_u32(caller.pid, optval_addr + 0) ||
++ put_user_u32(caller.uid, optval_addr + 4) ||
++ put_user_u32(caller.gid, optval_addr + 8))
++ return -TARGET_EFAULT;
++ }
++ }
++ break;
++
+ case TARGET_SO_PEERNAME:
+ /* These don't just return a single integer */
+ goto unimplemented;
+@@ -1220,17 +1318,25 @@
+ void *addr;
+ abi_long ret;
+
+- if (get_user_u32(addrlen, target_addrlen_addr))
+- return -TARGET_EINVAL;
+-
+- addr = alloca(addrlen);
++ if (target_addrlen_addr != (abi_ulong)NULL &&
++ target_addr != (abi_ulong)NULL) {
++ if (get_user_u32(addrlen, target_addrlen_addr))
++ return -TARGET_EINVAL;
++ addr = alloca(addrlen);
++ ret = get_errno(accept(fd, addr, &addrlen));
++ } else {
++ ret = get_errno(accept(fd, NULL, NULL));
++ return ret;
++ }
+
+- ret = get_errno(accept(fd, addr, &addrlen));
+ if (!is_error(ret)) {
+- host_to_target_sockaddr(target_addr, addr, addrlen);
+- if (put_user_u32(addrlen, target_addrlen_addr))
+- ret = -TARGET_EFAULT;
+- }
++ if (target_addr != (abi_ulong)NULL)
++ host_to_target_sockaddr(target_addr, addr, addrlen);
++ if (target_addrlen_addr != (abi_ulong)NULL)
++ if (put_user_u32(addrlen, target_addrlen_addr))
++ ret = -TARGET_EFAULT;
++ }
++
+ return ret;
+ }
+
+Index: qemu-arm-eabi/linux-user/syscall_defs.h
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall_defs.h 2008-10-15 14:04:04.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall_defs.h 2008-10-15 14:04:45.000000000 -0300
+@@ -114,6 +114,11 @@
+ abi_long tv_nsec;
+ };
+
++struct target_linger {
++ target_long l_onoff;
++ target_long l_linger;
++};
++
+ struct target_itimerval {
+ struct target_timeval it_interval;
+ struct target_timeval it_value;
Copied: tags/qemu-arm-eabi-0.3/patches/22_IPCOP_msg.patch (from rev 30, trunk/patches/22_IPCOP_msg.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/22_IPCOP_msg.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/22_IPCOP_msg.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,285 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:17 +0300
+Subject: [Qemu-devel] [PATCH] Fix and cleanup IPCOP_msg* ipc calls handling
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 173 ++++++++++++++++++++++++++++++++++----------------
+ 1 files changed, 117 insertions(+), 56 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index a8eb6d3..c048843 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -1611,7 +1611,6 @@ static abi_long do_socketcall(int num, abi_ulong vptr)
+ }
+ #endif
+
+-#ifdef TARGET_NR_ipc
+ #define N_SHM_REGIONS 32
+
+ static struct shm_region {
+@@ -1845,20 +1844,26 @@ static inline abi_long do_semctl(int first, int second, int third,
+
+ struct target_msqid_ds
+ {
+- struct target_ipc_perm msg_perm;
+- abi_ulong msg_stime;
+- abi_ulong __unused1;
+- abi_ulong msg_rtime;
+- abi_ulong __unused2;
+- abi_ulong msg_ctime;
+- abi_ulong __unused3;
+- abi_ulong __msg_cbytes;
+- abi_ulong msg_qnum;
+- abi_ulong msg_qbytes;
+- abi_ulong msg_lspid;
+- abi_ulong msg_lrpid;
+- abi_ulong __unused4;
+- abi_ulong __unused5;
++ struct target_ipc_perm msg_perm;
++ abi_ulong msg_stime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused1;
++#endif
++ abi_ulong msg_rtime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused2;
++#endif
++ abi_ulong msg_ctime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused3;
++#endif
++ abi_ulong __msg_cbytes;
++ abi_ulong msg_qnum;
++ abi_ulong msg_qbytes;
++ abi_ulong msg_lspid;
++ abi_ulong msg_lrpid;
++ abi_ulong __unused4;
++ abi_ulong __unused5;
+ };
+
+ static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
+@@ -1868,7 +1873,8 @@ static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
+
+ if (!lock_user_struct(VERIFY_READ, target_md, target_addr, 1))
+ return -TARGET_EFAULT;
+- target_to_host_ipc_perm(&(host_md->msg_perm),target_addr);
++ if (target_to_host_ipc_perm(&(host_md->msg_perm),target_addr))
++ return -TARGET_EFAULT;
+ host_md->msg_stime = tswapl(target_md->msg_stime);
+ host_md->msg_rtime = tswapl(target_md->msg_rtime);
+ host_md->msg_ctime = tswapl(target_md->msg_ctime);
+@@ -1888,7 +1894,8 @@ static inline abi_long host_to_target_msqid_ds(abi_ulong target_addr,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_md, target_addr, 0))
+ return -TARGET_EFAULT;
+- host_to_target_ipc_perm(target_addr,&(host_md->msg_perm));
++ if (host_to_target_ipc_perm(target_addr,&(host_md->msg_perm)))
++ return -TARGET_EFAULT;
+ target_md->msg_stime = tswapl(host_md->msg_stime);
+ target_md->msg_rtime = tswapl(host_md->msg_rtime);
+ target_md->msg_ctime = tswapl(host_md->msg_ctime);
+@@ -1901,26 +1908,69 @@ static inline abi_long host_to_target_msqid_ds(abi_ulong target_addr,
+ return 0;
+ }
+
+-static inline abi_long do_msgctl(int first, int second, abi_long ptr)
++struct target_msginfo {
++ int msgpool;
++ int msgmap;
++ int msgmax;
++ int msgmnb;
++ int msgmni;
++ int msgssz;
++ int msgtql;
++ unsigned short int msgseg;
++};
++
++static inline abi_long host_to_target_msginfo(abi_ulong target_addr,
++ struct msginfo *host_msginfo)
++{
++ struct target_msginfo *target_msginfo;
++ if (!lock_user_struct(VERIFY_WRITE, target_msginfo, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_msginfo->msgpool, &target_msginfo->msgpool);
++ __put_user(host_msginfo->msgmap, &target_msginfo->msgmap);
++ __put_user(host_msginfo->msgmax, &target_msginfo->msgmax);
++ __put_user(host_msginfo->msgmnb, &target_msginfo->msgmnb);
++ __put_user(host_msginfo->msgmni, &target_msginfo->msgmni);
++ __put_user(host_msginfo->msgssz, &target_msginfo->msgssz);
++ __put_user(host_msginfo->msgtql, &target_msginfo->msgtql);
++ __put_user(host_msginfo->msgseg, &target_msginfo->msgseg);
++ unlock_user_struct(target_msginfo, target_addr, 1);
++}
++
++static inline abi_long do_msgctl(int msgid, int cmd, abi_long ptr)
+ {
+ struct msqid_ds dsarg;
+- int cmd = second&0xff;
+- abi_long ret = 0;
+- switch( cmd ) {
++ struct msginfo msginfo;
++ abi_long ret = -TARGET_EINVAL;
++
++ cmd &= 0xff;
++
++ switch (cmd) {
+ case IPC_STAT:
+ case IPC_SET:
+- target_to_host_msqid_ds(&dsarg,ptr);
+- ret = get_errno(msgctl(first, cmd, &dsarg));
+- host_to_target_msqid_ds(ptr,&dsarg);
+- default:
+- ret = get_errno(msgctl(first, cmd, &dsarg));
++ case MSG_STAT:
++ if (target_to_host_msqid_ds(&dsarg,ptr))
++ return -TARGET_EFAULT;
++ ret = get_errno(msgctl(msgid, cmd, &dsarg));
++ if (host_to_target_msqid_ds(ptr,&dsarg))
++ return -TARGET_EFAULT;
++ break;
++ case IPC_RMID:
++ ret = get_errno(msgctl(msgid, cmd, NULL));
++ break;
++ case IPC_INFO:
++ case MSG_INFO:
++ ret = get_errno(msgctl(msgid, cmd, (struct msqid_ds *)&msginfo));
++ if (host_to_target_msginfo(ptr, &msginfo))
++ return -TARGET_EFAULT;
++ break;
+ }
++
+ return ret;
+ }
+
+ struct target_msgbuf {
+- abi_ulong mtype;
+- char mtext[1];
++ abi_long mtype;
++ char mtext[1];
+ };
+
+ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+@@ -1933,8 +1983,8 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+ if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0))
+ return -TARGET_EFAULT;
+ host_mb = malloc(msgsz+sizeof(long));
+- host_mb->mtype = tswapl(target_mb->mtype);
+- memcpy(host_mb->mtext,target_mb->mtext,msgsz);
++ host_mb->mtype = (abi_long) tswapl(target_mb->mtype);
++ memcpy(host_mb->mtext, target_mb->mtext, msgsz);
+ ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));
+ free(host_mb);
+ unlock_user_struct(target_mb, msgp, 0);
+@@ -1943,7 +1993,7 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+ }
+
+ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+- unsigned int msgsz, int msgtype,
++ unsigned int msgsz, abi_long msgtyp,
+ int msgflg)
+ {
+ struct target_msgbuf *target_mb;
+@@ -1953,8 +2003,10 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_mb, msgp, 0))
+ return -TARGET_EFAULT;
++
+ host_mb = malloc(msgsz+sizeof(long));
+- ret = get_errno(msgrcv(msqid, host_mb, msgsz, 1, msgflg));
++ ret = get_errno(msgrcv(msqid, host_mb, msgsz, tswapl(msgtyp), msgflg));
++
+ if (ret > 0) {
+ abi_ulong target_mtext_addr = msgp + sizeof(abi_ulong);
+ target_mtext = lock_user(VERIFY_WRITE, target_mtext_addr, ret, 0);
+@@ -1962,9 +2014,10 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+ ret = -TARGET_EFAULT;
+ goto end;
+ }
+- memcpy(target_mb->mtext, host_mb->mtext, ret);
++ memcpy(target_mb->mtext, host_mb->mtext, ret);
+ unlock_user(target_mtext, target_mtext_addr, ret);
+ }
++
+ target_mb->mtype = tswapl(host_mb->mtype);
+ free(host_mb);
+
+@@ -1974,6 +2027,7 @@ end:
+ return ret;
+ }
+
++#ifdef TARGET_NR_ipc
+ /* ??? This only works with linear mappings. */
+ /* do_ipc() must return target values and target errnos. */
+ static abi_long do_ipc(unsigned int call, int first,
+@@ -2006,34 +2060,41 @@ static abi_long do_ipc(unsigned int call, int first,
+ ret = -TARGET_ENOSYS;
+ break;
+
+- case IPCOP_msgget:
+- ret = get_errno(msgget(first, second));
+- break;
++ case IPCOP_msgget:
++ ret = get_errno(msgget(first, second));
++ break;
+
+- case IPCOP_msgsnd:
+- ret = do_msgsnd(first, ptr, second, third);
+- break;
++ case IPCOP_msgsnd:
++ ret = do_msgsnd(first, ptr, second, third);
++ break;
+
+- case IPCOP_msgctl:
+- ret = do_msgctl(first, second, ptr);
+- break;
++ case IPCOP_msgctl:
++ ret = do_msgctl(first, second, ptr);
++ break;
+
+- case IPCOP_msgrcv:
+- {
+- /* XXX: this code is not correct */
+- struct ipc_kludge
+- {
+- void *__unbounded msgp;
+- long int msgtyp;
+- };
++ case IPCOP_msgrcv:
++ switch (version) {
++ case 0:
++ {
++ struct target_ipc_kludge {
++ abi_long msgp;
++ abi_long msgtyp;
++ } *tmp;
+
+- struct ipc_kludge *foo = (struct ipc_kludge *)g2h(ptr);
+- struct msgbuf *msgp = (struct msgbuf *) foo->msgp;
++ if (!lock_user_struct(VERIFY_READ, tmp, ptr, 1)) {
++ ret = -TARGET_EFAULT;
++ break;
++ }
+
+- ret = do_msgrcv(first, (long)msgp, second, 0, third);
++ ret = do_msgrcv(first, tmp->msgp, second, tmp->msgtyp, third);
+
+- }
+- break;
++ unlock_user_struct(tmp, ptr, 0);
++ break;
++ }
++ default:
++ ret = do_msgrcv(first, ptr, second, fifth, third);
++ }
++ break;
+
+ case IPCOP_shmat:
+ {
+--
+1.5.6.5.GIT
+
+
+
Deleted: tags/qemu-arm-eabi-0.3/patches/23_futimesat.patch
===================================================================
--- trunk/patches/23_futimesat.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ tags/qemu-arm-eabi-0.3/patches/23_futimesat.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -1,49 +0,0 @@
-Index: qemu/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:32:19.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:32:54.000000000 -0300
-@@ -154,6 +154,7 @@
- #define __NR_sys_faccessat __NR_faccessat
- #define __NR_sys_fchmodat __NR_fchmodat
- #define __NR_sys_fchownat __NR_fchownat
-+#define __NR_sys_futimesat __NR_futimesat
- #define __NR_sys_getcwd1 __NR_getcwd
- #define __NR_sys_getdents __NR_getdents
- #define __NR_sys_getdents64 __NR_getdents64
-@@ -198,6 +199,10 @@
- _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
- uid_t,owner,gid_t,group,int,flags)
- #endif
-+#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat)
-+_syscall3(int,sys_futimesat,int,dirfd,const char *,pathname,
-+ const struct timeval *,times)
-+#endif
- _syscall2(int,sys_getcwd1,char *,buf,size_t,size)
- _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count);
- #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
-@@ -5847,6 +5852,25 @@
- break;
- #endif
-
-+#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat)
-+ case TARGET_NR_futimesat:
-+ {
-+ struct timeval tv[2];
-+ if (copy_from_user_timeval(tv, arg3)
-+ || copy_from_user_timeval(tv+1, arg3+sizeof(struct target_timeval))) {
-+ goto efault;
-+ }
-+ if (!arg2)
-+ ret = get_errno(sys_futimesat(arg1, NULL, tv));
-+ else {
-+ p = lock_user_string(arg2);
-+ ret = get_errno(sys_futimesat(arg1, path(p), tv));
-+ unlock_user(p, arg2, 0);
-+ }
-+ }
-+ break;
-+#endif
-+
- #ifdef TARGET_NR_set_robust_list
- case TARGET_NR_set_robust_list:
- goto unimplemented_nowarn;
Copied: tags/qemu-arm-eabi-0.3/patches/23_msg_syscalls.patch (from rev 30, trunk/patches/23_msg_syscalls.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/23_msg_syscalls.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/23_msg_syscalls.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,47 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:18 +0300
+Subject: [Qemu-devel] [PATCH] Implement msg* syscalls
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index c048843..4e471df 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -4829,6 +4829,27 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ ret = do_ipc(arg1, arg2, arg3, arg4, arg5, arg6);
+ break;
+ #endif
++
++#ifdef TARGET_NR_msgctl
++ case TARGET_NR_msgctl:
++ ret = do_msgctl(arg1, arg2, arg3);
++ break;
++#endif
++#ifdef TARGET_NR_msgget
++ case TARGET_NR_msgget:
++ ret = get_errno(msgget(arg1, arg2));
++ break;
++#endif
++#ifdef TARGET_NR_msgrcv
++ case TARGET_NR_msgrcv:
++ ret = do_msgrcv(arg1, arg2, arg3, arg4, arg5);
++ break;
++#endif
++#ifdef TARGET_NR_msgsnd
++ case TARGET_NR_msgsnd:
++ ret = do_msgsnd(arg1, arg2, arg3, arg4);
++ break;
++#endif
+ case TARGET_NR_fsync:
+ ret = get_errno(fsync(arg1));
+ break;
+--
+1.5.6.5.GIT
+
+
+
Copied: tags/qemu-arm-eabi-0.3/patches/24_IPCOP_sem.patch (from rev 30, trunk/patches/24_IPCOP_sem.patch)
===================================================================
--- tags/qemu-arm-eabi-0.3/patches/24_IPCOP_sem.patch (rev 0)
+++ tags/qemu-arm-eabi-0.3/patches/24_IPCOP_sem.patch 2008-10-15 18:30:23 UTC (rev 46)
@@ -0,0 +1,405 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:19 +0300
+Subject: [Qemu-devel] [PATCH] Fix and cleanup IPCOP_sem* ipc calls handling
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 319 +++++++++++++++++++++++++++++++-------------------
+ 1 files changed, 198 insertions(+), 121 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 4e471df..f054ae4 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -1635,14 +1635,14 @@ struct target_ipc_perm
+
+ struct target_semid_ds
+ {
+- struct target_ipc_perm sem_perm;
+- abi_ulong sem_otime;
+- abi_ulong __unused1;
+- abi_ulong sem_ctime;
+- abi_ulong __unused2;
+- abi_ulong sem_nsems;
+- abi_ulong __unused3;
+- abi_ulong __unused4;
++ struct target_ipc_perm sem_perm;
++ abi_ulong sem_otime;
++ abi_ulong __unused1;
++ abi_ulong sem_ctime;
++ abi_ulong __unused2;
++ abi_ulong sem_nsems;
++ abi_ulong __unused3;
++ abi_ulong __unused4;
+ };
+
+ static inline abi_long target_to_host_ipc_perm(struct ipc_perm *host_ip,
+@@ -1690,7 +1690,8 @@ static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
+
+ if (!lock_user_struct(VERIFY_READ, target_sd, target_addr, 1))
+ return -TARGET_EFAULT;
+- target_to_host_ipc_perm(&(host_sd->sem_perm),target_addr);
++ if (target_to_host_ipc_perm(&(host_sd->sem_perm),target_addr))
++ return -TARGET_EFAULT;
+ host_sd->sem_nsems = tswapl(target_sd->sem_nsems);
+ host_sd->sem_otime = tswapl(target_sd->sem_otime);
+ host_sd->sem_ctime = tswapl(target_sd->sem_ctime);
+@@ -1705,7 +1706,8 @@ static inline abi_long host_to_target_semid_ds(abi_ulong target_addr,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0))
+ return -TARGET_EFAULT;
+- host_to_target_ipc_perm(target_addr,&(host_sd->sem_perm));
++ if (host_to_target_ipc_perm(target_addr,&(host_sd->sem_perm)))
++ return -TARGET_EFAULT;;
+ target_sd->sem_nsems = tswapl(host_sd->sem_nsems);
+ target_sd->sem_otime = tswapl(host_sd->sem_otime);
+ target_sd->sem_ctime = tswapl(host_sd->sem_ctime);
+@@ -1713,135 +1715,215 @@ static inline abi_long host_to_target_semid_ds(abi_ulong target_addr,
+ return 0;
+ }
+
++struct target_seminfo {
++ int semmap;
++ int semmni;
++ int semmns;
++ int semmnu;
++ int semmsl;
++ int semopm;
++ int semume;
++ int semusz;
++ int semvmx;
++ int semaem;
++};
++
++static inline abi_long host_to_target_seminfo(abi_ulong target_addr,
++ struct seminfo *host_seminfo)
++{
++ struct target_seminfo *target_seminfo;
++ if (!lock_user_struct(VERIFY_WRITE, target_seminfo, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_seminfo->semmap, &target_seminfo->semmap);
++ __put_user(host_seminfo->semmni, &target_seminfo->semmni);
++ __put_user(host_seminfo->semmns, &target_seminfo->semmns);
++ __put_user(host_seminfo->semmnu, &target_seminfo->semmnu);
++ __put_user(host_seminfo->semmsl, &target_seminfo->semmsl);
++ __put_user(host_seminfo->semopm, &target_seminfo->semopm);
++ __put_user(host_seminfo->semume, &target_seminfo->semume);
++ __put_user(host_seminfo->semusz, &target_seminfo->semusz);
++ __put_user(host_seminfo->semvmx, &target_seminfo->semvmx);
++ __put_user(host_seminfo->semaem, &target_seminfo->semaem);
++ unlock_user_struct(target_seminfo, target_addr, 1);
++ return 0;
++}
++
+ union semun {
+- int val;
+- struct semid_ds *buf;
+- unsigned short *array;
++ int val;
++ struct semid_ds *buf;
++ unsigned short *array;
++ struct seminfo *__buf;
+ };
+
+ union target_semun {
+- int val;
+- abi_long buf;
+- unsigned short int *array;
++ int val;
++ abi_ulong buf;
++ abi_ulong array;
++ abi_ulong __buf;
+ };
+
+-static inline abi_long target_to_host_semun(int cmd,
+- union semun *host_su,
+- abi_ulong target_addr,
+- struct semid_ds *ds)
++static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
++ abi_ulong target_addr)
+ {
+- union target_semun *target_su;
+-
+- switch( cmd ) {
+- case IPC_STAT:
+- case IPC_SET:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- target_to_host_semid_ds(ds,target_su->buf);
+- host_su->buf = ds;
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- case GETVAL:
+- case SETVAL:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- host_su->val = tswapl(target_su->val);
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- case GETALL:
+- case SETALL:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- *host_su->array = tswap16(*target_su->array);
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- default:
+- gemu_log("semun operation not fully supported: %d\n", (int)cmd);
++ int nsems;
++ unsigned short *array;
++ union semun semun;
++ struct semid_ds semid_ds;
++ int i, ret;
++
++ semun.buf = &semid_ds;
++
++ ret = semctl(semid, 0, IPC_STAT, semun);
++ if (ret == -1)
++ return get_errno(ret);
++
++ nsems = semid_ds.sem_nsems;
++
++ *host_array = malloc(nsems*sizeof(unsigned short));
++ array = lock_user(VERIFY_READ, target_addr,
++ nsems*sizeof(unsigned short), 1);
++ if (!array)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsems; i++) {
++ __get_user((*host_array)[i], &array[i]);
+ }
++ unlock_user(array, target_addr, 0);
++
+ return 0;
+ }
+
+-static inline abi_long host_to_target_semun(int cmd,
+- abi_ulong target_addr,
+- union semun *host_su,
+- struct semid_ds *ds)
++static inline abi_long host_to_target_semarray(int semid, abi_ulong target_addr,
++ unsigned short **host_array)
+ {
+- union target_semun *target_su;
+-
+- switch( cmd ) {
+- case IPC_STAT:
+- case IPC_SET:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- host_to_target_semid_ds(target_su->buf,ds);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- case GETVAL:
+- case SETVAL:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- target_su->val = tswapl(host_su->val);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- case GETALL:
+- case SETALL:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- *target_su->array = tswap16(*host_su->array);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- default:
+- gemu_log("semun operation not fully supported: %d\n", (int)cmd);
++ int nsems;
++ unsigned short *array;
++ union semun semun;
++ struct semid_ds semid_ds;
++ int i, ret;
++
++ semun.buf = &semid_ds;
++
++ ret = semctl(semid, 0, IPC_STAT, semun);
++ if (ret == -1)
++ return get_errno(ret);
++
++ nsems = semid_ds.sem_nsems;
++
++ array = lock_user(VERIFY_WRITE, target_addr,
++ nsems*sizeof(unsigned short), 0);
++ if (!array)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsems; i++) {
++ __put_user((*host_array)[i], &array[i]);
+ }
++ free(*host_array);
++ unlock_user(array, target_addr, 1);
++
+ return 0;
+ }
+
+-static inline abi_long do_semctl(int first, int second, int third,
+- abi_long ptr)
++static inline abi_long do_semctl(int semid, int semnum, int cmd,
++ union target_semun target_su)
+ {
+ union semun arg;
+ struct semid_ds dsarg;
+- int cmd = third&0xff;
+- abi_long ret = 0;
++ unsigned short *array;
++ struct seminfo seminfo;
++ abi_long ret = -TARGET_EINVAL;
++ abi_long err;
+
+- switch( cmd ) {
+- case GETVAL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case SETVAL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case GETALL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case SETALL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case IPC_STAT:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case IPC_SET:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- default:
+- ret = get_errno(semctl(first, second, cmd, arg));
++ cmd &= 0xff;
++
++ switch (cmd) {
++ case IPC_STAT:
++ case IPC_SET:
++ case SEM_STAT:
++ err = target_to_host_semid_ds(&dsarg, target_su.buf);
++ if (err)
++ return err;
++ arg.buf = &dsarg;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_semid_ds(target_su.buf, &dsarg);
++ if (err)
++ return err;
++ break;
++ case GETVAL:
++ case SETVAL:
++ arg.val = tswapl(target_su.val);
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ target_su.val = tswapl(arg.val);
++ break;
++ case GETALL:
++ case SETALL:
++ err = target_to_host_semarray(semid, &array, target_su.array);
++ if (err)
++ return err;
++ arg.array = array;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_semarray(semid, target_su.array, &array);
++ if (err)
++ return err;
++ break;
++ case IPC_INFO:
++ case SEM_INFO:
++ arg.__buf = &seminfo;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_seminfo(target_su.__buf, &seminfo);
++ if (err)
++ return err;
++ break;
++ case IPC_RMID:
++ case GETPID:
++ case GETNCNT:
++ case GETZCNT:
++ ret = get_errno(semctl(semid, semnum, cmd, NULL));
++ break;
+ }
+
+ return ret;
+ }
+
++struct target_sembuf {
++ unsigned short sem_num;
++ short sem_op;
++ short sem_flg;
++};
++
++static inline abi_long target_to_host_sembuf(struct sembuf *host_sembuf,
++ abi_ulong target_addr,
++ unsigned nsops)
++{
++ struct target_sembuf *target_sembuf;
++ int i;
++
++ target_sembuf = lock_user(VERIFY_READ, target_addr,
++ nsops*sizeof(struct target_sembuf), 1);
++ if (!target_sembuf)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsops; i++) {
++ __put_user(target_sembuf[i].sem_num, &host_sembuf[i].sem_num);
++ __put_user(target_sembuf[i].sem_op, &host...
[truncated message content] |
|
From: <la...@us...> - 2008-10-15 18:24:47
|
Revision: 45
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=45&view=rev
Author: laurov
Date: 2008-10-15 18:24:42 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Update the readme.
Modified Paths:
--------------
trunk/README
Modified: trunk/README
===================================================================
--- trunk/README 2008-10-15 17:47:03 UTC (rev 44)
+++ trunk/README 2008-10-15 18:24:42 UTC (rev 45)
@@ -1,23 +1,20 @@
HOW TO GET:
-export QUILT_PATCHES=../patches
-svn co -r4993 svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
-cd qemu-arm-eabi
-quilt push -a
-
-or run the script
+Run the script
./get-qemu.sh
HOWTO COMPILE:
In Debian/Ubuntu you will need the packages:
-build-essential gcc-3.4 subversion zlib1g-dev libsdl1.2-dev
+build-essential gcc-3.4 zlib1g-dev libsdl1.2-dev
-$ ./configure --target-list=arm-linux-user --static
-$ make
-
-or run the script
+Run the script
./build-qemu-arm-eabi.sh
INSTALLING ON SCRATCHBOX
+Run the script
+./install-on-scratchbox.sh
+
+or
+
1. Copy the compiled qemu to scratchbox
$ sudo cp qemu-arm-eabi/arm-linux-user/qemu-arm /scratchbox/devkits/cputransp/bin/qemu-arm-eabi
@@ -38,16 +35,6 @@
accepts ':', as any normal person would)
patch < fakeroot.patch
-or run the script
-./install-on-scratchbox.sh
-HOWTO UPDATE QEMU-ARM-EABI
-This version of qemu-arm-eabi was based on the latest qemu version at the time of its doing, which was svn trunk in revision 4993.
-To update proceed like this:
-$ cd qemu-arm-eabi-0.2/qemu-arm-eabi
-$ rm * .pc -rf
-$ svn up
-$ export QUILT_PATCHES=../patches
-$ quilt push -a
-Solve the possible conflicts.
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-15 18:13:23
|
Revision: 43
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=43&view=rev
Author: laurov
Date: 2008-10-15 17:46:17 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Fix setsockopt: add a missing break.
Modified Paths:
--------------
trunk/patches/21_net_soopts.patch
Modified: trunk/patches/21_net_soopts.patch
===================================================================
--- trunk/patches/21_net_soopts.patch 2008-10-14 14:39:38 UTC (rev 42)
+++ trunk/patches/21_net_soopts.patch 2008-10-15 17:46:17 UTC (rev 43)
@@ -1,8 +1,8 @@
Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:31:02.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:31:04.000000000 -0300
-@@ -802,6 +802,32 @@
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-15 14:04:16.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-15 14:06:03.000000000 -0300
+@@ -828,6 +828,32 @@
return 0;
}
@@ -35,7 +35,7 @@
/* do_setsockopt() Must return target values and target errnos. */
static abi_long do_setsockopt(int sockfd, int level, int optname,
abi_ulong optval_addr, socklen_t optlen)
-@@ -852,7 +878,6 @@
+@@ -878,7 +904,6 @@
break;
case TARGET_SOL_SOCKET:
switch (optname) {
@@ -43,7 +43,7 @@
case TARGET_SO_DEBUG:
optname = SO_DEBUG;
break;
-@@ -909,17 +934,44 @@
+@@ -935,16 +960,44 @@
case TARGET_SO_SNDTIMEO:
optname = SO_SNDTIMEO;
break;
@@ -60,7 +60,6 @@
- if (get_user_u32(val, optval_addr))
- return -TARGET_EFAULT;
- ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
-- break;
+ switch (optname) {
+ /* Options with non-'int' argument. */
+ case SO_RCVTIMEO:
@@ -92,11 +91,11 @@
+ ret = get_errno(setsockopt(sockfd, SOL_SOCKET, optname, &val, sizeof(val)));
+ }
+ break;
-+ }
++ }
+ break;
default:
unimplemented:
- gemu_log("Unsupported setsockopt level=%d optname=%d \n", level, optname);
-@@ -939,10 +991,55 @@
+@@ -966,10 +1019,55 @@
case TARGET_SOL_SOCKET:
level = SOL_SOCKET;
switch (optname) {
@@ -155,7 +154,7 @@
case TARGET_SO_PEERNAME:
/* These don't just return a single integer */
goto unimplemented;
-@@ -1193,17 +1290,25 @@
+@@ -1220,17 +1318,25 @@
void *addr;
abi_long ret;
@@ -190,10 +189,10 @@
return ret;
}
-Index: qemu/linux-user/syscall_defs.h
+Index: qemu-arm-eabi/linux-user/syscall_defs.h
===================================================================
---- qemu.orig/linux-user/syscall_defs.h 2008-08-11 12:02:12.000000000 -0300
-+++ qemu/linux-user/syscall_defs.h 2008-08-11 12:31:04.000000000 -0300
+--- qemu-arm-eabi.orig/linux-user/syscall_defs.h 2008-10-15 14:04:04.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall_defs.h 2008-10-15 14:04:45.000000000 -0300
@@ -114,6 +114,11 @@
abi_long tv_nsec;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-15 17:49:51
|
Revision: 44
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=44&view=rev
Author: laurov
Date: 2008-10-15 17:47:03 +0000 (Wed, 15 Oct 2008)
Log Message:
-----------
Do not call apt-get inside build scripts.
Modified Paths:
--------------
trunk/build-qemu-arm-eabi.sh
Modified: trunk/build-qemu-arm-eabi.sh
===================================================================
--- trunk/build-qemu-arm-eabi.sh 2008-10-15 17:46:17 UTC (rev 43)
+++ trunk/build-qemu-arm-eabi.sh 2008-10-15 17:47:03 UTC (rev 44)
@@ -2,8 +2,6 @@
echo "** Build qemu-arm-eabi **"
-sudo apt-get install -y --force-yes build-essential gcc-3.4 subversion zlib1g-dev libsdl1.2-dev
-
cd qemu-arm-eabi
./configure --target-list=arm-linux-user --static
make
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-14 14:39:56
|
Revision: 42
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=42&view=rev
Author: laurov
Date: 2008-10-14 14:39:38 +0000 (Tue, 14 Oct 2008)
Log Message:
-----------
clone syscall: implement CLONE_CHILD_CLEARTID.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/40_clone_child_cleartid.patch
Added: trunk/patches/40_clone_child_cleartid.patch
===================================================================
--- trunk/patches/40_clone_child_cleartid.patch (rev 0)
+++ trunk/patches/40_clone_child_cleartid.patch 2008-10-14 14:39:38 UTC (rev 42)
@@ -0,0 +1,55 @@
+Index: qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-13 19:10:54.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-13 19:31:01.000000000 -0300
+@@ -3177,6 +3177,7 @@
+ pthread_cond_t cond;
+ pthread_t thread;
+ uint32_t tid;
++ unsigned int flags;
+ abi_ulong child_tidptr;
+ abi_ulong parent_tidptr;
+ sigset_t sigmask;
+@@ -3190,9 +3191,11 @@
+ env = info->env;
+ thread_env = env;
+ info->tid = gettid();
+- if (info->child_tidptr)
++ if (info->flags & CLONE_CHILD_SETTID)
+ put_user_u32(info->tid, info->child_tidptr);
+- if (info->parent_tidptr)
++ if (info->flags & CLONE_CHILD_CLEARTID)
++ set_tid_address(g2h(info->child_tidptr));
++ if (info->flags & CLONE_PARENT_SETTID)
+ put_user_u32(info->tid, info->parent_tidptr);
+ /* Enable signals. */
+ sigprocmask(SIG_SETMASK, &info->sigmask, NULL);
+@@ -3257,7 +3260,6 @@
+ nptl_flags = flags;
+ flags &= ~CLONE_NPTL_FLAGS2;
+
+- /* TODO: Implement CLONE_CHILD_CLEARTID. */
+ if (nptl_flags & CLONE_SETTLS)
+ cpu_set_tls (new_env, newtls);
+
+@@ -3269,7 +3271,9 @@
+ pthread_mutex_lock(&info.mutex);
+ pthread_cond_init(&info.cond, NULL);
+ info.env = new_env;
+- if (nptl_flags & CLONE_CHILD_SETTID)
++ info.flags = nptl_flags;
++ if (nptl_flags & CLONE_CHILD_SETTID ||
++ nptl_flags & CLONE_CHILD_CLEARTID)
+ info.child_tidptr = child_tidptr;
+ if (nptl_flags & CLONE_PARENT_SETTID)
+ info.parent_tidptr = parent_tidptr;
+@@ -3332,7 +3336,8 @@
+ ts = (TaskState *)env->opaque;
+ if (flags & CLONE_SETTLS)
+ cpu_set_tls (env, newtls);
+- /* TODO: Implement CLONE_CHILD_CLEARTID. */
++ if (flags & CLONE_CHILD_CLEARTID)
++ set_tid_address(g2h(child_tidptr));
+ } else {
+ fork_end(0);
+ }
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-13 22:09:16 UTC (rev 41)
+++ trunk/patches/series 2008-10-14 14:39:38 UTC (rev 42)
@@ -24,6 +24,7 @@
37_check_target_to_host_sockaddr_return_value.patch
38_fix_recvmsg_return_value.patch
39_fix_exit_syscall.patch
+40_clone_child_cleartid.patch
44_socklen_t_check.patch
48_signal_terminate.patch
99_sbox_callhack.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-13 22:09:19
|
Revision: 41
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=41&view=rev
Author: laurov
Date: 2008-10-13 22:09:16 +0000 (Mon, 13 Oct 2008)
Log Message:
-----------
Fix exit syscall.
We can't call the libc _exit because it calls the exit_group syscall.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/39_fix_exit_syscall.patch
Added: trunk/patches/39_fix_exit_syscall.patch
===================================================================
--- trunk/patches/39_fix_exit_syscall.patch (rev 0)
+++ trunk/patches/39_fix_exit_syscall.patch 2008-10-13 22:09:16 UTC (rev 41)
@@ -0,0 +1,29 @@
+Index: qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-13 18:06:03.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-13 18:56:02.000000000 -0300
+@@ -154,6 +154,7 @@
+ }
+
+
++#define __NR_sys_exit __NR_exit
+ #define __NR_sys_uname __NR_uname
+ #define __NR_sys_faccessat __NR_faccessat
+ #define __NR_sys_fchmodat __NR_fchmodat
+@@ -195,6 +196,7 @@
+ return -ENOSYS;
+ }
+ #endif
++_syscall1(int,sys_exit,int,status)
+ _syscall1(int,sys_uname,struct new_utsname *,buf)
+ #if defined(TARGET_NR_faccessat) && defined(__NR_faccessat)
+ _syscall4(int,sys_faccessat,int,dirfd,const char *,pathname,int,mode,int,flags)
+@@ -3756,7 +3758,7 @@
+ #endif
+ gdb_exit(cpu_env, arg1);
+ /* XXX: should free thread stack and CPU env */
+- _exit(arg1);
++ sys_exit(arg1);
+ ret = 0; /* avoid warning */
+ break;
+ case TARGET_NR_read:
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-09 19:03:56 UTC (rev 40)
+++ trunk/patches/series 2008-10-13 22:09:16 UTC (rev 41)
@@ -23,6 +23,7 @@
36_fix_iovec.patch
37_check_target_to_host_sockaddr_return_value.patch
38_fix_recvmsg_return_value.patch
+39_fix_exit_syscall.patch
44_socklen_t_check.patch
48_signal_terminate.patch
99_sbox_callhack.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-09 19:04:03
|
Revision: 40
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=40&view=rev
Author: laurov
Date: 2008-10-09 19:03:56 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
Avoid a warning in lock_iovec.
Modified Paths:
--------------
trunk/patches/36_fix_iovec.patch
Modified: trunk/patches/36_fix_iovec.patch
===================================================================
--- trunk/patches/36_fix_iovec.patch 2008-10-09 18:54:05 UTC (rev 39)
+++ trunk/patches/36_fix_iovec.patch 2008-10-09 19:03:56 UTC (rev 40)
@@ -1,7 +1,16 @@
-Index: trunk/qemu-arm-eabi/linux-user/syscall.c
+Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
---- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-06 17:05:04.000000000 -0300
-+++ qemu-arm-eabi/linux-user/syscall.c 2008-10-06 17:10:55.000000000 -0300
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-09 15:51:24.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-09 16:02:15.000000000 -0300
+@@ -1165,7 +1165,7 @@
+ {
+ struct target_iovec *target_vec;
+ abi_ulong base;
+- int i, j;
++ int i;
+
+ target_vec = lock_user(VERIFY_READ, target_addr, count * sizeof(struct target_iovec), 1);
+ if (!target_vec)
@@ -1175,8 +1175,8 @@
vec[i].iov_len = tswapl(target_vec[i].iov_len);
if (vec[i].iov_len != 0) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-09 18:54:11
|
Revision: 39
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=39&view=rev
Author: laurov
Date: 2008-10-09 18:54:05 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
Fix recvmsg return value.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/38_fix_recvmsg_return_value.patch
Added: trunk/patches/38_fix_recvmsg_return_value.patch
===================================================================
--- trunk/patches/38_fix_recvmsg_return_value.patch (rev 0)
+++ trunk/patches/38_fix_recvmsg_return_value.patch 2008-10-09 18:54:05 UTC (rev 39)
@@ -0,0 +1,27 @@
+Index: qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-09 15:04:44.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-09 15:21:27.000000000 -0300
+@@ -1267,7 +1267,7 @@
+ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
+ int flags, int send)
+ {
+- abi_long ret;
++ abi_long ret, len;
+ struct target_msghdr *msgp;
+ struct msghdr msg;
+ int count;
+@@ -1308,8 +1308,12 @@
+ ret = get_errno(sendmsg(fd, &msg, flags));
+ } else {
+ ret = get_errno(recvmsg(fd, &msg, flags));
+- if (!is_error(ret))
++ if (!is_error(ret)) {
++ len = ret;
+ ret = host_to_target_cmsg(msgp, &msg);
++ if (!is_error(ret))
++ ret = len;
++ }
+ }
+ unlock_iovec(vec, target_vec, count, !send);
+ fail:
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-09 18:03:07 UTC (rev 38)
+++ trunk/patches/series 2008-10-09 18:54:05 UTC (rev 39)
@@ -22,6 +22,7 @@
35_syscall_sockaddr.patch
36_fix_iovec.patch
37_check_target_to_host_sockaddr_return_value.patch
+38_fix_recvmsg_return_value.patch
44_socklen_t_check.patch
48_signal_terminate.patch
99_sbox_callhack.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-09 18:03:17
|
Revision: 38
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=38&view=rev
Author: laurov
Date: 2008-10-09 18:03:07 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
Fix shmat strace.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/04_shmat_strace.patch
Added: trunk/patches/04_shmat_strace.patch
===================================================================
--- trunk/patches/04_shmat_strace.patch (rev 0)
+++ trunk/patches/04_shmat_strace.patch 2008-10-09 18:03:07 UTC (rev 38)
@@ -0,0 +1,13 @@
+Index: linux-user/strace.list
+===================================================================
+--- linux-user/strace.list (revision 5391)
++++ linux-user/strace.list (working copy)
+@@ -1250,7 +1250,7 @@
+ { TARGET_NR_sgetmask, "sgetmask" , NULL, NULL, NULL },
+ #endif
+ #ifdef TARGET_NR_shmat
+-{ TARGET_NR_shmat, "shmat" , NULL, NULL, NULL },
++{ TARGET_NR_shmat, "shmat" , NULL, NULL, print_syscall_ret_addr },
+ #endif
+ #ifdef TARGET_NR_shmctl
+ { TARGET_NR_shmctl, "shmctl" , NULL, NULL, NULL },
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-09 17:59:08 UTC (rev 37)
+++ trunk/patches/series 2008-10-09 18:03:07 UTC (rev 38)
@@ -1,6 +1,7 @@
01_fix_srs_rfe.patch -p0
02_fix_page_range_check.patch -p0
03_arm_cpu_default.patch
+04_shmat_strace.patch -p0
06_exit_segfault.patch -p0
10_signal_jobs.patch -p0
19_zero_null.4.acct.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-09 17:59:16
|
Revision: 37
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=37&view=rev
Author: laurov
Date: 2008-10-09 17:59:08 +0000 (Thu, 09 Oct 2008)
Log Message:
-----------
Fix page_range_check.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/02_fix_page_range_check.patch
Added: trunk/patches/02_fix_page_range_check.patch
===================================================================
--- trunk/patches/02_fix_page_range_check.patch (rev 0)
+++ trunk/patches/02_fix_page_range_check.patch 2008-10-09 17:59:08 UTC (rev 37)
@@ -0,0 +1,21 @@
+Index: exec.c
+===================================================================
+--- exec.c (revision 5391)
++++ exec.c (working copy)
+@@ -2068,12 +2068,13 @@
+ target_ulong end;
+ target_ulong addr;
+
++ if( start + len < start )
++ /* we've wrapped around */
++ return -1;
++
+ end = TARGET_PAGE_ALIGN(start+len); /* must do before we loose bits in the next step */
+ start = start & TARGET_PAGE_MASK;
+
+- if( end < start )
+- /* we've wrapped around */
+- return -1;
+ for(addr = start; addr < end; addr += TARGET_PAGE_SIZE) {
+ p = page_find(addr >> TARGET_PAGE_BITS);
+ if( !p )
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-07 13:54:52 UTC (rev 36)
+++ trunk/patches/series 2008-10-09 17:59:08 UTC (rev 37)
@@ -1,4 +1,5 @@
01_fix_srs_rfe.patch -p0
+02_fix_page_range_check.patch -p0
03_arm_cpu_default.patch
06_exit_segfault.patch -p0
10_signal_jobs.patch -p0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-07 13:56:12
|
Revision: 36
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=36&view=rev
Author: laurov
Date: 2008-10-07 13:54:52 +0000 (Tue, 07 Oct 2008)
Log Message:
-----------
Fix bind, connect and sendto syscalls.
Modified Paths:
--------------
trunk/patches/44_socklen_t_check.patch
trunk/patches/series
Added Paths:
-----------
trunk/patches/37_check_target_to_host_sockaddr_return_value.patch
Added: trunk/patches/37_check_target_to_host_sockaddr_return_value.patch
===================================================================
--- trunk/patches/37_check_target_to_host_sockaddr_return_value.patch (rev 0)
+++ trunk/patches/37_check_target_to_host_sockaddr_return_value.patch 2008-10-07 13:54:52 UTC (rev 36)
@@ -0,0 +1,67 @@
+Index: qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-07 10:23:57.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-07 10:38:24.000000000 -0300
+@@ -1242,9 +1242,12 @@
+ socklen_t addrlen)
+ {
+ void *addr = alloca(addrlen);
++ abi_long ret;
+
+- target_to_host_sockaddr(addr, target_addr, &addrlen);
+- return get_errno(bind(sockfd, addr, addrlen));
++ ret = target_to_host_sockaddr(addr, target_addr, &addrlen);
++ if (!is_error(ret))
++ ret = get_errno(bind(sockfd, addr, addrlen));
++ return ret;
+ }
+
+ /* do_connect() Must return target values and target errnos. */
+@@ -1252,9 +1255,12 @@
+ socklen_t addrlen)
+ {
+ void *addr = alloca(addrlen);
++ abi_long ret;
+
+- target_to_host_sockaddr(addr, target_addr, &addrlen);
+- return get_errno(connect(sockfd, addr, addrlen));
++ ret = target_to_host_sockaddr(addr, target_addr, &addrlen);
++ if (!is_error(ret))
++ ret = get_errno(connect(sockfd, addr, addrlen));
++ return ret;
+ }
+
+ /* do_sendrecvmsg() Must return target values and target errnos. */
+@@ -1277,8 +1283,10 @@
+ if (msgp->msg_name) {
+ msg.msg_namelen = tswap32(msgp->msg_namelen);
+ msg.msg_name = alloca(msg.msg_namelen);
+- target_to_host_sockaddr(msg.msg_name, tswapl(msgp->msg_name),
+- &msg.msg_namelen);
++ ret = target_to_host_sockaddr(msg.msg_name, tswapl(msgp->msg_name),
++ &msg.msg_namelen);
++ if (is_error(ret))
++ goto fail;
+ } else {
+ msg.msg_name = NULL;
+ msg.msg_namelen = 0;
+@@ -1304,6 +1312,7 @@
+ ret = host_to_target_cmsg(msgp, &msg);
+ }
+ unlock_iovec(vec, target_vec, count, !send);
++fail:
+ unlock_user_struct(msgp, target_msg, send ? 0 : 1);
+ return ret;
+ }
+@@ -1411,8 +1420,9 @@
+ return -TARGET_EFAULT;
+ if (target_addr) {
+ addr = alloca(addrlen);
+- target_to_host_sockaddr(addr, target_addr, &addrlen);
+- ret = get_errno(sendto(fd, host_msg, len, flags, addr, addrlen));
++ ret = target_to_host_sockaddr(addr, target_addr, &addrlen);
++ if (!is_error(ret))
++ ret = get_errno(sendto(fd, host_msg, len, flags, addr, addrlen));
+ } else {
+ ret = get_errno(send(fd, host_msg, len, flags));
+ }
Modified: trunk/patches/44_socklen_t_check.patch
===================================================================
--- trunk/patches/44_socklen_t_check.patch 2008-10-07 00:50:14 UTC (rev 35)
+++ trunk/patches/44_socklen_t_check.patch 2008-10-07 13:54:52 UTC (rev 36)
@@ -1,8 +1,8 @@
-Index: qemu/linux-user/syscall.c
+Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 14:40:59.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 14:53:48.000000000 -0300
-@@ -1223,11 +1223,19 @@
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-07 10:38:24.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-07 10:41:51.000000000 -0300
+@@ -1237,13 +1237,21 @@
return get_errno(socket(domain, type, protocol));
}
@@ -15,29 +15,33 @@
{
- void *addr = alloca(addrlen);
+ void *addr;
-+
+ abi_long ret;
+
+ if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ return -TARGET_EINVAL;
+
+ addr = alloca(addrlen);
-
- target_to_host_sockaddr(addr, target_addr, &addrlen);
- return get_errno(bind(sockfd, addr, addrlen));
-@@ -1237,7 +1245,12 @@
++
+ ret = target_to_host_sockaddr(addr, target_addr, &addrlen);
+ if (!is_error(ret))
+ ret = get_errno(bind(sockfd, addr, addrlen));
+@@ -1254,9 +1262,14 @@
static abi_long do_connect(int sockfd, abi_ulong target_addr,
socklen_t addrlen)
{
- void *addr = alloca(addrlen);
+ void *addr;
-+
+ abi_long ret;
+
+ if (addrlen < 0 || addrlen > MAX_SOCK_ADDR)
+ return -TARGET_EINVAL;
+
+ addr = alloca(addrlen);
-
- target_to_host_sockaddr(addr, target_addr, &addrlen);
- return get_errno(connect(sockfd, addr, addrlen));
-@@ -1306,6 +1319,8 @@
++
+ ret = target_to_host_sockaddr(addr, target_addr, &addrlen);
+ if (!is_error(ret))
+ ret = get_errno(connect(sockfd, addr, addrlen));
+@@ -1329,6 +1342,8 @@
target_addr != (abi_ulong)NULL) {
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EINVAL;
@@ -46,7 +50,7 @@
addr = alloca(addrlen);
ret = get_errno(accept(fd, addr, &addrlen));
} else {
-@@ -1335,6 +1350,9 @@
+@@ -1358,6 +1373,9 @@
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EFAULT;
@@ -56,7 +60,7 @@
addr = alloca(addrlen);
ret = get_errno(getpeername(fd, addr, &addrlen));
-@@ -1357,6 +1375,9 @@
+@@ -1380,6 +1398,9 @@
if (get_user_u32(addrlen, target_addrlen_addr))
return -TARGET_EFAULT;
@@ -66,7 +70,7 @@
addr = alloca(addrlen);
ret = get_errno(getsockname(fd, addr, &addrlen));
-@@ -1392,6 +1413,9 @@
+@@ -1415,6 +1436,9 @@
void *host_msg;
abi_long ret;
@@ -76,7 +80,7 @@
host_msg = lock_user(VERIFY_READ, msg, len, 1);
if (!host_msg)
return -TARGET_EFAULT;
-@@ -1424,6 +1448,10 @@
+@@ -1448,6 +1472,10 @@
ret = -TARGET_EFAULT;
goto fail;
}
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-07 00:50:14 UTC (rev 35)
+++ trunk/patches/series 2008-10-07 13:54:52 UTC (rev 36)
@@ -19,6 +19,7 @@
34_fix_siocatmark.patch -p0
35_syscall_sockaddr.patch
36_fix_iovec.patch
+37_check_target_to_host_sockaddr_return_value.patch
44_socklen_t_check.patch
48_signal_terminate.patch
99_sbox_callhack.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-07 00:52:55
|
Revision: 35
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=35&view=rev
Author: laurov
Date: 2008-10-07 00:50:14 +0000 (Tue, 07 Oct 2008)
Log Message:
-----------
Fix getpeername and getsockname syscalls.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/30_check_host_to_target_sockaddr_return_value.patch
Added: trunk/patches/30_check_host_to_target_sockaddr_return_value.patch
===================================================================
--- trunk/patches/30_check_host_to_target_sockaddr_return_value.patch (rev 0)
+++ trunk/patches/30_check_host_to_target_sockaddr_return_value.patch 2008-10-07 00:50:14 UTC (rev 35)
@@ -0,0 +1,26 @@
+Index: linux-user/syscall.c
+===================================================================
+--- linux-user/syscall.c.orig 2008-10-06 20:48:19.000000000 -0300
++++ linux-user/syscall.c 2008-10-06 20:53:13.000000000 -0300
+@@ -1354,8 +1355,8 @@
+
+ ret = get_errno(getpeername(fd, addr, &addrlen));
+ if (!is_error(ret)) {
+- host_to_target_sockaddr(target_addr, addr, addrlen);
+- if (put_user_u32(addrlen, target_addrlen_addr))
++ if ((host_to_target_sockaddr(target_addr, addr, addrlen) < 0) ||
++ (put_user_u32(addrlen, target_addrlen_addr)))
+ ret = -TARGET_EFAULT;
+ }
+ return ret;
+@@ -1376,8 +1377,8 @@
+
+ ret = get_errno(getsockname(fd, addr, &addrlen));
+ if (!is_error(ret)) {
+- host_to_target_sockaddr(target_addr, addr, addrlen);
+- if (put_user_u32(addrlen, target_addrlen_addr))
++ if ((host_to_target_sockaddr(target_addr, addr, addrlen) < 0) ||
++ (put_user_u32(addrlen, target_addrlen_addr)))
+ ret = -TARGET_EFAULT;
+ }
+ return ret;
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-06 21:48:09 UTC (rev 34)
+++ trunk/patches/series 2008-10-07 00:50:14 UTC (rev 35)
@@ -12,6 +12,7 @@
25_sem_syscalls.patch
26_IPCOP_shm.patch
27_shm_syscalls.patch
+30_check_host_to_target_sockaddr_return_value.patch -p0
31_syscalls.patch
32_syscall_sysctl.patch -p0
33_fix_getdents_syscalls.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-06 21:48:17
|
Revision: 34
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=34&view=rev
Author: laurov
Date: 2008-10-06 21:48:09 +0000 (Mon, 06 Oct 2008)
Log Message:
-----------
Fix writev syscall.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/36_fix_iovec.patch
Added: trunk/patches/36_fix_iovec.patch
===================================================================
--- trunk/patches/36_fix_iovec.patch (rev 0)
+++ trunk/patches/36_fix_iovec.patch 2008-10-06 21:48:09 UTC (rev 34)
@@ -0,0 +1,43 @@
+Index: trunk/qemu-arm-eabi/linux-user/syscall.c
+===================================================================
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-06 17:05:04.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-06 17:10:55.000000000 -0300
+@@ -1175,8 +1175,8 @@
+ vec[i].iov_len = tswapl(target_vec[i].iov_len);
+ if (vec[i].iov_len != 0) {
+ vec[i].iov_base = lock_user(type, base, vec[i].iov_len, copy);
+- if (!vec[i].iov_base && vec[i].iov_len)
+- goto fail;
++ /* Don't check lock_user return value. We must call writev even
++ if a element has invalid base address. */
+ } else {
+ /* zero length pointer is ignored */
+ vec[i].iov_base = NULL;
+@@ -1184,14 +1184,6 @@
+ }
+ unlock_user (target_vec, target_addr, 0);
+ return 0;
+- fail:
+- /* failure - unwind locks */
+- for (j = 0; j < i; j++) {
+- base = tswapl(target_vec[j].iov_base);
+- unlock_user(vec[j].iov_base, base, 0);
+- }
+- unlock_user (target_vec, target_addr, 0);
+- return -TARGET_EFAULT;
+ }
+
+ static abi_long unlock_iovec(struct iovec *vec, abi_ulong target_addr,
+@@ -1205,8 +1197,10 @@
+ if (!target_vec)
+ return -TARGET_EFAULT;
+ for(i = 0;i < count; i++) {
+- base = tswapl(target_vec[i].iov_base);
+- unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0);
++ if (target_vec[i].iov_base) {
++ base = tswapl(target_vec[i].iov_base);
++ unlock_user(vec[i].iov_base, base, copy ? vec[i].iov_len : 0);
++ }
+ }
+ unlock_user (target_vec, target_addr, 0);
+
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-04 00:06:55 UTC (rev 33)
+++ trunk/patches/series 2008-10-06 21:48:09 UTC (rev 34)
@@ -17,6 +17,7 @@
33_fix_getdents_syscalls.patch
34_fix_siocatmark.patch -p0
35_syscall_sockaddr.patch
+36_fix_iovec.patch
44_socklen_t_check.patch
48_signal_terminate.patch
99_sbox_callhack.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-04 00:07:11
|
Revision: 33
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=33&view=rev
Author: laurov
Date: 2008-10-04 00:06:55 +0000 (Sat, 04 Oct 2008)
Log Message:
-----------
Fix IOCTL SIOCAMARK.
It receives one argument.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/34_fix_siocatmark.patch
Added: trunk/patches/34_fix_siocatmark.patch
===================================================================
--- trunk/patches/34_fix_siocatmark.patch (rev 0)
+++ trunk/patches/34_fix_siocatmark.patch 2008-10-04 00:06:55 UTC (rev 33)
@@ -0,0 +1,13 @@
+Index: linux-user/ioctls.h
+===================================================================
+--- linux-user/ioctls.h (revision 5391)
++++ linux-user/ioctls.h (working copy)
+@@ -74,7 +74,7 @@
+ IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
+ #endif
+
+- IOCTL(SIOCATMARK, 0, TYPE_NULL)
++ IOCTL(SIOCATMARK, 0, MK_PTR(TYPE_INT))
+ IOCTL(SIOCADDRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
+ IOCTL(SIOCDELRT, IOC_W, MK_PTR(MK_STRUCT(STRUCT_rtentry)))
+ IOCTL(SIOCGIFNAME, IOC_RW, MK_PTR(TYPE_INT))
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-03 23:37:36 UTC (rev 32)
+++ trunk/patches/series 2008-10-04 00:06:55 UTC (rev 33)
@@ -15,6 +15,7 @@
31_syscalls.patch
32_syscall_sysctl.patch -p0
33_fix_getdents_syscalls.patch
+34_fix_siocatmark.patch -p0
35_syscall_sockaddr.patch
44_socklen_t_check.patch
48_signal_terminate.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-03 23:37:39
|
Revision: 32
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=32&view=rev
Author: laurov
Date: 2008-10-03 23:37:36 +0000 (Fri, 03 Oct 2008)
Log Message:
-----------
Remove 90_evil_dlclose.patch.
Modified Paths:
--------------
trunk/patches/series
Removed Paths:
-------------
trunk/patches/90_evil_dlclose.patch
Deleted: trunk/patches/90_evil_dlclose.patch
===================================================================
--- trunk/patches/90_evil_dlclose.patch 2008-10-03 19:17:14 UTC (rev 31)
+++ trunk/patches/90_evil_dlclose.patch 2008-10-03 23:37:36 UTC (rev 32)
@@ -1,80 +0,0 @@
-#DPATCHLEVEL=0
-Index: linux-user/main.c
-===================================================================
---- linux-user/main.c.orig 2008-08-11 15:20:16.000000000 -0300
-+++ linux-user/main.c 2008-08-11 15:35:26.000000000 -0300
-@@ -29,6 +29,8 @@
- /* For tb_lock */
- #include "exec-all.h"
-
-+int flush_close;
-+
- #define DEBUG_LOGFILE "/tmp/qemu.log"
-
- static const char *interp_prefix = CONFIG_QEMU_PREFIX;
-@@ -469,6 +471,11 @@
- abort();
- }
- process_pending_signals(env);
-+
-+ if (flush_close) {
-+ tb_flush(env);
-+ flush_close = 0;
-+ }
- }
- }
- #endif
-@@ -2211,6 +2218,8 @@
- if (argc <= 1)
- usage();
-
-+ flush_close = 0;
-+
- /* init debug */
- cpu_set_log_filename(DEBUG_LOGFILE);
-
-Index: linux-user/qemu.h
-===================================================================
---- linux-user/qemu.h.orig 2008-08-11 15:23:47.000000000 -0300
-+++ linux-user/qemu.h 2008-08-11 15:35:26.000000000 -0300
-@@ -37,6 +37,8 @@
- #include "target_signal.h"
- #include "gdbstub.h"
-
-+extern int flush_close;
-+
- #if defined(USE_NPTL)
- #define THREAD __thread
- #else
-Index: linux-user/syscall.c
-===================================================================
---- linux-user/syscall.c.orig 2008-08-11 15:31:40.000000000 -0300
-+++ linux-user/syscall.c 2008-08-11 15:35:26.000000000 -0300
-@@ -3423,7 +3423,27 @@
- break;
- #endif
- case TARGET_NR_close:
-+ {
-+ struct stat buf;
-+
-+ ret = fstat(arg1, &buf);
-+
-+ if ((ret == 0) && (S_ISREG(buf.st_mode)) && (buf.st_mode & S_IRUSR)) {
-+ char str[EI_PAD];
-+ int origpos;
-+ origpos=lseek(arg1, 0, SEEK_CUR); /* get current position */
-+
-+ if (lseek(arg1, 0, SEEK_SET) != (off_t)-1)
-+ if (read(arg1, str, EI_PAD) > 0)
-+ if (str[EI_MAG0] == ELFMAG0 && str[EI_MAG1] == ELFMAG1 &&
-+ str[EI_MAG1] == ELFMAG1 && str[EI_MAG3] == ELFMAG3)
-+ flush_close = 1;
-+
-+ lseek(arg1, origpos, SEEK_SET);
-+ }
-+
- ret = get_errno(close(arg1));
-+ }
- break;
- case TARGET_NR_brk:
- ret = do_brk(arg1);
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-03 19:17:14 UTC (rev 31)
+++ trunk/patches/series 2008-10-03 23:37:36 UTC (rev 32)
@@ -18,6 +18,5 @@
35_syscall_sockaddr.patch
44_socklen_t_check.patch
48_signal_terminate.patch
-90_evil_dlclose.patch -p0
99_sbox_callhack.patch
99_sbox_proc.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-03 19:17:16
|
Revision: 31
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=31&view=rev
Author: laurov
Date: 2008-10-03 19:17:14 +0000 (Fri, 03 Oct 2008)
Log Message:
-----------
ARMv6: Fix SRS/RFE instruction
Patch by Hyeonsung Jang.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/01_fix_srs_rfe.patch
Added: trunk/patches/01_fix_srs_rfe.patch
===================================================================
--- trunk/patches/01_fix_srs_rfe.patch (rev 0)
+++ trunk/patches/01_fix_srs_rfe.patch 2008-10-03 19:17:14 UTC (rev 31)
@@ -0,0 +1,115 @@
+From: Hans(Hyeonseung) Jang <hs...@ok...>
+To: qem...@no...
+Subject: [Qemu-devel] [Patch] ARMv6: Fix SRS/RFE instruction
+
+We are in the process of implementing a KZM (i.MX31) ARMv6 machine
+port in order to run the OKL4 kernel. We found the new CPS/SRS/RFE
+instructions were broken.
+Vincent Palatin released a patch recently which fixes the CPS problem.
+Attached is a patch to fix the SRS/RFE bugs. Could this patch please
+be applied to the main trunk.
+Thanks
+- Hyeonsung Jang.
+
+
+- The encoding of 'IA' condition must be '01' instead of '02'.
+- SRS instruction must store banked SPSR instead of CPSR at the specific address.
+- 'return' statements are missing
+
+
+Index: target-arm/translate.c
+===================================================================
+--- target-arm/translate.c.orig 2008-10-03 16:00:06.000000000 -0300
++++ target-arm/translate.c 2008-10-03 16:00:08.000000000 -0300
+@@ -5692,7 +5692,7 @@
+ }
+ } else if ((insn & 0x0e5fffe0) == 0x084d0500) {
+ /* srs */
+- uint32_t offset;
++ int32_t offset;
+ if (IS_USER(s))
+ goto illegal_op;
+ ARCH(6);
+@@ -5706,8 +5706,8 @@
+ i = (insn >> 23) & 3;
+ switch (i) {
+ case 0: offset = -4; break; /* DA */
+- case 1: offset = -8; break; /* DB */
+- case 2: offset = 0; break; /* IA */
++ case 1: offset = 0; break; /* IA */
++ case 2: offset = -8; break; /* DB */
+ case 3: offset = 4; break; /* IB */
+ default: abort();
+ }
+@@ -5715,32 +5715,33 @@
+ tcg_gen_addi_i32(addr, addr, offset);
+ tmp = load_reg(s, 14);
+ gen_st32(tmp, addr, 0);
+- tmp = new_tmp();
+- gen_helper_cpsr_read(tmp);
++ tmp = load_cpu_field(spsr);
+ tcg_gen_addi_i32(addr, addr, 4);
+ gen_st32(tmp, addr, 0);
+ if (insn & (1 << 21)) {
+ /* Base writeback. */
+ switch (i) {
+ case 0: offset = -8; break;
+- case 1: offset = -4; break;
+- case 2: offset = 4; break;
++ case 1: offset = 4; break;
++ case 2: offset = -4; break;
+ case 3: offset = 0; break;
+ default: abort();
+ }
+ if (offset)
+- tcg_gen_addi_i32(addr, tmp, offset);
++ tcg_gen_addi_i32(addr, addr, offset);
+ if (op1 == (env->uncached_cpsr & CPSR_M)) {
+- gen_movl_reg_T1(s, 13);
++ store_reg(s, 13, addr);
+ } else {
+- gen_helper_set_r13_banked(cpu_env, tcg_const_i32(op1), cpu_T[1]);
++ gen_helper_set_r13_banked(cpu_env, tcg_const_i32(op1), addr);
++ dead_tmp(addr);
+ }
+ } else {
+ dead_tmp(addr);
+ }
++ return;
+ } else if ((insn & 0x0e5fffe0) == 0x081d0a00) {
+ /* rfe */
+- uint32_t offset;
++ int32_t offset;
+ if (IS_USER(s))
+ goto illegal_op;
+ ARCH(6);
+@@ -5749,8 +5750,8 @@
+ i = (insn >> 23) & 3;
+ switch (i) {
+ case 0: offset = -4; break; /* DA */
+- case 1: offset = -8; break; /* DB */
+- case 2: offset = 0; break; /* IA */
++ case 1: offset = 0; break; /* IA */
++ case 2: offset = -8; break; /* DB */
+ case 3: offset = 4; break; /* IB */
+ default: abort();
+ }
+@@ -5764,8 +5765,8 @@
+ /* Base writeback. */
+ switch (i) {
+ case 0: offset = -8; break;
+- case 1: offset = -4; break;
+- case 2: offset = 4; break;
++ case 1: offset = 4; break;
++ case 2: offset = -4; break;
+ case 3: offset = 0; break;
+ default: abort();
+ }
+@@ -5776,6 +5777,7 @@
+ dead_tmp(addr);
+ }
+ gen_rfe(s, tmp, tmp2);
++ return;
+ } else if ((insn & 0x0e000000) == 0x0a000000) {
+ /* branch link and change to thumb (blx <offset>) */
+ int32_t offset;
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-02 22:17:28 UTC (rev 30)
+++ trunk/patches/series 2008-10-03 19:17:14 UTC (rev 31)
@@ -1,3 +1,4 @@
+01_fix_srs_rfe.patch -p0
03_arm_cpu_default.patch
06_exit_segfault.patch -p0
10_signal_jobs.patch -p0
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-02 22:18:03
|
Revision: 30
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=30&view=rev
Author: laurov
Date: 2008-10-02 22:17:28 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Implement msg*, sem* and shm* syscalls.
Patches by Kirill A. Shutemov.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/22_IPCOP_msg.patch
trunk/patches/23_msg_syscalls.patch
trunk/patches/24_IPCOP_sem.patch
trunk/patches/25_sem_syscalls.patch
trunk/patches/26_IPCOP_shm.patch
trunk/patches/27_shm_syscalls.patch
Removed Paths:
-------------
trunk/patches/30_syscall_ipc.patch
Added: trunk/patches/22_IPCOP_msg.patch
===================================================================
--- trunk/patches/22_IPCOP_msg.patch (rev 0)
+++ trunk/patches/22_IPCOP_msg.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,285 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:17 +0300
+Subject: [Qemu-devel] [PATCH] Fix and cleanup IPCOP_msg* ipc calls handling
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 173 ++++++++++++++++++++++++++++++++++----------------
+ 1 files changed, 117 insertions(+), 56 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index a8eb6d3..c048843 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -1611,7 +1611,6 @@ static abi_long do_socketcall(int num, abi_ulong vptr)
+ }
+ #endif
+
+-#ifdef TARGET_NR_ipc
+ #define N_SHM_REGIONS 32
+
+ static struct shm_region {
+@@ -1845,20 +1844,26 @@ static inline abi_long do_semctl(int first, int second, int third,
+
+ struct target_msqid_ds
+ {
+- struct target_ipc_perm msg_perm;
+- abi_ulong msg_stime;
+- abi_ulong __unused1;
+- abi_ulong msg_rtime;
+- abi_ulong __unused2;
+- abi_ulong msg_ctime;
+- abi_ulong __unused3;
+- abi_ulong __msg_cbytes;
+- abi_ulong msg_qnum;
+- abi_ulong msg_qbytes;
+- abi_ulong msg_lspid;
+- abi_ulong msg_lrpid;
+- abi_ulong __unused4;
+- abi_ulong __unused5;
++ struct target_ipc_perm msg_perm;
++ abi_ulong msg_stime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused1;
++#endif
++ abi_ulong msg_rtime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused2;
++#endif
++ abi_ulong msg_ctime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused3;
++#endif
++ abi_ulong __msg_cbytes;
++ abi_ulong msg_qnum;
++ abi_ulong msg_qbytes;
++ abi_ulong msg_lspid;
++ abi_ulong msg_lrpid;
++ abi_ulong __unused4;
++ abi_ulong __unused5;
+ };
+
+ static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
+@@ -1868,7 +1873,8 @@ static inline abi_long target_to_host_msqid_ds(struct msqid_ds *host_md,
+
+ if (!lock_user_struct(VERIFY_READ, target_md, target_addr, 1))
+ return -TARGET_EFAULT;
+- target_to_host_ipc_perm(&(host_md->msg_perm),target_addr);
++ if (target_to_host_ipc_perm(&(host_md->msg_perm),target_addr))
++ return -TARGET_EFAULT;
+ host_md->msg_stime = tswapl(target_md->msg_stime);
+ host_md->msg_rtime = tswapl(target_md->msg_rtime);
+ host_md->msg_ctime = tswapl(target_md->msg_ctime);
+@@ -1888,7 +1894,8 @@ static inline abi_long host_to_target_msqid_ds(abi_ulong target_addr,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_md, target_addr, 0))
+ return -TARGET_EFAULT;
+- host_to_target_ipc_perm(target_addr,&(host_md->msg_perm));
++ if (host_to_target_ipc_perm(target_addr,&(host_md->msg_perm)))
++ return -TARGET_EFAULT;
+ target_md->msg_stime = tswapl(host_md->msg_stime);
+ target_md->msg_rtime = tswapl(host_md->msg_rtime);
+ target_md->msg_ctime = tswapl(host_md->msg_ctime);
+@@ -1901,26 +1908,69 @@ static inline abi_long host_to_target_msqid_ds(abi_ulong target_addr,
+ return 0;
+ }
+
+-static inline abi_long do_msgctl(int first, int second, abi_long ptr)
++struct target_msginfo {
++ int msgpool;
++ int msgmap;
++ int msgmax;
++ int msgmnb;
++ int msgmni;
++ int msgssz;
++ int msgtql;
++ unsigned short int msgseg;
++};
++
++static inline abi_long host_to_target_msginfo(abi_ulong target_addr,
++ struct msginfo *host_msginfo)
++{
++ struct target_msginfo *target_msginfo;
++ if (!lock_user_struct(VERIFY_WRITE, target_msginfo, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_msginfo->msgpool, &target_msginfo->msgpool);
++ __put_user(host_msginfo->msgmap, &target_msginfo->msgmap);
++ __put_user(host_msginfo->msgmax, &target_msginfo->msgmax);
++ __put_user(host_msginfo->msgmnb, &target_msginfo->msgmnb);
++ __put_user(host_msginfo->msgmni, &target_msginfo->msgmni);
++ __put_user(host_msginfo->msgssz, &target_msginfo->msgssz);
++ __put_user(host_msginfo->msgtql, &target_msginfo->msgtql);
++ __put_user(host_msginfo->msgseg, &target_msginfo->msgseg);
++ unlock_user_struct(target_msginfo, target_addr, 1);
++}
++
++static inline abi_long do_msgctl(int msgid, int cmd, abi_long ptr)
+ {
+ struct msqid_ds dsarg;
+- int cmd = second&0xff;
+- abi_long ret = 0;
+- switch( cmd ) {
++ struct msginfo msginfo;
++ abi_long ret = -TARGET_EINVAL;
++
++ cmd &= 0xff;
++
++ switch (cmd) {
+ case IPC_STAT:
+ case IPC_SET:
+- target_to_host_msqid_ds(&dsarg,ptr);
+- ret = get_errno(msgctl(first, cmd, &dsarg));
+- host_to_target_msqid_ds(ptr,&dsarg);
+- default:
+- ret = get_errno(msgctl(first, cmd, &dsarg));
++ case MSG_STAT:
++ if (target_to_host_msqid_ds(&dsarg,ptr))
++ return -TARGET_EFAULT;
++ ret = get_errno(msgctl(msgid, cmd, &dsarg));
++ if (host_to_target_msqid_ds(ptr,&dsarg))
++ return -TARGET_EFAULT;
++ break;
++ case IPC_RMID:
++ ret = get_errno(msgctl(msgid, cmd, NULL));
++ break;
++ case IPC_INFO:
++ case MSG_INFO:
++ ret = get_errno(msgctl(msgid, cmd, (struct msqid_ds *)&msginfo));
++ if (host_to_target_msginfo(ptr, &msginfo))
++ return -TARGET_EFAULT;
++ break;
+ }
++
+ return ret;
+ }
+
+ struct target_msgbuf {
+- abi_ulong mtype;
+- char mtext[1];
++ abi_long mtype;
++ char mtext[1];
+ };
+
+ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+@@ -1933,8 +1983,8 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+ if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0))
+ return -TARGET_EFAULT;
+ host_mb = malloc(msgsz+sizeof(long));
+- host_mb->mtype = tswapl(target_mb->mtype);
+- memcpy(host_mb->mtext,target_mb->mtext,msgsz);
++ host_mb->mtype = (abi_long) tswapl(target_mb->mtype);
++ memcpy(host_mb->mtext, target_mb->mtext, msgsz);
+ ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));
+ free(host_mb);
+ unlock_user_struct(target_mb, msgp, 0);
+@@ -1943,7 +1993,7 @@ static inline abi_long do_msgsnd(int msqid, abi_long msgp,
+ }
+
+ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+- unsigned int msgsz, int msgtype,
++ unsigned int msgsz, abi_long msgtyp,
+ int msgflg)
+ {
+ struct target_msgbuf *target_mb;
+@@ -1953,8 +2003,10 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_mb, msgp, 0))
+ return -TARGET_EFAULT;
++
+ host_mb = malloc(msgsz+sizeof(long));
+- ret = get_errno(msgrcv(msqid, host_mb, msgsz, 1, msgflg));
++ ret = get_errno(msgrcv(msqid, host_mb, msgsz, tswapl(msgtyp), msgflg));
++
+ if (ret > 0) {
+ abi_ulong target_mtext_addr = msgp + sizeof(abi_ulong);
+ target_mtext = lock_user(VERIFY_WRITE, target_mtext_addr, ret, 0);
+@@ -1962,9 +2014,10 @@ static inline abi_long do_msgrcv(int msqid, abi_long msgp,
+ ret = -TARGET_EFAULT;
+ goto end;
+ }
+- memcpy(target_mb->mtext, host_mb->mtext, ret);
++ memcpy(target_mb->mtext, host_mb->mtext, ret);
+ unlock_user(target_mtext, target_mtext_addr, ret);
+ }
++
+ target_mb->mtype = tswapl(host_mb->mtype);
+ free(host_mb);
+
+@@ -1974,6 +2027,7 @@ end:
+ return ret;
+ }
+
++#ifdef TARGET_NR_ipc
+ /* ??? This only works with linear mappings. */
+ /* do_ipc() must return target values and target errnos. */
+ static abi_long do_ipc(unsigned int call, int first,
+@@ -2006,34 +2060,41 @@ static abi_long do_ipc(unsigned int call, int first,
+ ret = -TARGET_ENOSYS;
+ break;
+
+- case IPCOP_msgget:
+- ret = get_errno(msgget(first, second));
+- break;
++ case IPCOP_msgget:
++ ret = get_errno(msgget(first, second));
++ break;
+
+- case IPCOP_msgsnd:
+- ret = do_msgsnd(first, ptr, second, third);
+- break;
++ case IPCOP_msgsnd:
++ ret = do_msgsnd(first, ptr, second, third);
++ break;
+
+- case IPCOP_msgctl:
+- ret = do_msgctl(first, second, ptr);
+- break;
++ case IPCOP_msgctl:
++ ret = do_msgctl(first, second, ptr);
++ break;
+
+- case IPCOP_msgrcv:
+- {
+- /* XXX: this code is not correct */
+- struct ipc_kludge
+- {
+- void *__unbounded msgp;
+- long int msgtyp;
+- };
++ case IPCOP_msgrcv:
++ switch (version) {
++ case 0:
++ {
++ struct target_ipc_kludge {
++ abi_long msgp;
++ abi_long msgtyp;
++ } *tmp;
+
+- struct ipc_kludge *foo = (struct ipc_kludge *)g2h(ptr);
+- struct msgbuf *msgp = (struct msgbuf *) foo->msgp;
++ if (!lock_user_struct(VERIFY_READ, tmp, ptr, 1)) {
++ ret = -TARGET_EFAULT;
++ break;
++ }
+
+- ret = do_msgrcv(first, (long)msgp, second, 0, third);
++ ret = do_msgrcv(first, tmp->msgp, second, tmp->msgtyp, third);
+
+- }
+- break;
++ unlock_user_struct(tmp, ptr, 0);
++ break;
++ }
++ default:
++ ret = do_msgrcv(first, ptr, second, fifth, third);
++ }
++ break;
+
+ case IPCOP_shmat:
+ {
+--
+1.5.6.5.GIT
+
+
+
Added: trunk/patches/23_msg_syscalls.patch
===================================================================
--- trunk/patches/23_msg_syscalls.patch (rev 0)
+++ trunk/patches/23_msg_syscalls.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,47 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:18 +0300
+Subject: [Qemu-devel] [PATCH] Implement msg* syscalls
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index c048843..4e471df 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -4829,6 +4829,27 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ ret = do_ipc(arg1, arg2, arg3, arg4, arg5, arg6);
+ break;
+ #endif
++
++#ifdef TARGET_NR_msgctl
++ case TARGET_NR_msgctl:
++ ret = do_msgctl(arg1, arg2, arg3);
++ break;
++#endif
++#ifdef TARGET_NR_msgget
++ case TARGET_NR_msgget:
++ ret = get_errno(msgget(arg1, arg2));
++ break;
++#endif
++#ifdef TARGET_NR_msgrcv
++ case TARGET_NR_msgrcv:
++ ret = do_msgrcv(arg1, arg2, arg3, arg4, arg5);
++ break;
++#endif
++#ifdef TARGET_NR_msgsnd
++ case TARGET_NR_msgsnd:
++ ret = do_msgsnd(arg1, arg2, arg3, arg4);
++ break;
++#endif
+ case TARGET_NR_fsync:
+ ret = get_errno(fsync(arg1));
+ break;
+--
+1.5.6.5.GIT
+
+
+
Added: trunk/patches/24_IPCOP_sem.patch
===================================================================
--- trunk/patches/24_IPCOP_sem.patch (rev 0)
+++ trunk/patches/24_IPCOP_sem.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,405 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:19 +0300
+Subject: [Qemu-devel] [PATCH] Fix and cleanup IPCOP_sem* ipc calls handling
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 319 +++++++++++++++++++++++++++++++-------------------
+ 1 files changed, 198 insertions(+), 121 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 4e471df..f054ae4 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -1635,14 +1635,14 @@ struct target_ipc_perm
+
+ struct target_semid_ds
+ {
+- struct target_ipc_perm sem_perm;
+- abi_ulong sem_otime;
+- abi_ulong __unused1;
+- abi_ulong sem_ctime;
+- abi_ulong __unused2;
+- abi_ulong sem_nsems;
+- abi_ulong __unused3;
+- abi_ulong __unused4;
++ struct target_ipc_perm sem_perm;
++ abi_ulong sem_otime;
++ abi_ulong __unused1;
++ abi_ulong sem_ctime;
++ abi_ulong __unused2;
++ abi_ulong sem_nsems;
++ abi_ulong __unused3;
++ abi_ulong __unused4;
+ };
+
+ static inline abi_long target_to_host_ipc_perm(struct ipc_perm *host_ip,
+@@ -1690,7 +1690,8 @@ static inline abi_long target_to_host_semid_ds(struct semid_ds *host_sd,
+
+ if (!lock_user_struct(VERIFY_READ, target_sd, target_addr, 1))
+ return -TARGET_EFAULT;
+- target_to_host_ipc_perm(&(host_sd->sem_perm),target_addr);
++ if (target_to_host_ipc_perm(&(host_sd->sem_perm),target_addr))
++ return -TARGET_EFAULT;
+ host_sd->sem_nsems = tswapl(target_sd->sem_nsems);
+ host_sd->sem_otime = tswapl(target_sd->sem_otime);
+ host_sd->sem_ctime = tswapl(target_sd->sem_ctime);
+@@ -1705,7 +1706,8 @@ static inline abi_long host_to_target_semid_ds(abi_ulong target_addr,
+
+ if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0))
+ return -TARGET_EFAULT;
+- host_to_target_ipc_perm(target_addr,&(host_sd->sem_perm));
++ if (host_to_target_ipc_perm(target_addr,&(host_sd->sem_perm)))
++ return -TARGET_EFAULT;;
+ target_sd->sem_nsems = tswapl(host_sd->sem_nsems);
+ target_sd->sem_otime = tswapl(host_sd->sem_otime);
+ target_sd->sem_ctime = tswapl(host_sd->sem_ctime);
+@@ -1713,135 +1715,215 @@ static inline abi_long host_to_target_semid_ds(abi_ulong target_addr,
+ return 0;
+ }
+
++struct target_seminfo {
++ int semmap;
++ int semmni;
++ int semmns;
++ int semmnu;
++ int semmsl;
++ int semopm;
++ int semume;
++ int semusz;
++ int semvmx;
++ int semaem;
++};
++
++static inline abi_long host_to_target_seminfo(abi_ulong target_addr,
++ struct seminfo *host_seminfo)
++{
++ struct target_seminfo *target_seminfo;
++ if (!lock_user_struct(VERIFY_WRITE, target_seminfo, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_seminfo->semmap, &target_seminfo->semmap);
++ __put_user(host_seminfo->semmni, &target_seminfo->semmni);
++ __put_user(host_seminfo->semmns, &target_seminfo->semmns);
++ __put_user(host_seminfo->semmnu, &target_seminfo->semmnu);
++ __put_user(host_seminfo->semmsl, &target_seminfo->semmsl);
++ __put_user(host_seminfo->semopm, &target_seminfo->semopm);
++ __put_user(host_seminfo->semume, &target_seminfo->semume);
++ __put_user(host_seminfo->semusz, &target_seminfo->semusz);
++ __put_user(host_seminfo->semvmx, &target_seminfo->semvmx);
++ __put_user(host_seminfo->semaem, &target_seminfo->semaem);
++ unlock_user_struct(target_seminfo, target_addr, 1);
++ return 0;
++}
++
+ union semun {
+- int val;
+- struct semid_ds *buf;
+- unsigned short *array;
++ int val;
++ struct semid_ds *buf;
++ unsigned short *array;
++ struct seminfo *__buf;
+ };
+
+ union target_semun {
+- int val;
+- abi_long buf;
+- unsigned short int *array;
++ int val;
++ abi_ulong buf;
++ abi_ulong array;
++ abi_ulong __buf;
+ };
+
+-static inline abi_long target_to_host_semun(int cmd,
+- union semun *host_su,
+- abi_ulong target_addr,
+- struct semid_ds *ds)
++static inline abi_long target_to_host_semarray(int semid, unsigned short **host_array,
++ abi_ulong target_addr)
+ {
+- union target_semun *target_su;
+-
+- switch( cmd ) {
+- case IPC_STAT:
+- case IPC_SET:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- target_to_host_semid_ds(ds,target_su->buf);
+- host_su->buf = ds;
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- case GETVAL:
+- case SETVAL:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- host_su->val = tswapl(target_su->val);
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- case GETALL:
+- case SETALL:
+- if (!lock_user_struct(VERIFY_READ, target_su, target_addr, 1))
+- return -TARGET_EFAULT;
+- *host_su->array = tswap16(*target_su->array);
+- unlock_user_struct(target_su, target_addr, 0);
+- break;
+- default:
+- gemu_log("semun operation not fully supported: %d\n", (int)cmd);
++ int nsems;
++ unsigned short *array;
++ union semun semun;
++ struct semid_ds semid_ds;
++ int i, ret;
++
++ semun.buf = &semid_ds;
++
++ ret = semctl(semid, 0, IPC_STAT, semun);
++ if (ret == -1)
++ return get_errno(ret);
++
++ nsems = semid_ds.sem_nsems;
++
++ *host_array = malloc(nsems*sizeof(unsigned short));
++ array = lock_user(VERIFY_READ, target_addr,
++ nsems*sizeof(unsigned short), 1);
++ if (!array)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsems; i++) {
++ __get_user((*host_array)[i], &array[i]);
+ }
++ unlock_user(array, target_addr, 0);
++
+ return 0;
+ }
+
+-static inline abi_long host_to_target_semun(int cmd,
+- abi_ulong target_addr,
+- union semun *host_su,
+- struct semid_ds *ds)
++static inline abi_long host_to_target_semarray(int semid, abi_ulong target_addr,
++ unsigned short **host_array)
+ {
+- union target_semun *target_su;
+-
+- switch( cmd ) {
+- case IPC_STAT:
+- case IPC_SET:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- host_to_target_semid_ds(target_su->buf,ds);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- case GETVAL:
+- case SETVAL:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- target_su->val = tswapl(host_su->val);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- case GETALL:
+- case SETALL:
+- if (lock_user_struct(VERIFY_WRITE, target_su, target_addr, 0))
+- return -TARGET_EFAULT;
+- *target_su->array = tswap16(*host_su->array);
+- unlock_user_struct(target_su, target_addr, 1);
+- break;
+- default:
+- gemu_log("semun operation not fully supported: %d\n", (int)cmd);
++ int nsems;
++ unsigned short *array;
++ union semun semun;
++ struct semid_ds semid_ds;
++ int i, ret;
++
++ semun.buf = &semid_ds;
++
++ ret = semctl(semid, 0, IPC_STAT, semun);
++ if (ret == -1)
++ return get_errno(ret);
++
++ nsems = semid_ds.sem_nsems;
++
++ array = lock_user(VERIFY_WRITE, target_addr,
++ nsems*sizeof(unsigned short), 0);
++ if (!array)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsems; i++) {
++ __put_user((*host_array)[i], &array[i]);
+ }
++ free(*host_array);
++ unlock_user(array, target_addr, 1);
++
+ return 0;
+ }
+
+-static inline abi_long do_semctl(int first, int second, int third,
+- abi_long ptr)
++static inline abi_long do_semctl(int semid, int semnum, int cmd,
++ union target_semun target_su)
+ {
+ union semun arg;
+ struct semid_ds dsarg;
+- int cmd = third&0xff;
+- abi_long ret = 0;
++ unsigned short *array;
++ struct seminfo seminfo;
++ abi_long ret = -TARGET_EINVAL;
++ abi_long err;
+
+- switch( cmd ) {
+- case GETVAL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case SETVAL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case GETALL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case SETALL:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case IPC_STAT:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- case IPC_SET:
+- target_to_host_semun(cmd,&arg,ptr,&dsarg);
+- ret = get_errno(semctl(first, second, cmd, arg));
+- host_to_target_semun(cmd,ptr,&arg,&dsarg);
+- break;
+- default:
+- ret = get_errno(semctl(first, second, cmd, arg));
++ cmd &= 0xff;
++
++ switch (cmd) {
++ case IPC_STAT:
++ case IPC_SET:
++ case SEM_STAT:
++ err = target_to_host_semid_ds(&dsarg, target_su.buf);
++ if (err)
++ return err;
++ arg.buf = &dsarg;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_semid_ds(target_su.buf, &dsarg);
++ if (err)
++ return err;
++ break;
++ case GETVAL:
++ case SETVAL:
++ arg.val = tswapl(target_su.val);
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ target_su.val = tswapl(arg.val);
++ break;
++ case GETALL:
++ case SETALL:
++ err = target_to_host_semarray(semid, &array, target_su.array);
++ if (err)
++ return err;
++ arg.array = array;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_semarray(semid, target_su.array, &array);
++ if (err)
++ return err;
++ break;
++ case IPC_INFO:
++ case SEM_INFO:
++ arg.__buf = &seminfo;
++ ret = get_errno(semctl(semid, semnum, cmd, arg));
++ err = host_to_target_seminfo(target_su.__buf, &seminfo);
++ if (err)
++ return err;
++ break;
++ case IPC_RMID:
++ case GETPID:
++ case GETNCNT:
++ case GETZCNT:
++ ret = get_errno(semctl(semid, semnum, cmd, NULL));
++ break;
+ }
+
+ return ret;
+ }
+
++struct target_sembuf {
++ unsigned short sem_num;
++ short sem_op;
++ short sem_flg;
++};
++
++static inline abi_long target_to_host_sembuf(struct sembuf *host_sembuf,
++ abi_ulong target_addr,
++ unsigned nsops)
++{
++ struct target_sembuf *target_sembuf;
++ int i;
++
++ target_sembuf = lock_user(VERIFY_READ, target_addr,
++ nsops*sizeof(struct target_sembuf), 1);
++ if (!target_sembuf)
++ return -TARGET_EFAULT;
++
++ for(i=0; i<nsops; i++) {
++ __put_user(target_sembuf[i].sem_num, &host_sembuf[i].sem_num);
++ __put_user(target_sembuf[i].sem_op, &host_sembuf[i].sem_op);
++ __put_user(target_sembuf[i].sem_flg, &host_sembuf[i].sem_flg);
++ }
++
++ unlock_user(target_sembuf, target_addr, 0);
++
++ return 0;
++}
++
++static inline abi_long do_semop(int semid, abi_long ptr, unsigned nsops)
++{
++ struct sembuf sops[nsops];
++
++ if (target_to_host_sembuf(sops, ptr, nsops))
++ return -TARGET_EFAULT;
++
++ return semop(semid, sops, nsops);
++}
++
+ struct target_msqid_ds
+ {
+ struct target_ipc_perm msg_perm;
+@@ -2044,7 +2126,7 @@ static abi_long do_ipc(unsigned int call, int first,
+
+ switch (call) {
+ case IPCOP_semop:
+- ret = get_errno(semop(first,(struct sembuf *)g2h(ptr), second));
++ ret = do_semop(first, ptr, second);
+ break;
+
+ case IPCOP_semget:
+@@ -2052,12 +2134,7 @@ static abi_long do_ipc(unsigned int call, int first,
+ break;
+
+ case IPCOP_semctl:
+- ret = do_semctl(first, second, third, ptr);
+- break;
+-
+- case IPCOP_semtimedop:
+- gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
+- ret = -TARGET_ENOSYS;
++ ret = do_semctl(first, second, third, (union target_semun) ptr);
+ break;
+
+ case IPCOP_msgget:
+--
+1.5.6.5.GIT
+
+
+
Added: trunk/patches/25_sem_syscalls.patch
===================================================================
--- trunk/patches/25_sem_syscalls.patch (rev 0)
+++ trunk/patches/25_sem_syscalls.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,42 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:20 +0300
+Subject: [Qemu-devel] [PATCH] Implement sem* syscalls
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 16 +++++++++++++++-
+ 1 files changed, 15 insertions(+), 1 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index f054ae4..57ba6cb 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -4906,7 +4906,21 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ ret = do_ipc(arg1, arg2, arg3, arg4, arg5, arg6);
+ break;
+ #endif
+-
++#ifdef TARGET_NR_semget
++ case TARGET_NR_semget:
++ ret = get_errno(semget(arg1, arg2, arg3));
++ break;
++#endif
++#ifdef TARGET_NR_semop
++ case TARGET_NR_semop:
++ ret = get_errno(do_semop(arg1, arg2, arg3));
++ break;
++#endif
++#ifdef TARGET_NR_semctl
++ case TARGET_NR_semctl:
++ ret = do_semctl(arg1, arg2, arg3, (union target_semun)arg4);
++ break;
++#endif
+ #ifdef TARGET_NR_msgctl
+ case TARGET_NR_msgctl:
+ ret = do_msgctl(arg1, arg2, arg3);
+--
+1.5.6.5.GIT
+
+
+
Added: trunk/patches/26_IPCOP_shm.patch
===================================================================
--- trunk/patches/26_IPCOP_shm.patch (rev 0)
+++ trunk/patches/26_IPCOP_shm.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,332 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:21 +0300
+Subject: [Qemu-devel] [PATCH] Fix and cleanup IPCOP_shm* ipc calls handling
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 282 +++++++++++++++++++++++++++++++++++++++----------
+ 1 files changed, 224 insertions(+), 58 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 57ba6cb..d39e711 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -2109,6 +2109,206 @@ end:
+ return ret;
+ }
+
++struct target_shmid_ds
++{
++ struct target_ipc_perm shm_perm;
++ abi_ulong shm_segsz;
++ abi_ulong shm_atime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused1;
++#endif
++ abi_ulong shm_dtime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused2;
++#endif
++ abi_ulong shm_ctime;
++#if TARGET_ABI_BITS == 32
++ abi_ulong __unused3;
++#endif
++ int shm_cpid;
++ int shm_lpid;
++ abi_ulong shm_nattch;
++ unsigned long int __unused4;
++ unsigned long int __unused5;
++};
++
++static inline abi_long target_to_host_shmid_ds(struct shmid_ds *host_sd,
++ abi_ulong target_addr)
++{
++ struct target_shmid_ds *target_sd;
++
++ if (!lock_user_struct(VERIFY_READ, target_sd, target_addr, 1))
++ return -TARGET_EFAULT;
++ if (target_to_host_ipc_perm(&(host_sd->shm_perm), target_addr))
++ return -TARGET_EFAULT;
++ __put_user(target_sd->shm_segsz, &host_sd->shm_segsz);
++ __put_user(target_sd->shm_atime, &host_sd->shm_atime);
++ __put_user(target_sd->shm_dtime, &host_sd->shm_dtime);
++ __put_user(target_sd->shm_ctime, &host_sd->shm_ctime);
++ __put_user(target_sd->shm_cpid, &host_sd->shm_cpid);
++ __put_user(target_sd->shm_lpid, &host_sd->shm_lpid);
++ __put_user(target_sd->shm_nattch, &host_sd->shm_nattch);
++ unlock_user_struct(target_sd, target_addr, 0);
++ return 0;
++}
++
++static inline abi_long host_to_target_shmid_ds(abi_ulong target_addr,
++ struct shmid_ds *host_sd)
++{
++ struct target_shmid_ds *target_sd;
++
++ if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0))
++ return -TARGET_EFAULT;
++ if (host_to_target_ipc_perm(target_addr, &(host_sd->shm_perm)))
++ return -TARGET_EFAULT;
++ __put_user(host_sd->shm_segsz, &target_sd->shm_segsz);
++ __put_user(host_sd->shm_atime, &target_sd->shm_atime);
++ __put_user(host_sd->shm_dtime, &target_sd->shm_dtime);
++ __put_user(host_sd->shm_ctime, &target_sd->shm_ctime);
++ __put_user(host_sd->shm_cpid, &target_sd->shm_cpid);
++ __put_user(host_sd->shm_lpid, &target_sd->shm_lpid);
++ __put_user(host_sd->shm_nattch, &target_sd->shm_nattch);
++ unlock_user_struct(target_sd, target_addr, 1);
++ return 0;
++}
++
++struct target_shminfo {
++ abi_ulong shmmax;
++ abi_ulong shmmin;
++ abi_ulong shmmni;
++ abi_ulong shmseg;
++ abi_ulong shmall;
++};
++
++static inline abi_long host_to_target_shminfo(abi_ulong target_addr,
++ struct shminfo *host_shminfo)
++{
++ struct target_shminfo *target_shminfo;
++ if (!lock_user_struct(VERIFY_WRITE, target_shminfo, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_shminfo->shmmax, &target_shminfo->shmmax);
++ __put_user(host_shminfo->shmmin, &target_shminfo->shmmin);
++ __put_user(host_shminfo->shmmni, &target_shminfo->shmmni);
++ __put_user(host_shminfo->shmseg, &target_shminfo->shmseg);
++ __put_user(host_shminfo->shmall, &target_shminfo->shmall);
++ unlock_user_struct(target_shminfo, target_addr, 1);
++}
++
++struct target_shm_info {
++ int used_ids;
++ abi_ulong shm_tot;
++ abi_ulong shm_rss;
++ abi_ulong shm_swp;
++ abi_ulong swap_attempts;
++ abi_ulong swap_successes;
++};
++
++static inline abi_long host_to_target_shm_info(abi_ulong target_addr,
++ struct shm_info *host_shm_info)
++{
++ struct target_shm_info *target_shm_info;
++ if (!lock_user_struct(VERIFY_WRITE, target_shm_info, target_addr, 0))
++ return -TARGET_EFAULT;
++ __put_user(host_shm_info->used_ids, &target_shm_info->used_ids);
++ __put_user(host_shm_info->shm_tot, &target_shm_info->shm_tot);
++ __put_user(host_shm_info->shm_rss, &target_shm_info->shm_rss);
++ __put_user(host_shm_info->shm_swp, &target_shm_info->shm_swp);
++ __put_user(host_shm_info->swap_attempts, &target_shm_info->swap_attempts);
++ __put_user(host_shm_info->swap_successes, &target_shm_info->swap_successes);
++ unlock_user_struct(target_shm_info, target_addr, 1);
++}
++
++static inline abi_long do_shmctl(int shmid, int cmd, abi_long buf)
++{
++ struct shmid_ds dsarg;
++ struct shminfo shminfo;
++ struct shm_info shm_info;
++ abi_long ret = -TARGET_EINVAL;
++
++ cmd &= 0xff;
++
++ switch(cmd) {
++ case IPC_STAT:
++ case IPC_SET:
++ case SHM_STAT:
++ if (target_to_host_shmid_ds(&dsarg, buf))
++ return -TARGET_EFAULT;
++ ret = get_errno(shmctl(shmid, cmd, &dsarg));
++ if (host_to_target_shmid_ds(buf, &dsarg))
++ return -TARGET_EFAULT;
++ break;
++ case IPC_INFO:
++ ret = get_errno(shmctl(shmid, cmd, (struct shmid_ds *)&shminfo));
++ if (host_to_target_shminfo(buf, &shminfo))
++ return -TARGET_EFAULT;
++ break;
++ case SHM_INFO:
++ ret = get_errno(shmctl(shmid, cmd, (struct shmid_ds *)&shm_info));
++ if (host_to_target_shm_info(buf, &shm_info))
++ return -TARGET_EFAULT;
++ break;
++ case IPC_RMID:
++ case SHM_LOCK:
++ case SHM_UNLOCK:
++ ret = get_errno(shmctl(shmid, cmd, NULL));
++ break;
++ }
++
++ return ret;
++}
++
++static inline abi_long do_shmat(int shmid, abi_ulong shmaddr, int shmflg,
++ unsigned long *raddr)
++{
++ abi_long ret;
++ struct shmid_ds shm_info;
++ int i;
++
++ /* SHM_* flags are the same on all linux platforms */
++ *raddr = (unsigned long) shmat(shmid, g2h(shmaddr), shmflg);
++
++ if (*raddr == -1) {
++ return get_errno(*raddr);
++ }
++
++ /* find out the length of the shared memory segment */
++ ret = get_errno(shmctl(shmid, IPC_STAT, &shm_info));
++ if (is_error(ret)) {
++ /* can't get length, bail out */
++ shmdt((void *) *raddr);
++ return get_errno(ret);
++ }
++
++ page_set_flags(h2g(*raddr), h2g(*raddr) + shm_info.shm_segsz,
++ PAGE_VALID | PAGE_READ |
++ ((shmflg & SHM_RDONLY)? 0 : PAGE_WRITE));
++
++ for (i = 0; i < N_SHM_REGIONS; i++) {
++ if (shm_regions[i].start == 0) {
++ shm_regions[i].start = h2g(*raddr);
++ shm_regions[i].size = shm_info.shm_segsz;
++ break;
++ }
++ }
++
++ return 0;
++}
++
++static inline abi_long do_shmdt(abi_ulong shmaddr)
++{
++ int i;
++
++ for (i = 0; i < N_SHM_REGIONS; ++i) {
++ if (shm_regions[i].start == shmaddr) {
++ shm_regions[i].start = 0;
++ page_set_flags(shmaddr, shm_regions[i].size, 0);
++ break;
++ }
++ }
++
++ return get_errno(shmdt(g2h(shmaddr)));
++}
++
+ #ifdef TARGET_NR_ipc
+ /* ??? This only works with linear mappings. */
+ /* do_ipc() must return target values and target errnos. */
+@@ -2118,8 +2318,6 @@ static abi_long do_ipc(unsigned int call, int first,
+ {
+ int version;
+ abi_long ret = 0;
+- struct shmid_ds shm_info;
+- int i;
+
+ version = call >> 16;
+ call &= 0xffff;
+@@ -2174,72 +2372,40 @@ static abi_long do_ipc(unsigned int call, int first,
+ break;
+
+ case IPCOP_shmat:
+- {
+- abi_ulong raddr;
+- void *host_addr;
+- /* SHM_* flags are the same on all linux platforms */
+- host_addr = shmat(first, (void *)g2h(ptr), second);
+- if (host_addr == (void *)-1) {
+- ret = get_errno((long)host_addr);
+- break;
+- }
+- raddr = h2g((unsigned long)host_addr);
+- /* find out the length of the shared memory segment */
+-
+- ret = get_errno(shmctl(first, IPC_STAT, &shm_info));
+- if (is_error(ret)) {
+- /* can't get length, bail out */
+- shmdt(host_addr);
+- break;
+- }
+- page_set_flags(raddr, raddr + shm_info.shm_segsz,
+- PAGE_VALID | PAGE_READ |
+- ((second & SHM_RDONLY)? 0: PAGE_WRITE));
+- for (i = 0; i < N_SHM_REGIONS; ++i) {
+- if (shm_regions[i].start == 0) {
+- shm_regions[i].start = raddr;
+- shm_regions[i].size = shm_info.shm_segsz;
++ switch (version) {
++ default:
++ {
++ unsigned long raddr;
++
++ ret = do_shmat(first, ptr, second, &raddr);
++ if (ret)
+ break;
+- }
++
++ ret = put_user_ual(raddr, third);
++ break;
+ }
+- if (put_user_ual(raddr, third))
+- return -TARGET_EFAULT;
+- ret = 0;
++ case 1:
++ ret = -TARGET_EINVAL;
++ break;
+ }
+- break;
++ break;
++
+ case IPCOP_shmdt:
+- for (i = 0; i < N_SHM_REGIONS; ++i) {
+- if (shm_regions[i].start == ptr) {
+- shm_regions[i].start = 0;
+- page_set_flags(ptr, shm_regions[i].size, 0);
+- break;
+- }
+- }
+- ret = get_errno(shmdt((void *)g2h(ptr)));
+- break;
++ ret = do_shmdt(ptr);
++ break;
+
+ case IPCOP_shmget:
+- /* IPC_* flag values are the same on all linux platforms */
+- ret = get_errno(shmget(first, second, third));
+- break;
++ ret = get_errno(shmget(first, second, third));
++ break;
+
+- /* IPC_* and SHM_* command values are the same on all linux platforms */
+ case IPCOP_shmctl:
+- switch(second) {
+- case IPC_RMID:
+- case SHM_LOCK:
+- case SHM_UNLOCK:
+- ret = get_errno(shmctl(first, second, NULL));
+- break;
+- default:
+- goto unimplemented;
+- }
++ ret = do_shmctl(first, second, third);
+ break;
++
+ default:
+- unimplemented:
+- gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
+- ret = -TARGET_ENOSYS;
+- break;
++ gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
++ ret = -TARGET_ENOSYS;
++ break;
+ }
+ return ret;
+ }
+--
+1.5.6.5.GIT
+
+
+
Added: trunk/patches/27_shm_syscalls.patch
===================================================================
--- trunk/patches/27_shm_syscalls.patch (rev 0)
+++ trunk/patches/27_shm_syscalls.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -0,0 +1,52 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:22 +0300
+Subject: [Qemu-devel] [PATCH] Implement shm* syscalls
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 26 ++++++++++++++++++++++++++
+ 1 files changed, 26 insertions(+), 0 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index d39e711..45b2c66 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -5107,6 +5107,32 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ ret = do_msgsnd(arg1, arg2, arg3, arg4);
+ break;
+ #endif
++#ifdef TARGET_NR_shmget
++ case TARGET_NR_shmget:
++ ret = get_errno(shmget(arg1, arg2, arg3));
++ break;
++#endif
++#ifdef TARGET_NR_shmctl
++ case TARGET_NR_shmctl:
++ ret = do_shmctl(arg1, arg2, arg3);
++ break;
++#endif
++#ifdef TARGET_NR_shmat
++ case TARGET_NR_shmat:
++ {
++ abi_long err;
++ unsigned long _ret;
++
++ err = do_shmat(arg1, arg2, arg3, &_ret);
++ ret = err ? err : _ret;
++ }
++ break;
++#endif
++#ifdef TARGET_NR_shmdt
++ case TARGET_NR_shmdt:
++ ret = do_shmdt(arg1);
++ break;
++#endif
+ case TARGET_NR_fsync:
+ ret = get_errno(fsync(arg1));
+ break;
+--
+1.5.6.5.GIT
+
+
+
Deleted: trunk/patches/30_syscall_ipc.patch
===================================================================
--- trunk/patches/30_syscall_ipc.patch 2008-10-02 17:00:49 UTC (rev 29)
+++ trunk/patches/30_syscall_ipc.patch 2008-10-02 22:17:28 UTC (rev 30)
@@ -1,19 +0,0 @@
-#DPATCHLEVEL=0
-Index: linux-user/syscall.c
-===================================================================
---- linux-user/syscall.c.orig 2008-08-11 12:33:52.000000000 -0300
-+++ linux-user/syscall.c 2008-08-11 12:33:58.000000000 -0300
-@@ -2178,11 +2178,11 @@
- ret = get_errno(shmctl(first, second, NULL));
- break;
- default:
-- goto unimplemented;
-+ ret = get_errno(shmctl(first, second, (struct shmid_ds *) ptr));
-+ break;
- }
- break;
- default:
-- unimplemented:
- gemu_log("Unsupported ipc call: %d (version %d)\n", call, version);
- ret = -TARGET_ENOSYS;
- break;
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-02 17:00:49 UTC (rev 29)
+++ trunk/patches/series 2008-10-02 22:17:28 UTC (rev 30)
@@ -5,7 +5,12 @@
19_zero_null.3.accept.patch
19_zero_null.2.read.patch
21_net_soopts.patch
-30_syscall_ipc.patch -p0
+22_IPCOP_msg.patch
+23_msg_syscalls.patch
+24_IPCOP_sem.patch
+25_sem_syscalls.patch
+26_IPCOP_shm.patch
+27_shm_syscalls.patch
31_syscalls.patch
32_syscall_sysctl.patch -p0
33_fix_getdents_syscalls.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-02 17:00:52
|
Revision: 29
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=29&view=rev
Author: laurov
Date: 2008-10-02 17:00:49 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Apply fix_getdents_syscalls.patch (Kirill A. Shutemov).
It fixes ps execution inside a qemu chroot.
Modified Paths:
--------------
trunk/patches/series
Added Paths:
-----------
trunk/patches/33_fix_getdents_syscalls.patch
Added: trunk/patches/33_fix_getdents_syscalls.patch
===================================================================
--- trunk/patches/33_fix_getdents_syscalls.patch (rev 0)
+++ trunk/patches/33_fix_getdents_syscalls.patch 2008-10-02 17:00:49 UTC (rev 29)
@@ -0,0 +1,162 @@
+From: "Kirill A. Shutemov" <ki...@sh...>
+To: qem...@no...
+Date: Wed, 1 Oct 2008 16:56:16 +0300
+Subject: [Qemu-devel] [PATCH] Fix getdents* syscalls
+
+glibc's structs dirent and dirent64 is different from in-kernel dirent
+and dirent64. Kernel headers doesn't provide structs dirent(64) any
+more. So we should add it to qemu headers.
+
+To avoid conflict with glibc it called struct linux_dirent(64).
+
+Signed-off-by: Kirill A. Shutemov <ki...@sh...>
+---
+ linux-user/syscall.c | 27 +++++++++++++--------------
+ linux-user/syscall_defs.h | 15 +++++++++++++++
+ 2 files changed, 28 insertions(+), 14 deletions(-)
+
+diff --git a/linux-user/syscall.c b/linux-user/syscall.c
+index 33e953a..a8eb6d3 100644
+--- a/linux-user/syscall.c
++++ b/linux-user/syscall.c
+@@ -28,7 +28,6 @@
+ #include <fcntl.h>
+ #include <time.h>
+ #include <limits.h>
+-#include <dirent.h>
+ #include <sys/types.h>
+ #include <sys/ipc.h>
+ #include <sys/msg.h>
+@@ -94,8 +93,8 @@
+ #endif
+
+ //#include <linux/msdos_fs.h>
+-#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct dirent [2])
+-#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct dirent [2])
++#define VFAT_IOCTL_READDIR_BOTH _IOR('r', 1, struct linux_dirent [2])
++#define VFAT_IOCTL_READDIR_SHORT _IOR('r', 2, struct linux_dirent [2])
+
+
+ #undef _syscall0
+@@ -216,10 +215,10 @@ _syscall3(int,sys_futimesat,int,dirfd,const char *,pathname,
+ #endif
+ _syscall2(int,sys_getcwd1,char *,buf,size_t,size)
+ #if TARGET_ABI_BITS == 32
+-_syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count);
++_syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count);
+ #endif
+ #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
+-_syscall3(int, sys_getdents64, uint, fd, struct dirent64 *, dirp, uint, count);
++_syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
+ #endif
+ _syscall2(int, sys_getpriority, int, which, int, who);
+ #if !defined (__x86_64__)
+@@ -4879,7 +4878,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ #elif TARGET_ABI_BITS == 32 && HOST_LONG_BITS == 64
+ {
+ struct target_dirent *target_dirp;
+- struct dirent *dirp;
++ struct linux_dirent *dirp;
+ abi_long count = arg3;
+
+ dirp = malloc(count);
+@@ -4890,7 +4889,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+
+ ret = get_errno(sys_getdents(arg1, dirp, count));
+ if (!is_error(ret)) {
+- struct dirent *de;
++ struct linux_dirent *de;
+ struct target_dirent *tde;
+ int len = ret;
+ int reclen, treclen;
+@@ -4912,7 +4911,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ tnamelen = 256;
+ /* XXX: may not be correct */
+ strncpy(tde->d_name, de->d_name, tnamelen);
+- de = (struct dirent *)((char *)de + reclen);
++ de = (struct linux_dirent *)((char *)de + reclen);
+ len -= reclen;
+ tde = (struct target_dirent *)((char *)tde + treclen);
+ count1 += treclen;
+@@ -4924,14 +4923,14 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ }
+ #else
+ {
+- struct dirent *dirp;
++ struct linux_dirent *dirp;
+ abi_long count = arg3;
+
+ if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
+ goto efault;
+ ret = get_errno(sys_getdents(arg1, dirp, count));
+ if (!is_error(ret)) {
+- struct dirent *de;
++ struct linux_dirent *de;
+ int len = ret;
+ int reclen;
+ de = dirp;
+@@ -4942,7 +4941,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ de->d_reclen = tswap16(reclen);
+ tswapls(&de->d_ino);
+ tswapls(&de->d_off);
+- de = (struct dirent *)((char *)de + reclen);
++ de = (struct linux_dirent *)((char *)de + reclen);
+ len -= reclen;
+ }
+ }
+@@ -4953,13 +4952,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
+ case TARGET_NR_getdents64:
+ {
+- struct dirent64 *dirp;
++ struct linux_dirent64 *dirp;
+ abi_long count = arg3;
+ if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
+ goto efault;
+ ret = get_errno(sys_getdents64(arg1, dirp, count));
+ if (!is_error(ret)) {
+- struct dirent64 *de;
++ struct linux_dirent64 *de;
+ int len = ret;
+ int reclen;
+ de = dirp;
+@@ -4970,7 +4969,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
+ de->d_reclen = tswap16(reclen);
+ tswap64s((uint64_t *)&de->d_ino);
+ tswap64s((uint64_t *)&de->d_off);
+- de = (struct dirent64 *)((char *)de + reclen);
++ de = (struct linux_dirent64 *)((char *)de + reclen);
+ len -= reclen;
+ }
+ }
+diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
+index c30bb15..5a58010 100644
+--- a/linux-user/syscall_defs.h
++++ b/linux-user/syscall_defs.h
+@@ -1963,6 +1963,21 @@ struct target_sysinfo {
+ char _f[20-2*sizeof(abi_long)-sizeof(int)]; /* Padding: libc5 uses this.. */
+ };
+
++struct linux_dirent {
++ long d_ino;
++ unsigned long d_off;
++ unsigned short d_reclen;
++ char d_name[256]; /* We must not include limits.h! */
++};
++
++struct linux_dirent64 {
++ uint64_t d_ino;
++ int64_t d_off;
++ unsigned short d_reclen;
++ unsigned char d_type;
++ char d_name[256];
++};
++
+ #include "socket.h"
+
+ #include "errno_defs.h"
+--
+1.5.6.5.GIT
+
+
+
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-10-02 16:49:17 UTC (rev 28)
+++ trunk/patches/series 2008-10-02 17:00:49 UTC (rev 29)
@@ -8,6 +8,7 @@
30_syscall_ipc.patch -p0
31_syscalls.patch
32_syscall_sysctl.patch -p0
+33_fix_getdents_syscalls.patch
35_syscall_sockaddr.patch
44_socklen_t_check.patch
48_signal_terminate.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <la...@us...> - 2008-10-02 16:49:26
|
Revision: 28
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=28&view=rev
Author: laurov
Date: 2008-10-02 16:49:17 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Update to qemu mainstream revision 5391.
Revision Links:
--------------
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=5391&view=rev
Modified Paths:
--------------
trunk/get-qemu.sh
trunk/patches/31_syscalls.patch
trunk/patches/32_syscall_sysctl.patch
trunk/patches/35_syscall_sockaddr.patch
trunk/patches/series
Removed Paths:
-------------
trunk/patches/00_build_fix.patch
trunk/patches/01_static_build.patch
trunk/patches/02_snapshot_use_tmpdir.patch
trunk/patches/19_zero_null.1.getgroups.patch
trunk/patches/23_futimesat.patch
trunk/patches/34_syscalls_types.patch
trunk/patches/39_syscall_fadvise64.patch
trunk/patches/41_arm_fpa_sigfpe.patch
trunk/patches/42_arm_tls.patch
trunk/patches/43_arm_cpustate.patch
trunk/patches/55_unmux_socketcall.patch
trunk/patches/66_tls_ld.patch
trunk/patches/69_arm_kmb.patch
trunk/patches/96_futex.patch
trunk/patches/97_inotify.patch
Modified: trunk/get-qemu.sh
===================================================================
--- trunk/get-qemu.sh 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/get-qemu.sh 2008-10-02 16:49:17 UTC (rev 28)
@@ -13,7 +13,7 @@
export QUILT_PATCHES=../patches
-svn co -r4993 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
+svn co -r5391 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
cd qemu-arm-eabi
quilt push -a
Deleted: trunk/patches/00_build_fix.patch
===================================================================
--- trunk/patches/00_build_fix.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/00_build_fix.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,13 +0,0 @@
-Index: qemu/Makefile.target
-===================================================================
---- qemu.orig/Makefile.target 2007-11-12 16:40:12.000000000 -0300
-+++ qemu/Makefile.target 2007-11-12 16:42:34.000000000 -0300
-@@ -128,7 +128,7 @@
- USE_I386_LD=y
- endif
- ifdef USE_I386_LD
--BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-+#BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- else
- ifdef CONFIG_LINUX_USER
- # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
Deleted: trunk/patches/01_static_build.patch
===================================================================
--- trunk/patches/01_static_build.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/01_static_build.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,23 +0,0 @@
-Index: qemu/Makefile.target
-===================================================================
---- qemu.orig/Makefile.target 2007-11-12 14:47:19.000000000 -0300
-+++ qemu/Makefile.target 2007-11-12 15:31:04.000000000 -0300
-@@ -128,7 +128,7 @@
- USE_I386_LD=y
- endif
- ifdef USE_I386_LD
--BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
-+#BASE_LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH).ld
- else
- ifdef CONFIG_LINUX_USER
- # WARNING: this LDFLAGS is _very_ tricky : qemu is an ELF shared object
-@@ -538,6 +538,9 @@
- ifndef CONFIG_WIN32
- ifndef CONFIG_SOLARIS
- VL_LIBS+=-lutil
-+ifdef CONFIG_STATIC
-+LIBS+=-pthread
-+endif
- endif
- endif
- endif
Deleted: trunk/patches/02_snapshot_use_tmpdir.patch
===================================================================
--- trunk/patches/02_snapshot_use_tmpdir.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/02_snapshot_use_tmpdir.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,19 +0,0 @@
-#DPATCHLEVEL=0
-Index: block.c
-===================================================================
---- block.c.orig 2007-11-12 15:27:49.000000000 -0300
-+++ block.c 2007-11-12 16:45:57.000000000 -0300
-@@ -192,8 +192,12 @@
- void get_tmp_filename(char *filename, int size)
- {
- int fd;
-+ char *tmpdir;
- /* XXX: race condition possible */
-- pstrcpy(filename, size, "/tmp/vl.XXXXXX");
-+ tmpdir = getenv("TMPDIR");
-+ if (!tmpdir)
-+ tmpdir = "/tmp";
-+ snprintf(filename, size, "%s/vl.XXXXXX", tmpdir);
- fd = mkstemp(filename);
- close(fd);
- }
Deleted: trunk/patches/19_zero_null.1.getgroups.patch
===================================================================
--- trunk/patches/19_zero_null.1.getgroups.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/19_zero_null.1.getgroups.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,22 +0,0 @@
-Index: qemu/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:30:13.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:30:15.000000000 -0300
-@@ -5246,7 +5246,7 @@
-
- grouplist = alloca(gidsetsize * sizeof(gid_t));
- ret = get_errno(getgroups(gidsetsize, grouplist));
-- if (!is_error(ret)) {
-+ if (!is_error(ret) && arg1) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 2, 0);
- if (!target_grouplist)
- goto efault;
-@@ -5396,7 +5396,7 @@
-
- grouplist = alloca(gidsetsize * sizeof(gid_t));
- ret = get_errno(getgroups(gidsetsize, grouplist));
-- if (!is_error(ret)) {
-+ if (!is_error(ret) && arg1) {
- target_grouplist = lock_user(VERIFY_WRITE, arg2, gidsetsize * 4, 0);
- if (!target_grouplist) {
- ret = -TARGET_EFAULT;
Deleted: trunk/patches/23_futimesat.patch
===================================================================
--- trunk/patches/23_futimesat.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/23_futimesat.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,49 +0,0 @@
-Index: qemu/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:32:19.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:32:54.000000000 -0300
-@@ -154,6 +154,7 @@
- #define __NR_sys_faccessat __NR_faccessat
- #define __NR_sys_fchmodat __NR_fchmodat
- #define __NR_sys_fchownat __NR_fchownat
-+#define __NR_sys_futimesat __NR_futimesat
- #define __NR_sys_getcwd1 __NR_getcwd
- #define __NR_sys_getdents __NR_getdents
- #define __NR_sys_getdents64 __NR_getdents64
-@@ -198,6 +199,10 @@
- _syscall5(int,sys_fchownat,int,dirfd,const char *,pathname,
- uid_t,owner,gid_t,group,int,flags)
- #endif
-+#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat)
-+_syscall3(int,sys_futimesat,int,dirfd,const char *,pathname,
-+ const struct timeval *,times)
-+#endif
- _syscall2(int,sys_getcwd1,char *,buf,size_t,size)
- _syscall3(int, sys_getdents, uint, fd, struct dirent *, dirp, uint, count);
- #if defined(TARGET_NR_getdents64) && defined(__NR_getdents64)
-@@ -5847,6 +5852,25 @@
- break;
- #endif
-
-+#if defined(TARGET_NR_futimesat) && defined(__NR_futimesat)
-+ case TARGET_NR_futimesat:
-+ {
-+ struct timeval tv[2];
-+ if (copy_from_user_timeval(tv, arg3)
-+ || copy_from_user_timeval(tv+1, arg3+sizeof(struct target_timeval))) {
-+ goto efault;
-+ }
-+ if (!arg2)
-+ ret = get_errno(sys_futimesat(arg1, NULL, tv));
-+ else {
-+ p = lock_user_string(arg2);
-+ ret = get_errno(sys_futimesat(arg1, path(p), tv));
-+ unlock_user(p, arg2, 0);
-+ }
-+ }
-+ break;
-+#endif
-+
- #ifdef TARGET_NR_set_robust_list
- case TARGET_NR_set_robust_list:
- goto unimplemented_nowarn;
Modified: trunk/patches/31_syscalls.patch
===================================================================
--- trunk/patches/31_syscalls.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/31_syscalls.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,16 +1,16 @@
-Index: qemu/linux-user/syscall.c
+Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:33:58.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:34:15.000000000 -0300
-@@ -273,6 +273,7 @@
- extern int setresgid(gid_t, gid_t, gid_t);
- extern int getresgid(gid_t *, gid_t *, gid_t *);
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-01 20:18:39.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-01 20:27:26.000000000 -0300
+@@ -294,6 +294,7 @@
+ extern int setfsuid(int);
+ extern int setfsgid(int);
extern int setgroups(int, gid_t *);
+extern int uselib(const char*);
#define ERRNO_TABLE_SIZE 1200
-@@ -4334,7 +4335,8 @@
+@@ -4444,7 +4445,8 @@
#endif
#ifdef TARGET_NR_uselib
case TARGET_NR_uselib:
@@ -20,24 +20,7 @@
#endif
#ifdef TARGET_NR_swapon
case TARGET_NR_swapon:
-@@ -5615,8 +5617,14 @@
- case TARGET_NR_pivot_root:
- goto unimplemented;
- #ifdef TARGET_NR_mincore
-- case TARGET_NR_mincore:
-- goto unimplemented;
-+ case TARGET_NR_mincore: {
-+ size_t len = ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE;
-+ if (!(p = lock_user(VERIFY_WRITE, arg3, len, 0)))
-+ goto efault;
-+ ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)p));
-+ unlock_user(p, arg3, len);
-+ break;
-+ }
- #endif
- #ifdef TARGET_NR_madvise
- case TARGET_NR_madvise:
-@@ -5756,7 +5764,8 @@
+@@ -5874,7 +5876,8 @@
break;
#ifdef TARGET_NR_readahead
case TARGET_NR_readahead:
Modified: trunk/patches/32_syscall_sysctl.patch
===================================================================
--- trunk/patches/32_syscall_sysctl.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/32_syscall_sysctl.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,17 +1,17 @@
#DPATCHLEVEL=0
Index: linux-user/syscall.c
===================================================================
---- linux-user/syscall.c.orig 2008-08-11 12:34:15.000000000 -0300
-+++ linux-user/syscall.c 2008-08-11 12:34:45.000000000 -0300
-@@ -53,6 +53,7 @@
+--- linux-user/syscall.c.orig 2008-10-01 18:48:30.000000000 -0300
++++ linux-user/syscall.c 2008-10-01 19:00:21.000000000 -0300
+@@ -50,6 +50,7 @@
+ #include <sys/sem.h>
+ #include <sys/statfs.h>
+ #include <utime.h>
++#include <sys/sysctl.h>
+ #include <sys/sysinfo.h>
//#include <sys/user.h>
#include <netinet/ip.h>
- #include <netinet/tcp.h>
-+#include <sys/sysctl.h>
-
- #define termios host_termios
- #define winsize host_winsize
-@@ -5051,9 +5052,35 @@
+@@ -5153,9 +5154,35 @@
break;
#endif
case TARGET_NR__sysctl:
Deleted: trunk/patches/34_syscalls_types.patch
===================================================================
--- trunk/patches/34_syscalls_types.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/34_syscalls_types.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,10 +0,0 @@
---- linux-user/syscall.c.orig 2005-07-23 01:55:22.169404147 +0300
-+++ linux-user/syscall.c 2005-07-23 01:52:31.157924629 +0300
-@@ -17,6 +17,7 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-+/*#include <linux/types.h>*/
- #include <stdlib.h>
- #include <stdio.h>
- #include <stdarg.h>
Modified: trunk/patches/35_syscall_sockaddr.patch
===================================================================
--- trunk/patches/35_syscall_sockaddr.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/35_syscall_sockaddr.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,17 +1,17 @@
-Index: qemu/linux-user/syscall.c
+Index: qemu-arm-eabi/linux-user/syscall.c
===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 12:34:59.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 12:35:05.000000000 -0300
-@@ -54,6 +54,7 @@
- //#include <sys/user.h>
- #include <netinet/ip.h>
- #include <netinet/tcp.h>
+--- qemu-arm-eabi.orig/linux-user/syscall.c 2008-10-01 19:00:21.000000000 -0300
++++ qemu-arm-eabi/linux-user/syscall.c 2008-10-01 19:11:01.000000000 -0300
+@@ -44,6 +44,7 @@
+ #include <sched.h>
+ #include <sys/socket.h>
+ #include <sys/uio.h>
+#include <sys/un.h>
- #include <sys/sysctl.h>
+ #include <sys/poll.h>
+ #include <sys/times.h>
+ #include <sys/shm.h>
+@@ -675,14 +676,17 @@
- #define termios host_termios
-@@ -667,14 +668,17 @@
-
static inline abi_long target_to_host_sockaddr(struct sockaddr *addr,
abi_ulong target_addr,
- socklen_t len)
@@ -31,7 +31,7 @@
addr->sa_family = tswap16(target_saddr->sa_family);
unlock_user(target_saddr, target_addr, 0);
-@@ -1225,7 +1229,7 @@
+@@ -1234,7 +1238,7 @@
{
void *addr = alloca(addrlen);
@@ -40,7 +40,7 @@
return get_errno(bind(sockfd, addr, addrlen));
}
-@@ -1235,7 +1239,7 @@
+@@ -1244,7 +1248,7 @@
{
void *addr = alloca(addrlen);
@@ -49,7 +49,7 @@
return get_errno(connect(sockfd, addr, addrlen));
}
-@@ -1260,7 +1264,7 @@
+@@ -1269,7 +1273,7 @@
msg.msg_namelen = tswap32(msgp->msg_namelen);
msg.msg_name = alloca(msg.msg_namelen);
target_to_host_sockaddr(msg.msg_name, tswapl(msgp->msg_name),
@@ -58,7 +58,7 @@
} else {
msg.msg_name = NULL;
msg.msg_namelen = 0;
-@@ -1393,7 +1397,7 @@
+@@ -1402,7 +1406,7 @@
return -TARGET_EFAULT;
if (target_addr) {
addr = alloca(addrlen);
Deleted: trunk/patches/39_syscall_fadvise64.patch
===================================================================
--- trunk/patches/39_syscall_fadvise64.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/39_syscall_fadvise64.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,17 +0,0 @@
-Index: linux-user/syscall.c
-===================================================================
---- linux-user/syscall.c.orig 2008-08-11 12:35:05.000000000 -0300
-+++ linux-user/syscall.c 2008-08-11 12:35:21.000000000 -0300
-@@ -5658,6 +5658,12 @@
- break;
- }
- #endif
-+#ifdef TARGET_NR_arm_fadvise64_64
-+ case TARGET_NR_arm_fadvise64_64:
-+ /* Just return success */
-+ ret = get_errno(0);
-+ break;
-+#endif
- #ifdef TARGET_NR_madvise
- case TARGET_NR_madvise:
- /* A straight passthrough may not be safe because qemu sometimes
Deleted: trunk/patches/41_arm_fpa_sigfpe.patch
===================================================================
--- trunk/patches/41_arm_fpa_sigfpe.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/41_arm_fpa_sigfpe.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,101 +0,0 @@
-#DPATCHLEVEL=0
-Index: linux-user/main.c
-===================================================================
---- linux-user/main.c.orig 2007-11-26 14:00:51.000000000 -0300
-+++ linux-user/main.c 2007-11-26 14:40:23.000000000 -0300
-@@ -377,19 +377,68 @@
- {
- TaskState *ts = env->opaque;
- uint32_t opcode;
-+ int rc;
-
- /* we handle the FPU emulation here, as Linux */
- /* we get the opcode */
- /* FIXME - what to do if get_user() fails? */
- get_user_u32(opcode, env->regs[15]);
-
-- if (EmulateAll(opcode, &ts->fpa, env) == 0) {
-+ rc = EmulateAll(opcode, &ts->fpa, env);
-+ if (rc == 0) {
- info.si_signo = SIGILL;
- info.si_errno = 0;
- info.si_code = TARGET_ILL_ILLOPN;
- info._sifields._sigfault._addr = env->regs[15];
- queue_signal(info.si_signo, &info);
-- } else {
-+ } else if (rc < 0) { /* FP exception */
-+ int arm_fpe=0;
-+
-+ /* translate softfloat flags to FPSR flags */
-+ if (-rc & float_flag_invalid)
-+ arm_fpe |= BIT_IOC;
-+ if (-rc & float_flag_divbyzero)
-+ arm_fpe |= BIT_DZC;
-+ if (-rc & float_flag_overflow)
-+ arm_fpe |= BIT_OFC;
-+ if (-rc & float_flag_underflow)
-+ arm_fpe |= BIT_UFC;
-+ if (-rc & float_flag_inexact)
-+ arm_fpe |= BIT_IXC;
-+
-+ FPSR fpsr = ts->fpa.fpsr;
-+ //printf("fpsr 0x%x, arm_fpe 0x%x\n",fpsr,arm_fpe);
-+
-+ if (fpsr & (arm_fpe << 16)) { /* exception enabled? */
-+ info.si_signo = SIGFPE;
-+ info.si_errno = 0;
-+
-+ /* ordered by priority, least first */
-+ if (arm_fpe & BIT_IXC) info.si_code = TARGET_FPE_FLTRES;
-+ if (arm_fpe & BIT_UFC) info.si_code = TARGET_FPE_FLTUND;
-+ if (arm_fpe & BIT_OFC) info.si_code = TARGET_FPE_FLTOVF;
-+ if (arm_fpe & BIT_DZC) info.si_code = TARGET_FPE_FLTDIV;
-+ if (arm_fpe & BIT_IOC) info.si_code = TARGET_FPE_FLTINV;
-+
-+ info._sifields._sigfault._addr = env->regs[15];
-+ queue_signal(info.si_signo, &info);
-+ } else {
-+ env->regs[15] += 4;
-+ }
-+
-+ /* accumulate unenabled exceptions */
-+ if ((!(fpsr & BIT_IXE)) && (arm_fpe & BIT_IXC))
-+ fpsr |= BIT_IXC;
-+ if ((!(fpsr & BIT_UFE)) && (arm_fpe & BIT_UFC))
-+ fpsr |= BIT_UFC;
-+ if ((!(fpsr & BIT_OFE)) && (arm_fpe & BIT_OFC))
-+ fpsr |= BIT_OFC;
-+ if ((!(fpsr & BIT_DZE)) && (arm_fpe & BIT_DZC))
-+ fpsr |= BIT_DZC;
-+ if ((!(fpsr & BIT_IOE)) && (arm_fpe & BIT_IOC))
-+ fpsr |= BIT_IOC;
-+ ts->fpa.fpsr=fpsr;
-+ } else { /* everything OK */
- /* increment PC */
- env->regs[15] += 4;
- }
-Index: target-arm/nwfpe/fpa11.c
-===================================================================
---- target-arm/nwfpe/fpa11.c.orig 2007-11-26 14:00:26.000000000 -0300
-+++ target-arm/nwfpe/fpa11.c 2007-11-26 14:37:00.000000000 -0300
-@@ -162,6 +162,8 @@
- fpa11->initflag = 1;
- }
-
-+ set_float_exception_flags(0, &fpa11->fp_status);
-+
- if (TEST_OPCODE(opcode,MASK_CPRT))
- {
- //fprintf(stderr,"emulating CPRT\n");
-@@ -191,6 +193,11 @@
- }
-
- // restore_flags(flags);
-+ if(nRc == 1 && get_float_exception_flags(&fpa11->fp_status))
-+ {
-+ //printf("fef 0x%x\n",float_exception_flags);
-+ nRc=-get_float_exception_flags(&fpa11->fp_status);
-+ }
-
- //printf("returning %d\n",nRc);
- return(nRc);
Deleted: trunk/patches/42_arm_tls.patch
===================================================================
--- trunk/patches/42_arm_tls.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/42_arm_tls.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,42 +0,0 @@
-Index: linux-user/qemu.h
-===================================================================
---- linux-user/qemu.h.orig 2008-08-11 14:42:46.000000000 -0300
-+++ linux-user/qemu.h 2008-08-11 14:43:14.000000000 -0300
-@@ -127,6 +127,9 @@
- uint32_t heap_base;
- uint32_t heap_limit;
- #endif
-+#if defined(USE_NPTL)
-+ uint32_t *child_tidptr;
-+#endif
- int used; /* non zero if used */
- struct image_info *info;
-
-Index: linux-user/main.c
-===================================================================
---- linux-user/main.c.orig 2008-08-11 14:43:09.000000000 -0300
-+++ linux-user/main.c 2008-08-11 14:43:14.000000000 -0300
-@@ -661,10 +661,8 @@
- }
- }
-
-- if (n == ARM_NR_cacheflush) {
-- arm_cache_flush(env->regs[0], env->regs[1]);
-- } else if (n == ARM_NR_semihosting
-- || n == ARM_NR_thumb_semihosting) {
-+ if (n == ARM_NR_semihosting
-+ || n == ARM_NR_thumb_semihosting) {
- env->regs[0] = do_arm_semihosting (env);
- } else if (n == 0 || n >= ARM_SYSCALL_BASE
- || (env->thumb && n == ARM_THUMB_SYSCALL)) {
-@@ -2620,6 +2618,10 @@
- ts->heap_base = info->brk;
- /* This will be filled in on the first SYS_HEAPINFO call. */
- ts->heap_limit = 0;
-+ /* Register the magic kernel code page. The cpu will generate a
-+ special exception when it tries to execute code here. We can't
-+ put real code here because it may be in use by the host kernel. */
-+ page_set_flags(0xffff0000, 0xffff0fff, 0);
- #endif
-
- if (gdbstub_port) {
Deleted: trunk/patches/43_arm_cpustate.patch
===================================================================
--- trunk/patches/43_arm_cpustate.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/43_arm_cpustate.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,35 +0,0 @@
-#DPATCHLEVEL=0
-Index: exec.c
-===================================================================
---- exec.c.orig 2007-11-12 14:47:21.000000000 -0300
-+++ exec.c 2007-11-12 19:31:36.000000000 -0300
-@@ -286,24 +286,16 @@
-
- void cpu_exec_init(CPUState *env)
- {
-- CPUState **penv;
-- int cpu_index;
--
- if (!code_gen_ptr) {
- code_gen_ptr = code_gen_buffer;
- page_init();
- io_mem_init();
- }
-- env->next_cpu = NULL;
-- penv = &first_cpu;
-- cpu_index = 0;
-- while (*penv != NULL) {
-- penv = (CPUState **)&(*penv)->next_cpu;
-- cpu_index++;
-- }
-- env->cpu_index = cpu_index;
-- env->nb_watchpoints = 0;
-- *penv = env;
-+ if (first_cpu)
-+ env->cpu_index = first_cpu->cpu_index + 1;
-+
-+ env->next_cpu = first_cpu;
-+ first_cpu = env;
- }
-
- static inline void invalidate_page_bitmap(PageDesc *p)
Deleted: trunk/patches/55_unmux_socketcall.patch
===================================================================
--- trunk/patches/55_unmux_socketcall.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/55_unmux_socketcall.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,17 +0,0 @@
-Index: qemu/linux-user/arm/syscall_nr.h
-===================================================================
---- qemu.orig/linux-user/arm/syscall_nr.h 2008-08-11 12:02:12.000000000 -0300
-+++ qemu/linux-user/arm/syscall_nr.h 2008-08-11 14:58:09.000000000 -0300
-@@ -256,9 +256,8 @@
- #define TARGET_NR_epoll_ctl (251)
- #define TARGET_NR_epoll_wait (252)
- #define TARGET_NR_remap_file_pages (253)
-- /* 254 for set_thread_area */
-- /* 255 for get_thread_area */
-- /* 256 for set_tid_address */
-+#define TARGET_NR_set_thread_area (254)
-+#define TARGET_NR_get_thread_area (255)
- #define TARGET_NR_set_tid_address 256
- #define TARGET_NR_timer_create 257
- #define TARGET_NR_timer_settime 258
-
Deleted: trunk/patches/66_tls_ld.patch
===================================================================
--- trunk/patches/66_tls_ld.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/66_tls_ld.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,50 +0,0 @@
-Index: arm.ld
-===================================================================
---- arm.ld.orig 2008-08-11 15:03:12.000000000 -0300
-+++ arm.ld 2008-08-11 15:03:24.000000000 -0300
-@@ -26,6 +26,10 @@
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
-+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
-+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
-+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
-+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
-@@ -58,6 +62,9 @@
- .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
- __exidx_end = .;
- .reginfo : { *(.reginfo) }
-+ /* Thread Local Storage sections */
-+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
-+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
- /* Adjust the address for the data segment. We want to adjust up to
- the same address within the page on the next page up. */
- . = ALIGN(0x100000) + (. & (0x100000 - 1));
-Index: i386.ld
-===================================================================
---- i386.ld.orig 2008-08-11 15:03:12.000000000 -0300
-+++ i386.ld 2008-08-11 15:03:24.000000000 -0300
-@@ -28,6 +28,10 @@
- { *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
- .rela.rodata :
- { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
-+ .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
-+ .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
-+ .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
-+ .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
- .rel.got : { *(.rel.got) }
- .rela.got : { *(.rela.got) }
- .rel.ctors : { *(.rel.ctors) }
-@@ -53,6 +57,9 @@
- _etext = .;
- PROVIDE (etext = .);
- .fini : { *(.fini) } =0x47ff041f
-+ /* Thread Local Storage sections */
-+ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
-+ .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
- . = ALIGN(32 / 8);
- PROVIDE (__preinit_array_start = .);
- .preinit_array : { *(.preinit_array) }
Deleted: trunk/patches/69_arm_kmb.patch
===================================================================
--- trunk/patches/69_arm_kmb.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/69_arm_kmb.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,14 +0,0 @@
-Index: linux-user/main.c
-===================================================================
---- linux-user/main.c.orig 2007-11-14 14:22:09.000000000 -0300
-+++ linux-user/main.c 2007-11-14 15:27:40.000000000 -0300
-@@ -336,6 +336,9 @@
- uint32_t cpsr;
-
- switch (env->regs[15]) {
-+ case 0xffff0fa0: /* __kernel_memory_barrier */
-+ /* XXX Nop for now XXX */
-+ break;
- case 0xffff0fc0: /* __kernel_cmpxchg */
- /* XXX: This only works between threads, not between processes.
- Use native atomic operations. */
Deleted: trunk/patches/96_futex.patch
===================================================================
--- trunk/patches/96_futex.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/96_futex.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,125 +0,0 @@
-Index: qemu/linux-user/syscall.c
-===================================================================
---- qemu.orig/linux-user/syscall.c 2008-08-11 15:35:26.000000000 -0300
-+++ qemu/linux-user/syscall.c 2008-08-11 15:35:49.000000000 -0300
-@@ -17,6 +17,7 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-+#define __user
- /*#include <linux/types.h>*/
- #include <stdlib.h>
- #include <stdio.h>
-@@ -64,6 +65,7 @@
- #define tchars host_tchars /* same as target */
- #define ltchars host_ltchars /* same as target */
-
-+#include <linux/futex.h>
- #include <linux/termios.h>
- #include <linux/unistd.h>
- #include <linux/utsname.h>
-@@ -3359,6 +3361,94 @@
- return osversion;
- }
-
-+#ifdef BSWAP_NEEDED
-+static int futex_op(int oldval, int op, int oparg)
-+{
-+ int retval = oparg;
-+ switch(op) {
-+ case FUTEX_OP_SET: break;
-+ case FUTEX_OP_ADD: retval += oparg; break;
-+ case FUTEX_OP_OR: retval |= oparg; break;
-+ case FUTEX_OP_ANDN: retval &= oparg; break;
-+ case FUTEX_OP_XOR: retval ^= oparg; break;
-+ }
-+ return retval;
-+}
-+
-+static int futex_cmp(int oldval, int cmp, int cmparg)
-+{
-+ switch(cmp) {
-+ case FUTEX_OP_CMP_EQ: return oldval == cmparg;
-+ case FUTEX_OP_CMP_NE: return oldval != cmparg;
-+ case FUTEX_OP_CMP_LT: return oldval < cmparg;
-+ case FUTEX_OP_CMP_LE: return oldval <= cmparg;
-+ case FUTEX_OP_CMP_GT: return oldval > cmparg;
-+ case FUTEX_OP_CMP_GE: return oldval >= cmparg;
-+ }
-+ return -1;
-+}
-+#endif
-+
-+static abi_long do_futex(target_ulong uaddr, int op, uint32_t val,
-+ target_ulong utime, target_ulong uaddr2,
-+ uint32_t val3)
-+{
-+ struct timespec host_utime;
-+ unsigned long val2 = utime;
-+ long retval;
-+
-+ if (utime && (op == FUTEX_WAIT || op == FUTEX_LOCK_PI)) {
-+ target_to_host_timespec(&host_utime, utime);
-+ val2 = (unsigned long)&host_utime;
-+ }
-+
-+#ifdef BSWAP_NEEDED
-+ switch(op) {
-+ case FUTEX_CMP_REQUEUE:
-+ val3 = tswap32(val3);
-+ case FUTEX_REQUEUE:
-+ val2 = tswap32(val2);
-+ case FUTEX_WAIT:
-+ case FUTEX_WAKE:
-+ case FUTEX_WAKE_OP:
-+ val = tswap32(val);
-+ case FUTEX_LOCK_PI: /* This one's icky, but comes out OK */
-+ case FUTEX_UNLOCK_PI:
-+ break;
-+ default:
-+ gemu_log("qemu: Unsupported futex op %d\n", op);
-+ return -ENOSYS;
-+ }
-+ if (op == FUTEX_WAKE_OP) {
-+ /* Need to munge the secondary operation (val3) */
-+ gemu_log("qemu: Tricky FUTEX_WAKE_OP - trying to emulate it\n");
-+ val3 = tswap32(val3);
-+ int op2 = (val3 >> 28) & 0xf;
-+ int cmp = (val3 >> 24) & 0xf;
-+ int oparg = (val3 >> 12) & 0xfff;
-+ int cmparg = val3 & 0xfff;
-+ int shift = val3 & (FUTEX_OP_OPARG_SHIFT << 28);
-+ int oldval;
-+ if (get_user_u32(oldval, uaddr2))
-+ return -TARGET_EFAULT;
-+ if (shift)
-+ oparg = 1 << oparg;
-+
-+ if (put_user_u32(futex_op(oldval, op2, oparg), uaddr2))
-+ return -TARGET_EFAULT;
-+ retval = syscall(__NR_futex, g2h(uaddr), FUTEX_WAKE, val, 0, 0, 0);
-+ if(futex_cmp(oldval, cmp, cmparg)) {
-+ retval = syscall(__NR_futex, g2h(uaddr2), FUTEX_WAKE, val2, 0, 0, 0);
-+ }
-+ } else {
-+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
-+ }
-+#else
-+ retval = syscall(__NR_futex, g2h(uaddr), op, val, val2, g2h(uaddr2), val3);
-+#endif
-+ return retval;
-+}
-+
- /* do_syscall() should always have a single exit point at the end so
- that actions, such as logging of syscall results, can be performed.
- All errnos that do_syscall() returns must be -TARGET_<errcode>. */
-@@ -5895,7 +5985,8 @@
- #endif
- #ifdef TARGET_NR_futex
- case TARGET_NR_futex:
-- goto unimplemented_nowarn;
-+ ret = get_errno(do_futex(arg1, arg2, arg3, arg4, arg5, arg6));
-+ break;
- #endif
- #ifdef TARGET_NR_clock_gettime
- case TARGET_NR_clock_gettime:
Deleted: trunk/patches/97_inotify.patch
===================================================================
--- trunk/patches/97_inotify.patch 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/97_inotify.patch 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,37 +0,0 @@
-Index: qemu-current/linux-user/syscall.c
-===================================================================
---- qemu-current.orig/linux-user/syscall.c 2008-08-11 16:28:21.000000000 -0300
-+++ qemu-current/linux-user/syscall.c 2008-08-11 16:28:22.000000000 -0300
-@@ -56,6 +56,7 @@
- #include <netinet/tcp.h>
- #include <sys/un.h>
- #include <sys/sysctl.h>
-+#include <sys/inotify.h>
-
- #define termios host_termios
- #define winsize host_winsize
-@@ -5995,7 +5996,23 @@
- ret = do_futex(arg1, arg2, arg3, arg4, arg5, arg6);
- break;
- #endif
--
-+#ifdef TARGET_NR_inotify_init
-+ case TARGET_NR_inotify_init:
-+ ret = get_errno(inotify_init());
-+ break;
-+#endif
-+#ifdef TARGET_NR_inotify_add_watch
-+ case TARGET_NR_inotify_add_watch:
-+ p = lock_user_string(arg2);
-+ ret = get_errno(inotify_add_watch(arg1, path(p), arg3));
-+ unlock_user(p, arg2, 0);
-+ break;
-+#endif
-+#ifdef TARGET_NR_inotify_rm_watch
-+ case TARGET_NR_inotify_rm_watch:
-+ ret = get_errno(inotify_rm_watch(arg1, arg2));
-+ break;
-+#endif
- default:
- unimplemented:
- gemu_log("qemu: Unsupported syscall: %d\n", num);
Modified: trunk/patches/series
===================================================================
--- trunk/patches/series 2008-08-19 15:42:10 UTC (rev 27)
+++ trunk/patches/series 2008-10-02 16:49:17 UTC (rev 28)
@@ -1,30 +1,16 @@
-#00_build_fix.patch # not working
-#02_snapshot_use_tmpdir.patch -p0 # already applied
-03_arm_cpu_default.patch # refreshed: line count changed
-06_exit_segfault.patch -p0 # same as above
-10_signal_jobs.patch -p0 # same
-19_zero_null.4.acct.patch # same
-19_zero_null.3.accept.patch # same
-19_zero_null.2.read.patch # same
-19_zero_null.1.getgroups.patch # same
-21_net_soopts.patch # same
-23_futimesat.patch # same
-30_syscall_ipc.patch -p0 # same
-31_syscalls.patch # same
-32_syscall_sysctl.patch -p0 # same
-34_syscalls_types.patch -p0 # same
-35_syscall_sockaddr.patch # same
-39_syscall_fadvise64.patch -p0 # same
-#41_arm_fpa_sigfpe.patch -p0 # patch for first file already applied, second file does not exist anymore
-42_arm_tls.patch -p0 # spinlock patch to exec-all.h already applied, other things that i don't want to remember
-#43_arm_cpustate.patch -p0 # apparently already applied. weird.
-44_socklen_t_check.patch # refreshed
-48_signal_terminate.patch # refreshed
-55_unmux_socketcall.patch # refreshed
-66_tls_ld.patch -p0 # refreshed
-#69_arm_kmb.patch -p0 # already applied
-90_evil_dlclose.patch -p0 # heavily edited
-#96_futex.patch # refreshed
-97_inotify.patch # refreshed
-99_sbox_callhack.patch # refreshed
-99_sbox_proc.patch # edited
+03_arm_cpu_default.patch
+06_exit_segfault.patch -p0
+10_signal_jobs.patch -p0
+19_zero_null.4.acct.patch
+19_zero_null.3.accept.patch
+19_zero_null.2.read.patch
+21_net_soopts.patch
+30_syscall_ipc.patch -p0
+31_syscalls.patch
+32_syscall_sysctl.patch -p0
+35_syscall_sockaddr.patch
+44_socklen_t_check.patch
+48_signal_terminate.patch
+90_evil_dlclose.patch -p0
+99_sbox_callhack.patch
+99_sbox_proc.patch
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-19 15:42:13
|
Revision: 27
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=27&view=rev
Author: bueroman
Date: 2008-08-19 15:42:10 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
README updated.
Modified Paths:
--------------
tags/qemu-arm-eabi-0.2/README
Modified: tags/qemu-arm-eabi-0.2/README
===================================================================
--- tags/qemu-arm-eabi-0.2/README 2008-08-19 15:41:21 UTC (rev 26)
+++ tags/qemu-arm-eabi-0.2/README 2008-08-19 15:42:10 UTC (rev 27)
@@ -42,7 +42,10 @@
./install-on-scratchbox.sh
HOWTO UPDATE QEMU-ARM-EABI
-$ cd qemu-arm-eabi
+This version of qemu-arm-eabi was based on the latest qemu version at the time of its doing, which was svn trunk in revision 4993.
+To update proceed like this:
+$ cd qemu-arm-eabi-0.2/qemu-arm-eabi
+$ rm * .pc -rf
$ svn up
$ export QUILT_PATCHES=../patches
$ quilt push -a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-19 15:41:23
|
Revision: 26
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=26&view=rev
Author: bueroman
Date: 2008-08-19 15:41:21 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
README updated.
Modified Paths:
--------------
trunk/README
Modified: trunk/README
===================================================================
--- trunk/README 2008-08-19 15:27:02 UTC (rev 25)
+++ trunk/README 2008-08-19 15:41:21 UTC (rev 26)
@@ -42,7 +42,10 @@
./install-on-scratchbox.sh
HOWTO UPDATE QEMU-ARM-EABI
-$ cd qemu-arm-eabi
+This version of qemu-arm-eabi was based on the latest qemu version at the time of its doing, which was svn trunk in revision 4993.
+To update proceed like this:
+$ cd qemu-arm-eabi-0.2/qemu-arm-eabi
+$ rm * .pc -rf
$ svn up
$ export QUILT_PATCHES=../patches
$ quilt push -a
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-19 15:27:06
|
Revision: 25
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=25&view=rev
Author: bueroman
Date: 2008-08-19 15:27:02 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
Small fix to fakeroot patch.
Modified Paths:
--------------
tags/qemu-arm-eabi-0.2/fakeroot.patch
tags/qemu-arm-eabi-0.2/get-qemu.sh
Modified: tags/qemu-arm-eabi-0.2/fakeroot.patch
===================================================================
--- tags/qemu-arm-eabi-0.2/fakeroot.patch 2008-08-19 15:22:17 UTC (rev 24)
+++ tags/qemu-arm-eabi-0.2/fakeroot.patch 2008-08-19 15:27:02 UTC (rev 25)
@@ -1,24 +1,15 @@
---- /scratchbox/tools/bin/fakeroot-tcp 2008-08-18 17:01:21.000000000 -0300
-+++ /scratchbox/tools/bin/fakeroot-tcp.mine 2008-08-18 17:00:42.000000000 -0300
-@@ -113,11 +113,19 @@
- export _SBOX_NONFAKE_UID=`id -u`
+--- /scratchbox/tools/bin/fakeroot-tcp.orig 2008-08-18 19:11:03.000000000 -0300
++++ /scratchbox/tools/bin/fakeroot-tcp.mine 2008-08-19 11:31:14.000000000 -0300
+@@ -114,10 +114,10 @@
export _SBOX_NONFAKE_GID=`id -g`
-+# Fix qemu path separator problem between scratchbox and arm-eabi versions.
-+if [ "`sb-conf show | grep CPU-transparency | cut -c53-65`" == "qemu-arm-eabi" ]
-+then
-+ SEP=":"
-+else
-+ SEP=","
-+fi
-+
if test -z "$*"; then
- FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB,/usr/lib/libfakeroot/$LIB" ${SHELL:-/bin/sh}
-+ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB${SEP}/usr/lib/libfakeroot/$LIB" ${SHELL:-/bin/sh}
++ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB" ${SHELL:-/bin/sh}
RESULT=$?
else
- FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB,/usr/lib/libfakeroot/$LIB" "$@"
-+ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB${SEP}/usr/lib/libfakeroot/$LIB" "$@"
++ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB" "$@"
RESULT=$?
fi
Modified: tags/qemu-arm-eabi-0.2/get-qemu.sh
===================================================================
--- tags/qemu-arm-eabi-0.2/get-qemu.sh 2008-08-19 15:22:17 UTC (rev 24)
+++ tags/qemu-arm-eabi-0.2/get-qemu.sh 2008-08-19 15:27:02 UTC (rev 25)
@@ -2,6 +2,15 @@
echo "** Get the qemu code from svn and apply arm-eabi patches **"
+quilt 2> /dev/null 1>/dev/null
+
+# 127: command not found.
+if [ "$?" -eq "127" ]; then
+ echo "You need to install quilt to apply the patches."
+ echo "If in Debian/Ubuntu: sudo apt-get install quilt"
+ exit 1
+fi
+
export QUILT_PATCHES=../patches
svn co -r4993 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-19 15:22:19
|
Revision: 24
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=24&view=rev
Author: bueroman
Date: 2008-08-19 15:22:17 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
Changes to fakeroot patch based on caio's fix.
Modified Paths:
--------------
trunk/fakeroot.patch
Modified: trunk/fakeroot.patch
===================================================================
--- trunk/fakeroot.patch 2008-08-19 00:11:25 UTC (rev 23)
+++ trunk/fakeroot.patch 2008-08-19 15:22:17 UTC (rev 24)
@@ -1,24 +1,15 @@
---- /scratchbox/tools/bin/fakeroot-tcp 2008-08-18 17:01:21.000000000 -0300
-+++ /scratchbox/tools/bin/fakeroot-tcp.mine 2008-08-18 17:00:42.000000000 -0300
-@@ -113,11 +113,19 @@
- export _SBOX_NONFAKE_UID=`id -u`
+--- /scratchbox/tools/bin/fakeroot-tcp.orig 2008-08-18 19:11:03.000000000 -0300
++++ /scratchbox/tools/bin/fakeroot-tcp.mine 2008-08-19 11:31:14.000000000 -0300
+@@ -114,10 +114,10 @@
export _SBOX_NONFAKE_GID=`id -g`
-+# Fix qemu path separator problem between scratchbox and arm-eabi versions.
-+if [ "`sb-conf show | grep CPU-transparency | cut -c53-65`" == "qemu-arm-eabi" ]
-+then
-+ SEP=":"
-+else
-+ SEP=","
-+fi
-+
if test -z "$*"; then
- FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB,/usr/lib/libfakeroot/$LIB" ${SHELL:-/bin/sh}
-+ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB${SEP}/usr/lib/libfakeroot/$LIB" ${SHELL:-/bin/sh}
++ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB" ${SHELL:-/bin/sh}
RESULT=$?
else
- FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB,/usr/lib/libfakeroot/$LIB" "$@"
-+ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB${SEP}/usr/lib/libfakeroot/$LIB" "$@"
++ FAKEROOTKEY=$FAKEROOTKEY SBOX_PRELOAD="${PREFIX}/lib/$LIB" "$@"
RESULT=$?
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-19 00:11:28
|
Revision: 23
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=23&view=rev
Author: bueroman
Date: 2008-08-19 00:11:25 +0000 (Tue, 19 Aug 2008)
Log Message:
-----------
verifies if quilt is installed before try to apply patches.
Modified Paths:
--------------
trunk/get-qemu.sh
Modified: trunk/get-qemu.sh
===================================================================
--- trunk/get-qemu.sh 2008-08-18 23:10:02 UTC (rev 22)
+++ trunk/get-qemu.sh 2008-08-19 00:11:25 UTC (rev 23)
@@ -2,6 +2,15 @@
echo "** Get the qemu code from svn and apply arm-eabi patches **"
+quilt 2> /dev/null 1>/dev/null
+
+# 127: command not found.
+if [ "$?" -eq "127" ]; then
+ echo "You need to install quilt to apply the patches."
+ echo "If in Debian/Ubuntu: sudo apt-get install quilt"
+ exit 1
+fi
+
export QUILT_PATCHES=../patches
svn co -r4993 --non-interactive svn://svn.savannah.nongnu.org/qemu/trunk qemu-arm-eabi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bue...@us...> - 2008-08-18 23:10:06
|
Revision: 22
http://qemu-arm-eabi.svn.sourceforge.net/qemu-arm-eabi/?rev=22&view=rev
Author: bueroman
Date: 2008-08-18 23:10:02 +0000 (Mon, 18 Aug 2008)
Log Message:
-----------
fakeroot-test.c missing
Added Paths:
-----------
tags/qemu-arm-eabi-0.2/fakeroot-test.c
Added: tags/qemu-arm-eabi-0.2/fakeroot-test.c
===================================================================
--- tags/qemu-arm-eabi-0.2/fakeroot-test.c (rev 0)
+++ tags/qemu-arm-eabi-0.2/fakeroot-test.c 2008-08-18 23:10:02 UTC (rev 22)
@@ -0,0 +1,23 @@
+// $ gcc fakeroot-test.c -o fakeroot-test
+// $ fakeroot ./fakeroot-test
+#include <stdio.h>
+#define PATH_MAX 1024
+
+int
+main(int argc, char *argv[])
+{
+ FILE *fp;
+ int status;
+ char path[PATH_MAX];
+
+ printf("** Testing popen **\n\n");
+
+ fp = popen("ls *", "r");
+ while (fgets(path, PATH_MAX, fp) != NULL)
+ printf("%s", path);
+
+ pclose(fp);
+
+ return 0;
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|