* [RFC PATCH] stubs: split semihosting_get_target from system only stubs
@ 2023-03-07 17:04 Alex Bennée
2023-03-07 17:06 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Alex Bennée @ 2023-03-07 17:04 UTC (permalink / raw)
To: qemu-devel; +Cc: richard.henderson, Alex Bennée, Paolo Bonzini
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>
Cc: Richard Henderson <richard.henderson@linaro.org>
---
stubs/semihost-all.c | 17 +++++++++++++++++
stubs/semihost.c | 5 -----
stubs/meson.build | 1 +
3 files changed, 18 insertions(+), 5 deletions(-)
create mode 100644 stubs/semihost-all.c
diff --git a/stubs/semihost-all.c b/stubs/semihost-all.c
new file mode 100644
index 0000000000..a2a1fc9c6f
--- /dev/null
+++ b/stubs/semihost-all.c
@@ -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;
+}
diff --git a/stubs/semihost.c b/stubs/semihost.c
index d65c9fd5dc..aad7a70353 100644
--- a/stubs/semihost.c
+++ b/stubs/semihost.c
@@ -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.
diff --git a/stubs/meson.build b/stubs/meson.build
index 7657467a5d..b2b5956d97 100644
--- a/stubs/meson.build
+++ b/stubs/meson.build
@@ -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'))
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC PATCH] stubs: split semihosting_get_target from system only stubs
2023-03-07 17:04 [RFC PATCH] stubs: split semihosting_get_target from system only stubs Alex Bennée
@ 2023-03-07 17:06 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2023-03-07 17:06 UTC (permalink / raw)
To: Alex Bennée, qemu-devel; +Cc: Paolo Bonzini
On 3/7/23 09:04, Alex Bennée wrote:
> 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>
> Cc: Richard Henderson<richard.henderson@linaro.org>
> ---
> stubs/semihost-all.c | 17 +++++++++++++++++
> stubs/semihost.c | 5 -----
> stubs/meson.build | 1 +
> 3 files changed, 18 insertions(+), 5 deletions(-)
> create mode 100644 stubs/semihost-all.c
We could name the file after the function that it implements, rather than "all". But
either way,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-07 17:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-07 17:04 [RFC PATCH] stubs: split semihosting_get_target from system only stubs Alex Bennée
2023-03-07 17:06 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).