You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/API.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -210,13 +210,13 @@ A box identity identifies a security domain uniquely and globally.
210
210
211
211
The box identity API can be used to determine the source box of an inbound secure gateway call. This can be useful for implementing complex authorization logic between mutually distrustful security domains.
212
212
213
-
uVisor provides the ability to retrieve the box ID of the current box (`uvisor_box_id_self`), or of the box that most recently called the current box through a secure gateway (`uvisor_box_id_caller`).
213
+
uVisor provides the ability to retrieve the box ID of the current box (`uvisor_box_id_self`), or of the box that called the current box through an RPC gateway via the `box_id_caller` parameter of `rpc_fncall_waitfor`.
214
214
215
215
The box ID number is not constant and can change between reboots. But, the box ID number can be used as a token to retrieve a constant string identifier, known as the box namespace.
216
216
217
217
A box namespace is a static, box-specific string, that can help identify which box has which ID at run-time. In the future, the box namespace will be guaranteed to be globally unique.
218
218
219
-
A full example using this API is available at [example-uvisor-box-id](https://github.com/ARMmbed/example-uvisor-box-id).
219
+
A full example using this API is available at [mbed-os-example-uvisor-number-store](https://github.com/ARMmbed/mbed-os-example-uvisor-number-store).
220
220
221
221
```C
222
222
intuvisor_box_id_self(void)
@@ -236,20 +236,22 @@ int uvisor_box_id_self(void)
236
236
---
237
237
238
238
```C
239
-
int uvisor_box_id_caller(void)
239
+
int rpc_fncall_waitfor(const TFN_Ptr fn_ptr_array[], size_t fn_count, int * box_id_caller, uint32_t timeout_ms)
240
240
```
241
241
242
242
<table>
243
243
<tr>
244
244
<td>Description</td>
245
-
<td colspan="2">Get the ID of the box that is calling the current box through the most recent secure gateway</td>
245
+
<td colspan="2">Handle incoming RPC, setting the parameter `box_id_caller` to the caller box ID.</td>
246
246
</tr>
247
247
<tr>
248
-
<td>Return value</td>
249
-
<td colspan="2">The ID of the caller box, or -1 if there is no secure gateway calling box</td>
248
+
<td>`box_id_caller` value</td>
249
+
<td colspan="2">After a call, `box_id_caller` is set to the box ID of the calling box (the source box of the RPC). This is set before the RPC is dispatched, so that the RPC target function can read from this location to determine the calling box ID. This parameter is optional.</td>
250
250
</tr>
251
251
</table>
252
252
253
+
> When deciding which memory to provide for `rpc_fncall_waitfor` to use when writing `box_id_caller`, strongly prefer thread local storage when multiple threads in a box can handle incoming RPC.
0 commit comments