summaryrefslogtreecommitdiff
path: root/kernel/virtio.h
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2022-08-02 11:44:40 -0400
committerFrans Kaashoek <[email protected]>2022-08-02 11:44:40 -0400
commit84fb6f3dc2bf9d6fea6e21646352f74d063f432f (patch)
tree0f5b79b299070a538edbec5f2ebbc626dde5cc44 /kernel/virtio.h
parent1b02b08db18210f2c1efb4e184c482a06f690fbd (diff)
parentcd00a8233ad43be269908db5bdc28c5961a9dce9 (diff)
downloadxv6-labs-84fb6f3dc2bf9d6fea6e21646352f74d063f432f.tar.gz
xv6-labs-84fb6f3dc2bf9d6fea6e21646352f74d063f432f.tar.bz2
xv6-labs-84fb6f3dc2bf9d6fea6e21646352f74d063f432f.zip
Merge branch 'virtio' into riscv
Diffstat (limited to 'kernel/virtio.h')
-rw-r--r--kernel/virtio.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/kernel/virtio.h b/kernel/virtio.h
index f1dc520..3d85583 100644
--- a/kernel/virtio.h
+++ b/kernel/virtio.h
@@ -2,7 +2,6 @@
// virtio device definitions.
// for both the mmio interface, and virtio descriptors.
// only tested with qemu.
-// this is the "legacy" virtio interface.
//
// the virtio spec:
// https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.pdf
@@ -16,17 +15,20 @@
#define VIRTIO_MMIO_VENDOR_ID 0x00c // 0x554d4551
#define VIRTIO_MMIO_DEVICE_FEATURES 0x010
#define VIRTIO_MMIO_DRIVER_FEATURES 0x020
-#define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 // page size for PFN, write-only
#define VIRTIO_MMIO_QUEUE_SEL 0x030 // select queue, write-only
#define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034 // max size of current queue, read-only
#define VIRTIO_MMIO_QUEUE_NUM 0x038 // size of current queue, write-only
-#define VIRTIO_MMIO_QUEUE_ALIGN 0x03c // used ring alignment, write-only
-#define VIRTIO_MMIO_QUEUE_PFN 0x040 // physical page number for queue, read/write
#define VIRTIO_MMIO_QUEUE_READY 0x044 // ready bit
#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 // write-only
#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 // read-only
#define VIRTIO_MMIO_INTERRUPT_ACK 0x064 // write-only
#define VIRTIO_MMIO_STATUS 0x070 // read/write
+#define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080 // physical address for descriptor table, write-only
+#define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084
+#define VIRTIO_MMIO_DRIVER_DESC_LOW 0x090 // physical address for available ring, write-only
+#define VIRTIO_MMIO_DRIVER_DESC_HIGH 0x094
+#define VIRTIO_MMIO_DEVICE_DESC_LOW 0x0a0 // physical address for used ring, write-only
+#define VIRTIO_MMIO_DEVICE_DESC_HIGH 0x0a4
// status register bits, from qemu virtio_config.h
#define VIRTIO_CONFIG_S_ACKNOWLEDGE 1