From patchwork Sat Jun 22 06:07:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 253342 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7159C2C0411 for ; Sat, 22 Jun 2013 16:09:19 +1000 (EST) Received: from localhost ([::1]:37676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqH0f-0001GO-EU for incoming@patchwork.ozlabs.org; Sat, 22 Jun 2013 02:09:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqGzC-0007ev-7p for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:07:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UqGzB-0004v8-2G for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:07:46 -0400 Received: from mout.web.de ([212.227.17.12]:54195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UqGzA-0004us-NL for qemu-devel@nongnu.org; Sat, 22 Jun 2013 02:07:44 -0400 Received: from localhost.localdomain ([95.157.58.223]) by smtp.web.de (mrweb101) with ESMTPSA (Nemesis) id 0MPHC8-1Uueh32N3A-004PYt; Sat, 22 Jun 2013 08:07:26 +0200 From: Jan Kiszka To: qemu-devel Date: Sat, 22 Jun 2013 08:07:06 +0200 Message-Id: <70ced61c00008dee55d4aaccbb55b5435767cf5d.1371881222.git.jan.kiszka@web.de> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: References: In-Reply-To: References: X-Provags-ID: V03:K0:SobLf1brD8Q5kZ72zlg30hP4JJ9ZKM0D+uKQlKUXOzIBCbf94AI vrt3OIZCys7eL0KXnd+oYrP5wIm8MD0hH3o4nAjfb+5Xw9iq2JVpmW+Lse/ad/RJElINLvv 1tRqZNDsubPHOUoG/p3yC+WWltRfAW7Y8bMDhpdo0T97Wp4U42MSLz28j3GXZwjtTmh3Gbk rc0xYkWvRZdkJvhKzKVGQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.12 Cc: Paolo Bonzini , Liu Ping Fan , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Jan Kiszka Subject: [Qemu-devel] [PATCH v3 13/14] vmport: Disentangle read handler type from portio 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 From: Jan Kiszka In case the latter may vanish one day, make sure the vmport read handler type will remain unaffected. This is also conceptually cleaner. Signed-off-by: Jan Kiszka --- hw/misc/vmport.c | 4 ++-- include/hw/i386/pc.h | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c index 57b71f5..eb9059e 100644 --- a/hw/misc/vmport.c +++ b/hw/misc/vmport.c @@ -43,13 +43,13 @@ typedef struct VMPortState ISADevice parent_obj; MemoryRegion io; - IOPortReadFunc *func[VMPORT_ENTRIES]; + VMPortReadFunc *func[VMPORT_ENTRIES]; void *opaque[VMPORT_ENTRIES]; } VMPortState; static VMPortState *port_state; -void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque) +void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque) { if (command >= VMPORT_ENTRIES) return; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 7f04967..3a89ce3 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -3,7 +3,6 @@ #include "qemu-common.h" #include "exec/memory.h" -#include "exec/ioport.h" #include "hw/isa/isa.h" #include "hw/block/fdc.h" #include "net/net.h" @@ -56,11 +55,14 @@ typedef struct GSIState { void gsi_handler(void *opaque, int n, int level); /* vmport.c */ +typedef uint32_t (VMPortReadFunc)(void *opaque, uint32_t address); + static inline void vmport_init(ISABus *bus) { isa_create_simple(bus, "vmport"); } -void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque); + +void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque); void vmmouse_get_data(uint32_t *data); void vmmouse_set_data(const uint32_t *data);