From 16a1b6e97c2a2919fd296db4bea2f9da2ad3cc4d Mon Sep 17 00:00:00 2001 From: Juan Quintela Date: Fri, 4 May 2012 12:54:34 +0200 Subject: target-cris: update CPU state save/load to use VMStateDescription Update the CRIS CPU state save/load to use a VMStateDescription struct rather than cpu_save/cpu_load functions. Have to define TLBSet struct. Multidimensional arrays in C are a mess, just unroll them. Signed-off-by: Juan Quintela [PMM: * expand commit message a little since it's no longer one patch in a 35-patch series * add header/copyright comment to machine.c; credited copyright is Red Hat and author is Juan, since this commit gives the file all-new contents; license is LGPL-2-or-later, to match other target-cris code * remove hardcoded tab * add fields for locked_irq, interrupt_vector, fault_vector, trap_vector * drop minimum_version_id_old fields * bump version_id to 2 as we are not compatible with old state format * remove unnecessary hw/boards.h include * update to register via dc->vmsd] Signed-off-by: Peter Maydell Acked-by: Edgar E. Iglesias --- target-cris/cpu.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'target-cris/cpu.h') diff --git a/target-cris/cpu.h b/target-cris/cpu.h index 82df90d91c..8ae7708645 100644 --- a/target-cris/cpu.h +++ b/target-cris/cpu.h @@ -108,6 +108,11 @@ #define NB_MMU_MODES 2 +typedef struct { + uint32_t hi; + uint32_t lo; +} TLBSet; + typedef struct CPUCRISState { uint32_t regs[16]; /* P0 - P15 are referred to as special registers in the docs. */ @@ -161,11 +166,7 @@ typedef struct CPUCRISState { * * One for I and another for D. */ - struct - { - uint32_t hi; - uint32_t lo; - } tlbsets[2][4][16]; + TLBSet tlbsets[2][4][16]; CPU_COMMON @@ -227,8 +228,6 @@ enum { #define cpu_gen_code cpu_cris_gen_code #define cpu_signal_handler cpu_cris_signal_handler -#define CPU_SAVE_VERSION 1 - /* MMU modes definitions */ #define MMU_MODE0_SUFFIX _kernel #define MMU_MODE1_SUFFIX _user -- cgit v1.2.3