[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 6/7] hw/sparc: Implement fw_cfg_arch_key_name
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PATCH v3 6/7] hw/sparc: Implement fw_cfg_arch_key_name() |
Date: |
Tue, 23 Apr 2019 21:05:49 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
On 04/22/19 21:50, Philippe Mathieu-Daudé wrote:
> Implement fw_cfg_arch_key_name(), which returns the name of a
> sparc32-specific key.
>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> hw/sparc/sun4m.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
> index ca1e3825d58..49251d62b35 100644
> --- a/hw/sparc/sun4m.c
> +++ b/hw/sparc/sun4m.c
> @@ -97,6 +97,25 @@ struct sun4m_hwdef {
> uint8_t nvram_machine_id;
> };
>
> +const char *fw_cfg_arch_key_name(uint16_t key)
> +{
> + static const struct {
> + uint16_t key;
> + const char *name;
> + } fw_cfg_arch_wellknown_keys[] = {
> + {FW_CFG_SUN4M_DEPTH, "depth"},
> + {FW_CFG_SUN4M_WIDTH, "width"},
> + {FW_CFG_SUN4M_HEIGHT, "height"},
> + };
> +
> + for (size_t i = 0; i < ARRAY_SIZE(fw_cfg_arch_wellknown_keys); i++) {
> + if (fw_cfg_arch_wellknown_keys[i].key == key) {
> + return fw_cfg_arch_wellknown_keys[i].name;
> + }
> + }
> + return NULL;
> +}
> +
> static void fw_cfg_boot_set(void *opaque, const char *boot_device,
> Error **errp)
> {
>
My previous questions apply. From my POV,
Reviewed-by: Laszlo Ersek <address@hidden>
- Re: [Qemu-devel] [PATCH v3 2/7] hw/nvram/fw_cfg: Add fw_cfg_arch_key_name(), (continued)
- [Qemu-devel] [PATCH v3 3/7] hw/i386: Extract fw_cfg definitions to local "fw_cfg.h", Philippe Mathieu-Daudé, 2019/04/22
- [Qemu-devel] [PATCH v3 4/7] hw/i386: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/04/22
- [Qemu-devel] [PATCH v3 5/7] hw/ppc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/04/22
- [Qemu-devel] [PATCH v3 6/7] hw/sparc: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/04/22
- Re: [Qemu-devel] [PATCH v3 6/7] hw/sparc: Implement fw_cfg_arch_key_name(),
Laszlo Ersek <=
- [Qemu-devel] [PATCH v3 7/7] hw/sparc64: Implement fw_cfg_arch_key_name(), Philippe Mathieu-Daudé, 2019/04/22