From 03fee66fde3f9e179e3973e8c50f6fa0a0a14613 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 14 Nov 2018 17:29:30 +0400 Subject: vmstate: constify VMStateField MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because they are supposed to remain const. Signed-off-by: Marc-André Lureau Message-Id: <20181114132931.22624-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini --- target/alpha/machine.c | 5 +++-- target/arm/machine.c | 12 ++++++------ target/hppa/machine.c | 10 ++++++---- target/mips/machine.c | 14 ++++++++------ target/openrisc/machine.c | 5 +++-- target/ppc/machine.c | 14 ++++++++------ target/sparc/machine.c | 7 ++++--- 7 files changed, 38 insertions(+), 29 deletions(-) (limited to 'target') diff --git a/target/alpha/machine.c b/target/alpha/machine.c index 0914ba5fc1..abc81cef7b 100644 --- a/target/alpha/machine.c +++ b/target/alpha/machine.c @@ -5,7 +5,8 @@ #include "hw/boards.h" #include "migration/cpu.h" -static int get_fpcr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) +static int get_fpcr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) { CPUAlphaState *env = opaque; cpu_alpha_store_fpcr(env, qemu_get_be64(f)); @@ -13,7 +14,7 @@ static int get_fpcr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) } static int put_fpcr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { CPUAlphaState *env = opaque; qemu_put_be64(f, cpu_alpha_load_fpcr(env)); diff --git a/target/arm/machine.c b/target/arm/machine.c index 2033816a64..7a22ebc209 100644 --- a/target/arm/machine.c +++ b/target/arm/machine.c @@ -18,7 +18,7 @@ static bool vfp_needed(void *opaque) } static int get_fpscr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field) + const VMStateField *field) { ARMCPU *cpu = opaque; CPUARMState *env = &cpu->env; @@ -29,7 +29,7 @@ static int get_fpscr(QEMUFile *f, void *opaque, size_t size, } static int put_fpscr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { ARMCPU *cpu = opaque; CPUARMState *env = &cpu->env; @@ -503,7 +503,7 @@ static const VMStateDescription vmstate_m_security = { }; static int get_cpsr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field) + const VMStateField *field) { ARMCPU *cpu = opaque; CPUARMState *env = &cpu->env; @@ -559,7 +559,7 @@ static int get_cpsr(QEMUFile *f, void *opaque, size_t size, } static int put_cpsr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { ARMCPU *cpu = opaque; CPUARMState *env = &cpu->env; @@ -585,7 +585,7 @@ static const VMStateInfo vmstate_cpsr = { }; static int get_power(QEMUFile *f, void *opaque, size_t size, - VMStateField *field) + const VMStateField *field) { ARMCPU *cpu = opaque; bool powered_off = qemu_get_byte(f); @@ -594,7 +594,7 @@ static int get_power(QEMUFile *f, void *opaque, size_t size, } static int put_power(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { ARMCPU *cpu = opaque; diff --git a/target/hppa/machine.c b/target/hppa/machine.c index 8e077788c3..a1bee9796f 100644 --- a/target/hppa/machine.c +++ b/target/hppa/machine.c @@ -46,7 +46,8 @@ VMSTATE_UINTTR_ARRAY_V(_f, _s, _n, 0) -static int get_psw(QEMUFile *f, void *opaque, size_t size, VMStateField *field) +static int get_psw(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) { CPUHPPAState *env = opaque; cpu_hppa_put_psw(env, qemu_get_betr(f)); @@ -54,7 +55,7 @@ static int get_psw(QEMUFile *f, void *opaque, size_t size, VMStateField *field) } static int put_psw(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { CPUHPPAState *env = opaque; qemu_put_betr(f, cpu_hppa_get_psw(env)); @@ -68,7 +69,8 @@ static const VMStateInfo vmstate_psw = { }; /* FIXME: Use the PA2.0 format, which is a superset of the PA1.1 format. */ -static int get_tlb(QEMUFile *f, void *opaque, size_t size, VMStateField *field) +static int get_tlb(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) { hppa_tlb_entry *ent = opaque; uint32_t val; @@ -94,7 +96,7 @@ static int get_tlb(QEMUFile *f, void *opaque, size_t size, VMStateField *field) } static int put_tlb(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { hppa_tlb_entry *ent = opaque; uint32_t val = 0; diff --git a/target/mips/machine.c b/target/mips/machine.c index 70a8909b90..704e9c01bf 100644 --- a/target/mips/machine.c +++ b/target/mips/machine.c @@ -20,7 +20,8 @@ static int cpu_post_load(void *opaque, int version_id) /* FPU state */ -static int get_fpr(QEMUFile *f, void *pv, size_t size, VMStateField *field) +static int get_fpr(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) { int i; fpr_t *v = pv; @@ -31,8 +32,8 @@ static int get_fpr(QEMUFile *f, void *pv, size_t size, VMStateField *field) return 0; } -static int put_fpr(QEMUFile *f, void *pv, size_t size, VMStateField *field, - QJSON *vmdesc) +static int put_fpr(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, QJSON *vmdesc) { int i; fpr_t *v = pv; @@ -128,7 +129,8 @@ const VMStateDescription vmstate_mvp = { /* TLB state */ -static int get_tlb(QEMUFile *f, void *pv, size_t size, VMStateField *field) +static int get_tlb(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) { r4k_tlb_t *v = pv; uint16_t flags; @@ -155,8 +157,8 @@ static int get_tlb(QEMUFile *f, void *pv, size_t size, VMStateField *field) return 0; } -static int put_tlb(QEMUFile *f, void *pv, size_t size, VMStateField *field, - QJSON *vmdesc) +static int put_tlb(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, QJSON *vmdesc) { r4k_tlb_t *v = pv; diff --git a/target/openrisc/machine.c b/target/openrisc/machine.c index 1eedbf3dbe..5d822f7ab1 100644 --- a/target/openrisc/machine.c +++ b/target/openrisc/machine.c @@ -49,7 +49,8 @@ static const VMStateDescription vmstate_cpu_tlb = { } }; -static int get_sr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) +static int get_sr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) { CPUOpenRISCState *env = opaque; cpu_set_sr(env, qemu_get_be32(f)); @@ -57,7 +58,7 @@ static int get_sr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) } static int put_sr(QEMUFile *f, void *opaque, size_t size, - VMStateField *field, QJSON *vmdesc) + const VMStateField *field, QJSON *vmdesc) { CPUOpenRISCState *env = opaque; qemu_put_be32(f, cpu_get_sr(env)); diff --git a/target/ppc/machine.c b/target/ppc/machine.c index b2745ec4e5..e7b3725273 100644 --- a/target/ppc/machine.c +++ b/target/ppc/machine.c @@ -110,7 +110,8 @@ static int cpu_load_old(QEMUFile *f, void *opaque, int version_id) return 0; } -static int get_avr(QEMUFile *f, void *pv, size_t size, VMStateField *field) +static int get_avr(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) { ppc_avr_t *v = pv; @@ -120,8 +121,8 @@ static int get_avr(QEMUFile *f, void *pv, size_t size, VMStateField *field) return 0; } -static int put_avr(QEMUFile *f, void *pv, size_t size, VMStateField *field, - QJSON *vmdesc) +static int put_avr(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, QJSON *vmdesc) { ppc_avr_t *v = pv; @@ -452,7 +453,8 @@ static const VMStateDescription vmstate_sr = { }; #ifdef TARGET_PPC64 -static int get_slbe(QEMUFile *f, void *pv, size_t size, VMStateField *field) +static int get_slbe(QEMUFile *f, void *pv, size_t size, + const VMStateField *field) { ppc_slb_t *v = pv; @@ -462,8 +464,8 @@ static int get_slbe(QEMUFile *f, void *pv, size_t size, VMStateField *field) return 0; } -static int put_slbe(QEMUFile *f, void *pv, size_t size, VMStateField *field, - QJSON *vmdesc) +static int put_slbe(QEMUFile *f, void *pv, size_t size, + const VMStateField *field, QJSON *vmdesc) { ppc_slb_t *v = pv; diff --git a/target/sparc/machine.c b/target/sparc/machine.c index 8ff9dea297..7791c84963 100644 --- a/target/sparc/machine.c +++ b/target/sparc/machine.c @@ -56,7 +56,8 @@ static const VMStateDescription vmstate_tlb_entry = { }; #endif -static int get_psr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) +static int get_psr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field) { SPARCCPU *cpu = opaque; CPUSPARCState *env = &cpu->env; @@ -69,8 +70,8 @@ static int get_psr(QEMUFile *f, void *opaque, size_t size, VMStateField *field) return 0; } -static int put_psr(QEMUFile *f, void *opaque, size_t size, VMStateField *field, - QJSON *vmdesc) +static int put_psr(QEMUFile *f, void *opaque, size_t size, + const VMStateField *field, QJSON *vmdesc) { SPARCCPU *cpu = opaque; CPUSPARCState *env = &cpu->env; -- cgit v1.2.3