Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
qemu-linux-user.11147
0116-cpu-introduce-CPUClass-virtio_is_bi.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0116-cpu-introduce-CPUClass-virtio_is_bi.patch of Package qemu-linux-user.11147
From 94b6e2198a0cc47205042aba7885134f913dec85 Mon Sep 17 00:00:00 2001 From: Greg Kurz <gkurz@linux.vnet.ibm.com> Date: Tue, 24 Jun 2014 19:33:21 +0200 Subject: [PATCH] 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> (cherry picked from commit bf7663c4bd8f8f619d6dbb5780025d92ace250a8) Signed-off-by: Alexander Graf <agraf@suse.de> Conflicts: include/qom/cpu.h --- include/qom/cpu.h | 1 + qom/cpu.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index df977c88f0..444e263c04 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -112,6 +112,7 @@ typedef struct CPUClass { bool (*has_work)(CPUState *cpu); void (*do_interrupt)(CPUState *cpu); CPUUnassignedAccess do_unassigned_access; + bool (*virtio_is_big_endian)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); void (*dump_state)(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, diff --git a/qom/cpu.c b/qom/cpu.c index fada2d4b92..b32dd0a562 100644 --- a/qom/cpu.c +++ b/qom/cpu.c @@ -196,6 +196,11 @@ static int cpu_common_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg) return 0; } +bool target_words_bigendian(void); +static bool cpu_common_virtio_is_big_endian(CPUState *cpu) +{ + return target_words_bigendian(); +} void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf, int flags) @@ -334,6 +339,7 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->write_elf64_note = cpu_common_write_elf64_note; k->gdb_read_register = cpu_common_gdb_read_register; k->gdb_write_register = cpu_common_gdb_write_register; + k->virtio_is_big_endian = cpu_common_virtio_is_big_endian; dc->realize = cpu_common_realizefn; /* * Reason: CPUs still need special care by board code: wiring up
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor