diff options
Diffstat (limited to 'kernel/virtio.h')
-rw-r--r-- | kernel/virtio.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/kernel/virtio.h b/kernel/virtio.h index bac215d..c142af9 100644 --- a/kernel/virtio.h +++ b/kernel/virtio.h @@ -35,13 +35,13 @@ #define VIRTIO_CONFIG_S_FEATURES_OK 8 // device feature bits -#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ -#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ -#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ -#define VIRTIO_F_ANY_LAYOUT 27 -#define VIRTIO_RING_F_INDIRECT_DESC 28 -#define VIRTIO_RING_F_EVENT_IDX 29 +#define VIRTIO_BLK_F_RO 5 /* Disk is read-only */ +#define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ +#define VIRTIO_BLK_F_CONFIG_WCE 11 /* Writeback mode available in config */ +#define VIRTIO_BLK_F_MQ 12 /* support more than one vq */ +#define VIRTIO_F_ANY_LAYOUT 27 +#define VIRTIO_RING_F_INDIRECT_DESC 28 +#define VIRTIO_RING_F_EVENT_IDX 29 struct VRingDesc { uint64 addr; @@ -49,14 +49,14 @@ struct VRingDesc { uint16 flags; uint16 next; }; -#define VRING_DESC_F_NEXT 1 -#define VRING_DESC_F_WRITE 2 // device writes (vs read) +#define VRING_DESC_F_NEXT 1 // chained with another descriptor +#define VRING_DESC_F_WRITE 2 // device writes (vs read) struct VRingUsedElem { - uint32 id; // index of start of completed descriptor chain + uint32 id; // index of start of completed descriptor chain uint32 len; }; // for disk ops -#define VIRTIO_BLK_T_IN 0 -#define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_IN 0 // read the disk +#define VIRTIO_BLK_T_OUT 1 // write the disk |