You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently each virtIO device class talks to the sDDF interface via the same sddf_handler struct, which has been made generic. Furthermore, we have each device initialised via the same function virtio_mmio_device_init, which takes in an enum that specifies the device class type.
However a better design would be to have:
different sddf_handler structs specific to each device class.
different init function for each device class.
The text was updated successfully, but these errors were encountered:
Not too sure about the name "handler". I think "handler" came from "queue_handle" then for some reason we put an r on the end. E.g., the global array sddf_handler_t sddf_serial_handlers[SDDF_SERIAL_NUM_HANDLES] has NUM_HANDLES as the size, doesn't really make sense. All this needs to be is something like void *device_data, it doens't need to be sDDF specific.
I agree we should have a per device class init function. virtio_mmio_device_init doesn't really do much extra apart from register the exception handler and virq. We could either
remove virtio_mmio_device_init and put exception and virq registration in per-device functions, or
rename and switch sddf_handlers to be a device-specific struct passed with void *.
if we wanted to remove the switch statement we could also pass in the virtio_*_init function as a function pointer.
Currently each virtIO device class talks to the sDDF interface via the same sddf_handler struct, which has been made generic. Furthermore, we have each device initialised via the same function virtio_mmio_device_init, which takes in an enum that specifies the device class type.
However a better design would be to have:
The text was updated successfully, but these errors were encountered: