mirror of https://github.com/xemu-project/xemu.git
target/mips: Constify VMState in machine.c
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20231221031652.119827-13-richard.henderson@linaro.org>
This commit is contained in:
parent
61d5442a9a
commit
6db6de6506
|
@ -44,7 +44,7 @@ static int put_fpr(QEMUFile *f, void *pv, size_t size,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VMStateInfo vmstate_info_fpr = {
|
static const VMStateInfo vmstate_info_fpr = {
|
||||||
.name = "fpr",
|
.name = "fpr",
|
||||||
.get = get_fpr,
|
.get = get_fpr,
|
||||||
.put = put_fpr,
|
.put = put_fpr,
|
||||||
|
@ -56,21 +56,21 @@ const VMStateInfo vmstate_info_fpr = {
|
||||||
#define VMSTATE_FPR_ARRAY(_f, _s, _n) \
|
#define VMSTATE_FPR_ARRAY(_f, _s, _n) \
|
||||||
VMSTATE_FPR_ARRAY_V(_f, _s, _n, 0)
|
VMSTATE_FPR_ARRAY_V(_f, _s, _n, 0)
|
||||||
|
|
||||||
static VMStateField vmstate_fpu_fields[] = {
|
static const VMStateField vmstate_fpu_fields[] = {
|
||||||
VMSTATE_FPR_ARRAY(fpr, CPUMIPSFPUContext, 32),
|
VMSTATE_FPR_ARRAY(fpr, CPUMIPSFPUContext, 32),
|
||||||
VMSTATE_UINT32(fcr0, CPUMIPSFPUContext),
|
VMSTATE_UINT32(fcr0, CPUMIPSFPUContext),
|
||||||
VMSTATE_UINT32(fcr31, CPUMIPSFPUContext),
|
VMSTATE_UINT32(fcr31, CPUMIPSFPUContext),
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
};
|
};
|
||||||
|
|
||||||
const VMStateDescription vmstate_fpu = {
|
static const VMStateDescription vmstate_fpu = {
|
||||||
.name = "cpu/fpu",
|
.name = "cpu/fpu",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
.fields = vmstate_fpu_fields
|
.fields = vmstate_fpu_fields
|
||||||
};
|
};
|
||||||
|
|
||||||
const VMStateDescription vmstate_inactive_fpu = {
|
static const VMStateDescription vmstate_inactive_fpu = {
|
||||||
.name = "cpu/inactive_fpu",
|
.name = "cpu/inactive_fpu",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
|
@ -79,7 +79,7 @@ const VMStateDescription vmstate_inactive_fpu = {
|
||||||
|
|
||||||
/* TC state */
|
/* TC state */
|
||||||
|
|
||||||
static VMStateField vmstate_tc_fields[] = {
|
static const VMStateField vmstate_tc_fields[] = {
|
||||||
VMSTATE_UINTTL_ARRAY(gpr, TCState, 32),
|
VMSTATE_UINTTL_ARRAY(gpr, TCState, 32),
|
||||||
#if defined(TARGET_MIPS64)
|
#if defined(TARGET_MIPS64)
|
||||||
VMSTATE_UINT64_ARRAY(gpr_hi, TCState, 32),
|
VMSTATE_UINT64_ARRAY(gpr_hi, TCState, 32),
|
||||||
|
@ -103,14 +103,14 @@ static VMStateField vmstate_tc_fields[] = {
|
||||||
VMSTATE_END_OF_LIST()
|
VMSTATE_END_OF_LIST()
|
||||||
};
|
};
|
||||||
|
|
||||||
const VMStateDescription vmstate_tc = {
|
static const VMStateDescription vmstate_tc = {
|
||||||
.name = "cpu/tc",
|
.name = "cpu/tc",
|
||||||
.version_id = 2,
|
.version_id = 2,
|
||||||
.minimum_version_id = 2,
|
.minimum_version_id = 2,
|
||||||
.fields = vmstate_tc_fields
|
.fields = vmstate_tc_fields
|
||||||
};
|
};
|
||||||
|
|
||||||
const VMStateDescription vmstate_inactive_tc = {
|
static const VMStateDescription vmstate_inactive_tc = {
|
||||||
.name = "cpu/inactive_tc",
|
.name = "cpu/inactive_tc",
|
||||||
.version_id = 2,
|
.version_id = 2,
|
||||||
.minimum_version_id = 2,
|
.minimum_version_id = 2,
|
||||||
|
@ -119,11 +119,11 @@ const VMStateDescription vmstate_inactive_tc = {
|
||||||
|
|
||||||
/* MVP state */
|
/* MVP state */
|
||||||
|
|
||||||
const VMStateDescription vmstate_mvp = {
|
static const VMStateDescription vmstate_mvp = {
|
||||||
.name = "cpu/mvp",
|
.name = "cpu/mvp",
|
||||||
.version_id = 1,
|
.version_id = 1,
|
||||||
.minimum_version_id = 1,
|
.minimum_version_id = 1,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (const VMStateField[]) {
|
||||||
VMSTATE_INT32(CP0_MVPControl, CPUMIPSMVPContext),
|
VMSTATE_INT32(CP0_MVPControl, CPUMIPSMVPContext),
|
||||||
VMSTATE_INT32(CP0_MVPConf0, CPUMIPSMVPContext),
|
VMSTATE_INT32(CP0_MVPConf0, CPUMIPSMVPContext),
|
||||||
VMSTATE_INT32(CP0_MVPConf1, CPUMIPSMVPContext),
|
VMSTATE_INT32(CP0_MVPConf1, CPUMIPSMVPContext),
|
||||||
|
@ -190,7 +190,7 @@ static int put_tlb(QEMUFile *f, void *pv, size_t size,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VMStateInfo vmstate_info_tlb = {
|
static const VMStateInfo vmstate_info_tlb = {
|
||||||
.name = "tlb_entry",
|
.name = "tlb_entry",
|
||||||
.get = get_tlb,
|
.get = get_tlb,
|
||||||
.put = put_tlb,
|
.put = put_tlb,
|
||||||
|
@ -202,11 +202,11 @@ const VMStateInfo vmstate_info_tlb = {
|
||||||
#define VMSTATE_TLB_ARRAY(_f, _s, _n) \
|
#define VMSTATE_TLB_ARRAY(_f, _s, _n) \
|
||||||
VMSTATE_TLB_ARRAY_V(_f, _s, _n, 0)
|
VMSTATE_TLB_ARRAY_V(_f, _s, _n, 0)
|
||||||
|
|
||||||
const VMStateDescription vmstate_tlb = {
|
static const VMStateDescription vmstate_tlb = {
|
||||||
.name = "cpu/tlb",
|
.name = "cpu/tlb",
|
||||||
.version_id = 2,
|
.version_id = 2,
|
||||||
.minimum_version_id = 2,
|
.minimum_version_id = 2,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (const VMStateField[]) {
|
||||||
VMSTATE_UINT32(nb_tlb, CPUMIPSTLBContext),
|
VMSTATE_UINT32(nb_tlb, CPUMIPSTLBContext),
|
||||||
VMSTATE_UINT32(tlb_in_use, CPUMIPSTLBContext),
|
VMSTATE_UINT32(tlb_in_use, CPUMIPSTLBContext),
|
||||||
VMSTATE_TLB_ARRAY(mmu.r4k.tlb, CPUMIPSTLBContext, MIPS_TLB_MAX),
|
VMSTATE_TLB_ARRAY(mmu.r4k.tlb, CPUMIPSTLBContext, MIPS_TLB_MAX),
|
||||||
|
@ -221,7 +221,7 @@ const VMStateDescription vmstate_mips_cpu = {
|
||||||
.version_id = 21,
|
.version_id = 21,
|
||||||
.minimum_version_id = 21,
|
.minimum_version_id = 21,
|
||||||
.post_load = cpu_post_load,
|
.post_load = cpu_post_load,
|
||||||
.fields = (VMStateField[]) {
|
.fields = (const VMStateField[]) {
|
||||||
/* Active TC */
|
/* Active TC */
|
||||||
VMSTATE_STRUCT(env.active_tc, MIPSCPU, 1, vmstate_tc, TCState),
|
VMSTATE_STRUCT(env.active_tc, MIPSCPU, 1, vmstate_tc, TCState),
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue