tweak virtio comments

This commit is contained in:
Robert Morris 2022-08-08 11:10:54 -04:00
parent 84fb6f3dc2
commit ca6fc54934
2 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@
// virtio mmio control registers, mapped starting at 0x10001000. // virtio mmio control registers, mapped starting at 0x10001000.
// from qemu virtio_mmio.h // from qemu virtio_mmio.h
#define VIRTIO_MMIO_MAGIC_VALUE 0x000 // 0x74726976 #define VIRTIO_MMIO_MAGIC_VALUE 0x000 // 0x74726976
#define VIRTIO_MMIO_VERSION 0x004 // version; 1 is legacy #define VIRTIO_MMIO_VERSION 0x004 // version; should be 2
#define VIRTIO_MMIO_DEVICE_ID 0x008 // device type; 1 is net, 2 is disk #define VIRTIO_MMIO_DEVICE_ID 0x008 // device type; 1 is net, 2 is disk
#define VIRTIO_MMIO_VENDOR_ID 0x00c // 0x554d4551 #define VIRTIO_MMIO_VENDOR_ID 0x00c // 0x554d4551
#define VIRTIO_MMIO_DEVICE_FEATURES 0x010 #define VIRTIO_MMIO_DEVICE_FEATURES 0x010

View file

@ -20,20 +20,20 @@
#define R(r) ((volatile uint32 *)(VIRTIO0 + (r))) #define R(r) ((volatile uint32 *)(VIRTIO0 + (r)))
static struct disk { static struct disk {
// the first is a set (not a ring) of DMA descriptors, with which the // a set (not a ring) of DMA descriptors, with which the
// driver tells the device where to read and write individual // driver tells the device where to read and write individual
// disk operations. there are NUM descriptors. // disk operations. there are NUM descriptors.
// most commands consist of a "chain" (a linked list) of a couple of // most commands consist of a "chain" (a linked list) of a couple of
// these descriptors. // these descriptors.
struct virtq_desc *desc; struct virtq_desc *desc;
// next is a ring in which the driver writes descriptor numbers // a ring in which the driver writes descriptor numbers
// that the driver would like the device to process. it only // that the driver would like the device to process. it only
// includes the head descriptor of each chain. the ring has // includes the head descriptor of each chain. the ring has
// NUM elements. // NUM elements.
struct virtq_avail *avail; struct virtq_avail *avail;
// finally a ring in which the device writes descriptor numbers that // a ring in which the device writes descriptor numbers that
// the device has finished processing (just the head of each chain). // the device has finished processing (just the head of each chain).
// there are NUM used ring entries. // there are NUM used ring entries.
struct virtq_used *used; struct virtq_used *used;