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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user