From patchwork Thu Jul 4 15:13:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 256915 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 666832C0092 for ; Fri, 5 Jul 2013 01:18:22 +1000 (EST) Received: from localhost ([::1]:49540 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulIa-0005ZG-2f for incoming@patchwork.ozlabs.org; Thu, 04 Jul 2013 11:18:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulFC-0000Ga-OL for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UulFB-0004z5-NT for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:50 -0400 Received: from mail-wi0-x234.google.com ([2a00:1450:400c:c05::234]:35535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UulFB-0004yT-II for qemu-devel@nongnu.org; Thu, 04 Jul 2013 11:14:49 -0400 Received: by mail-wi0-f180.google.com with SMTP id c10so1341841wiw.7 for ; Thu, 04 Jul 2013 08:14:49 -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=Nw8sNOVTd9g07/uhJI+YqGoklk9y/geX/4DJgqD6KfA=; b=PszvYjNhVVA+LVZ+ZnX9OmTktV/SOkU+ndqhP6Vsr0t+8dQPgi3WADQu+mMWdYpI7S 0rPWMNDEu0khZH9xscI6Hde7VSNInSB6JndS3T7wS3BMpXwEIFQmM/07gHGRtnyNCQkz Yjeg3DOno02sZzjXv7it6l/13UyGxWfh5CEPV8ipajPh6fIDFfn3+tfZvTihOX90qUA+ r2hyUwDxBkK0yrEDir3u8IezPFZaqoleN6dYRTACfAMgFNCWXSuUu9qFAQadTV0R/MGG O9J+5FlH6aUwjqM0Ktb3xLHXmW3gHR9BpxljvX2DW7jZ78gABLgCOn0+cdbhgFm3/6Mc ezPg== X-Received: by 10.194.242.134 with SMTP id wq6mr3560191wjc.94.1372950888967; Thu, 04 Jul 2013 08:14:48 -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.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 04 Jul 2013 08:14:47 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 4 Jul 2013 17:13:13 +0200 Message-Id: <1372950842-32422-18-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:c05::234 Cc: Jan Kiszka Subject: [Qemu-devel] [PATCH 17/66] ioport: Move portio types to ioport.h 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 This decouples memory.h from ioport.h, concentrating all portio related types in a single header. Signed-off-by: Jan Kiszka Signed-off-by: Paolo Bonzini --- include/exec/ioport.h | 17 +++++++++++------ include/exec/memory.h | 13 ------------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/include/exec/ioport.h b/include/exec/ioport.h index ba3ebb8..6fb237d 100644 --- a/include/exec/ioport.h +++ b/include/exec/ioport.h @@ -25,6 +25,7 @@ #define IOPORT_H #include "qemu-common.h" +#include "exec/memory.h" typedef uint32_t pio_addr_t; #define FMT_pioaddr PRIx32 @@ -32,9 +33,16 @@ typedef uint32_t pio_addr_t; #define MAX_IOPORTS (64 * 1024) #define IOPORTS_MASK (MAX_IOPORTS - 1) -/* These should really be in isa.h, but are here to make pc.h happy. */ -typedef void (IOPortWriteFunc)(void *opaque, uint32_t address, uint32_t data); -typedef uint32_t (IOPortReadFunc)(void *opaque, uint32_t address); +typedef struct MemoryRegionPortio { + uint32_t offset; + uint32_t len; + unsigned size; + uint32_t (*read)(void *opaque, uint32_t address); + void (*write)(void *opaque, uint32_t address, uint32_t data); + uint32_t base; /* private field */ +} MemoryRegionPortio; + +#define PORTIO_END_OF_LIST() { } void cpu_outb(pio_addr_t addr, uint8_t val); void cpu_outw(pio_addr_t addr, uint16_t val); @@ -43,9 +51,6 @@ uint8_t cpu_inb(pio_addr_t addr); uint16_t cpu_inw(pio_addr_t addr); uint32_t cpu_inl(pio_addr_t addr); -struct MemoryRegion; -struct MemoryRegionPortio; - typedef struct PortioList { const struct MemoryRegionPortio *ports; struct MemoryRegion *address_space; diff --git a/include/exec/memory.h b/include/exec/memory.h index 2d7f49c..4eec2f7 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -24,7 +24,6 @@ #include "exec/hwaddr.h" #endif #include "qemu/queue.h" -#include "exec/ioport.h" #include "qemu/int128.h" #include "qemu/notify.h" @@ -32,7 +31,6 @@ #define MAX_PHYS_ADDR (((hwaddr)1 << MAX_PHYS_ADDR_SPACE_BITS) - 1) typedef struct MemoryRegionOps MemoryRegionOps; -typedef struct MemoryRegionPortio MemoryRegionPortio; typedef struct MemoryRegionMmio MemoryRegionMmio; /* Must match *_DIRTY_FLAGS in cpu-all.h. To be replaced with dynamic @@ -166,17 +164,6 @@ struct MemoryRegion { NotifierList iommu_notify; }; -struct MemoryRegionPortio { - uint32_t offset; - uint32_t len; - unsigned size; - IOPortReadFunc *read; - IOPortWriteFunc *write; - uint32_t base; /* private field */ -}; - -#define PORTIO_END_OF_LIST() { } - /** * AddressSpace: describes a mapping of addresses to #MemoryRegion objects */