From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8YMB-0008Pb-QI for qemu-devel@nongnu.org; Tue, 06 Jan 2015 12:55:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8YM8-00087X-8m for qemu-devel@nongnu.org; Tue, 06 Jan 2015 12:55:51 -0500 Received: from mail-la0-f41.google.com ([209.85.215.41]:40924) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8YM8-00087T-05 for qemu-devel@nongnu.org; Tue, 06 Jan 2015 12:55:48 -0500 Received: by mail-la0-f41.google.com with SMTP id hv19so20133034lab.14 for ; Tue, 06 Jan 2015 09:55:47 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1420474453-10058-3-git-send-email-eric.auger@linaro.org> References: <1420474453-10058-1-git-send-email-eric.auger@linaro.org> <1420474453-10058-3-git-send-email-eric.auger@linaro.org> From: Peter Maydell Date: Tue, 6 Jan 2015 17:55:26 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v8 2/3] hw/arm/boot: arm_load_kernel implemented as a machine init done notifier List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Auger Cc: Joel Schopp , Kim Phillips , eric.auger@st.com, Ard Biesheuvel , Patch Tracking , QEMU Developers , Alexander Graf , Alex Williamson , Paolo Bonzini , "kvmarm@lists.cs.columbia.edu" , Shannon Zhao , b.reynal@virtualopensystems.com, =?UTF-8?Q?Andreas_F=C3=A4rber?= , Christoffer Dall On 5 January 2015 at 16:14, Eric Auger wrote: > Device tree nodes for the platform bus and its children dynamic sysbus > devices are added in a machine init done notifier. To load the dtb once, > after those latter nodes are built and before ROM freeze, the actual > arm_load_kernel existing code is moved into a notifier notify function, > arm_load_kernel_notify. arm_load_kernel now only registers the > corresponding notifier. > > Machine files that do not support platform bus stay unchanged. Machine > files willing to support dynamic sysbus devices must call arm_load_kernel > before sysbus-fdt arm_register_platform_bus_fdt_creator to make sure > dynamic sysbus device nodes are integrated in the dtb. > --- a/include/hw/arm/arm.h > +++ b/include/hw/arm/arm.h > @@ -19,6 +19,16 @@ qemu_irq *armv7m_init(MemoryRegion *system_memory, > int flash_size, int sram_size, > const char *kernel_filename, const char *cpu_model= ); > > +/* > + * struct used as a parameter of the arm_load_kernel machine init > + * done notifier > + */ > +typedef struct { > + ARMCPU *cpu; /* handle to the first cpu object */ > + Notifier notifier; /* actual notifier */ This is an odd order -- why not put 'notifier' first? > +} ArmLoadKernelNotifier; > + > + This breaks building of the linux-user targets: In file included from /home/petmay01/linaro/qemu-from-laptop/qemu/target-arm/cpu.c:29:0: /home/petmay01/linaro/qemu-from-laptop/qemu/include/hw/arm/arm.h:28:5: error: unknown type name =E2=80=98Notifier=E2=80=99 Notifier notifier; /* actual notifier */ ^ make[1]: *** [target-arm/cpu.o] Error 1 Including "qemu/notify.h" in this file fixes it. Also, stray blank line. Otherwise looks OK. (It seems a slight shame to have to drag notify.h into everything that includes arm.h when really the notifier is just a detail of the implementation of boot.c, but I can't see a nice way round that, so never mind.) -- PMM