Drivers implement the Driver
trait --- command
and subscribe
methods that correspond to command
and subscribe system calls for that driver.
The subscribe
system call comes with access to a Callback
. Callback
s encode the process that invoked the syscall, and
the function pointer passed as a callback. Callback
s also act as a capability to allocate memory from the application's
heap space.
- Should
Callback
and memory allocation be separated - Should
command
be allowed to allocate memory - Should drivers be allowed to allocate memory from applications whenever they want, or just within a
subscribe
andcommand
body.