mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
exec: introduce target_words_bigendian() helper
We currently have a virtio_is_big_endian() helper that provides the target endianness to the virtio code. As of today, the helper returns a fixed compile-time value. Of course, this will have to change if we want to support target endianness changes at run-time. Let's move the TARGET_WORDS_BIGENDIAN bits out to a new helper and have virtio_is_big_endian() implemented on top of it. This patch doesn't change any functionality. Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6b321a3df5
commit
98ed8ecfc9
3 changed files with 8 additions and 9 deletions
8
exec.c
8
exec.c
|
@ -2759,14 +2759,12 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
|||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
|
||||
/*
|
||||
* A helper function for the _utterly broken_ virtio device model to find out if
|
||||
* it's running on a big endian machine. Don't do this at home kids!
|
||||
*/
|
||||
bool virtio_is_big_endian(void);
|
||||
bool virtio_is_big_endian(void)
|
||||
bool target_words_bigendian(void);
|
||||
bool target_words_bigendian(void)
|
||||
{
|
||||
#if defined(TARGET_WORDS_BIGENDIAN)
|
||||
return true;
|
||||
|
@ -2775,8 +2773,6 @@ bool virtio_is_big_endian(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
bool cpu_physical_memory_is_io(hwaddr phys_addr)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue