Skip to content

Commit ebef3d4

Browse files
committed
clarified grant section
1 parent a41f0c4 commit ebef3d4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/embedded/assets/grant.png

16.2 KB
Loading

docs/embedded/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ Simplest method to do this is to add a `counter` field in the capsule's structur
5959

6060
### The Tock way
6161

62-
One issue with the previous approach is that the counter would be shared between the applications. This could be an issue for mutually distrustful application. Fortunately, Tock has a mechanism in place for such situations, called `Grant`s, which are per-process memory regions allocated in the kernel for a capsule to store that process’s state.
62+
One issue with the previous approach is that the counter would be shared between the applications. This could be an issue for mutually distrustful application. Fortunately, Tock has a mechanism in place for such situations, called `Grant`s, which are per-process memory regions allocated by the kernel in a process memory region for a capsule to store that process’s state.
63+
64+
![Grant](assets/grant.png)
6365

6466
To access this region, you can simply add a new `grant` field in the capsule structure.
6567

@@ -72,9 +74,9 @@ struct App;
7274
struct PrintCounter {
7375
grant: Grant<
7476
App,
75-
UpcallCount<0>,
76-
AllowRoCount<0>,
77-
AllowRwCount<0>
77+
UpcallCount<0>, // Number of upcalls supported by the capsule
78+
AllowRoCount<0>, // Number of Read-Only buffers supported
79+
AllowRwCount<0>, // Number of Read-Write buffers supported
7880
>,
7981
}
8082
```

0 commit comments

Comments
 (0)