qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH 3/4] pl031: rearm alarm timer upon load
Date: Fri, 20 Jan 2012 13:06:45 +0100	[thread overview]
Message-ID: <1327061206-9404-4-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1327061206-9404-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/pl031.c |   40 +++++++++++++++++++++++++---------------
 1 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/hw/pl031.c b/hw/pl031.c
index 2fb0c8e..1ca4c23 100644
--- a/hw/pl031.c
+++ b/hw/pl031.c
@@ -47,21 +47,6 @@ typedef struct {
     uint32_t is;
 } pl031_state;
 
-static const VMStateDescription vmstate_pl031 = {
-    .name = "pl031",
-    .version_id = 1,
-    .minimum_version_id = 1,
-    .fields = (VMStateField[]) {
-        VMSTATE_UINT32(tick_offset, pl031_state),
-        VMSTATE_UINT32(mr, pl031_state),
-        VMSTATE_UINT32(lr, pl031_state),
-        VMSTATE_UINT32(cr, pl031_state),
-        VMSTATE_UINT32(im, pl031_state),
-        VMSTATE_UINT32(is, pl031_state),
-        VMSTATE_END_OF_LIST()
-    }
-};
-
 static const unsigned char pl031_id[] = {
     0x31, 0x10, 0x14, 0x00,         /* Device ID        */
     0x0d, 0xf0, 0x05, 0xb1          /* Cell ID      */
@@ -213,6 +198,31 @@ static int pl031_init(SysBusDevice *dev)
     return 0;
 }
 
+static int pl031_post_load(void *opaque, int version_id)
+{
+    pl031_state *s = opaque;
+
+    pl031_set_alarm(s);
+    return 0;
+}
+
+static const VMStateDescription vmstate_pl031 = {
+    .name = "pl031",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .post_load = pl031_post_load,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(tick_offset, pl031_state),
+        VMSTATE_UINT32(mr, pl031_state),
+        VMSTATE_UINT32(lr, pl031_state),
+        VMSTATE_UINT32(cr, pl031_state),
+        VMSTATE_UINT32(im, pl031_state),
+        VMSTATE_UINT32(is, pl031_state),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
+
 static SysBusDeviceInfo pl031_info = {
     .init = pl031_init,
     .qdev.name = "pl031",
-- 
1.7.7.1

  parent reply	other threads:[~2012-01-20 12:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-20 12:06 [Qemu-devel] [PATCH 0/4] Use rtc_clock uniformly for ARM Paolo Bonzini
2012-01-20 12:06 ` [Qemu-devel] [PATCH 1/4] rtc: add -rtc clock=rt Paolo Bonzini
2012-01-20 12:06 ` [Qemu-devel] [PATCH 2/4] arm: switch real-time clocks to rtc_clock Paolo Bonzini
2012-02-17  7:09   ` andrzej zaborowski
2012-02-17  8:05     ` Paolo Bonzini
2012-02-17  8:24       ` andrzej zaborowski
2012-02-17  8:31         ` Paolo Bonzini
2012-01-20 12:06 ` Paolo Bonzini [this message]
2012-01-20 12:06 ` [Qemu-devel] [PATCH 4/4] pl031: switch clock base " Paolo Bonzini
2012-01-30 16:54   ` Peter Maydell
2012-01-30 17:02     ` Paolo Bonzini
2012-01-30 16:42 ` [Qemu-devel] [PATCH 0/4] Use rtc_clock uniformly for ARM Paolo Bonzini
2012-01-30 17:21   ` Peter Maydell
2012-01-31  7:28     ` Paolo Bonzini

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=1327061206-9404-4-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).