summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson2022-05-01 21:31:08 +0200
committerRichard Henderson2022-06-28 01:05:52 +0200
commite7fb6f320548c1b0c25d291466a0249ee80d91b6 (patch)
tree418c8dc3bae7cc3dfcb21b749ed5fcd5a9f60fe5 /include
parentsemihosting: Pass CPUState to qemu_semihosting_console_inc (diff)
downloadqemu-e7fb6f320548c1b0c25d291466a0249ee80d91b6.tar.gz
qemu-e7fb6f320548c1b0c25d291466a0249ee80d91b6.tar.xz
qemu-e7fb6f320548c1b0c25d291466a0249ee80d91b6.zip
semihosting: Expand qemu_semihosting_console_inc to read
Allow more than one character to be read at one time. Will be used by m68k and nios2 semihosting for stdio. Reviewed-by: Luc Michel <lmichel@kalray.eu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/semihosting/console.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/semihosting/console.h b/include/semihosting/console.h
index 27f8e9ae2e..39dbf1b062 100644
--- a/include/semihosting/console.h
+++ b/include/semihosting/console.h
@@ -38,19 +38,21 @@ int qemu_semihosting_console_outs(CPUArchState *env, target_ulong s);
void qemu_semihosting_console_outc(CPUArchState *env, target_ulong c);
/**
- * qemu_semihosting_console_inc:
+ * qemu_semihosting_console_read:
* @cs: CPUState
+ * @buf: host buffer
+ * @len: buffer size
*
- * Receive single character from debug console. As this call may block
- * if no data is available we suspend the CPU and will re-execute the
+ * Receive at least one character from debug console. As this call may
+ * block if no data is available we suspend the CPU and will re-execute the
* instruction when data is there. Therefore two conditions must be met:
*
* - CPUState is synchronized before calling this function
* - pc is only updated once the character is successfully returned
*
- * Returns: character read OR cpu_loop_exit!
+ * Returns: number of characters read, OR cpu_loop_exit!
*/
-target_ulong qemu_semihosting_console_inc(CPUState *cs);
+int qemu_semihosting_console_read(CPUState *cs, void *buf, int len);
/**
* qemu_semihosting_log_out: