]> git.proxmox.com Git - mirror_qemu.git/commitdiff
stubs: split semihosting_get_target from system only stubs
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 7 Mar 2023 17:01:20 +0000 (17:01 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 7 Mar 2023 20:44:09 +0000 (20:44 +0000)
As we are about to have a common syscalls.c for gdbstub we need to
stub out one semihosting helper function for all targets.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230307170405.796822-1-alex.bennee@linaro.org>

stubs/meson.build
stubs/semihost-all.c [new file with mode: 0644]
stubs/semihost.c

index 7657467a5d7e187b2fc058bf4bbc7b632159df14..b2b5956d97cd81a4d62d08ee509be4af44bde3cb 100644 (file)
@@ -61,4 +61,5 @@ if have_system
 else
   stub_ss.add(files('qdev.c'))
 endif
+stub_ss.add(files('semihost-all.c'))
 stub_ss.add(when: 'CONFIG_VFIO_USER_SERVER', if_false: files('vfio-user-obj.c'))
diff --git a/stubs/semihost-all.c b/stubs/semihost-all.c
new file mode 100644 (file)
index 0000000..a2a1fc9
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+ * Semihosting Stubs for all targets
+ *
+ * Copyright (c) 2023 Linaro Ltd
+ *
+ * Stubs for all targets that don't actually do semihosting.
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "semihosting/semihost.h"
+
+SemihostingTarget semihosting_get_target(void)
+{
+    return SEMIHOSTING_TARGET_AUTO;
+}
index d65c9fd5dcf4959360281ccdc39465119c12356c..aad7a70353225aae4d0667bf0abb2911d5860659 100644 (file)
@@ -28,11 +28,6 @@ bool semihosting_enabled(bool is_user)
     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.