qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Syscall 269


From: James Pellow
Subject: Re: [Qemu-devel] Syscall 269
Date: Fri, 3 Dec 2004 16:05:10 -0800
User-agent: KMail/1.7.1

Hi Paul,

Is this closer to what you want?  I saw the swap functions.  I wasn't sure 
what long translated to for all supported archs.  Do I need to do 32/64 bit 
translation?  tv_sec and tv_usec are both long.

Thanks,

James Pellow

------------------------------------------------------------------------------------------------------------

diff -ruN qemu-0.6.1/linux-user/arm/syscall_nr.h 
qemu-0.6.1_new/linux-user/arm/syscall_nr.h
--- qemu-0.6.1/linux-user/arm/syscall_nr.h      2004-11-14 12:51:33.000000000 
-0800
+++ qemu-0.6.1_new/linux-user/arm/syscall_nr.h  2004-11-18 00:58:44.000000000 
-0800
@@ -259,3 +259,5 @@
                                        /* 254 for set_thread_area */
                                        /* 255 for get_thread_area */
                                        /* 256 for set_tid_address */
+#define TARGET_NR_utimes                       (269)
+
diff -ruN qemu-0.6.1/linux-user/i386/syscall_nr.h 
qemu-0.6.1_new/linux-user/i386/syscall_nr.h
--- qemu-0.6.1/linux-user/i386/syscall_nr.h     2004-11-14 12:51:33.000000000 
-0800
+++ qemu-0.6.1_new/linux-user/i386/syscall_nr.h 2004-11-18 01:28:59.000000000 
-0800
@@ -271,3 +271,5 @@
 #define TARGET_NR_clock_getres (TARGET_NR_timer_create+7)
 #define TARGET_NR_clock_nanosleep      (TARGET_NR_timer_create+8)

+#define TARGET_NR_utimes               271
+
diff -ruN qemu-0.6.1/linux-user/syscall.c qemu-0.6.1_new/linux-user/syscall.c
--- qemu-0.6.1/linux-user/syscall.c     2004-11-14 12:51:33.000000000 -0800
+++ qemu-0.6.1_new/linux-user/syscall.c 2004-12-03 15:44:37.174197904 -0800
@@ -3025,6 +3025,15 @@
     case TARGET_NR_get_thread_area:
         goto unimplemented_nowarn;
 #endif
+    case TARGET_NR_utimes:
+    {
+       struct timeval tv;
+       struct timeval *target_tv = (struct timeval *)arg2;
+       tv.tv_sec  = tswapl(target_tv->tv_sec);
+       tv.tv_usec = tswapl(target_tv->tv_usec);
+       ret = get_errno(utimes((const char *)arg1, &tv));
+       break;
+    }
     default:
     unimplemented:
         gemu_log("qemu: Unsupported syscall: %d\n", num);

------------------------------------------------------------------------------------------------------------------------



On Thursday 18 November 2004 05:03 am, Paul Brook wrote:
> On Thursday 18 November 2004 09:38, James Pellow wrote:
> > Hi All,
> >
> > I am trying to chroot to a gentoo flavor of arm linux on my AMD
> > tbird-1.4GHz. I have set up binfmt_misc and qemu to allow me to do the
> > chroot, and all seems to be working well.  Now I wanted to emerge some
> > stuff, and I get the following message:
> >
> > qemu: Unsupported syscall: 269.
> >
> > Looking at the arm linux kernel source, I see that 269 is utimes. 
> > Looking at the source code for qemu it seems that all I have to do is to
> > add a define for TARGET_NR_utimes in all linux-user/*/syscall_nr.h and
> > then add a new case in linux-user/syscall.c.
> >
> > So, I gave it a shot.  The patch is at the bottom of this message.  This
> > is the first time I have looked at the qemu sources, so I am likely
> > missing something, but the patch does seem to allow emerge to work
> > properly under gentoo.  If a correct implementation requires more work, I
> > am happy to do that too, just let me know.  BTW, I am not subscribed to
> > this list to please CC me.
>
> You also need to do proper 32/64bit and big/little endian conversion of
> struct timeval. It happens to work in your case because arm-linux and
> i686-linux both use the same word size and endianness.
>
> Paul

-- 
*****************************
James A. Pellow, President
Alent Design Solutions
www.alentdesignsolutions.com
(509) 526-0682
*****************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]