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 <email address hidden> Reviewed-by: Peter Maydell <email address hidden> Cc: Bug 1915925 <email address hidden> Cc: Keith Packard <email address hidden> Bug: https://bugs.launchpad.net/bugs/1915925 Message-Id: <email address hidden>
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
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 *") /bugs.launchpad .net/bugs/ 1915925
Signed-off-by: Alex Bennée <email address hidden>
Reviewed-by: Peter Maydell <email address hidden>
Cc: Bug 1915925 <email address hidden>
Cc: Keith Packard <email address hidden>
Bug: https:/
Message-Id: <email address hidden>
diff --git a/semihosting/ arm-compat- semi.c b/semihosting/ arm-compat- semi.c .fe079ca93a 100644 arm-compat- semi.c arm-compat- semi.c semihosting( CPUState *cs) retvals) ; i++) {
bool fail;
index 0f0e129a7c.
--- a/semihosting/
+++ b/semihosting/
@@ -1214,7 +1214,11 @@ target_ulong do_common_
for (i = 0; i < ARRAY_SIZE(
- fail = SET_ARG(i, retvals[i]); semihosting( env)) { u64(retvals[ i], arg0 + i * 8); u32(retvals[ i], arg0 + i * 4);
+ if (is_64bit_
+ fail = put_user_
+ } else {
+ fail = put_user_
+ }
if (fail) {
/* Couldn't write back to argument block */
--
2.20.1