summaryrefslogtreecommitdiffstats
path: root/include/semihosting
diff options
context:
space:
mode:
authorRichard Henderson2022-05-02 20:15:40 +0200
committerRichard Henderson2022-06-28 01:11:37 +0200
commit1b9177f7495086f1595d7c989c810013f1c9eb5a (patch)
tree41469c64b92e70a3b352c170d28cedc590e09dcc /include/semihosting
parentsemihosting: Remove qemu_semihosting_console_outs (diff)
downloadqemu-1b9177f7495086f1595d7c989c810013f1c9eb5a.tar.gz
qemu-1b9177f7495086f1595d7c989c810013f1c9eb5a.tar.xz
qemu-1b9177f7495086f1595d7c989c810013f1c9eb5a.zip
semihosting: Create semihost_sys_poll_one
This will be used for implementing the xtensa select_one system call. Choose "poll" over "select" so that we can reuse Glib's g_poll constants and to avoid struct timeval. Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include/semihosting')
-rw-r--r--include/semihosting/console.h16
-rw-r--r--include/semihosting/syscalls.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/include/semihosting/console.h b/include/semihosting/console.h
index 20c31d89d4..61b0cb3a94 100644
--- a/include/semihosting/console.h
+++ b/include/semihosting/console.h
@@ -53,4 +53,20 @@ int qemu_semihosting_console_write(void *buf, int len);
*/
int qemu_semihosting_log_out(const char *s, int len);
+/*
+ * qemu_semihosting_console_block_until_ready:
+ * @cs: CPUState
+ *
+ * If no data is available we suspend the CPU and will re-execute the
+ * instruction when data is available.
+ */
+void qemu_semihosting_console_block_until_ready(CPUState *cs);
+
+/**
+ * qemu_semihosting_console_ready:
+ *
+ * Return true if characters are available for read; does not block.
+ */
+bool qemu_semihosting_console_ready(void);
+
#endif /* SEMIHOST_CONSOLE_H */
diff --git a/include/semihosting/syscalls.h b/include/semihosting/syscalls.h
index 347200cb9f..3a5ec229eb 100644
--- a/include/semihosting/syscalls.h
+++ b/include/semihosting/syscalls.h
@@ -69,4 +69,7 @@ void semihost_sys_system(CPUState *cs, gdb_syscall_complete_cb complete,
void semihost_sys_gettimeofday(CPUState *cs, gdb_syscall_complete_cb complete,
target_ulong tv_addr, target_ulong tz_addr);
+void semihost_sys_poll_one(CPUState *cs, gdb_syscall_complete_cb complete,
+ int fd, GIOCondition cond, int timeout);
+
#endif /* SEMIHOSTING_SYSCALLS_H */