[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 2/2] generic-loader: Add a generic loader
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v1 2/2] generic-loader: Add a generic loader |
Date: |
Wed, 17 Feb 2016 14:41:55 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
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.
>
> This only supports ARM architectures at the moment.
>
> Signed-off-by: Alistair Francis <address@hidden>
> ---
> Changes since RFC:
> - Add BE support
>
> 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 <address@hidden>
Want to claim 2016?
>
> +
> +#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 = GENERIC_LOADER(dev);
> + hwaddr entry;
> + int big_endian;
> + int size = 0;
> +
> + if (s->cpu_nr != CPU_NONE) {
> + CPUState *cs = first_cpu;
> + int cpu_num = 0;
> +
> + CPU_FOREACH(cs) {
> + if (cpu_num == s->cpu_nr) {
> + s->cpu = cs;
> + break;
> + } else if (!CPU_NEXT(cs)) {
> + error_setg(errp, "Specified boot CPU#%d is non existant",
> + 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 <address@hidden>
2016
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v1 1/2] qdev-monitor.c: Register reset function if the device has one, Alistair Francis, 2016/02/17