From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HEnar-0000By-5e for qemu-devel@nongnu.org; Wed, 07 Feb 2007 09:16:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HEnao-0000Bm-LM for qemu-devel@nongnu.org; Wed, 07 Feb 2007 09:16:15 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HEnao-0000Bj-EW for qemu-devel@nongnu.org; Wed, 07 Feb 2007 09:16:14 -0500 Received: from partizan.velesys.com ([213.184.230.195] helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HEnan-00088v-TQ for qemu-devel@nongnu.org; Wed, 07 Feb 2007 09:16:14 -0500 Date: Wed, 7 Feb 2007 16:16:13 +0300 From: "Kirill A. Shutemov" Message-ID: <20070207131613.GA25082@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hQiwHBbRI9kgIhsi" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] prctl, mount, uselib, syslog, mincore, clock_gettime syscalls Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --hQiwHBbRI9kgIhsi Content-Type: multipart/mixed; boundary="rwEMma7ioTxnRzrJ" Content-Disposition: inline --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In the attachments debian patches to implementation subject syscalls. Any ideas why hasn't commited? --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="31_syscalls.patch" Content-Transfer-Encoding: quoted-printable #DPATCHLEVEL=3D0 Index: linux-user/syscall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-user/syscall.c.orig 2006-11-05 07:07:19.000000000 +0200 +++ linux-user/syscall.c 2006-11-05 07:07:25.000000000 +0200 @@ -141,6 +141,7 @@ type name (type1 arg1,type2 arg2,type3 a #define __NR_sys_getdents __NR_getdents #define __NR_sys_getdents64 __NR_getdents64 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo +#define __NR_sys_syslog __NR_syslog =20 #if defined(__alpha__) || defined (__ia64__) || defined(__x86_64__) #define __NR__llseek __NR_lseek @@ -160,6 +161,7 @@ _syscall3(int, sys_getdents64, uint, fd, _syscall5(int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh); _syscall3(int,sys_rt_sigqueueinfo,int,pid,int,sig,siginfo_t *,uinfo) +_syscall3(int,sys_syslog,int,type,char*,bufp,int,len) #ifdef __NR_exit_group _syscall1(int,exit_group,int,error_code) #endif @@ -173,6 +175,7 @@ extern int getresuid(uid_t *, uid_t *, u extern int setresgid(gid_t, gid_t, gid_t); extern int getresgid(gid_t *, gid_t *, gid_t *); extern int setgroups(int, gid_t *); +extern int uselib(const char*); =20 static inline long get_errno(long ret) { @@ -2742,7 +2745,9 @@ long do_syscall(void *cpu_env, int num,=20 } break; case TARGET_NR_uselib: - goto unimplemented; + ret =3D get_errno(uselib(path((const char*)arg1))); + break; + case TARGET_NR_swapon: p =3D lock_user_string(arg1); ret =3D get_errno(swapon(p, arg2)); @@ -2982,7 +2987,9 @@ long do_syscall(void *cpu_env, int num,=20 #endif =20 case TARGET_NR_syslog: - goto unimplemented; + ret =3D get_errno(sys_syslog((int)arg1, (char*)arg2, (int)arg3)); + break; + case TARGET_NR_setitimer: { struct itimerval value, ovalue, *pvalue; @@ -3856,7 +3863,9 @@ long do_syscall(void *cpu_env, int num,=20 goto unimplemented; #ifdef TARGET_NR_mincore case TARGET_NR_mincore: - goto unimplemented; + page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE= - 1) / TARGET_PAGE_SIZE); + ret =3D get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned cha= r*)arg3)); + break; #endif #ifdef TARGET_NR_madvise case TARGET_NR_madvise: @@ -3947,7 +3956,8 @@ long do_syscall(void *cpu_env, int num,=20 ret =3D get_errno(gettid()); break; case TARGET_NR_readahead: - goto unimplemented; + ret =3D get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3= )); + break; #ifdef TARGET_NR_setxattr case TARGET_NR_setxattr: case TARGET_NR_lsetxattr: @@ -3972,6 +3982,22 @@ long do_syscall(void *cpu_env, int num,=20 case TARGET_NR_getdomainname: goto unimplemented_nowarn; #endif +#ifdef TARGET_NR_clock_gettime + case TARGET_NR_clock_gettime: + { + struct target_timespec* ttp =3D (struct target_timespec*)arg2; + struct timespec htp; + if(ttp) { + htp.tv_sec =3D tswapl(ttp->tv_sec); + htp.tv_nsec =3D tswapl(ttp->tv_nsec); + ret =3D get_errno(clock_gettime((clockid_t)arg1, &htp)); + ttp->tv_sec =3D tswapl(htp.tv_sec); + ttp->tv_nsec =3D tswapl(htp.tv_nsec); + } else + ret =3D get_errno(clock_gettime((clockid_t)arg1, NULL)); + break; + } +#endif default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); Index: Makefile.target =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- Makefile.target.orig 2006-11-05 07:06:52.000000000 +0200 +++ Makefile.target 2006-11-05 07:07:25.000000000 +0200 @@ -166,7 +166,7 @@ endif ######################################################### =20 CPPFLAGS+=3D-D_GNU_SOURCE -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -LIBS+=3D-lm +LIBS+=3D-lm -lrt ifndef CONFIG_USER_ONLY LIBS+=3D-lz endif --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="36_syscall_prctl.patch" Content-Transfer-Encoding: quoted-printable #DPATCHLEVEL=3D0 Index: linux-user/syscall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-user/syscall.c.orig 2006-11-05 07:07:41.000000000 +0200 +++ linux-user/syscall.c 2006-11-05 07:07:44.000000000 +0200 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -3486,7 +3487,8 @@ long do_syscall(void *cpu_env, int num,=20 case TARGET_NR_nfsservctl: goto unimplemented; case TARGET_NR_prctl: - goto unimplemented; + ret =3D get_errno(prctl(arg1, arg2, arg3, arg4, arg5)); + break; #ifdef TARGET_NR_pread case TARGET_NR_pread: page_unprotect_range(arg2, arg3); --rwEMma7ioTxnRzrJ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="37_syscall_mount.patch" Content-Transfer-Encoding: quoted-printable #DPATCHLEVEL=3D0 Index: linux-user/syscall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- linux-user/syscall.c.orig 2006-11-05 07:07:44.000000000 +0200 +++ linux-user/syscall.c 2006-11-05 07:07:48.000000000 +0200 @@ -2200,7 +2200,9 @@ long do_syscall(void *cpu_env, int num,=20 break; case TARGET_NR_mount: /* need to look at the data field */ - goto unimplemented; + ret =3D get_errno(mount((const char *)arg1, (const char *)arg2, + (const char *)arg3, (unsigned long)arg4, (const void *)arg5)); + break; case TARGET_NR_umount: p =3D lock_user_string(arg1); ret =3D get_errno(umount(p)); --rwEMma7ioTxnRzrJ-- --hQiwHBbRI9kgIhsi Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFydEdbWYnhzC5v6oRAlERAJsFpQIkGeFYiw70iIrw2YBkkXrxbACeLCAQ MQfC7AbHvRzzZftO8WmVZp0= =9XVT -----END PGP SIGNATURE----- --hQiwHBbRI9kgIhsi--