summaryrefslogtreecommitdiffstats
path: root/semihosting
diff options
context:
space:
mode:
authorPeter Maydell2022-07-25 16:05:14 +0200
committerAlex Bennée2022-07-29 10:48:01 +0200
commit45704e89047fc0a151c5909f006d8757140f23d6 (patch)
tree18a1799ade53c5fbc89d73e7c412019f9833a9a1 /semihosting
parentsemihosting: Don't return negative values on qemu_semihosting_console_write()... (diff)
downloadqemu-45704e89047fc0a151c5909f006d8757140f23d6.tar.gz
qemu-45704e89047fc0a151c5909f006d8757140f23d6.tar.xz
qemu-45704e89047fc0a151c5909f006d8757140f23d6.zip
semihosting: Don't copy buffer after console_write()
The console_write() semihosting function outputs guest data from a buffer; it doesn't update that buffer. It therefore doesn't need to pass a length value to unlock_user(), but can pass 0, meaning "do not copy any data back to the guest memory". Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220719121110.225657-3-peter.maydell@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20220725140520.515340-8-alex.bennee@linaro.org>
Diffstat (limited to 'semihosting')
-rw-r--r--semihosting/syscalls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c
index 4847f66c02..508a0ad88c 100644
--- a/semihosting/syscalls.c
+++ b/semihosting/syscalls.c
@@ -627,7 +627,7 @@ static void console_write(CPUState *cs, gdb_syscall_complete_cb complete,
}
ret = qemu_semihosting_console_write(ptr, len);
complete(cs, ret ? ret : -1, ret ? 0 : EIO);
- unlock_user(ptr, buf, ret);
+ unlock_user(ptr, buf, 0);
}
static void console_fstat(CPUState *cs, gdb_syscall_complete_cb complete,