From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW9rL-0007mj-L1 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 16:42:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW9rF-0005zk-Qu for qemu-devel@nongnu.org; Wed, 17 Feb 2016 16:42:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW9rF-0005zg-J8 for qemu-devel@nongnu.org; Wed, 17 Feb 2016 16:42:01 -0500 References: <174e5d40f6c59bf57ea997c0575f21b8b67ce5d6.1455739133.git.alistair.francis@xilinx.com> From: Eric Blake Message-ID: <56C4E923.9000306@redhat.com> Date: Wed, 17 Feb 2016 14:41:55 -0700 MIME-Version: 1.0 In-Reply-To: <174e5d40f6c59bf57ea997c0575f21b8b67ce5d6.1455739133.git.alistair.francis@xilinx.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Itl4eCEf9fPWctn504hb4ORcSdAO63bhO" Subject: Re: [Qemu-devel] [PATCH v1 2/2] generic-loader: Add a generic loader List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alistair Francis , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, crosthwaitepeter@gmail.com, cov@codeaurora.org, lig.fnst@cn.fujitsu.com, pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Itl4eCEf9fPWctn504hb4ORcSdAO63bhO Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/17/2016 02:04 PM, Alistair Francis wrote: > Add a generic loader to QEMU which can be used to load images or set > memory values. >=20 > This only supports ARM architectures at the moment. >=20 > Signed-off-by: Alistair Francis > --- > Changes since RFC: > - Add BE support >=20 > hw/misc/generic-loader.c | 127 +++++++++++++++++++++++++++++++= ++++++++ > include/hw/misc/generic-loader.h | 50 +++++++++++++++ > 4 files changed, 180 insertions(+) > create mode 100644 hw/misc/generic-loader.c > create mode 100644 include/hw/misc/generic-loader.h We really ought to improve checkpatch.pl to flag patches that add new files not covered by MAINTAINERS. > +++ b/hw/misc/generic-loader.c > @@ -0,0 +1,127 @@ > +/* > + * Generic Loader > + * > + * Copyright (C) 2014 Li Guang > + * Written by Li Guang Want to claim 2016? >=20 > + > +#include "hw/sysbus.h" > +#include "sysemu/dma.h" > +#include "hw/loader.h" > +#include "hw/misc/generic-loader.h" New .c files should include "qemu/osdep.h" first, before anything else. > +static void generic_loader_realize(DeviceState *dev, Error **errp) > +{ > + GenericLoaderState *s =3D GENERIC_LOADER(dev); > + hwaddr entry; > + int big_endian; > + int size =3D 0; > + > + if (s->cpu_nr !=3D CPU_NONE) { > + CPUState *cs =3D first_cpu; > + int cpu_num =3D 0; > + > + CPU_FOREACH(cs) { > + if (cpu_num =3D=3D s->cpu_nr) { > + s->cpu =3D cs; > + break; > + } else if (!CPU_NEXT(cs)) { > + error_setg(errp, "Specified boot CPU#%d is non existan= t", > + s->cpu_nr); s/non existant/nonexistent/ > +++ b/include/hw/misc/generic-loader.h > @@ -0,0 +1,50 @@ > +/* > + * Generic Loader > + * > + * Copyright (C) 2014 Li Guang > + * Written by Li Guang 2016 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Itl4eCEf9fPWctn504hb4ORcSdAO63bhO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWxOkjAAoJEKeha0olJ0NqKjQH/3p5362WQVRUS4AGC6d83pvQ eZUavGcKrum73gsjR+XqS/BtzSTblbDkL8jE4MfAGmUoXr/VW8MThHYhVp5Os1Y9 mqT8zS9MMMdcmD3svXwjloSEc0Rd4Pr0VJzmYfXu+zKkUAoCDTWklpHdyJuwpQWN exbbnfYKrMPeGOi6+rcSVJjDC0Cs+gj3PMPkrW7Ke8Q78XP4McJzqeIEu6dvqxz5 dYgdbJTiNJzX3lPpTMfKcX3aBJudPyUKHyGER0ep17phye5CK6KPaMcKwmW2OzQo CdTbyXnkLyuvKD7ORujpbthgs0zlWlZ0PyxNICFqiXpRyikrvyBP6VlNtxNh+EM= =ZKLO -----END PGP SIGNATURE----- --Itl4eCEf9fPWctn504hb4ORcSdAO63bhO--