summaryrefslogtreecommitdiff
path: root/hw/arm_boot.c
diff options
context:
space:
mode:
authorpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-11 13:03:18 +0000
committerpbrook <pbrook@c046a42c-6fe2-441c-8c8c-71466251a162>2007-03-11 13:03:18 +0000
commitf3d6b95e835ba12e9cfdca76124897122c47cd1b (patch)
treea2a4240c0e97229dee690c8fecde0b242593f949 /hw/arm_boot.c
parent5adb4839e3c35382832bedc7155b3317b7b7d560 (diff)
downloadqemu-f3d6b95e835ba12e9cfdca76124897122c47cd1b.tar.gz
qemu-f3d6b95e835ba12e9cfdca76124897122c47cd1b.tar.bz2
qemu-f3d6b95e835ba12e9cfdca76124897122c47cd1b.zip
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/arm_boot.c')
-rw-r--r--hw/arm_boot.c19
1 files changed, 19 insertions, 0 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;