Skip to content

Commit 0016bd4

Browse files
Patater0xc0170
authored andcommitted
uVisor: Re-import RTX5-capable uVisor
Use a newer version of uVisor that doesn't change the box main thread function type. Previously, we required all box main thread definitions to change from taking a `const void *` to a `void *` when moving to RTX5. We now are backwards compatibile.
1 parent 6be9e47 commit 0016bd4

File tree

15 files changed

+15
-15
lines changed

15 files changed

+15
-15
lines changed

features/FEATURE_UVISOR/AUTHORS.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
592 Milosch Meriac
2-
547 Alessandro Angelino
2+
554 Alessandro Angelino
33
105 Jaeden Amero
44
65 Niklas Hauser
55
5 Irit Arkin
6+
3 JaredCJR
7+
3 AnotherButler
68
3 Hugo Vincent
79
3 Jim Huang
8-
3 JaredCJR
910
2 tonyyanxuan
11+
2 Amanda Butler
1012
2 Jan Jongboom
1113
2 Nathan Chong
1214
2 Vincenzo Frascino
13-
1 Amanda Butler
14-
1 Aksel Skauge Mellbye
15-
1 AnotherButler
1615
1 ccli8
16+
1 Aksel Skauge Mellbye

features/FEATURE_UVISOR/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ If the LED is blinking, the app is running correctly. If you press the `SW2` but
310310
## Expose public secure entry points to the secure box
311311
[Go to top](#overview)
312312

313-
So far the code in the secure box cannot communicate to other boxes. To let other boxes call functions in our secure box you can define public secure entry points. These entry points can map to private functions within the context of a secure box, and the arguments and return values are automatically serialized using an RPC protocol to ensure no private memory can be leaked to external boxes.
313+
So far, the code in the secure box cannot communicate to other boxes. To let other boxes call functions in our secure box, you can define public secure entry points. These entry points can map to private functions within the context of a secure box, and an RPC protocol automatically serializes the arguments and return values to ensure no private memory can leak to external boxes.
314314

315-
You can define a public secure entry point to retrieve the index value from the secure box. This index value is increased every time the `SW2` button is pressed.
315+
You can define a public secure entry point to retrieve the index value from the secure box. This index value increases every time you press the `SW2` button.
316316

317317
### Defining a secure entry point
318318

319-
Create a new source file, `~/code/uvisor-example/source/secure_box.h`. In here we will define the functions that can be called through RPC.
319+
Create a new source file, `~/code/uvisor-example/source/secure_box.h`, where you will define the functions that you can call through RPC.
320320

321321
```cpp
322322
/* ~/code/uvisor-example/source/secure_box.h */
@@ -333,7 +333,7 @@ UVISOR_EXTERN int (*secure_get_index)(void);
333333

334334
### Implementing a secure entry point
335335

336-
Now that you have defined the secure entry point, you can map the entry point to a function running in the secure box. This is done through the `UVISOR_BOX_RPC_GATEWAY_SYNC` macro. Open `~/code/uvisor-example/source/secure_box.cpp`, and replace the line with `#define PRIVATE_BUTTON_BUFFER_COUNT 8` by:
336+
Now that you have defined the secure entry point, you can map the entry point to a function running in the secure box. You can do this through the `UVISOR_BOX_RPC_GATEWAY_SYNC` macro. Open `~/code/uvisor-example/source/secure_box.cpp`, and replace the line with `#define PRIVATE_BUTTON_BUFFER_COUNT 8` by:
337337

338338
```cpp
339339
/* ~/code/uvisor-example/source/secure_box.cpp */
@@ -351,7 +351,7 @@ UVISOR_BOX_RPC_GATEWAY_SYNC (private_button, secure_get_index, get_index, int, v
351351
352352
### Listening for RPC messages
353353
354-
To receive RPC messages you will need to spin up a new thread, running in the secure box context. You can do this in the main thread of the secure box. In `~/code/uvisor-example/source/secure_box.cpp`, replace the first five lines of `private_button_main_thread` with:
354+
To receive RPC messages, you need to spin up a new thread, running in the secure box context. You can do this in the main thread of the secure box. In `~/code/uvisor-example/source/secure_box.cpp`, replace the first five lines of `private_button_main_thread` with:
355355
356356
```cpp
357357
/* ~/code/uvisor-example/source/secure_box.cpp */
@@ -397,7 +397,7 @@ To call the public secure entry point from any other box, you can use the `secur
397397
#include "secure-box.h"
398398
```
399399

400-
And then replace the `main` function with:
400+
Then replace the `main` function with:
401401

402402
```cpp
403403
/* ~/code/uvisor-example/source/main.cpp */
@@ -412,7 +412,7 @@ int main(void)
412412
}
413413
```
414414
415-
You can observe the secure index by opening a serial port connection to the device, with a baud rate of 9600. When you press the `SW2` button the index will be increased.
415+
You can observe the secure index by opening a serial port connection to the device with a baud rate of 9600. When you press the `SW2` button, the index will increase.
416416
417417
## The NVIC APIs
418418

features/FEATURE_UVISOR/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20170407_v7-M
1+
v0.27.0-23-g8231ae897dadbb1c3eeb79ae2103d308d28c7e14

features/FEATURE_UVISOR/includes/uvisor/api/inc/box_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
2727
UVISOR_EXTERN void const * const public_box_cfg_ptr;
2828

2929
typedef struct {
30-
void (*function)(void *);
30+
void (*function)(const void *);
3131
size_t priority;
3232
size_t stack_size;
3333
} uvisor_box_main_t;

features/FEATURE_UVISOR/source/rtx/box_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void __uvisor_lib_box_init(void * lib_config)
137137
uvisor_error(USER_NOT_ALLOWED);
138138
}
139139

140-
thread_id = osThreadNew(box_main->function, NULL, &thread_attr);
140+
thread_id = osThreadNew((osThreadFunc_t) box_main->function, NULL, &thread_attr);
141141

142142
if (thread_id == NULL) {
143143
/* Failed to create thread */

0 commit comments

Comments
 (0)