Commit 1b2e93c175a947653326efce9a6f36791d458691
1 parent
b3a23197
Separate fault for code access to unassigned memory
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2876 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
2 changed files
with
10 additions
and
2 deletions
target-sparc/cpu.h
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | #define TT_DFAULT 0x09 |
41 | 41 | #define TT_TOVF 0x0a |
42 | 42 | #define TT_EXTINT 0x10 |
43 | +#define TT_CODE_ACCESS 0x21 | |
43 | 44 | #define TT_DATA_ACCESS 0x29 |
44 | 45 | #define TT_DIV_ZERO 0x2a |
45 | 46 | #define TT_NCP_INSN 0x24 |
... | ... | @@ -47,6 +48,7 @@ |
47 | 48 | #else |
48 | 49 | #define TT_TFAULT 0x08 |
49 | 50 | #define TT_TMISS 0x09 |
51 | +#define TT_CODE_ACCESS 0x0a | |
50 | 52 | #define TT_ILL_INSN 0x10 |
51 | 53 | #define TT_PRIV_INSN 0x11 |
52 | 54 | #define TT_NFPU_INSN 0x20 | ... | ... |
target-sparc/op_helper.c
... | ... | @@ -1111,7 +1111,10 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, |
1111 | 1111 | printf("Unassigned mem access to " TARGET_FMT_plx " from " TARGET_FMT_lx |
1112 | 1112 | "\n", addr, env->pc); |
1113 | 1113 | #endif |
1114 | - raise_exception(TT_DATA_ACCESS); | |
1114 | + if (is_exec) | |
1115 | + raise_exception(TT_CODE_ACCESS); | |
1116 | + else | |
1117 | + raise_exception(TT_DATA_ACCESS); | |
1115 | 1118 | } |
1116 | 1119 | env = saved_env; |
1117 | 1120 | } |
... | ... | @@ -1130,7 +1133,10 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec, |
1130 | 1133 | addr, env->pc); |
1131 | 1134 | env = saved_env; |
1132 | 1135 | #endif |
1133 | - raise_exception(TT_DATA_ACCESS); | |
1136 | + if (is_exec) | |
1137 | + raise_exception(TT_CODE_ACCESS); | |
1138 | + else | |
1139 | + raise_exception(TT_DATA_ACCESS); | |
1134 | 1140 | } |
1135 | 1141 | #endif |
1136 | 1142 | ... | ... |