提交 a2b45ea5 编写于 作者: P Philippe Mathieu-Daudé

hw/sparc64: Implement fw_cfg_arch_key_name()

Implement fw_cfg_arch_key_name(), which returns the name of a
sparc64-specific key.
Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
Message-Id: <20190422195020.1494-8-philmd@redhat.com>
Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
上级 d5a42d19
......@@ -91,6 +91,25 @@ typedef struct EbusState {
#define TYPE_EBUS "ebus"
#define EBUS(obj) OBJECT_CHECK(EbusState, (obj), TYPE_EBUS)
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_SPARC64_WIDTH, "width"},
{FW_CFG_SPARC64_HEIGHT, "height"},
{FW_CFG_SPARC64_DEPTH, "depth"},
};
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)
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册