Commit 07a6ecf4 authored by Richard Henderson's avatar Richard Henderson Committed by Laurent Vivier
Browse files

linux-user: Introduce cpu_clone_regs_parent



We will need a target-specific hook for adjusting registers
in the parent during clone.  Add an empty inline function for
each target, and invoke it from the proper places.

Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20191106113318.10226-11-richard.henderson@linaro.org>
Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
parent 608999d1
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong newsp,
    env->xregs[0] = 0;
}

static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags)
{
}

static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls)
{
    /* Note that AArch64 Linux keeps the TLS pointer in TPIDR; this is
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUAlphaState *env, target_ulong newsp,
    env->ir[IR_A3] = 0;
}

static inline void cpu_clone_regs_parent(CPUAlphaState *env, unsigned flags)
{
}

static inline void cpu_set_tls(CPUAlphaState *env, target_ulong newtls)
{
    env->unique = newtls;
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@ static inline void cpu_clone_regs_child(CPUARMState *env, target_ulong newsp,
    env->regs[0] = 0;
}

static inline void cpu_clone_regs_parent(CPUARMState *env, unsigned flags)
{
}

static inline void cpu_set_tls(CPUARMState *env, target_ulong newtls)
{
    if (access_secure_reg(env)) {
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,10 @@ static inline void cpu_clone_regs_child(CPUCRISState *env, target_ulong newsp,
    env->regs[10] = 0;
}

static inline void cpu_clone_regs_parent(CPUCRISState *env, unsigned flags)
{
}

static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls)
{
    env->pregs[PR_PID] = (env->pregs[PR_PID] & 0xff) | newtls;
+4 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ static inline void cpu_clone_regs_child(CPUHPPAState *env, target_ulong newsp,
    env->iaoq_b = env->gr[31] + 4;
}

static inline void cpu_clone_regs_parent(CPUHPPAState *env, unsigned flags)
{
}

static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls)
{
    env->cr[27] = newtls;
Loading