new file mode 100644
@@ -0,0 +1,15 @@
+/*
+ * QEMU fw_cfg/SMBIOS stubs
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * SPDX-FileCopyrightText: 2024 Linaro Ltd.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/firmware/smbios.h"
+#include "fw_cfg.h"
+
+void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
+ SmbiosEntryPointType ep_type)
+{
+}
@@ -48,10 +48,10 @@ const char *fw_cfg_arch_key_name(uint16_t key)
return NULL;
}
+#ifdef CONFIG_SMBIOS
void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
SmbiosEntryPointType ep_type)
{
-#ifdef CONFIG_SMBIOS
uint8_t *smbios_tables, *smbios_anchor;
size_t smbios_tables_len, smbios_anchor_len;
struct smbios_phys_mem_area *mem_array;
@@ -100,8 +100,8 @@ void fw_cfg_build_smbios(PCMachineState *pcms, FWCfgState *fw_cfg,
fw_cfg_add_file(fw_cfg, "etc/smbios/smbios-anchor",
smbios_anchor, smbios_anchor_len);
}
-#endif
}
+#endif
FWCfgState *fw_cfg_arch_create(MachineState *ms,
uint16_t boot_cpus,
@@ -6,6 +6,7 @@ i386_ss.add(files(
'multiboot.c',
'x86.c',
))
+i386_ss.add(when: 'CONFIG_SMBIOS', if_false: files('fw_cfg-smbios-stub.c'))
i386_ss.add(when: 'CONFIG_X86_IOMMU', if_true: files('x86-iommu.c'),
if_false: files('x86-iommu-stub.c'))
We are going to refactor fw_cfg_build_smbios() in the next patches. In order to avoid too much #ifdef'ry in it, define a stub. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/i386/fw_cfg-smbios-stub.c | 15 +++++++++++++++ hw/i386/fw_cfg.c | 4 ++-- hw/i386/meson.build | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 hw/i386/fw_cfg-smbios-stub.c