aboutsummaryrefslogtreecommitdiff
path: root/target-microblaze/cpu.c
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@xilinx.com>2015-05-29 16:30:43 +1000
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>2015-06-21 17:20:15 +1000
commit9aaaa181949e4a23ca298fb7006e2d8bac842e92 (patch)
treeaa9dd2fd75c9f98e80950fc56bba2902550854bd /target-microblaze/cpu.c
parent8bac22423e4c3b70082dd6c1b492ccf21f3b5a0c (diff)
downloadqemu-arm-9aaaa181949e4a23ca298fb7006e2d8bac842e92.tar.gz
target-microblaze: Allow the stack protection to be disabled
Microblaze stack protection is configurable and isn't always enabled. This patch allows the stack protection to be disabled from the CPU properties. Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Diffstat (limited to 'target-microblaze/cpu.c')
-rw-r--r--target-microblaze/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 95be540124..d3dad4ab7a 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -114,6 +114,9 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
| PVR2_USE_FPU2_MASK \
| PVR2_FPU_EXC_MASK \
| 0;
+
+ env->pvr.regs[0] |= cpu->cfg.stackprot ? PVR0_SPROT_MASK : 0;
+
env->pvr.regs[10] = 0x0c000000; /* Default to spartan 3a dsp family. */
env->pvr.regs[11] = PVR11_USE_MMU | (16 << 17);
@@ -156,6 +159,8 @@ static const VMStateDescription vmstate_mb_cpu = {
static Property mb_properties[] = {
DEFINE_PROP_UINT32("xlnx.base-vectors", MicroBlazeCPU, base_vectors, 0),
+ DEFINE_PROP_BOOL("use-stack-protection", MicroBlazeCPU, cfg.stackprot,
+ true),
DEFINE_PROP_END_OF_LIST(),
};