[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V2 1/3] hw/arm,loongarch: Move load_image_to_fw_cfg() to comm
From: |
Peter Maydell |
Subject: |
Re: [PATCH V2 1/3] hw/arm,loongarch: Move load_image_to_fw_cfg() to common location |
Date: |
Mon, 5 Sep 2022 22:20:40 +0100 |
On Mon, 5 Sept 2022 at 19:23, Sunil V L <sunilvl@ventanamicro.com> wrote:
>
> load_image_to_fw_cfg() is duplicated by both arm and loongarch. The same
> function will be required by riscv too. So, it's time to refactor and
> move this function to a common path.
>
> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
> ---
> hw/arm/boot.c | 49 ---------------------------------------
> hw/loongarch/virt.c | 33 --------------------------
> hw/nvram/fw_cfg.c | 49 +++++++++++++++++++++++++++++++++++++++
> include/hw/nvram/fw_cfg.h | 3 +++
> 4 files changed, 52 insertions(+), 82 deletions(-)
> diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
> index d605f3f45a..3f68dae5d2 100644
> --- a/hw/nvram/fw_cfg.c
> +++ b/hw/nvram/fw_cfg.c
> @@ -41,6 +41,7 @@
> #include "qapi/error.h"
> #include "hw/acpi/aml-build.h"
> #include "hw/pci/pci_bus.h"
> +#include "hw/loader.h"
>
> #define FW_CFG_FILE_SLOTS_DFLT 0x20
>
> @@ -1221,6 +1222,54 @@ FWCfgState *fw_cfg_find(void)
> return FW_CFG(object_resolve_path_type("", TYPE_FW_CFG, NULL));
> }
>
> +/**
> + * load_image_to_fw_cfg() - Load an image file into an fw_cfg entry
> identified
> + * by key.
For functions declared in public header files, put the doc comment
in the .h file, not the .c file, please.
thanks
-- PMM