Skip to content

Commit

Permalink
Merge #1831
Browse files Browse the repository at this point in the history
1831: Allow/subscribe null pointer doc clarifications r=ppannuto a=jrvanwhy

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](https://www.github.com/jrvanwhy/tock/blob/allow-subscribe-null/doc/Syscalls.md).



### Documentation Updated

- [X] Updated the relevant files in `/docs`, or no updates are required.

### Formatting

- [X] Ran `make formatall`.


Co-authored-by: Johnathan Van Why <jrvanwhy@google.com>
  • Loading branch information
bors[bot] and jrvanwhy committed May 8, 2020
2 parents e3c8b2e + f1893f5 commit d958392
Showing 1 changed file with 5 additions and 3 deletions.
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
disable a previously set callback (besides flushing pending callbacks for this
callback ID).

```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.

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

0 comments on commit d958392

Please sign in to comment.