qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 48/53] semihosting: Use console_in_gf for SYS_READC


From: Alex Bennée
Subject: Re: [PATCH v4 48/53] semihosting: Use console_in_gf for SYS_READC
Date: Tue, 28 Jun 2022 10:35:43 +0100
User-agent: mu4e 1.7.27; emacs 28.1.50

Richard Henderson <richard.henderson@linaro.org> writes:

> On 6/27/22 14:37, Alex Bennée wrote:
>> Richard Henderson <richard.henderson@linaro.org> writes:
>> 
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>>   semihosting/arm-compat-semi.c | 27 ++++++++++++++++++---------
>>>   1 file changed, 18 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
>>> index 20e99cdcc0..4c8932ad54 100644
>>> --- a/semihosting/arm-compat-semi.c
>>> +++ b/semihosting/arm-compat-semi.c
>>> @@ -302,6 +302,22 @@ common_semi_flen_fstat_cb(CPUState *cs, uint64_t ret, 
>>> int err)
>>>       common_semi_cb(cs, ret, err);
>>>   }
>>>   +static void
>>> +common_semi_readc_cb(CPUState *cs, uint64_t ret, int err)
>>> +{
>>> +    if (!err) {
>>> +        CPUArchState *env G_GNUC_UNUSED = cs->env_ptr;
>> Why do you even both extracting env here if it's not being used?
>> 
>>> +        uint8_t ch;
>>> +
>>> +        if (get_user_u8(ch, common_semi_stack_bottom(cs) - 1)) {
>
> It is used in here, for system-mode, but not user-mode.
> It's ugly, I know, but that's the interface we inherited.
> The simplest non-ifdef solution is to mark the variable unused.

Fair enough.

>
>
> r~


-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]