summaryrefslogtreecommitdiff
path: root/target-unicore32/helper.c
diff options
context:
space:
mode:
authorGuan Xuetao <gxt@mprc.pku.edu.cn>2012-08-10 14:42:21 +0800
committerBlue Swirl <blauwirbel@gmail.com>2012-08-11 09:36:55 +0000
commit4f23a1e645d4bfba620a63ba2c54c1813bcbfb63 (patch)
tree4d54c02296aeea93038a9122db42834529232273 /target-unicore32/helper.c
parent3d1d9652978ac5a32a0beb4bdf6065ca39440d89 (diff)
downloadqemu-4f23a1e645d4bfba620a63ba2c54c1813bcbfb63.tar.gz
unicore32-softmmu: Add unicore32-softmmu build support
This patch adds unicore32-softmmu build support, include configure, makefile, arch_init, and all missing functions needed by softmmu. Although all missing functions are empty, unicore32-softmmu could be build successfully. By 20120804: change QEMU_ARCH_UNICORE32 to 0x4000 Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-unicore32/helper.c')
-rw-r--r--target-unicore32/helper.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c
index 9fe4a375e4..9b8ff06d5c 100644
--- a/target-unicore32/helper.c
+++ b/target-unicore32/helper.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010-2011 GUAN Xue-tao
+ * Copyright (C) 2010-2012 Guan Xuetao
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -45,18 +45,26 @@ uint32_t HELPER(clz)(uint32_t x)
return clz32(x);
}
+#ifdef CONFIG_USER_ONLY
+void switch_mode(CPUUniCore32State *env, int mode)
+{
+ if (mode != ASR_MODE_USER) {
+ cpu_abort(env, "Tried to switch out of user mode\n");
+ }
+}
+
void do_interrupt(CPUUniCore32State *env)
{
- env->exception_index = -1;
+ cpu_abort(env, "NO interrupt in user mode\n");
}
-int uc32_cpu_handle_mmu_fault(CPUUniCore32State *env, target_ulong address, int rw,
- int mmu_idx)
+int uc32_cpu_handle_mmu_fault(CPUUniCore32State *env, target_ulong address,
+ int access_type, int mmu_idx)
{
- env->exception_index = UC32_EXCP_TRAP;
- env->cp0.c4_faultaddr = address;
+ cpu_abort(env, "NO mmu fault in user mode\n");
return 1;
}
+#endif
/* These should probably raise undefined insn exceptions. */
void HELPER(set_cp)(CPUUniCore32State *env, uint32_t insn, uint32_t val)
@@ -84,13 +92,6 @@ uint32_t HELPER(get_cp0)(CPUUniCore32State *env, uint32_t insn)
return 0;
}
-void switch_mode(CPUUniCore32State *env, int mode)
-{
- if (mode != ASR_MODE_USER) {
- cpu_abort(env, "Tried to switch out of user mode\n");
- }
-}
-
void HELPER(set_r29_banked)(CPUUniCore32State *env, uint32_t mode, uint32_t val)
{
cpu_abort(env, "banked r29 write\n");