[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to repor
From: |
Alex Bennée |
Subject: |
[PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO |
Date: |
Sat, 20 Mar 2021 13:36:59 +0000 |
As per the spec:
the PARAMETER REGISTER contains the address of a pointer to a
four-field data block.
So we need to follow arg0 and place the results of SYS_HEAPINFO there.
Fixes: 3c37cfe0b1 ("semihosting: Change internal common-semi interfaces to use
CPUState *")
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Cc: Bug 1915925 <1915925@bugs.launchpad.net>
Cc: Keith Packard <keithp@keithp.com>
Bug: https://bugs.launchpad.net/bugs/1915925
Message-Id: <20210312102029.17017-4-alex.bennee@linaro.org>
---
semihosting/arm-compat-semi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index 0f0e129a7c..fe079ca93a 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -1214,7 +1214,11 @@ target_ulong do_common_semihosting(CPUState *cs)
for (i = 0; i < ARRAY_SIZE(retvals); i++) {
bool fail;
- fail = SET_ARG(i, retvals[i]);
+ if (is_64bit_semihosting(env)) {
+ fail = put_user_u64(retvals[i], arg0 + i * 8);
+ } else {
+ fail = put_user_u32(retvals[i], arg0 + i * 4);
+ }
if (fail) {
/* Couldn't write back to argument block */
--
2.20.1
- Re: [PATCH v1 01/14] scripts/kernel-doc: strip QEMU_ from function definitions, (continued)
- [PATCH v1 08/14] linux-user/riscv: initialise the TaskState heap/stack info, Alex Bennée, 2021/03/20
- [PATCH v1 02/14] docs/devel: include the plugin API information from the headers, Alex Bennée, 2021/03/20
- [PATCH v1 05/14] semihosting: move semihosting tests to multiarch, Alex Bennée, 2021/03/20
- [PATCH v1 04/14] tools/virtiofsd: include --socket-group in help, Alex Bennée, 2021/03/20
- [PATCH v1 03/14] docs/devel: expand style section of memory management, Alex Bennée, 2021/03/20
- [PATCH v1 07/14] semihosting/arm-compat-semi: don't use SET_ARG to report SYS_HEAPINFO,
Alex Bennée <=
- [PATCH v1 11/14] configure: Don't use the __atomic_*_16 functions for testing 128-bit support, Alex Bennée, 2021/03/20
- [PATCH v1 10/14] gitlab-ci.yml: Merge the trace-backend testing into other jobs, Alex Bennée, 2021/03/20
- [PATCH v1 06/14] semihosting/arm-compat-semi: unify GET/SET_ARG helpers, Alex Bennée, 2021/03/20
- [PATCH v1 09/14] tests/tcg: add HeapInfo checking to semihosting test, Alex Bennée, 2021/03/20
- [PATCH v1 12/14] cirrus.yml: Update the FreeBSD task to version 12.2, Alex Bennée, 2021/03/20
- [PATCH v1 14/14] utils: Work around mingw strto*l bug with 0x, Alex Bennée, 2021/03/20
- [PATCH v1 13/14] utils: Tighter tests for qemu_strtosz, Alex Bennée, 2021/03/20
- Re: [PATCH for 6.0 v1 00/14] fixes for rc1 (kernel-doc, semihosting, testing), no-reply, 2021/03/20