From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXswJ-00044G-4S for qemu-devel@nongnu.org; Fri, 25 May 2012 07:44:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXswH-0003On-4X for qemu-devel@nongnu.org; Fri, 25 May 2012 07:44:14 -0400 Received: from cantor2.suse.de ([195.135.220.15]:42812 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXswG-0003Od-Uc for qemu-devel@nongnu.org; Fri, 25 May 2012 07:44:13 -0400 Message-ID: <4FBF7088.2030101@suse.de> Date: Fri, 25 May 2012 13:44:08 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 6/9] unicore32-softmmu: add generic cpu state save/load functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Guan Xuetao Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org 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 optimiza= tion. >=20 > Signed-off-by: Guan Xuetao > --- > target-unicore32/machine.c | 99 ++++++++++++++++++++++++++++++++++++= ++++++++ > 1 files changed, 99 insertions(+), 0 deletions(-) > create mode 100644 target-unicore32/machine.c >=20 > 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 modif= y > + * 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 =3D (CPUUniCore32State *)opaque; > + > + for (i =3D 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 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg