From patchwork Thu Dec 23 17:19:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 76528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A27BDB6F07 for ; Fri, 24 Dec 2010 04:21:18 +1100 (EST) Received: from localhost ([127.0.0.1]:47348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVoqo-0005De-Sj for incoming@patchwork.ozlabs.org; Thu, 23 Dec 2010 12:21:14 -0500 Received: from [140.186.70.92] (port=39952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PVopk-0005Ad-I8 for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PVopj-0003dE-7C for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:08 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:41349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PVopi-0003bQ-W3 for qemu-devel@nongnu.org; Thu, 23 Dec 2010 12:20:07 -0500 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.69) (envelope-from ) id 1PVopa-0001Ol-Ap for qemu-devel@nongnu.org; Thu, 23 Dec 2010 17:19:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 23 Dec 2010 17:19:58 +0000 Message-Id: <1293124798-5335-9-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1293124798-5335-1-git-send-email-peter.maydell@linaro.org> References: <1293124798-5335-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 8/8] stc91c111: Implement save/restore X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Peter Maydell --- hw/smc91c111.c | 30 ++++++++++++++++++++++++++++++ 1 files changed, 30 insertions(+), 0 deletions(-) diff --git a/hw/smc91c111.c b/hw/smc91c111.c index fc714d7..dafea5c 100644 --- a/hw/smc91c111.c +++ b/hw/smc91c111.c @@ -46,6 +46,35 @@ typedef struct { int mmio_index; } smc91c111_state; +static const VMStateDescription vmstate_smc91c111 = { + .name = "smc91c111", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField []) { + VMSTATE_UINT16(tcr, smc91c111_state), + VMSTATE_UINT16(rcr, smc91c111_state), + VMSTATE_UINT16(cr, smc91c111_state), + VMSTATE_UINT16(ctr, smc91c111_state), + VMSTATE_UINT16(gpr, smc91c111_state), + VMSTATE_UINT16(ptr, smc91c111_state), + VMSTATE_UINT16(ercv, smc91c111_state), + VMSTATE_INT32(bank, smc91c111_state), + VMSTATE_INT32(packet_num, smc91c111_state), + VMSTATE_INT32(tx_alloc, smc91c111_state), + VMSTATE_INT32(allocated, smc91c111_state), + VMSTATE_INT32(tx_fifo_len, smc91c111_state), + VMSTATE_INT32_ARRAY(tx_fifo, smc91c111_state, NUM_PACKETS), + VMSTATE_INT32(rx_fifo_len, smc91c111_state), + VMSTATE_INT32_ARRAY(rx_fifo, smc91c111_state, NUM_PACKETS), + VMSTATE_INT32(tx_fifo_done_len, smc91c111_state), + VMSTATE_INT32_ARRAY(tx_fifo_done, smc91c111_state, NUM_PACKETS), + VMSTATE_BUFFER_UNSAFE(data, smc91c111_state, 0, NUM_PACKETS * 2048), + VMSTATE_UINT8(int_level, smc91c111_state), + VMSTATE_UINT8(int_mask, smc91c111_state), + VMSTATE_END_OF_LIST() + } +}; + #define RCR_SOFT_RST 0x8000 #define RCR_STRIP_CRC 0x0200 #define RCR_RXEN 0x0100 @@ -738,6 +767,7 @@ static SysBusDeviceInfo smc91c111_info = { .init = smc91c111_init1, .qdev.name = "smc91c111", .qdev.size = sizeof(smc91c111_state), + .qdev.vmsd = &vmstate_smc91c111, .qdev.props = (Property[]) { DEFINE_NIC_PROPERTIES(smc91c111_state, conf), DEFINE_PROP_END_OF_LIST(),