Commit d5a42d19 authored by Philippe Mathieu-Daudé's avatar Philippe Mathieu-Daudé
Browse files

hw/sparc: Implement fw_cfg_arch_key_name()



Implement fw_cfg_arch_key_name(), which returns the name of a
sparc32-specific key.

Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
Message-Id: <20190422195020.1494-7-philmd@redhat.com>
Signed-off-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
parent d632b9de
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -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)
{