diff options
author | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-11 13:03:18 +0000 |
---|---|---|
committer | pbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-03-11 13:03:18 +0000 |
commit | f3d6b95e835ba12e9cfdca76124897122c47cd1b (patch) | |
tree | a2a4240c0e97229dee690c8fecde0b242593f949 /hw | |
parent | 5adb4839e3c35382832bedc7155b3317b7b7d560 (diff) |
ARM reabbot support (orginal patch by Aurelien Jarno).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2476 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/arm_boot.c | 19 | ||||
-rw-r--r-- | hw/arm_sysctl.c | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/hw/arm_boot.c b/hw/arm_boot.c index c313a9f9af..dfc00db28a 100644 --- a/hw/arm_boot.c +++ b/hw/arm_boot.c @@ -24,6 +24,17 @@ static uint32_t bootloader[] = { 0 /* Kernel entry point. Set by integratorcp_init. */ }; +static void main_cpu_reset(void *opaque) +{ + CPUState *env = opaque; + + cpu_reset(env); + if (env->kernel_filename) + arm_load_kernel(env, env->ram_size, env->kernel_filename, + env->kernel_cmdline, env->initrd_filename, + env->board_id); +} + static void set_kernel_args(uint32_t ram_size, int initrd_size, const char *kernel_cmdline) { @@ -81,6 +92,14 @@ void arm_load_kernel(CPUState *env, int ram_size, const char *kernel_filename, exit(1); } + if (!env->kernel_filename) { + env->ram_size = ram_size; + env->kernel_filename = kernel_filename; + env->kernel_cmdline = kernel_cmdline; + env->initrd_filename = initrd_filename; + env->board_id = board_id; + qemu_register_reset(main_cpu_reset, env); + } /* Assume that raw images are linux kernels, and ELF images are not. */ kernel_size = load_elf(kernel_filename, 0, &elf_entry); entry = elf_entry; diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index e9de998a2a..90ea76e714 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -149,7 +149,7 @@ static void arm_sysctl_write(void *opaque, target_phys_addr_t offset, if (s->lockval == LOCK_VALUE) { s->resetlevel = val; if (val & 0x100) - cpu_abort(cpu_single_env, "Board reset\n"); + qemu_system_reset_request (); } break; case 0x44: /* PCICTL */ |