virtio_pci.c (267312) | virtio_pci.c (268010) |
---|---|
1/*- 2 * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27/* Driver for the VirtIO PCI interface. */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2011, Bryan Venteicher <bryanv@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 13 unchanged lines hidden (view full) --- 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27/* Driver for the VirtIO PCI interface. */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: stable/10/sys/dev/virtio/pci/virtio_pci.c 267312 2014-06-10 03:23:35Z bryanv $"); | 30__FBSDID("$FreeBSD: stable/10/sys/dev/virtio/pci/virtio_pci.c 268010 2014-06-29 00:37:59Z bryanv $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/malloc.h> 38 39#include <machine/bus.h> 40#include <machine/resource.h> 41#include <sys/bus.h> 42#include <sys/rman.h> 43 44#include <dev/pci/pcivar.h> 45#include <dev/pci/pcireg.h> 46 47#include <dev/virtio/virtio.h> | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/bus.h> 35#include <sys/kernel.h> 36#include <sys/module.h> 37#include <sys/malloc.h> 38 39#include <machine/bus.h> 40#include <machine/resource.h> 41#include <sys/bus.h> 42#include <sys/rman.h> 43 44#include <dev/pci/pcivar.h> 45#include <dev/pci/pcireg.h> 46 47#include <dev/virtio/virtio.h> |
48#include <dev/virtio/virtio_config.h> | |
49#include <dev/virtio/virtqueue.h> 50#include <dev/virtio/pci/virtio_pci.h> 51 52#include "virtio_bus_if.h" 53#include "virtio_if.h" 54 55struct vtpci_interrupt { 56 struct resource *vti_irq; --- 108 unchanged lines hidden (view full) --- 165static int vtpci_vq_shared_intr_filter(void *); 166static void vtpci_vq_shared_intr(void *); 167static int vtpci_vq_intr_filter(void *); 168static void vtpci_vq_intr(void *); 169static void vtpci_config_intr(void *); 170 171#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt 172 | 48#include <dev/virtio/virtqueue.h> 49#include <dev/virtio/pci/virtio_pci.h> 50 51#include "virtio_bus_if.h" 52#include "virtio_if.h" 53 54struct vtpci_interrupt { 55 struct resource *vti_irq; --- 108 unchanged lines hidden (view full) --- 164static int vtpci_vq_shared_intr_filter(void *); 165static void vtpci_vq_shared_intr(void *); 166static int vtpci_vq_intr_filter(void *); 167static void vtpci_vq_intr(void *); 168static void vtpci_config_intr(void *); 169 170#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt 171 |
172#define VIRTIO_PCI_CONFIG(_sc) \ 173 VIRTIO_PCI_CONFIG_OFF((((_sc)->vtpci_flags & VTPCI_FLAG_MSIX)) != 0) 174 |
|
173/* 174 * I/O port read/write wrappers. 175 */ 176#define vtpci_read_config_1(sc, o) bus_read_1((sc)->vtpci_res, (o)) 177#define vtpci_read_config_2(sc, o) bus_read_2((sc)->vtpci_res, (o)) 178#define vtpci_read_config_4(sc, o) bus_read_4((sc)->vtpci_res, (o)) 179#define vtpci_write_config_1(sc, o, v) bus_write_1((sc)->vtpci_res, (o), (v)) 180#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) --- 1147 unchanged lines hidden --- | 175/* 176 * I/O port read/write wrappers. 177 */ 178#define vtpci_read_config_1(sc, o) bus_read_1((sc)->vtpci_res, (o)) 179#define vtpci_read_config_2(sc, o) bus_read_2((sc)->vtpci_res, (o)) 180#define vtpci_read_config_4(sc, o) bus_read_4((sc)->vtpci_res, (o)) 181#define vtpci_write_config_1(sc, o, v) bus_write_1((sc)->vtpci_res, (o), (v)) 182#define vtpci_write_config_2(sc, o, v) bus_write_2((sc)->vtpci_res, (o), (v)) --- 1147 unchanged lines hidden --- |