OSDN Git Service

cpu: introduce CPUClass::virtio_is_big_endian()
authorGreg Kurz <gkurz@linux.vnet.ibm.com>
Tue, 24 Jun 2014 17:33:21 +0000 (19:33 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Sun, 29 Jun 2014 16:39:42 +0000 (19:39 +0300)
commitbf7663c4bd8f8f619d6dbb5780025d92ace250a8
treec79ad18b6630f97ac5c0f3e9aec336f9496d76dc
parent98ed8ecfc9dd9e22e4251251492f062dde32c3c4
cpu: introduce CPUClass::virtio_is_big_endian()

If we want to support targets that can change endianness (modern PPC and
ARM for the moment), we need to add a per-CPU class method to be called
from the virtio code. The virtio_ prefix in the name is a hint for people
to avoid misusage (aka. anywhere but from the virtio code).

The default behaviour is to return the compile-time default target
endianness.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
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>
include/qom/cpu.h
qom/cpu.c