diff options
author | Frans Kaashoek <[email protected]> | 2019-07-01 08:20:35 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2019-07-01 08:20:35 -0400 |
commit | af6c35e14bc4d9e4c24726600971921cba406a83 (patch) | |
tree | b57aab48b38f55cf93aef49ef40cc14f8b5035dc /kernel/virtio.h | |
parent | a8305b7318e66eb33e7789072e8b91dffa0e4b93 (diff) | |
download | xv6-labs-af6c35e14bc4d9e4c24726600971921cba406a83.tar.gz xv6-labs-af6c35e14bc4d9e4c24726600971921cba406a83.tar.bz2 xv6-labs-af6c35e14bc4d9e4c24726600971921cba406a83.zip |
Introduce alloc3_desc and UsedArea to make code easier to read
Diffstat (limited to 'kernel/virtio.h')
-rw-r--r-- | kernel/virtio.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/virtio.h b/kernel/virtio.h index c142af9..03b53a9 100644 --- a/kernel/virtio.h +++ b/kernel/virtio.h @@ -43,6 +43,10 @@ #define VIRTIO_RING_F_INDIRECT_DESC 28 #define VIRTIO_RING_F_EVENT_IDX 29 +// this many virtio descriptors. +// must be a power of two. +#define NUM 8 + struct VRingDesc { uint64 addr; uint32 len; @@ -60,3 +64,9 @@ struct VRingUsedElem { // for disk ops #define VIRTIO_BLK_T_IN 0 // read the disk #define VIRTIO_BLK_T_OUT 1 // write the disk + +struct UsedArea { + uint16 flags; + uint16 id; + struct VRingUsedElem elems[NUM]; +}; |