qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH 2/2] ppc: tcg: implement helper_nap


From: Alexander Graf
Subject: Re: [Qemu-ppc] [PATCH 2/2] ppc: tcg: implement helper_nap
Date: Mon, 20 Jan 2014 15:52:12 +0100

On 15.01.2014, at 03:22, Liu Ping Fan <address@hidden> wrote:

> When nap, clear no persistent register as ISA spec says.
> 
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> target-ppc/excp_helper.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
> 
> diff --git a/target-ppc/excp_helper.c b/target-ppc/excp_helper.c
> index a9712bc..5dbb166 100644
> --- a/target-ppc/excp_helper.c
> +++ b/target-ppc/excp_helper.c
> @@ -892,6 +892,20 @@ void helper_hrfid(CPUPPCState *env)
> 
> void helper_nap(CPUPPCState *env)
> {
> +    int i;
> +    for (i = 0; i < 32; i++) {
> +        env->gpr[i] = 0;
> +    }
> +    env->lr = 0;
> +    env->ctr = 0;
> +    for (i = 0; i < 8; i++) {
> +        env->crf[i] = 0;
> +    }
> +    env->msr = 0;
> +    for (i = 0; i < 32; i++) {
> +        env->fpr[i] = 0;
> +    }
> +

According to the specification there's no guarantee that the registers really 
have gone. In fact, it explicitly states "may". So I would just emulate it the 
same way we emulate MSR_WE.

(plus this code doesn't halt the CPU as was already mentioned)


Alex




reply via email to

[Prev in Thread] Current Thread [Next in Thread]