qemu sh4 nptl support
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 15 Sep 2008 07:43:43 +0000 (07:43 +0000)
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
Mon, 15 Sep 2008 07:43:43 +0000 (07:43 +0000)
(Michael Trimarchi)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5223 c046a42c-6fe2-441c-8c8c-71466251a162

configure
linux-user/main.c
linux-user/syscall.c
target-sh4/cpu.h

index d77f9b8..df756db 100755 (executable)
--- a/configure
+++ b/configure
@@ -1437,6 +1437,7 @@ case "$target_cpu" in
     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
index 4bf739e..c32cd75 100644 (file)
@@ -1887,6 +1887,7 @@ void cpu_loop (CPUState *env)
 
         switch (trapnr) {
         case 0x160:
+            env->pc += 2;
             ret = do_syscall(env,
                              env->gregs[3],
                              env->gregs[4],
@@ -1896,7 +1897,6 @@ void cpu_loop (CPUState *env)
                              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 eba2c02..56b4138 100644 (file)
@@ -53,6 +53,7 @@
 //#include <sys/user.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
+#include <qemu-common.h>
 
 #define termios host_termios
 #define winsize host_winsize
@@ -4662,7 +4663,11 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         ret = get_errno(fsync(arg1));
         break;
     case TARGET_NR_clone:
+#if defined(TARGET_SH4)
+        ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg5, arg4));
+#else
         ret = get_errno(do_fork(cpu_env, arg1, arg2, arg3, arg4, arg5));
+#endif
         break;
 #ifdef __NR_exit_group
         /* new thread calls */
index 686b668..2f42e60 100644 (file)
@@ -141,6 +141,11 @@ void sh4_cpu_list(FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
 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