aboutsummaryrefslogtreecommitdiff
path: root/common-user
diff options
context:
space:
mode:
Diffstat (limited to 'common-user')
-rw-r--r--common-user/host/riscv/safe-syscall.inc.S4
-rw-r--r--common-user/plugin-api.c.inc43
2 files changed, 45 insertions, 2 deletions
diff --git a/common-user/host/riscv/safe-syscall.inc.S b/common-user/host/riscv/safe-syscall.inc.S
index dfe83c3..c8b81e3 100644
--- a/common-user/host/riscv/safe-syscall.inc.S
+++ b/common-user/host/riscv/safe-syscall.inc.S
@@ -69,11 +69,11 @@ safe_syscall_end:
/* code path setting errno */
0: neg a0, a0
- j safe_syscall_set_errno_tail
+ tail safe_syscall_set_errno_tail
/* code path when we didn't execute the syscall */
2: li a0, QEMU_ERESTARTSYS
- j safe_syscall_set_errno_tail
+ tail safe_syscall_set_errno_tail
.cfi_endproc
.size safe_syscall_base, .-safe_syscall_base
diff --git a/common-user/plugin-api.c.inc b/common-user/plugin-api.c.inc
new file mode 100644
index 0000000..5b8a139
--- /dev/null
+++ b/common-user/plugin-api.c.inc
@@ -0,0 +1,43 @@
+/*
+ * QEMU Plugin API - *-user-mode only implementations
+ *
+ * Common user-mode only APIs are in plugins/api-user. These helpers
+ * are only specific to the *-user frontends.
+ *
+ * Copyright (C) 2017, Emilio G. Cota <cota@braap.org>
+ * Copyright (C) 2019-2025, Linaro
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "qemu/main-loop.h"
+#include "qemu/plugin.h"
+#include "qemu.h"
+
+/*
+ * Binary path, start and end locations. Host specific due to TaskState.
+ */
+const char *qemu_plugin_path_to_binary(void)
+{
+ TaskState *ts = get_task_state(current_cpu);
+ return g_strdup(ts->bprm->filename);
+}
+
+uint64_t qemu_plugin_start_code(void)
+{
+ TaskState *ts = get_task_state(current_cpu);
+ return ts->info->start_code;
+}
+
+uint64_t qemu_plugin_end_code(void)
+{
+ TaskState *ts = get_task_state(current_cpu);
+ return ts->info->end_code;
+}
+
+uint64_t qemu_plugin_entry_code(void)
+{
+ TaskState *ts = get_task_state(current_cpu);
+ return ts->info->entry;
+}