From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39920 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVopi-000583-Ko for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVoph-0003cW-H6 for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:06 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:41349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVoph-0003bQ-AP for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:05 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PVopa-0001Of-96 for qemu-devel@nongnu.org; Thu, 23 Dec 2010 17:19:58 +0000 From: Peter Maydell Date: Thu, 23 Dec 2010 17:19:55 +0000 Message-Id: <1293124798-5335-6-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1293124798-5335-1-git-send-email-peter.maydell@linaro.org> References: <1293124798-5335-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH 5/8] pl031: Implement save/restore List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Peter Maydell --- hw/pl031.c | 25 ++++++++++++++++++++++++- 1 files changed, 24 insertions(+), 1 deletions(-) diff --git a/hw/pl031.c b/hw/pl031.c index e3700c1..c488f69 100644 --- a/hw/pl031.c +++ b/hw/pl031.c @@ -44,6 +44,21 @@ 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 */ @@ -206,9 +221,17 @@ static int pl031_init(SysBusDevice *dev) return 0; } +static SysBusDeviceInfo pl031_info = { + .init = pl031_init, + .qdev.name = "pl031", + .qdev.size = sizeof(pl031_state), + .qdev.vmsd = &vmstate_pl031, + .qdev.no_user = 1, +}; + static void pl031_register_devices(void) { - sysbus_register_dev("pl031", sizeof(pl031_state), pl031_init); + sysbus_register_withprop(&pl031_info); } device_init(pl031_register_devices) -- 1.6.3.3