virtio: changed a bit the driver API by adding a driverCookie.

* the processing of requests in drivers is eased a bit with this change, but
this could be improved for instance by enabling a driver to dequeue items
in a service thread instead of the interrupt handler.
* made a few methods const.
This commit is contained in:
Jérôme Duval
2013-07-17 17:30:18 +02:00
parent b3a0911eb7
commit ed4a8e4d11
8 changed files with 42 additions and 31 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ typedef void* virtio_device;
// queue cookie, issued by virtio bus manager
typedef void* virtio_queue;
// callback function for requests
typedef void (*virtio_callback_func)(void *cookie);
typedef void (*virtio_callback_func)(void* driverCookie, void *cookie);
// callback function for interrupts
typedef void (*virtio_intr_func)(void *cookie);
@@ -105,7 +105,7 @@ typedef struct {
virtio_queue *queues);
status_t (*setup_interrupt)(virtio_device cookie,
virtio_intr_func config_handler, void* configCookie);
virtio_intr_func config_handler, void* driverCookie);
status_t (*queue_request)(virtio_queue queue,
const physical_entry *readEntry,