From: blueswir1 Date: Mon, 21 Jul 2008 18:43:32 +0000 (+0000) Subject: Use MMU globals for some MMU traps X-Git-Tag: stefano.display-merge-start~871 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=74b9decc473177f16cb84b3504ad8169f13ec147;p=qemu-xen-4.5-testing.git Use MMU globals for some MMU traps git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4918 c046a42c-6fe2-441c-8c8c-71466251a162 --- diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 676aac613..248fc0593 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -61,12 +61,13 @@ #define TT_DIV_ZERO 0x28 #define TT_DFAULT 0x30 #define TT_DATA_ACCESS 0x32 -#define TT_DPROT 0x33 #define TT_UNALIGNED 0x34 #define TT_PRIV_ACT 0x37 #define TT_EXTINT 0x40 +#define TT_IVEC 0x60 #define TT_TMISS 0x64 #define TT_DMISS 0x68 +#define TT_DPROT 0x6c #define TT_SPILL 0x80 #define TT_FILL 0xc0 #define TT_WOTHER 0x10 diff --git a/target-sparc/helper.c b/target-sparc/helper.c index 6822f1b92..06265dc6a 100644 --- a/target-sparc/helper.c +++ b/target-sparc/helper.c @@ -758,9 +758,23 @@ void do_interrupt(CPUState *env) env->tsptr->tpc = env->pc; env->tsptr->tnpc = env->npc; env->tsptr->tt = intno; - if (!(env->features & CPU_FEATURE_GL)) - change_pstate(PS_PEF | PS_PRIV | PS_AG); - + if (!(env->features & CPU_FEATURE_GL)) { + switch (intno) { + case TT_IVEC: + change_pstate(PS_PEF | PS_PRIV | PS_IG); + break; + case TT_TFAULT: + case TT_TMISS: + case TT_DFAULT: + case TT_DMISS: + case TT_DPROT: + change_pstate(PS_PEF | PS_PRIV | PS_MG); + break; + default: + change_pstate(PS_PEF | PS_PRIV | PS_AG); + break; + } + } if (intno == TT_CLRWIN) cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - 1)); else if ((intno & 0x1c0) == TT_SPILL)