On 18/3/25 22:31, Richard Henderson wrote:
Avoid testing CONFIG_USER_ONLY in semihost.h.
The only function that's required is semihosting_enabled.
Signed-off-by: Richard Henderson <richard.hender...@linaro.org>
---
include/semihosting/semihost.h | 29 ++---------------------------
semihosting/user.c | 15 +++++++++++++++
semihosting/meson.build | 2 ++
3 files changed, 19 insertions(+), 27 deletions(-)
create mode 100644 semihosting/user.c
diff --git a/semihosting/user.c b/semihosting/user.c
new file mode 100644
index 0000000000..9473729beb
--- /dev/null
+++ b/semihosting/user.c
@@ -0,0 +1,15 @@
+/*
+ * Semihosting for user emulation
+ *
+ * Copyright (c) 2019 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "semihosting/semihost.h"
+
+bool semihosting_enabled(bool is_user)
+{
While moving this code, we could also add:
assert(is_user);
+ return true;
+}
Reviewed-by: Philippe Mathieu-Daudé <phi...@linaro.org>