aboutsummaryrefslogtreecommitdiff
path: root/util/buffer.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2023-01-24 18:01:15 +0000
committerAlex Bennée <alex.bennee@linaro.org>2023-02-02 11:48:20 +0000
commit978c2bf97b2f8b0938dc6570c46275ed8d8e96f8 (patch)
tree9506de96b216942c811c9fcd2d6a1e28dc49ee22 /util/buffer.c
parent2c46bc240a1ac9b99974fcd4b735a6715ce99798 (diff)
semihosting: Write back semihosting data before completion callback
'lock_user' allocates a host buffer to shadow a target buffer, 'unlock_user' copies that host buffer back to the target and frees the host memory. If the completion function uses the target buffer, it must be called after unlock_user to ensure the data are present. This caused the arm-compatible TARGET_SYS_READC to fail as the completion function, common_semi_readc_cb, pulled data from the target buffer which would not have been gotten the console data. I decided to fix all instances of this pattern instead of just the console_read function to make things consistent and potentially fix bugs in other cases. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20221012014822.1242170-1-keithp@keithp.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230124180127.1881110-24-alex.bennee@linaro.org>
Diffstat (limited to 'util/buffer.c')
0 files changed, 0 insertions, 0 deletions