* [Qemu-devel] SH4 TARGET_NR_clone
@ 2008-07-10 9:20 michael
2008-07-10 9:48 ` Thiemo Seufer
0 siblings, 1 reply; 4+ messages in thread
From: michael @ 2008-07-10 9:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Michael Trimarchi
[-- Attachment #1: Type: text/plain, Size: 70 bytes --]
Hi,
This patch fix the call of Clone in SH4 system
Regards Michael
[-- Attachment #2: syscall_sh4.patch --]
[-- Type: text/x-patch, Size: 851 bytes --]
This patch implements the correct TARGET_NR_clone for SH4
cpu.
Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c (revision 4865)
+++ 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
@@ -4657,7 +4658,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 */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] SH4 TARGET_NR_clone
2008-07-10 9:20 [Qemu-devel] SH4 TARGET_NR_clone michael
@ 2008-07-10 9:48 ` Thiemo Seufer
2008-07-10 10:22 ` michael
2008-08-21 16:53 ` michael
0 siblings, 2 replies; 4+ messages in thread
From: Thiemo Seufer @ 2008-07-10 9:48 UTC (permalink / raw)
To: michael; +Cc: qemu-devel
michael wrote:
> Hi,
>
> This patch fix the call of Clone in SH4 system
What exactly does it fix? The kernel side of sys_clone seems to be no
different to other architectures.
Thiemo
> This patch implements the correct TARGET_NR_clone for SH4
> cpu.
>
> Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
>
> Index: linux-user/syscall.c
> ===================================================================
> --- linux-user/syscall.c (revision 4865)
> +++ 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
> @@ -4657,7 +4658,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 */
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] SH4 TARGET_NR_clone
2008-07-10 9:48 ` Thiemo Seufer
@ 2008-07-10 10:22 ` michael
2008-08-21 16:53 ` michael
1 sibling, 0 replies; 4+ messages in thread
From: michael @ 2008-07-10 10:22 UTC (permalink / raw)
To: qemu-devel
Hi,
Thiemo Seufer wrote:
> michael wrote:
>
>> Hi,
>>
>> This patch fix the call of Clone in SH4 system
>>
>
> What exactly does it fix? The kernel side of sys_clone seems to be no
> different to other architectures.
>
>
> Thiemo
>
>
>
Is not related to the kernel but how glibc pass the argument to you.
Depends on the ARCH_FORK. I just notice that the tid is not in the same
position.
Michael
>> This patch implements the correct TARGET_NR_clone for SH4
>> cpu.
>>
>> Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
>>
>> Index: linux-user/syscall.c
>> ===================================================================
>> --- linux-user/syscall.c (revision 4865)
>> +++ 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
>> @@ -4657,7 +4658,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 */
>>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] SH4 TARGET_NR_clone
2008-07-10 9:48 ` Thiemo Seufer
2008-07-10 10:22 ` michael
@ 2008-08-21 16:53 ` michael
1 sibling, 0 replies; 4+ messages in thread
From: michael @ 2008-08-21 16:53 UTC (permalink / raw)
To: qemu-devel; +Cc: jan.kiszka
Hi,
Thiemo Seufer wrote:
> michael wrote:
>
>> Hi,
>>
>> This patch fix the call of Clone in SH4 system
>>
>
> What exactly does it fix? The kernel side of sys_clone seems to be no
> different to other architectures.
>
Look at the libc code:
nptl/sysdeps/unix/sysv/linux/fork.c
the fork is implemente in this file. The ARCH_FORK is different in
i386 an sh code.
sh code:
/* TLS pointer argument is passed as the 5-th argument. */
#define ARCH_FORK() \
INLINE_SYSCALL (clone,
5, \
CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD,
0, \
NULL, &THREAD_SELF->tid, NULL)
i386 code:
#define ARCH_FORK() \
INLINE_SYSCALL (clone,
5, \
CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID | SIGCHLD,
0, \
NULL, NULL, &THREAD_SELF->tid)
As you can see the 4th and 5th argument are inverted, and it maybe
justify my problem.
>
> Thiemo
>
>
>
>> This patch implements the correct TARGET_NR_clone for SH4
>> cpu.
>>
>> Signed-off-by: Michael Trimarchi <trimarchimichael@yahoo.it>
>>
>> Index: linux-user/syscall.c
>> ===================================================================
>> --- linux-user/syscall.c (revision 4865)
>> +++ 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
>> @@ -4657,7 +4658,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 */
>>
>
>
>
>
Regards Michael
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-08-21 16:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-10 9:20 [Qemu-devel] SH4 TARGET_NR_clone michael
2008-07-10 9:48 ` Thiemo Seufer
2008-07-10 10:22 ` michael
2008-08-21 16:53 ` michael
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).