Skip to content

Commit

Permalink
virtio: undo weird styling
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan-Velickovic <[email protected]>
  • Loading branch information
Ivan-Velickovic committed Nov 7, 2024
1 parent 9b92a9c commit 4a18c5b
Show file tree
Hide file tree
Showing 2 changed files with 679 additions and 663 deletions.
72 changes: 36 additions & 36 deletions include/libvmm/virtio/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,45 +150,45 @@ struct virtio_blk_outhdr {
* virtio response from sddf response.
*/
typedef struct reqbk {
// /* For writing response byte in virtio descriptor */
// uint8_t *virtio_resp_byte;
/* Descriptor head of the virtio request */
uint16_t virtio_desc_head;
/* For enqueuing sddf req/resp */
uintptr_t sddf_data_cell_base;
uint16_t sddf_count;
uint32_t sddf_block_number;
uintptr_t sddf_data;
/* The size of data contained in virtio request */
uint32_t virtio_body_size_bytes;
/* Indicates this request is an unaligned write from virtIO. When not true,
* this request is the "read" part of the read-modify-write. A subsequent
* write request will be enqueued to complete the read-modify-write.
*/
bool aligned;
// /* For writing response byte in virtio descriptor */
// uint8_t *virtio_resp_byte;
/* Descriptor head of the virtio request */
uint16_t virtio_desc_head;
/* For enqueuing sddf req/resp */
uintptr_t sddf_data_cell_base;
uint16_t sddf_count;
uint32_t sddf_block_number;
uintptr_t sddf_data;
/* The size of data contained in virtio request */
uint32_t virtio_body_size_bytes;
/* Indicates this request is an unaligned write from virtIO. When not true,
* this request is the "read" part of the read-modify-write. A subsequent
* write request will be enqueued to complete the read-modify-write.
*/
bool aligned;
} reqbk_t;

struct virtio_blk_device {
struct virtio_device virtio_device;
struct virtio_blk_config config;
struct virtio_queue_handler vqs[VIRTIO_BLK_NUM_VIRTQ];
/* Request bookkeep indexed by the request id */
reqbk_t reqsbk[SDDF_MAX_QUEUE_CAPACITY];
/* Data struct that handles allocation and freeing of fixed size data cells
* in sDDF memory region */
fsmalloc_t fsmalloc;
bitarray_t fsmalloc_avail_bitarr;
word_t fsmalloc_avail_bitarr_words[roundup_bits2words64(SDDF_MAX_DATA_CELLS)];
/* Index allocator for sddf request ids */
ialloc_t ialloc;
uint32_t ialloc_idxlist[SDDF_MAX_QUEUE_CAPACITY];
/* Sddf structures */
blk_storage_info_t *storage_info;
blk_queue_handle_t queue_h;
uint32_t queue_capacity;
uintptr_t data_region;
/* Channel to notify microkit component serving this client */
int server_ch;
struct virtio_device virtio_device;
struct virtio_blk_config config;
struct virtio_queue_handler vqs[VIRTIO_BLK_NUM_VIRTQ];
/* Request bookkeep indexed by the request id */
reqbk_t reqsbk[SDDF_MAX_QUEUE_CAPACITY];
/* Data struct that handles allocation and freeing of fixed size data cells
* in sDDF memory region */
fsmalloc_t fsmalloc;
bitarray_t fsmalloc_avail_bitarr;
word_t fsmalloc_avail_bitarr_words[roundup_bits2words64(SDDF_MAX_DATA_CELLS)];
/* Index allocator for sddf request ids */
ialloc_t ialloc;
uint32_t ialloc_idxlist[SDDF_MAX_QUEUE_CAPACITY];
/* Sddf structures */
blk_storage_info_t *storage_info;
blk_queue_handle_t queue_h;
uint32_t queue_capacity;
uintptr_t data_region;
/* Channel to notify microkit component serving this client */
int server_ch;
};

bool virtio_mmio_blk_init(struct virtio_blk_device *blk_dev,
Expand Down
Loading

0 comments on commit 4a18c5b

Please sign in to comment.