From patchwork Mon Mar 5 08:30:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mitsyanko Igor X-Patchwork-Id: 144623 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BD98AB6EEA for ; Mon, 5 Mar 2012 19:31:58 +1100 (EST) Received: from localhost ([::1]:49467 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4TKm-0000gU-Ed for incoming@patchwork.ozlabs.org; Mon, 05 Mar 2012 03:31:56 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4TKS-00007F-5T for qemu-devel@nongnu.org; Mon, 05 Mar 2012 03:31:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4TK9-0004zW-S3 for qemu-devel@nongnu.org; Mon, 05 Mar 2012 03:31:35 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:63768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4TK9-0004yO-3r for qemu-devel@nongnu.org; Mon, 05 Mar 2012 03:31:17 -0500 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M0E00BHEKZROF@mailout1.w1.samsung.com> for qemu-devel@nongnu.org; Mon, 05 Mar 2012 08:31:13 +0000 (GMT) Received: from dodo.rnd.samsung.ru ([106.109.8.162]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M0E009A5KZAQ0@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Mon, 05 Mar 2012 08:31:06 +0000 (GMT) Date: Mon, 05 Mar 2012 12:30:43 +0400 From: Igor Mitsyanko In-reply-to: <1330936245-2570-1-git-send-email-i.mitsyanko@samsung.com> To: qemu-devel@nongnu.org Message-id: <1330936245-2570-4-git-send-email-i.mitsyanko@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.4.1 Content-type: TEXT/PLAIN Content-transfer-encoding: 7BIT References: <1330936245-2570-1-git-send-email-i.mitsyanko@samsung.com> X-detected-operating-system: by eggs.gnu.org: Solaris 9.1 X-Received-From: 210.118.77.11 Cc: peter.maydell@linaro.org, balrog@zabor.org, Igor Mitsyanko , e.voevodin@samsung.com, quintela@redhat.com, kyungmin.park@samsung.com, d.solodkiy@samsung.com, m.kozlov@samsung.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH V2 3/5] hw/pxa2xx_lcd.c: drop target_phys_addr_t usage in device state X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Pxa2xx LCD controller is intended to work with 32-bit bus and it has no knowledge of system's physical address size, so it should not use target_phys_addr_t in it's state. Convert three variables in DMAChannel state from target_phys_addr_t to uint32_t, use VMSTATE_UINT32 instead of VMSTATE_UINTTL for these variables. We can do this safely because: 1) pxa2xx has 32-bit physical address; 2) rest of the code in file never assumes converted variables to have any size different from uint32_t; 3) we shouldn't have used VMSTATE_UINTTL in the first place because this macro is for target_ulong type (which can be different from target_phys_addr_t). Signed-off-by: Igor Mitsyanko Reviewed-by: Peter Maydell Reviewed-by: Andreas Färber --- hw/pxa2xx_lcd.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/pxa2xx_lcd.c b/hw/pxa2xx_lcd.c index fcbdfb3..ee8bf57 100644 --- a/hw/pxa2xx_lcd.c +++ b/hw/pxa2xx_lcd.c @@ -19,15 +19,15 @@ #include "framebuffer.h" struct DMAChannel { - target_phys_addr_t branch; + uint32_t branch; uint8_t up; uint8_t palette[1024]; uint8_t pbuffer[1024]; void (*redraw)(PXA2xxLCDState *s, target_phys_addr_t addr, int *miny, int *maxy); - target_phys_addr_t descriptor; - target_phys_addr_t source; + uint32_t descriptor; + uint32_t source; uint32_t id; uint32_t command; }; @@ -929,11 +929,11 @@ static const VMStateDescription vmstate_dma_channel = { .minimum_version_id = 0, .minimum_version_id_old = 0, .fields = (VMStateField[]) { - VMSTATE_UINTTL(branch, struct DMAChannel), + VMSTATE_UINT32(branch, struct DMAChannel), VMSTATE_UINT8(up, struct DMAChannel), VMSTATE_BUFFER(pbuffer, struct DMAChannel), - VMSTATE_UINTTL(descriptor, struct DMAChannel), - VMSTATE_UINTTL(source, struct DMAChannel), + VMSTATE_UINT32(descriptor, struct DMAChannel), + VMSTATE_UINT32(source, struct DMAChannel), VMSTATE_UINT32(id, struct DMAChannel), VMSTATE_UINT32(command, struct DMAChannel), VMSTATE_END_OF_LIST()