Thanks for responding so swiftly! Sorry for not doing the same. I was thinking
maybe Philippe would want to chime in first.

> > +#define cpu_needs_bswap(cpu) (HOST_BIG_ENDIAN != 
> > cpu_virtio_is_big_endian(cpu))
> > +
> 
> 
> Hmm looking at the description:
> 
> 
> /**
> * @virtio_is_big_endian: Callback to return %true if a CPU which supports
> * runtime configurable endianness is currently big-endian.
> * Non-configurable CPUs can use the default implementation of this method.
> * This method should not be used by any callers other than the pre-1.0
> * virtio devices.
> */
> bool (*virtio_is_big_endian)(CPUState *cpu);
> 
> 
> I'm not sure if we want to expand the usage of this hack. I think
> Philippe is hoping to get rid of these warts eventually. Of course we
> could rename the method and just provide a way to get the current
> systems endianess.


I am not very familiar with QEMU's source code, but having a way to get the
current system's endianness sounds necessary to me considering semihosting's
requirements. Should I just rename `virtio_is_big_endian` to `is_big_endian`
and `cpu_virtio_is_big_endian` to `cpu_is_big_endian` or do you prefer
different names?

Reply via email to