[PATCH] riscv: Fixup wrong clone's arguments define

Palmer Dabbelt palmer at sifive.com
Wed Mar 27 01:56:31 UTC 2019


On Fri, 22 Mar 2019 01:58:17 PDT (-0700), guoren at kernel.org wrote:
> From: Guo Ren <ren_guo at c-sky.com>
>
> In linux kernel riscv select CLONE_BACKWARDS in
> linux/arch/riscv/Kconfig, and in linux/kernel/fork.c:
>
> ifdef CONFIG_CLONE_BACKWARDS
> SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
> 		 int __user *, parent_tidptr,
> 		 unsigned long, tls,
> 		 int __user *, child_tidptr)
> elif ...
>
> So we must make the riscv clone-arguments' sequence to be:
>   define ARG_FLAGS	0
>   define ARG_STACK	1
>   define ARG_PTID	2
>   define ARG_TLS	3
>   define ARG_CTID	4
>
> Signed-off-by: Guo Ren <ren_guo at c-sky.com>
> Cc: Dmitry V. Levin <ldv at altlinux.org>
> Cc: Palmer Dabbelt <palmer at sifive.com>
> ---
>  clone.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/clone.c b/clone.c
> index d37e580..64c7e95 100644
> --- a/clone.c
> +++ b/clone.c
> @@ -42,7 +42,7 @@
>  # define ARG_PTID	2
>  # define ARG_CTID	((current_personality != 1) ? 3 : 4)
>  # define ARG_TLS	((current_personality != 1) ? 4 : 3)
> -#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV
> +#elif defined ALPHA || defined TILE || defined OR1K
>  # define ARG_FLAGS	0
>  # define ARG_STACK	1
>  # define ARG_PTID	2

Reviewed-by: Palmer Dabbelt <palmer at sifive.com>

Thanks for the fix!


More information about the Strace-devel mailing list