1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 00:17:46 +00:00

Kernel: Activate queues and enable interrutps in VirtIODevices

This patch actually enables virtio queues after configuring them
so the device can use them, it also enables interrupt handling in
VirtIODevice so they are not ignored.

Co-authored-by: Sahan <sahan.h.fernando@gmail.com>
This commit is contained in:
Idan Horowitz 2021-04-15 19:17:49 +10:00 committed by Andreas Kling
parent 4a467c553a
commit 42b1eb5af1
4 changed files with 30 additions and 6 deletions

View file

@ -77,10 +77,11 @@ bool VirtIOQueue::supply_buffer(const u8* buffer, u32 len, BufferType buffer_typ
m_free_buffers--;
m_free_head = (m_free_head + 1) % m_queue_size;
m_driver->rings[m_driver->index % m_queue_size] = descriptor_index;
m_driver->rings[m_driver_index_shadow % m_queue_size] = descriptor_index; // m_driver_index_shadow is used to prevent accesses to index before the rings are updated
full_memory_barrier();
m_driver_index_shadow++;
m_driver->index++;
full_memory_barrier();