Commit 74b9decc473177f16cb84b3504ad8169f13ec147
1 parent
8eba209e
Use MMU globals for some MMU traps
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4918 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
19 additions
and
4 deletions
target-sparc/cpu.h
... | ... | @@ -61,12 +61,13 @@ |
61 | 61 | #define TT_DIV_ZERO 0x28 |
62 | 62 | #define TT_DFAULT 0x30 |
63 | 63 | #define TT_DATA_ACCESS 0x32 |
64 | -#define TT_DPROT 0x33 | |
65 | 64 | #define TT_UNALIGNED 0x34 |
66 | 65 | #define TT_PRIV_ACT 0x37 |
67 | 66 | #define TT_EXTINT 0x40 |
67 | +#define TT_IVEC 0x60 | |
68 | 68 | #define TT_TMISS 0x64 |
69 | 69 | #define TT_DMISS 0x68 |
70 | +#define TT_DPROT 0x6c | |
70 | 71 | #define TT_SPILL 0x80 |
71 | 72 | #define TT_FILL 0xc0 |
72 | 73 | #define TT_WOTHER 0x10 | ... | ... |
target-sparc/helper.c
... | ... | @@ -758,9 +758,23 @@ void do_interrupt(CPUState *env) |
758 | 758 | env->tsptr->tpc = env->pc; |
759 | 759 | env->tsptr->tnpc = env->npc; |
760 | 760 | env->tsptr->tt = intno; |
761 | - if (!(env->features & CPU_FEATURE_GL)) | |
762 | - change_pstate(PS_PEF | PS_PRIV | PS_AG); | |
763 | - | |
761 | + if (!(env->features & CPU_FEATURE_GL)) { | |
762 | + switch (intno) { | |
763 | + case TT_IVEC: | |
764 | + change_pstate(PS_PEF | PS_PRIV | PS_IG); | |
765 | + break; | |
766 | + case TT_TFAULT: | |
767 | + case TT_TMISS: | |
768 | + case TT_DFAULT: | |
769 | + case TT_DMISS: | |
770 | + case TT_DPROT: | |
771 | + change_pstate(PS_PEF | PS_PRIV | PS_MG); | |
772 | + break; | |
773 | + default: | |
774 | + change_pstate(PS_PEF | PS_PRIV | PS_AG); | |
775 | + break; | |
776 | + } | |
777 | + } | |
764 | 778 | if (intno == TT_CLRWIN) |
765 | 779 | cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - 1)); |
766 | 780 | else if ((intno & 0x1c0) == TT_SPILL) | ... | ... |