aboutsummaryrefslogtreecommitdiffstats
path: root/target-sh4/helper.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-17 19:58:25 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2006-06-17 19:58:25 +0000
commit355fb23d83aad9ffae376cac09c6b52656e7d083 (patch)
tree6d4279f10b498a5723c0d829887557e46517cf62 /target-sh4/helper.c
parent9854bc4662906a60c35c64c1e5b4d76eee4ac631 (diff)
SH usermode fault handling.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1988 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-sh4/helper.c')
-rw-r--r--target-sh4/helper.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/target-sh4/helper.c b/target-sh4/helper.c
index 5ab505aed..1839c96dd 100644
--- a/target-sh4/helper.c
+++ b/target-sh4/helper.c
@@ -28,6 +28,38 @@
#include "cpu.h"
#include "exec-all.h"
+#if defined(CONFIG_USER_ONLY)
+
+void do_interrupt (CPUState *env)
+{
+ env->exception_index = -1;
+}
+
+int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
+ int is_user, int is_softmmu)
+{
+ env->tea = address;
+ switch (rw) {
+ case 0:
+ env->exception_index = 0x0a0;
+ break;
+ case 1:
+ env->exception_index = 0x0c0;
+ break;
+ case 2:
+ env->exception_index = 0x0a0;
+ break;
+ }
+ return 1;
+}
+
+target_ulong cpu_get_phys_page_debug(CPUState * env, target_ulong addr)
+{
+ return addr;
+}
+
+#else /* !CONFIG_USER_ONLY */
+
#define MMU_OK 0
#define MMU_ITLB_MISS (-1)
#define MMU_ITLB_MULTIPLE (-2)
@@ -396,3 +428,14 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,
return tlb_set_page(env, address, physical, prot, is_user, is_softmmu);
}
+
+target_ulong cpu_get_phys_page_debug(CPUState * env, target_ulong addr)
+{
+ target_ulong physical;
+ int prot;
+
+ get_physical_address(env, &physical, &prot, addr, PAGE_READ, 0);
+ return physical;
+}
+
+#endif