On 5/9/19 11:55 PM, Alex Bennée wrote:
> 
> Richard Henderson <richard.hender...@linaro.org> writes:
> 
>> On 5/9/19 9:58 AM, Alex Bennée wrote:
>>> @@ -51,12 +51,18 @@ static inline const char *semihosting_get_cmdline(void)
>>>  {
>>>      return NULL;
>>>  }
>>> +
>>> +static inline Chardev *semihosting_get_chardev(void)
>>> +{
>>> +    return NULL;
>>> +}
>>
>> Isn't the point of this function to avoid...
> 
> Yes... but...
> 
>>
>>> -                return write(STDERR_FILENO, &c, 1);
>>> +#ifdef CONFIG_SOFTMMU
>>> +              Chardev *chardev = semihosting_get_chardev();
>>> +              if (chardev) {
>>> +                  return qemu_chr_write_all(chardev, (uint8_t *) &c,
>> 1);
> 
> The qemu_chr device stuff doesn't have such stubs and is softmmu only as
> well. *sigh*

Ah, I see.  Yes that's a problem.

Well at least you don't need the "else\n#endif\n{" ugliness.  You have the
return out of the then block.


r~

Reply via email to