qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [v2 PATCH] target-mips: implement UserLocal Register


From: Petar Jovanovic
Subject: Re: [Qemu-devel] [v2 PATCH] target-mips: implement UserLocal Register
Date: Tue, 27 May 2014 01:21:04 +0000

________________________________________
From: Richard Henderson address@hidden on behalf of Richard Henderson 
address@hidden
Sent: Tuesday, May 27, 2014 12:53 AM
To: Petar Jovanovic; address@hidden
Cc: Petar Jovanovic; address@hidden; James Hogan
Subject: Re: [v2 PATCH] target-mips: implement UserLocal Register

On 05/26/2014 10:28 AM, Petar Jovanovic wrote:
>  void helper_mtc0_hwrena(CPUMIPSState *env, target_ulong arg1)
>  {
> -    env->CP0_HWREna = arg1 & 0x0000000F;
> +    uint32_t mask = 0x0000000F;
> +
> +    if (env->CP0_Config3 & (1 << CP0C3_ULRI)) {
> +        mask |= 0x20000000;
> +    }
> +
> +    env->CP0_HWREna = arg1 & mask;
>  }

> If you're going to force the bit on here...

No bit is forced here. It's only the mask that is set.

> +target_ulong helper_rdhwr_ul(CPUMIPSState *env)
> +{
> +    if ((env->hflags & MIPS_HFLAG_CP0) ||
> +        (env->CP0_HWREna & (1 << 29))) {
> +        return env->active_tc.CP0_UserLocal;
> +    } else {
> +        helper_raise_exception(env, EXCP_RI);
> +    }

> ... why do you need to check it here?


Because we do not know the content of CP0_HWREna.

P.


reply via email to

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