From patchwork Mon Aug 24 16:42:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 31973 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 2BD4AB7B63 for ; Tue, 25 Aug 2009 03:23:51 +1000 (EST) Received: from localhost ([127.0.0.1]:40696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfdGm-0001QP-C0 for incoming@patchwork.ozlabs.org; Mon, 24 Aug 2009 13:23:48 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mfcfw-00014w-4d for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mfcfq-0000tq-CR for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:43 -0400 Received: from [199.232.76.173] (port=33813 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mfcfo-0000t4-OF for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28257) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mfcfo-00034p-7r for qemu-devel@nongnu.org; Mon, 24 Aug 2009 12:45:36 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjZKJ018898 for ; Mon, 24 Aug 2009 12:45:35 -0400 Received: from localhost.localdomain (vpn1-4-157.ams2.redhat.com [10.36.4.157]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7OGjKU3024317; Mon, 24 Aug 2009 12:45:34 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Mon, 24 Aug 2009 18:42:45 +0200 Message-Id: <844a9be47ee777d79b8c3ffc632e4a82c238f8db.1251131364.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 11/26] Introduce vga_common_reset() to be able to typcheck vga_reset() 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: Juan Quintela --- hw/cirrus_vga.c | 2 +- hw/vga.c | 10 +++++++--- hw/vga_int.h | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 95d822a..8ac30be 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -3125,7 +3125,7 @@ static void cirrus_reset(void *opaque) { CirrusVGAState *s = opaque; - vga_reset(s); + vga_common_reset(&s->vga); unmap_linear_vram(s); s->vga.sr[0x06] = 0x0f; if (s->device_id == CIRRUS_ID_CLGD5446) { diff --git a/hw/vga.c b/hw/vga.c index 3882f20..463276e 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1873,10 +1873,8 @@ static void vga_invalidate_display(void *opaque) s->full_update = 1; } -void vga_reset(void *opaque) +void vga_common_reset(VGACommonState *s) { - VGAState *s = (VGAState *) opaque; - s->lfb_addr = 0; s->lfb_end = 0; s->map_addr = 0; @@ -1942,6 +1940,12 @@ void vga_reset(void *opaque) } } +static void vga_reset(void *opaque) +{ + VGAState *s = (VGAState *) opaque; + vga_common_reset(s); +} + #define TEXTMODE_X(x) ((x) % width) #define TEXTMODE_Y(x) ((x) / width) #define VMEM2CHTYPE(v) ((v & 0xff0007ff) | \ diff --git a/hw/vga_int.h b/hw/vga_int.h index eb2d6ea..bb28872 100644 --- a/hw/vga_int.h +++ b/hw/vga_int.h @@ -192,7 +192,7 @@ static inline int c6_to_8(int v) void vga_common_init(VGAState *s, int vga_ram_size); void vga_init(VGAState *s); -void vga_reset(void *s); +void vga_common_reset(VGACommonState *s); void vga_dirty_log_start(VGAState *s);