From patchwork Thu Jul 4 15:13:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 256974 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 681CC2C0091 for ; Fri, 5 Jul 2013 02:51:22 +1000 (EST) Received: from localhost ([::1]:51108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulIw-0006Q4-44 for incoming@patchwork.ozlabs.org; Thu, 04 Jul 2013 11:18:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulFA-0000C1-Ez for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UulF9-0004y6-H5 for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:48 -0400 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:37798) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulF9-0004xv-Aq for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:47 -0400 Received: by mail-wg0-f46.google.com with SMTP id c11so1219089wgh.1 for ; Thu, 04 Jul 2013 08:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=REQ8oUuSME1ZKVSFTRe6Naplk4ENETwpKN9X70S3LqI=; b=kGNRSmS7jRoRGayBAJloeT/WwoR0BjDeESwAWRnfgQHeXqtYTesWbJtk2kzmKBi8bA 2cJOyWCwKPYJ/1z4NQPN5lUc2RI/0wJtlrfkuFAVXqlJsUXgwAc58W+84SwzLy0Kojxw T0/0j7uz+qGhXTKNQgSmxvsj3TkjKDTp0NAkoNEENUpAXLkSuDdKzw1ZWDYpiPQmjYab /bN4QHkeXckmsElc21UsfSCShxQQRDatJzba70svAgMAceWlSEWQQ7xEm4p8gTXWlVDN zD417AmvltoRgPfhAyILULPHiOOAURtQlgr6zo2WR/SQ4wpBuK6+3568GPRXkgDPFsVi taiw== X-Received: by 10.194.1.226 with SMTP id 2mr3805499wjp.91.1372950886716; Thu, 04 Jul 2013 08:14:46 -0700 (PDT) Received: from playground.station (net-37-117-148-210.cust.dsl.vodafone.it. [37.117.148.210]) by mx.google.com with ESMTPSA id d8sm4212546wiz.0.2013.07.04.08.14.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Jul 2013 08:14:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 4 Jul 2013 17:13:12 +0200 Message-Id: <1372950842-32422-17-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372950842-32422-1-git-send-email-pbonzini@redhat.com> References: <1372950842-32422-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22e Cc: Jan Kiszka Subject: [Qemu-devel] [PATCH 16/66] 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 Signed-off-by: Paolo Bonzini --- 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 8363dfd..8639072 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 a417402..a350d8f 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);