qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: 陳韋任 <chenwj@iis.sinica.edu.tw>
To: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 6/9] unicore32-softmmu: add generic cpu state save/load functions
Date: Fri, 25 May 2012 19:45:16 +0800	[thread overview]
Message-ID: <20120525114516.GA41096@cs.nctu.edu.tw> (raw)
In-Reply-To: <fe8aa39bbdc705447369352969d2bd6010189345.1337944756.git.gxt@mprc.pku.edu.cn>

Hi Guan,

> +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);
> +    for (i = 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 = 0;  i < 16; i++) {
> +            CPU_DoubleU u;
> +            u.d = env->ucf64.regs[i];
> +            qemu_put_be32(f, u.l.upper);
> +            qemu_put_be32(f, u.l.lower);
> +        }
> +        for (i = 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

-- 
Wei-Ren Chen (陳韋任)
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

  parent reply	other threads:[~2012-05-25 11:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 11:28 [Qemu-devel] [PATCH 0/9] *** SUBJECT HERE *** Guan Xuetao
2012-05-25 11:28 ` [Qemu-devel] [PATCH 1/9] unicore32-softmmu: make exceptions generated in unicore32 architecture Guan Xuetao
2012-05-25 11:29 ` [Qemu-devel] [PATCH 2/9] unicore32-softmmu: implement some softmmu specific functions Guan Xuetao
2012-05-25 11:29 ` [Qemu-devel] [PATCH 3/9] unicore32-softmmu: add coprocessor 0 and ocd instruction support Guan Xuetao
2012-05-25 11:29 ` [Qemu-devel] [PATCH 4/9] unicore32-softmmu: make sure that kernel can access user space Guan Xuetao
2012-05-25 11:29 ` [Qemu-devel] [PATCH 5/9] unicore32-softmmu: initialize ucv2 cpu Guan Xuetao
2012-05-25 11:42   ` Andreas Färber
2012-05-28  9:43     ` guanxuetao
2012-05-28 13:14       ` Andreas Färber
2012-05-25 11:29 ` [Qemu-devel] [PATCH 6/9] unicore32-softmmu: add generic cpu state save/load functions Guan Xuetao
2012-05-25 11:44   ` Andreas Färber
2012-05-28  9:45     ` guanxuetao
2012-05-25 11:45   ` 陳韋任 [this message]
2012-05-25 11:29 ` [Qemu-devel] [PATCH 7/9] unicore32-softmmu: add puv3 soc support Guan Xuetao
2012-05-25 11:46   ` Andreas Färber
2012-05-28  9:58     ` guanxuetao
2012-05-25 11:29 ` [Qemu-devel] [PATCH 8/9] unicore32-softmmu: add config and makefile support Guan Xuetao
2012-05-25 11:48   ` Andreas Färber
2012-05-28 10:08     ` guanxuetao
2012-05-28 13:46       ` Andreas Färber
2012-05-25 11:29 ` [Qemu-devel] [PATCH 9/9] unicore32-softmmu: add maintainer information Guan Xuetao
2012-05-25 11:30 ` [Qemu-devel] [PATCH 0/9] *** SUBJECT HERE *** Guan Xuetao
2012-05-25 12:09 ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120525114516.GA41096@cs.nctu.edu.tw \
    --to=chenwj@iis.sinica.edu.tw \
    --cc=blauwirbel@gmail.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).