From 6c132bc67372c8ec8715e690547799d596066377 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Tue, 8 Sep 2015 01:08:37 +0800 Subject: [PATCH] arm: fix #114 by enabling cortex-a15 model. FIXME: enable this on demand with an API --- qemu/hw/arm/tosa.c | 3 ++- regress/arm_movr12_hang.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu/hw/arm/tosa.c b/qemu/hw/arm/tosa.c index 952585ca..818fe32f 100644 --- a/qemu/hw/arm/tosa.c +++ b/qemu/hw/arm/tosa.c @@ -19,7 +19,8 @@ static void tosa_init(struct uc_struct *uc, MachineState *machine) { - cpu_arm_init(uc, "pxa255"); + //cpu_arm_init(uc, "pxa255"); + cpu_arm_init(uc, "cortex-a15"); // FIXME } void tosa_machine_init(struct uc_struct *uc) diff --git a/regress/arm_movr12_hang.py b/regress/arm_movr12_hang.py index 6f065882..8847694c 100755 --- a/regress/arm_movr12_hang.py +++ b/regress/arm_movr12_hang.py @@ -1,11 +1,17 @@ #!/usr/bin/python from unicorn import * +from unicorn.arm_const import * + uc = Uc(UC_ARCH_ARM, UC_MODE_ARM) uc.mem_map(0x1000, 0x1000) uc.mem_write(0x1000, '00c000e3'.decode('hex')) def hook_block(uc, addr, *args): print 'enter block 0x%04x' % addr + +uc.reg_write(UC_ARM_REG_R12, 0x123) +print 'r12 =', uc.reg_read(UC_ARM_REG_R12) uc.hook_add(UC_HOOK_BLOCK, hook_block) print 'block should only run once' uc.emu_start(0x1000, 0x1004, timeout=250) +print 'r12 =', uc.reg_read(UC_ARM_REG_R12)