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>
This commit is contained in:
Richard Henderson
2022-05-02 11:15:40 -07:00
parent 2d010c2719
commit 1b9177f749
4 changed files with 106 additions and 2 deletions

View File

@@ -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 */