diff --git a/examples/virtio/client_vmm.c b/examples/virtio/client_vmm.c index e4c9e754..7987c0e2 100644 --- a/examples/virtio/client_vmm.c +++ b/examples/virtio/client_vmm.c @@ -74,6 +74,11 @@ uintptr_t blk_storage_info; static struct virtio_blk_device virtio_blk; +_Static_assert(BLK_DATA_REGION_SIZE_CLI0 >= BLK_TRANSFER_SIZE && BLK_DATA_REGION_SIZE_CLI0 % BLK_TRANSFER_SIZE == 0, + "Client0 data region size must be a multiple of the transfer size"); +_Static_assert(BLK_DATA_REGION_SIZE_CLI1 >= BLK_TRANSFER_SIZE && BLK_DATA_REGION_SIZE_CLI1 % BLK_TRANSFER_SIZE == 0, + "Client1 data region size must be a multiple of the transfer size"); + void init(void) { blk_storage_info_t *storage_info = (blk_storage_info_t *)blk_storage_info; diff --git a/src/virtio/block.c b/src/virtio/block.c index c468ddeb..b584c1c5 100644 --- a/src/virtio/block.c +++ b/src/virtio/block.c @@ -16,7 +16,6 @@ #include #include #include -#include /* Uncomment this to enable debug logging */ // #define DEBUG_BLOCK @@ -29,11 +28,6 @@ #define LOG_BLOCK_ERR(...) do{ printf("VIRTIO(BLOCK)|ERROR: "); printf(__VA_ARGS__); }while(0) -_Static_assert(BLK_DATA_REGION_SIZE_CLI0 >= BLK_TRANSFER_SIZE && BLK_DATA_REGION_SIZE_CLI0 % BLK_TRANSFER_SIZE == 0, - "Client0 data region size must be a multiple of the transfer size"); -_Static_assert(BLK_DATA_REGION_SIZE_CLI1 >= BLK_TRANSFER_SIZE && BLK_DATA_REGION_SIZE_CLI1 % BLK_TRANSFER_SIZE == 0, - "Client1 data region size must be a multiple of the transfer size"); - static inline struct virtio_blk_device *device_state(struct virtio_device *dev) { return (struct virtio_blk_device *)dev->device_data;