ladybird/Kernel/VirtIO
Idan Horowitz d1f7a2f9a5 Kernel: Finish base implementation of VirtQueues
This commit includes a lot of small changes and additions needed to
finalize the base implementation of VirtIOQueues and VirtDevices:
* The device specific driver implementation now has to handle setting
up the queues it needs before letting the base device class know it
finised initialization
* Supplying buffers to VirtQueues is now done via ScatterGatherLists
instead of arbitary buffer pointers - this ensures the pointers are
physical and allows us to follow the specification in regards to the
requirement that individual descriptors must point to physically
contiguous buffers. This can be further improved in the future by
implementating support for the Indirect-Descriptors feature (as
defined by the specification) to reduce descriptor usage for very
fragmented buffers.
* When supplying buffers to a VirtQueue the driver must supply a
(temporarily-)unique token (usually the supplied buffer's virtual
address) to ensure the driver can discern which buffer has finished
processing by the device in the case in which the device does not
offer the F_IN_ORDER feature.
* Device drivers now handle queue updates (supplied buffers being
returned from the device) by implementing a single pure virtual
method instead of setting a seperate callback for each queue
* Two new VirtQueue methods were added to allow the device driver
to either discard or get used/returned buffers from the device by
cleanly removing them off the descriptor chain (This also allows
the VirtQueue implementation to reuse those freed descriptors)

This also includes the necessary changes to the VirtIOConsole
implementation to match these interface changes.

Co-authored-by: Sahan <sahan.h.fernando@gmail.com>
2021-04-17 10:21:23 +02:00
..
VirtIO.cpp Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VirtIO.h Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VirtIOConsole.cpp Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VirtIOConsole.h Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VirtIOQueue.cpp Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00
VirtIOQueue.h Kernel: Finish base implementation of VirtQueues 2021-04-17 10:21:23 +02:00