aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/op_helper.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-01-10 10:27:11 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-01-12 13:54:16 +0100
commit5818dee572deabb1e75a0901b43caa81fb30f419 (patch)
tree98ce117e5395b85d8aef4fcc0637059586aa6f4f /target-microblaze/op_helper.c
parent48b5e96f0f7006f46a7d6c6f0934a6acdda22e3b (diff)
microblaze: Emulate the hw stackprotector
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'target-microblaze/op_helper.c')
-rw-r--r--target-microblaze/op_helper.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/target-microblaze/op_helper.c b/target-microblaze/op_helper.c
index d99c564375..7232c71998 100644
--- a/target-microblaze/op_helper.c
+++ b/target-microblaze/op_helper.c
@@ -483,6 +483,17 @@ void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t mask)
}
}
+void helper_stackprot(uint32_t addr)
+{
+ if (addr < env->slr || addr > env->shr) {
+ qemu_log("Stack protector violation at %x %x %x\n",
+ addr, env->slr, env->shr);
+ env->sregs[SR_EAR] = addr;
+ env->sregs[SR_ESR] = ESR_EC_STACKPROT;
+ helper_raise_exception(EXCP_HW_EXCP);
+ }
+}
+
#if !defined(CONFIG_USER_ONLY)
/* Writes/reads to the MMU's special regs end up here. */
uint32_t helper_mmu_read(uint32_t rn)