Skip to content

Commit 7d1959a

Browse files
authored
Merge pull request #23 from AlessandroA/backwards_comp
Define symbol to context pointer
2 parents 876c7b5 + 500802e commit 7d1959a

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

source/client_a.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ UVISOR_BOX_HEAPSIZE(3072);
3737
UVISOR_BOX_MAIN(client_a_main, osPriorityNormal, 512);
3838
UVISOR_BOX_CONFIG(secure_number_client_a, acl, 512, box_context);
3939

40+
/* FIXME: The guard is needed for backwards-compatibility reasons. Remove it
41+
* when mbed OS is updated. */
42+
#ifdef __uvisor_ctx
43+
#define uvisor_ctx ((my_box_context *) __uvisor_ctx)
44+
#endif
45+
4046
static uint32_t get_a_number()
4147
{
4248
/* Such random. Many secure. Much bits. Wow. */

source/client_b.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ UVISOR_BOX_HEAPSIZE(3072);
3838
UVISOR_BOX_MAIN(client_b_main, osPriorityNormal, 1024);
3939
UVISOR_BOX_CONFIG(secure_number_client_b, acl, 512, box_context);
4040

41+
/* FIXME: The guard is needed for backwards-compatibility reasons. Remove it
42+
* when mbed OS is updated. */
43+
#ifdef __uvisor_ctx
44+
#define uvisor_ctx ((my_box_context *) __uvisor_ctx)
45+
#endif
46+
4147
static uint32_t get_a_number()
4248
{
4349
/* Such random. Many secure. Much bits. Wow. */

source/secure_number.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ UVISOR_BOX_HEAPSIZE(3072);
3939
UVISOR_BOX_MAIN(number_store_main, osPriorityNormal, UVISOR_BOX_STACK_SIZE);
4040
UVISOR_BOX_CONFIG(box_number_store, acl, UVISOR_BOX_STACK_SIZE, box_context);
4141

42+
/* FIXME: The guard is needed for backwards-compatibility reasons. Remove it
43+
* when mbed OS is updated. */
44+
#ifdef __uvisor_ctx
45+
#define uvisor_ctx ((my_box_context *) __uvisor_ctx)
46+
#endif
47+
4248
/* Gateways */
4349
UVISOR_BOX_RPC_GATEWAY_SYNC (box_number_store, secure_number_get_number, get_number, uint32_t, void);
4450
UVISOR_BOX_RPC_GATEWAY_ASYNC(box_number_store, secure_number_set_number, set_number, int, uint32_t);

0 commit comments

Comments
 (0)