summary refs log tree commit diff stats
path: root/hw/sparc/sun4m.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2019-04-22 15:51:17 +0200
committerPhilippe Mathieu-Daudé <philmd@redhat.com>2019-05-23 14:10:31 +0200
commitd5a42d1942b77de0d1271f53d47c14a40b831be6 (patch)
tree2e33c75eab57e1493e60563b6673f6af337fb4d5 /hw/sparc/sun4m.c
parentd632b9de7865e05f06f02549e6dbdcf9a61f4ad3 (diff)
downloadfocaccia-qemu-d5a42d1942b77de0d1271f53d47c14a40b831be6.tar.gz
focaccia-qemu-d5a42d1942b77de0d1271f53d47c14a40b831be6.zip
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: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190422195020.1494-7-philmd@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'hw/sparc/sun4m.c')
-rw-r--r--hw/sparc/sun4m.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c
index 07d126aea8..5151a7202b 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)
 {