[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_co
From: |
Richard Henderson |
Subject: |
Re: [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_context() |
Date: |
Fri, 6 Nov 2020 09:22:28 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 11/6/20 7:27 AM, Peter Maydell wrote:
> +#ifdef TARGET_SPARC64
> +/* win_helper.c */
> +target_ulong cpu_get_ccr(CPUSPARCState *env1);
> +void cpu_put_ccr(CPUSPARCState *env1, target_ulong val);
> +target_ulong cpu_get_cwp64(CPUSPARCState *env1);
> +void cpu_put_cwp64(CPUSPARCState *env1, int cwp);
> +
> +static inline uint64_t sparc64_tstate(CPUSPARCState *env)
> +{
> + uint64_t tstate = (cpu_get_ccr(env) << 32) |
> + ((env->asi & 0xff) << 24) | ((env->pstate & 0xf3f) << 8) |
> + cpu_get_cwp64(env);
> +
> + if (env->def.features & CPU_FEATURE_GL) {
> + tstate |= (env->gl & 7ULL) << 40;
> + }
> + return tstate;
> +}
> +#endif
Given that this inline function calls 2 other out-of-line functions, I think it
might as well be out-of-line itself.
I'd place it in win_helper.c alongside the functions that it calls.
But either way,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
- [PATCH v2 0/4] linux/sparc: more get/set_context fixes, Peter Maydell, 2020/11/06
- [PATCH v2 1/4] linux-user/sparc: Correct sparc64_get/set_context() FPU handling, Peter Maydell, 2020/11/06
- [PATCH v2 2/4] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context(), Peter Maydell, 2020/11/06
- [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_context(), Peter Maydell, 2020/11/06
- Re: [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_context(),
Richard Henderson <=
- [PATCH v2 3/4] linux-user/sparc: Don't restore %g7 in sparc64_set_context(), Peter Maydell, 2020/11/06
- Re: [PATCH v2 0/4] linux/sparc: more get/set_context fixes, Peter Maydell, 2020/11/06