Patchwork [10/10] hw: honor low bit in mipssim machine

login
register
mail settings
Submitter Nathan Froyd
Date May 24, 2010, 4:19 p.m.
Message ID <1274717984-25887-11-git-send-email-froydnj@codesourcery.com>
Download mbox | patch
Permalink /patch/53444/
State New
Headers show

Comments

Nathan Froyd - May 24, 2010, 4:19 p.m.
Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
---
 hw/mips_mipssim.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Richard Henderson - June 4, 2010, 6:37 p.m.
On 05/24/2010 09:19 AM, Nathan Froyd wrote:
> Signed-off-by: Nathan Froyd <froydnj@codesourcery.com>
> ---
>  hw/mips_mipssim.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
> index a747de5..cd6c2be 100644
> --- a/hw/mips_mipssim.c
> +++ b/hw/mips_mipssim.c
> @@ -106,7 +106,9 @@ static void main_cpu_reset(void *opaque)
>      CPUState *env = s->env;
>  
>      cpu_reset(env);
> -    env->active_tc.PC = s->vector;
> +    env->active_tc.PC = s->vector & ~(target_ulong)1;
> +    if (s->vector & 1)
> +        env->hflags |= MIPS_HFLAG_M16;

Coding style.


r~

Patch

diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index a747de5..cd6c2be 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -106,7 +106,9 @@  static void main_cpu_reset(void *opaque)
     CPUState *env = s->env;
 
     cpu_reset(env);
-    env->active_tc.PC = s->vector;
+    env->active_tc.PC = s->vector & ~(target_ulong)1;
+    if (s->vector & 1)
+        env->hflags |= MIPS_HFLAG_M16;
 }
 
 static void