OSDN Git Service

Separate fault for code access to unassigned memory
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 27 May 2007 19:36:00 +0000 (19:36 +0000)
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 27 May 2007 19:36:00 +0000 (19:36 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2876 c046a42c-6fe2-441c-8c8c-71466251a162

target-sparc/cpu.h
target-sparc/op_helper.c

index c5ccd28..2158629 100644 (file)
@@ -40,6 +40,7 @@
 #define TT_DFAULT   0x09
 #define TT_TOVF     0x0a
 #define TT_EXTINT   0x10
+#define TT_CODE_ACCESS 0x21
 #define TT_DATA_ACCESS 0x29
 #define TT_DIV_ZERO 0x2a
 #define TT_NCP_INSN 0x24
@@ -47,6 +48,7 @@
 #else
 #define TT_TFAULT   0x08
 #define TT_TMISS    0x09
+#define TT_CODE_ACCESS 0x0a
 #define TT_ILL_INSN 0x10
 #define TT_PRIV_INSN 0x11
 #define TT_NFPU_INSN 0x20
index b2f982f..dc1c04d 100644 (file)
@@ -1111,7 +1111,10 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
         printf("Unassigned mem access to " TARGET_FMT_plx " from " TARGET_FMT_lx
                "\n", addr, env->pc);
 #endif
-        raise_exception(TT_DATA_ACCESS);
+        if (is_exec)
+            raise_exception(TT_CODE_ACCESS);
+        else
+            raise_exception(TT_DATA_ACCESS);
     }
     env = saved_env;
 }
@@ -1130,7 +1133,10 @@ void do_unassigned_access(target_phys_addr_t addr, int is_write, int is_exec,
            addr, env->pc);
     env = saved_env;
 #endif
-    raise_exception(TT_DATA_ACCESS);
+    if (is_exec)
+        raise_exception(TT_CODE_ACCESS);
+    else
+        raise_exception(TT_DATA_ACCESS);
 }
 #endif