[04/13] linux-user/alpha: Set r20 secondary return value

Message ID 20190519201953.20161-5-richard.henderson@linaro.org
State New
Headers show
Series
  • linux-user: path, clone, sparc, shmat fixes
Related show

Commit Message

Richard Henderson May 19, 2019, 8:19 p.m.
This value is not, as far as I know, used by any linux software,
but it is set by the kernel and is part of the ABI.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 linux-user/alpha/target_cpu.h | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.17.1

Comments

Laurent Vivier June 13, 2019, 4:23 p.m. | #1
Le 19/05/2019 à 22:19, Richard Henderson a écrit :
> This value is not, as far as I know, used by any linux software,

> but it is set by the kernel and is part of the ABI.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  linux-user/alpha/target_cpu.h | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h

> index 140a459f73..caadb54372 100644

> --- a/linux-user/alpha/target_cpu.h

> +++ b/linux-user/alpha/target_cpu.h

> @@ -26,10 +26,12 @@ static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong newsp)

>      }

>      env->ir[IR_V0] = 0;

>      env->ir[IR_A3] = 0;

> +    env->ir[IR_A4] = 1;  /* OSF/1 secondary return: child */

>  }

>  

>  static inline void cpu_clone_regs_parent(CPUAlphaState *env)

>  {

> +    env->ir[IR_A4] = 0;  /* OSF/1 secondary return: parent */


In the kernel, r20 is only set to 0 if !(clone_flags & CLONE_SETTLS), is
this a problem here to set it unconditionally?

Thanks,
Laurent

Patch

diff --git a/linux-user/alpha/target_cpu.h b/linux-user/alpha/target_cpu.h
index 140a459f73..caadb54372 100644
--- a/linux-user/alpha/target_cpu.h
+++ b/linux-user/alpha/target_cpu.h
@@ -26,10 +26,12 @@  static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong newsp)
     }
     env->ir[IR_V0] = 0;
     env->ir[IR_A3] = 0;
+    env->ir[IR_A4] = 1;  /* OSF/1 secondary return: child */
 }
 
 static inline void cpu_clone_regs_parent(CPUAlphaState *env)
 {
+    env->ir[IR_A4] = 0;  /* OSF/1 secondary return: parent */
 }
 
 static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls)