Commit edc257eb authored by MaPl's avatar MaPl
Browse files

[lab6] drivers/virtio: add queue_align configure

No related merge requests found
Showing with 3 additions and 0 deletions
+3 -0
......@@ -38,6 +38,7 @@ void virtio_set_queue(struct virtio_device *device, uint64_t is_legacy, uint32_t
device->queue_num = VIRTQ_RING_NUM;
// 6. set the queue address
if(is_legacy) {
device->queue_align = PAGE_SIZE;
device->guest_page_size = PAGE_SIZE;
device->queue_pfn = virtq_phy_addr / PAGE_SIZE;
} else {
......
......@@ -92,6 +92,8 @@ struct virtq {
uint64_t physical_addr;
};
#define VIRTQ_ALIGN(x) (((x) + PAGE_SIZE) & ~PAGE_SIZE)
uint16_t virtq_get_desc(struct virtq *vq);
void virtq_free_desc(struct virtq *vq, uint16_t idx);
void virtq_free_desc_chain(struct virtq *vq, uint16_t idx);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment