aboutsummaryrefslogtreecommitdiff
path: root/target-mips/op_helper.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-02-24 11:08:40 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-02-24 11:08:40 +0000
commitbf2fd13af3925f3a081fdeab8e8a1c8830431e46 (patch)
treecec1c65f37248d2adf0ec1097cda2046ed84675a /target-mips/op_helper.c
parentcd2d5541271f1934345d8ca42f5fafff1744eee7 (diff)
parent1ab2aea2489f34a05dabfe5bd91a76d89dd8c922 (diff)
Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150213-2' into staging
MIPS patches 2015-02-13 Changes: * bug fixes, cleanups and minor improvements # gpg: Signature made Sat Feb 14 17:01:37 2015 GMT using RSA key ID 0B29DA6B # gpg: Can't check signature: public key not found * remotes/lalrae/tags/mips-20150213-2: linux-user: correct stat structure in MIPS N32 target-mips: pass 0 instead of -1 as rs in microMIPS LUI instruction target-mips: fix broken snapshotting target-mips: use CP0EnLo_XI instead of magic number target-mips: ll and lld cause AdEL exception for unaligned address target-mips: fix detection of the end of the page during translation target-mips: Make CP0.Status.CU1 read-only for the 5Kc and 5KEc processors isa: remove isa_mem_base variable gt64xxx: remove isa_mem_base usage piix4: use PCI address space instead of system memory mips: remove isa_mem_base usage jazz: remove usage of isa_mem_base jazz: do not explode QEMUMachineInitArgs structure isa: add memory space parameter to isa_bus_new Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-mips/op_helper.c')
-rw-r--r--target-mips/op_helper.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index ea7d95f36c..73a8e458fc 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -304,16 +304,20 @@ static inline hwaddr do_translate_address(CPUMIPSState *env,
}
}
-#define HELPER_LD_ATOMIC(name, insn) \
+#define HELPER_LD_ATOMIC(name, insn, almask) \
target_ulong helper_##name(CPUMIPSState *env, target_ulong arg, int mem_idx) \
{ \
+ if (arg & almask) { \
+ env->CP0_BadVAddr = arg; \
+ helper_raise_exception(env, EXCP_AdEL); \
+ } \
env->lladdr = do_translate_address(env, arg, 0); \
env->llval = do_##insn(env, arg, mem_idx); \
return env->llval; \
}
-HELPER_LD_ATOMIC(ll, lw)
+HELPER_LD_ATOMIC(ll, lw, 0x3)
#ifdef TARGET_MIPS64
-HELPER_LD_ATOMIC(lld, ld)
+HELPER_LD_ATOMIC(lld, ld, 0x7)
#endif
#undef HELPER_LD_ATOMIC