]> Git Repo - qemu.git/commitdiff
semihosting: introduce CONFIG_SEMIHOSTING
authorAlex Bennée <[email protected]>
Mon, 13 May 2019 14:25:27 +0000 (15:25 +0100)
committerAlex Bennée <[email protected]>
Tue, 28 May 2019 09:28:50 +0000 (10:28 +0100)
There isn't much point building semihosting for platforms that don't
support it. Introduce a new symbol and enable it only for the softmmu
targets that need it.

Signed-off-by: Alex Bennée <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
default-configs/arm-softmmu.mak
default-configs/lm32-softmmu.mak
default-configs/m68k-softmmu.mak
default-configs/mips-softmmu-common.mak
default-configs/nios2-softmmu.mak
default-configs/xtensa-softmmu.mak
hw/Kconfig
hw/semihosting/Kconfig [new file with mode: 0644]
hw/semihosting/Makefile.objs
stubs/Makefile.objs
stubs/semihost.c [new file with mode: 0644]

index f23ecfd5c58a46bfb1a92ae748ef75645a7ec1ea..1f2e0e7fdeba94bac820b7a42686a06252d0537e 100644 (file)
@@ -39,3 +39,4 @@ CONFIG_MICROBIT=y
 CONFIG_FSL_IMX25=y
 CONFIG_FSL_IMX7=y
 CONFIG_FSL_IMX6UL=y
+CONFIG_SEMIHOSTING=y
index 6d259665d604b4a0cc07d4130ac52b729500e3d1..115b3e34c983747abfa0ea99efd21657b9bc81cb 100644 (file)
@@ -4,6 +4,8 @@
 #
 #CONFIG_MILKYMIST_TMU2=n        # disabling it actually causes compile-time failures
 
+CONFIG_SEMIHOSTING=y
+
 # Boards:
 #
 CONFIG_LM32=y
index e17495e2a0b3ac90e5ab8520764c151d9189d2cc..4049a8f2ba9272ca745b5122a60d856b4911688a 100644 (file)
@@ -1,5 +1,7 @@
 # Default configuration for m68k-softmmu
 
+CONFIG_SEMIHOSTING=y
+
 # Boards:
 #
 CONFIG_AN5206=y
index 8e54a74b7a5e5f02865fab02e16d51991b71bb9a..e10ac4b20c003fc4f7f046e984b6944bd4efaf44 100644 (file)
@@ -35,6 +35,7 @@ CONFIG_MIPS_CPS=y
 CONFIG_MIPS_ITU=y
 CONFIG_R4K=y
 CONFIG_MALTA=y
+CONFIG_SEMIHOSTING=y
 CONFIG_PCNET_PCI=y
 CONFIG_MIPSSIM=y
 CONFIG_ACPI_SMBUS=y
index e130d024e6241feb743124a9a82df5e36edb62f0..1bc4082ea9960d98165df25c811dde2cce9b3fdf 100644 (file)
@@ -1,5 +1,7 @@
 # Default configuration for nios2-softmmu
 
+CONFIG_SEMIHOSTING=y
+
 # Boards:
 #
 CONFIG_NIOS2_10M50=y
index 7e4d1cc0979c076e9f09d26aa81f3d451e1ed113..3aa20a47a7fbcdae500c64acd59e71b8cdd96521 100644 (file)
@@ -1,5 +1,7 @@
 # Default configuration for Xtensa
 
+CONFIG_SEMIHOSTING=y
+
 # Boards:
 #
 CONFIG_XTENSA_SIM=y
index 88b9f150070742f206d4595adcfe6a7cd921a7e1..195f541e50cd2f9599665d33e2b633a8df6ae502 100644 (file)
@@ -29,6 +29,7 @@ source pci/Kconfig
 source rdma/Kconfig
 source scsi/Kconfig
 source sd/Kconfig
+source semihosting/Kconfig
 source smbios/Kconfig
 source ssi/Kconfig
 source timer/Kconfig
diff --git a/hw/semihosting/Kconfig b/hw/semihosting/Kconfig
new file mode 100644 (file)
index 0000000..efe0a30
--- /dev/null
@@ -0,0 +1,3 @@
+
+config SEMIHOSTING
+       bool
index 546954f4ff4981db95a871a589712007a5c6d237..09c19bf19ed8849dbcb8c8dbc2b5370cd23ebe31 100644 (file)
@@ -1 +1 @@
-common-obj-$(CONFIG_SOFTMMU) += config.o
+obj-$(CONFIG_SEMIHOSTING) += config.o
index 73452ad2657a88f9014207b5dab0db3cd33f8e82..9c7393b08c866b8b6473b23a2c73d6bea76970e5 100644 (file)
@@ -40,3 +40,4 @@ stub-obj-y += pci-host-piix.o
 stub-obj-y += ram-block.o
 stub-obj-y += ramfb.o
 stub-obj-y += fw_cfg.o
+stub-obj-$(CONFIG_SOFTMMU) += semihost.o
diff --git a/stubs/semihost.c b/stubs/semihost.c
new file mode 100644 (file)
index 0000000..1a4e88e
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Semihosting Stubs for SoftMMU
+ *
+ * Copyright (c) 2019 Linaro Ltd
+ *
+ * Stubs for SoftMMU targets that don't actually do semihosting.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/option.h"
+#include "qemu/error-report.h"
+#include "hw/semihosting/semihost.h"
+
+/* Empty config */
+QemuOptsList qemu_semihosting_config_opts = {
+    .name = "",
+    .head = QTAILQ_HEAD_INITIALIZER(qemu_semihosting_config_opts.head),
+    .desc = {
+        { /* end of list */ }
+    },
+};
+
+/* Queries to config status default to off */
+bool semihosting_enabled(void)
+{
+    return false;
+}
+
+SemihostingTarget semihosting_get_target(void)
+{
+    return SEMIHOSTING_TARGET_AUTO;
+}
+
+/*
+ * All the rest are empty subs. We could g_assert_not_reached() but
+ * that adds extra weight to the final binary. Waste not want not.
+ */
+void qemu_semihosting_enable(void)
+{
+}
+
+int qemu_semihosting_config_options(const char *optarg)
+{
+    return 1;
+}
+
+const char *semihosting_get_arg(int i)
+{
+    return NULL;
+}
+
+int semihosting_get_argc(void)
+{
+    return 0;
+}
+
+const char *semihosting_get_cmdline(void)
+{
+    return NULL;
+}
+
+void semihosting_arg_fallback(const char *file, const char *cmd)
+{
+}
This page took 0.038184 seconds and 4 git commands to generate.