From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYUP-0002zq-GX for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XcYUJ-0000Vg-Fg for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:36:05 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:40682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XcYUJ-0000VS-B0 for qemu-devel@nongnu.org; Fri, 10 Oct 2014 07:35:59 -0400 Received: by mail-wg0-f52.google.com with SMTP id a1so3633056wgh.35 for ; Fri, 10 Oct 2014 04:35:55 -0700 (PDT) From: Ard Biesheuvel Date: Fri, 10 Oct 2014 13:35:44 +0200 Message-Id: <1412940944-19107-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [Qemu-devel] [PATCH v2] hw/arm/boot: register cpu reset handlers if using -bios List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: Ard Biesheuvel , qemu-devel@nongnu.org, greg.bellows@linaro.org Move the registering of CPU reset handlers to before the point where we leave the function in the -bios (not -kernel) case, so CPU reset works correctly with -bios as well. Signed-off-by: Ard Biesheuvel --- hw/arm/boot.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index c8dc34f0865b..fc6a3ebf853d 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -488,6 +488,12 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) int big_endian; static const ARMInsnFixup *primary_loader; + for (; cs; cs = CPU_NEXT(cs)) { + cpu = ARM_CPU(cs); + cpu->env.boot_info = info; + qemu_register_reset(do_cpu_reset, cpu); + } + /* Load the kernel. */ if (!info->kernel_filename) { @@ -651,10 +657,4 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info) } } info->is_linux = is_linux; - - for (; cs; cs = CPU_NEXT(cs)) { - cpu = ARM_CPU(cs); - cpu->env.boot_info = info; - qemu_register_reset(do_cpu_reset, cpu); - } } -- 1.8.3.2