> Am 25.05.2012 13:29, schrieb Guan Xuetao: >> This patch adds generic cpu state save/load functions for UniCore32 ISA. >> All architecture related registers are saved or loaded, and no >> optimization. >> >> Signed-off-by: Guan Xuetao <g...@mprc.pku.edu.cn> >> --- >> target-unicore32/machine.c | 99 >> ++++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 99 insertions(+), 0 deletions(-) >> create mode 100644 target-unicore32/machine.c >> >> diff --git a/target-unicore32/machine.c b/target-unicore32/machine.c >> new file mode 100644 >> index 0000000..e8c52cd >> --- /dev/null >> +++ b/target-unicore32/machine.c >> @@ -0,0 +1,99 @@ >> +/* >> + * Generic machine functions for UniCore32 ISA >> + * >> + * Copyright (C) 2010-2012 Guan Xuetao >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation, or any later version. >> + * See the COPYING file in the top-level directory. >> + */ >> +#include "hw/hw.h" >> + >> +void cpu_save(QEMUFile *f, void *opaque) >> +{ >> + int i; >> + CPUUniCore32State *env = (CPUUniCore32State *)opaque; >> + >> + for (i = 0; i < 32; i++) { >> + qemu_put_be32(f, env->regs[i]); >> + } >> + qemu_put_be32(f, cpu_asr_read(env)); >> + qemu_put_be32(f, env->bsr); > [snip] > > Please use VMState instead. > > Andreas
Thanks, I will try it. Guan Xuetao