Skip to content
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

Merged
merged 1 commit into from May 8, 2020

Conversation

jrvanwhy
Copy link
Contributor

@jrvanwhy jrvanwhy commented May 6, 2020

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 and subscribe.

Testing Strategy

This pull request was tested by looking the rendered documentation.

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make formatall.

… 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.
doc/Syscalls.md Show resolved Hide resolved
doc/Syscalls.md Show resolved Hide resolved
Copy link
Member

@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented May 8, 2020

@gendx
Copy link
Contributor

gendx commented May 29, 2020

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
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants