From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9r4h-0001ep-QK for qemu-devel@nongnu.org; Tue, 30 Jun 2015 04:39:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9r4c-0000ip-Sf for qemu-devel@nongnu.org; Tue, 30 Jun 2015 04:39:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9r4c-0000iT-N9 for qemu-devel@nongnu.org; Tue, 30 Jun 2015 04:39:22 -0400 From: Gerd Hoffmann Date: Tue, 30 Jun 2015 10:39:13 +0200 Message-Id: <1435653553-7728-23-git-send-email-kraxel@redhat.com> In-Reply-To: <1435653553-7728-1-git-send-email-kraxel@redhat.com> References: <1435653553-7728-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH v2 22/22] virtio: legacy cleanup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: seabios@seabios.org Cc: Gerd Hoffmann , qemu-devel@nongnu.org, "Michael S. Tsirkin" Now that all code is switched over to use vp_read/write we can drop the ioaddr field from vp_device and the offset #defines. Signed-off-by: Gerd Hoffmann --- src/hw/virtio-pci.c | 1 - src/hw/virtio-pci.h | 33 +-------------------------------- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/hw/virtio-pci.c b/src/hw/virtio-pci.c index 1186603..a53db7b 100644 --- a/src/hw/virtio-pci.c +++ b/src/hw/virtio-pci.c @@ -271,7 +271,6 @@ struct vp_device *vp_init_simple(struct pci_device *pci) vp->legacy.addr = pci_config_readl(pci->bdf, PCI_BASE_ADDRESS_0) & PCI_BASE_ADDRESS_IO_MASK; vp->legacy.is_io = 1; - vp->ioaddr = vp->legacy.addr; /* temporary */ } vp_reset(vp); diff --git a/src/hw/virtio-pci.h b/src/hw/virtio-pci.h index f1d5e3e..e017ce8 100644 --- a/src/hw/virtio-pci.h +++ b/src/hw/virtio-pci.h @@ -4,39 +4,9 @@ #include "x86.h" // inl #include "biosvar.h" // GET_LOWFLAT -/* A 32-bit r/o bitmask of the features supported by the host */ -#define VIRTIO_PCI_HOST_FEATURES 0 - -/* A 32-bit r/w bitmask of features activated by the guest */ -#define VIRTIO_PCI_GUEST_FEATURES 4 - -/* A 32-bit r/w PFN for the currently selected queue */ -#define VIRTIO_PCI_QUEUE_PFN 8 - -/* A 16-bit r/o queue size for the currently selected queue */ -#define VIRTIO_PCI_QUEUE_NUM 12 - -/* A 16-bit r/w queue selector */ -#define VIRTIO_PCI_QUEUE_SEL 14 - -/* A 16-bit r/w queue notifier */ -#define VIRTIO_PCI_QUEUE_NOTIFY 16 - -/* An 8-bit device status register. */ -#define VIRTIO_PCI_STATUS 18 - -/* An 8-bit r/o interrupt status register. Reading the value will return the - * current contents of the ISR and will also clear it. This is effectively - * a read-and-acknowledge. */ -#define VIRTIO_PCI_ISR 19 - /* The bit of the ISR which indicates a device configuration change. */ #define VIRTIO_PCI_ISR_CONFIG 0x2 -/* The remaining space is defined by each driver as the per-driver - * configuration space */ -#define VIRTIO_PCI_CONFIG 20 - /* Virtio ABI version, this must match exactly */ #define VIRTIO_PCI_ABI_VERSION 0 @@ -123,7 +93,6 @@ struct vp_cap { }; struct vp_device { - unsigned int ioaddr; struct vp_cap common, notify, isr, device, legacy; u32 notify_off_multiplier; u8 use_modern; @@ -225,7 +194,7 @@ static inline void vp_get_legacy(struct vp_device *vp, unsigned offset, unsigned i; for (i = 0; i < len; i++) - ptr[i] = inb(vp->ioaddr + VIRTIO_PCI_CONFIG + offset + i); + ptr[i] = vp_read(&vp->legacy, virtio_pci_legacy, device[i]); } u8 vp_get_status(struct vp_device *vp); -- 1.8.3.1