virtio_mmio.c (275640) | virtio_mmio.c (275647) |
---|---|
1/*- 2 * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> 3 * Copyright (c) 2014 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * This software was developed by SRI International and the University of 7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 8 * ("CTSRD"), as part of the DARPA CRASH research programme. --- 34 unchanged lines hidden (view full) --- 43 * compatible = "virtio,mmio"; 44 * reg = <0x1000 0x100>; 45 * interrupts = <63>; 46 * interrupt-parent = <&GIC>; 47 * }; 48 */ 49 50#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> 3 * Copyright (c) 2014 The FreeBSD Foundation 4 * All rights reserved. 5 * 6 * This software was developed by SRI International and the University of 7 * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 8 * ("CTSRD"), as part of the DARPA CRASH research programme. --- 34 unchanged lines hidden (view full) --- 43 * compatible = "virtio,mmio"; 44 * reg = <0x1000 0x100>; 45 * interrupts = <63>; 46 * interrupt-parent = <&GIC>; 47 * }; 48 */ 49 50#include <sys/cdefs.h> |
51__FBSDID("$FreeBSD: head/sys/dev/virtio/mmio/virtio_mmio.c 275640 2014-12-09 10:31:35Z andrew $"); | 51__FBSDID("$FreeBSD: head/sys/dev/virtio/mmio/virtio_mmio.c 275647 2014-12-09 16:39:21Z br $"); |
52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/bus.h> 56#include <sys/kernel.h> 57#include <sys/module.h> 58#include <sys/malloc.h> 59#include <sys/rman.h> --- 70 unchanged lines hidden (view full) --- 130static void vtmmio_release_child_resources(struct vtmmio_softc *); 131static void vtmmio_reset(struct vtmmio_softc *); 132static void vtmmio_select_virtqueue(struct vtmmio_softc *, int); 133static void vtmmio_vq_intr(void *); 134 135/* 136 * I/O port read/write wrappers. 137 */ | 52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/bus.h> 56#include <sys/kernel.h> 57#include <sys/module.h> 58#include <sys/malloc.h> 59#include <sys/rman.h> --- 70 unchanged lines hidden (view full) --- 130static void vtmmio_release_child_resources(struct vtmmio_softc *); 131static void vtmmio_reset(struct vtmmio_softc *); 132static void vtmmio_select_virtqueue(struct vtmmio_softc *, int); 133static void vtmmio_vq_intr(void *); 134 135/* 136 * I/O port read/write wrappers. 137 */ |
138#define vtmmio_write_config_1(sc, o, v) \ 139do { \ 140 bus_write_1((sc)->res[0], (o), (v)); \ 141 if (sc->platform != NULL) \ 142 VIRTIO_MMIO_NOTE(sc->platform, (o)); \ | 138#define vtmmio_write_config_1(sc, o, v) \ 139do { \ 140 bus_write_1((sc)->res[0], (o), (v)); \ 141 if (sc->platform != NULL) \ 142 VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ |
143} while (0) | 143} while (0) |
144#define vtmmio_write_config_2(sc, o, v) \ 145do { \ 146 bus_write_2((sc)->res[0], (o), (v)); \ 147 if (sc->platform != NULL) \ 148 VIRTIO_MMIO_NOTE(sc->platform, (o)); \ | 144#define vtmmio_write_config_2(sc, o, v) \ 145do { \ 146 bus_write_2((sc)->res[0], (o), (v)); \ 147 if (sc->platform != NULL) \ 148 VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ |
149} while (0) | 149} while (0) |
150#define vtmmio_write_config_4(sc, o, v) \ 151do { \ 152 bus_write_4((sc)->res[0], (o), (v)); \ 153 if (sc->platform != NULL) \ 154 VIRTIO_MMIO_NOTE(sc->platform, (o)); \ | 150#define vtmmio_write_config_4(sc, o, v) \ 151do { \ 152 bus_write_4((sc)->res[0], (o), (v)); \ 153 if (sc->platform != NULL) \ 154 VIRTIO_MMIO_NOTE(sc->platform, (o), (v)); \ |
155} while (0) 156 157#define vtmmio_read_config_1(sc, o) \ 158 bus_read_1((sc)->res[0], (o)) 159#define vtmmio_read_config_2(sc, o) \ 160 bus_read_2((sc)->res[0], (o)) 161#define vtmmio_read_config_4(sc, o) \ 162 bus_read_4((sc)->res[0], (o)) --- 678 unchanged lines hidden --- | 155} while (0) 156 157#define vtmmio_read_config_1(sc, o) \ 158 bus_read_1((sc)->res[0], (o)) 159#define vtmmio_read_config_2(sc, o) \ 160 bus_read_2((sc)->res[0], (o)) 161#define vtmmio_read_config_4(sc, o) \ 162 bus_read_4((sc)->res[0], (o)) --- 678 unchanged lines hidden --- |