All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC][PATCH] qemu sh4 nptl support
@ 2008-09-10 20:04 michael
  2008-09-15  7:44 ` Aurelien Jarno
  0 siblings, 1 reply; 2+ messages in thread
From: michael @ 2008-09-10 20:04 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

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




[-- Attachment #2: sh4_nptl.patch --]
[-- Type: text/x-patch, Size: 2618 bytes --]

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 <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 @@
         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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [RFC][PATCH] qemu sh4 nptl support
  2008-09-10 20:04 [Qemu-devel] [RFC][PATCH] qemu sh4 nptl support michael
@ 2008-09-15  7:44 ` Aurelien Jarno
  0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2008-09-15  7:44 UTC (permalink / raw)
  To: qemu-devel

On Wed, Sep 10, 2008 at 10:04:30PM +0200, michael wrote:
> 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.

Applied, thanks.

> Regards Michael
>
>
>

> 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 <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 @@
>          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
> 


-- 
  .''`.  Aurelien Jarno	            | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   aurel32@debian.org         | aurelien@aurel32.net
   `-    people.debian.org/~aurel32 | www.aurel32.net

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-15  7:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-10 20:04 [Qemu-devel] [RFC][PATCH] qemu sh4 nptl support michael
2008-09-15  7:44 ` Aurelien Jarno

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.