qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Giuseppe Musacchio <thatlemon@gmail.com>,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Laurent Vivier <laurent@vivier.eu>
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	[thread overview]
Message-ID: <a0444a23-3f89-8d72-6fc5-13414e0c96a5@linaro.org> (raw)
In-Reply-To: <20201106152738.26026-5-peter.maydell@linaro.org>

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~


  reply	other threads:[~2020-11-06 17:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 15:27 [PATCH v2 0/4] linux/sparc: more get/set_context fixes Peter Maydell
2020-11-06 15:27 ` [PATCH v2 1/4] linux-user/sparc: Correct sparc64_get/set_context() FPU handling Peter Maydell
2020-11-06 17:09   ` Richard Henderson
2020-11-06 17:10     ` Peter Maydell
2020-12-17 11:30     ` Laurent Vivier
2020-11-06 15:27 ` [PATCH v2 2/4] linux-user/sparc: Remove unneeded checks of 'err' from sparc64_get_context() Peter Maydell
2020-11-06 17:10   ` Richard Henderson
2020-12-17 11:32   ` Laurent Vivier
2020-11-06 15:27 ` [PATCH v2 3/4] linux-user/sparc: Don't restore %g7 in sparc64_set_context() Peter Maydell
2020-11-06 17:11   ` Richard Henderson
2020-12-17 11:33   ` Laurent Vivier
2020-11-06 15:27 ` [PATCH v2 4/4] linux-user/sparc: Handle tstate in sparc64_get/set_context() Peter Maydell
2020-11-06 17:22   ` Richard Henderson [this message]
2020-12-17 11:33   ` Laurent Vivier
2020-11-06 15:30 ` [PATCH v2 0/4] linux/sparc: more get/set_context fixes Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0444a23-3f89-8d72-6fc5-13414e0c96a5@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=laurent@vivier.eu \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thatlemon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).