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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions doc/Syscalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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?

disable a previously set callback (besides flushing pending callbacks for this
callback ID).
jrvanwhy marked this conversation as resolved.
Show resolved Hide resolved

```rust
subscribe(driver: u32, subscribe_number: u32, callback: u32, userdata: u32) -> ReturnCode as u32
Expand Down Expand Up @@ -224,7 +225,8 @@ additional meaning such as the number of devices present, as is the case in the
### 3: Allow

Allow marks a region of memory as shared between the kernel and application.
A null pointer revokes sharing a region.
Passing a null pointer requests the corresponding driver to stop accessing the
shared memory region.
jrvanwhy marked this conversation as resolved.
Show resolved Hide resolved

```rust
allow(driver: u32, allow_number: u32, pointer: usize, size: u32) -> ReturnCode as u32
Expand Down