Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging
[qemu/ar7.git] / hw / i386 / fw_cfg.c
blob380a819230c07333e196aeb8b93976f1b4068b7e
1 /*
2 * QEMU fw_cfg helpers (X86 specific)
4 * Copyright (c) 2019 Red Hat, Inc.
6 * Author:
7 * Philippe Mathieu-Daudé <philmd@redhat.com>
9 * SPDX-License-Identifier: GPL-2.0-or-later
11 * This work is licensed under the terms of the GNU GPL, version 2 or later.
12 * See the COPYING file in the top-level directory.
15 #include "qemu/osdep.h"
16 #include "hw/i386/fw_cfg.h"
17 #include "hw/nvram/fw_cfg.h"
19 const char *fw_cfg_arch_key_name(uint16_t key)
21 static const struct {
22 uint16_t key;
23 const char *name;
24 } fw_cfg_arch_wellknown_keys[] = {
25 {FW_CFG_ACPI_TABLES, "acpi_tables"},
26 {FW_CFG_SMBIOS_ENTRIES, "smbios_entries"},
27 {FW_CFG_IRQ0_OVERRIDE, "irq0_override"},
28 {FW_CFG_E820_TABLE, "e820_table"},
29 {FW_CFG_HPET, "hpet"},
32 for (size_t i = 0; i < ARRAY_SIZE(fw_cfg_arch_wellknown_keys); i++) {
33 if (fw_cfg_arch_wellknown_keys[i].key == key) {
34 return fw_cfg_arch_wellknown_keys[i].name;
37 return NULL;