mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
3367d452b0
commit
e7fb6f3205
4 changed files with 34 additions and 15 deletions
|
@ -428,8 +428,15 @@ void do_common_semihosting(CPUState *cs)
|
|||
break;
|
||||
|
||||
case TARGET_SYS_READC:
|
||||
ret = qemu_semihosting_console_inc(cs);
|
||||
common_semi_set_ret(cs, ret);
|
||||
{
|
||||
uint8_t ch;
|
||||
int ret = qemu_semihosting_console_read(cs, &ch, 1);
|
||||
if (ret == 1) {
|
||||
common_semi_cb(cs, ch, 0);
|
||||
} else {
|
||||
common_semi_cb(cs, -1, EIO);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TARGET_SYS_ISERROR:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue