From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55631) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXsxU-0004pB-JB for qemu-devel@nongnu.org; Fri, 25 May 2012 07:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXsxS-0003hA-DY for qemu-devel@nongnu.org; Fri, 25 May 2012 07:45:28 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:18087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXsxR-0003g7-Of for qemu-devel@nongnu.org; Fri, 25 May 2012 07:45:26 -0400 Date: Fri, 25 May 2012 19:45:16 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20120525114516.GA41096@cs.nctu.edu.tw> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Hi Guan, > +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); > + for (i =3D 0; i < 6; i++) { > + qemu_put_be32(f, env->banked_bsr[i]); > + qemu_put_be32(f, env->banked_r29[i]); > + qemu_put_be32(f, env->banked_r30[i]); > + } > + > + qemu_put_be32(f, env->cp0.c0_cpuid); > + qemu_put_be32(f, env->cp0.c0_cachetype); > + qemu_put_be32(f, env->cp0.c1_sys); > + qemu_put_be32(f, env->cp0.c2_base); > + qemu_put_be32(f, env->cp0.c3_faultstatus); > + qemu_put_be32(f, env->cp0.c4_faultaddr); > + qemu_put_be32(f, env->cp0.c5_cacheop); > + qemu_put_be32(f, env->cp0.c6_tlbop); > + > + qemu_put_be32(f, env->features); > + > + if (env->features & UC32_HWCAP_UCF64) { > + for (i =3D 0; i < 16; i++) { > + CPU_DoubleU u; > + u.d =3D env->ucf64.regs[i]; > + qemu_put_be32(f, u.l.upper); > + qemu_put_be32(f, u.l.lower); > + } > + for (i =3D 0; i < 32; i++) { > + qemu_put_be32(f, env->ucf64.xregs[i]); > + } > + } > +} Do you think use VMState rather then QEMUFile is a good idea? I saw OpenRISC target got this kind of feedback before [1]. Regards, chenwj [1] http://lists.gnu.org/archive/html/qemu-devel/2012-05/msg02457.html --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj