New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow/subscribe null pointer doc clarifications #1831
Conversation
… passing a null pointer only asks a driver to stop accessing a region; it does not revoke that driver's access. I also clarified the subscribe documentation to indicate that passing a null callback asks the driver to stop calling it rather than revokes its access to the callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded: |
Although this matches what the code actually does, to me this is a breaking change in the API. Instead of changing the documentation, shouldn't we fix the code and create a bug fix release (e.g. Tock 1.6.1) that actually implements the behavior that was documented so far? |
@@ -157,8 +157,9 @@ A callback function is uniquely identified by the pair (`driver`, | |||
are any pending callbacks for this callback ID, they are removed from the queue | |||
before the new callback function is bound to the callback ID. | |||
|
|||
Passing a null pointer callback function disables a previously set callback | |||
(besides flushing pending callbacks for this callback ID). | |||
A process can pass a null pointer as the callback argument to request the driver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is much less clear than the previous documentation. It doesn't specify at all what happens with this "request" to disable the callback. When does the driver take it into account? Can a driver reject such a request?
Without any such guarantees that the callback is indeed disabled once the syscall returns, how can one program anything useful in userspace?
Correct the documentation of the allow() system call to indicate that passing a null pointer only asks a driver to stop accessing a region; it does not revoke that driver's access.
I also clarified the subscribe documentation to indicate that passing a null callback asks the driver to stop calling it rather than revokes its access to the callback.
Pull Request Overview
This pull request changes the system call documentation for
allow
andsubscribe
.Testing Strategy
This pull request was tested by looking the rendered documentation.
Documentation Updated
/docs
, or no updates are required.Formatting
make formatall
.