Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdWKO-0004Y6-In for qemu-devel@nongnu.org; Wed, 10 Sep 2008 16:30:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdWKM-0004Va-Sn for qemu-devel@nongnu.org; Wed, 10 Sep 2008 16:30:16 -0400 Received: from [199.232.76.173] (port=55539 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdWKM-0004VM-Pl for qemu-devel@nongnu.org; Wed, 10 Sep 2008 16:30:14 -0400 Received: from ms01.sssup.it ([193.205.80.99]:39561 helo=sssup.it) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KdVug-0007HP-PQ for qemu-devel@nongnu.org; Wed, 10 Sep 2008 16:03:43 -0400 Received: from [193.205.82.7] (HELO gandalf.sssup.it) by sssup.it (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 44981817 for qemu-devel@nongnu.org; Wed, 10 Sep 2008 22:03:52 +0200 Received: from [10.30.3.161] ([10.30.3.161]) by gandalf.sssup.it (8.12.10/8.12.10) with ESMTP id m8AIrvVr020097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 10 Sep 2008 20:53:58 +0200 Message-ID: <48C8284E.8030004@gandalf.sssup.it> Date: Wed, 10 Sep 2008 22:04:30 +0200 From: michael MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060902000107040207040708" Subject: [Qemu-devel] [RFC][PATCH] qemu sh4 nptl support 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 This is a multi-part message in MIME format. --------------060902000107040207040708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi all, I do some change the qemu to support nptl in linux-user mode for the sh4 cpu starting from the arm support. This is a little and an initial step and I hope that another peaple can test it. Regards Michael --------------060902000107040207040708 Content-Type: text/x-patch; name="sh4_nptl.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="sh4_nptl.patch" Index: target-sh4/cpu.h =================================================================== --- target-sh4/cpu.h (revision 5185) +++ target-sh4/cpu.h (working copy) @@ -141,6 +141,11 @@ void cpu_sh4_write_mmaped_utlb_addr(CPUSH4State *s, target_phys_addr_t addr, uint32_t mem_value); +static inline void cpu_set_tls(CPUSH4State *env, target_ulong newtls) +{ + env->gbr = newtls; +} + #include "softfloat.h" #define CPUState CPUSH4State Index: target-sh4/translate.c =================================================================== --- target-sh4/translate.c (revision 5185) +++ target-sh4/translate.c (working copy) @@ -243,6 +243,7 @@ return NULL; cpu_exec_init(env); sh4_translate_init(); + env->cpu_model_str = cpu_model; cpu_sh4_reset(env); cpu_sh4_register(env, def); tlb_flush(env, 1); Index: linux-user/syscall.c =================================================================== --- linux-user/syscall.c (revision 5185) +++ linux-user/syscall.c (working copy) @@ -53,6 +53,7 @@ //#include #include #include +#include #define termios host_termios #define winsize host_winsize @@ -4662,7 +4663,11 @@ ret = get_errno(fsync(arg1)); break; case TARGET_NR_clone: +#if !defined(TARGET_SH4) ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg4, arg5)); +#else + ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4)); +#endif break; #ifdef __NR_exit_group /* new thread calls */ Index: linux-user/main.c =================================================================== --- linux-user/main.c (revision 5185) +++ linux-user/main.c (working copy) @@ -1887,6 +1887,7 @@ switch (trapnr) { case 0x160: + env->pc += 2; ret = do_syscall(env, env->gregs[3], env->gregs[4], @@ -1896,7 +1897,6 @@ env->gregs[0], env->gregs[1]); env->gregs[0] = ret; - env->pc += 2; break; case EXCP_INTERRUPT: /* just indicate that signals should be handled asap */ Index: configure =================================================================== --- configure (revision 5185) +++ configure (working copy) @@ -1435,6 +1435,7 @@ echo "#define TARGET_ARCH \"sh4\"" >> $config_h echo "#define TARGET_SH4 1" >> $config_h bflt="yes" + target_nptl="yes" ;; sparc) echo "TARGET_ARCH=sparc" >> $config_mak --------------060902000107040207040708--