Skip to content

Commit fd7d5ec

Browse files
authored
Merge pull request #3270 from AlessandroA/update_uvisor
uVisor: Update to v0.26.1
2 parents 082159f + 1321e12 commit fd7d5ec

30 files changed

+253
-196
lines changed

features/FEATURE_UVISOR/AUTHORS.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
569 Milosch Meriac
2-
478 Alessandro Angelino
3-
73 Jaeden Amero
4-
54 Niklas Hauser
5-
3 Hugo Vincent
1+
584 Milosch Meriac
2+
501 Alessandro Angelino
3+
95 Jaeden Amero
4+
61 Niklas Hauser
5+
4 Irit Arkin
66
3 JaredCJR
77
3 Jim Huang
8-
2 Vincenzo Frascino
8+
3 Hugo Vincent
99
2 tonyyanxuan
10+
2 Vincenzo Frascino
1011
1 Aksel Skauge Mellbye
11-
1 Irit Arkin
12-
1 Nathan Chong
1312
1 ccli8
13+
1 Nathan Chong

features/FEATURE_UVISOR/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.25.1
1+
v0.26.1

features/FEATURE_UVISOR/importer/Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ publish: rsync TARGET_M3 TARGET_M4
9696
#
9797
# Rename target directorires to TARGET_* filters...
9898
$(foreach target, $(TARGET_TRANSLATION),mv $(TARGET_SUPPORTED)/$(subst .,,$(suffix $(target))) $(TARGET_SUPPORTED)/TARGET_$(basename $(target));)
99+
#
100+
# Updating checked out version tag
101+
git -C $(UVISOR_DIR) describe --tags --abbrev=40 --dirty > $(TARGET_PREFIX)VERSION.txt
102+
#
103+
# Updated list of authors, sorted by contributions
104+
git -C $(UVISOR_DIR) shortlog -s -n > $(TARGET_PREFIX)AUTHORS.txt
99105

100106
uvisor-compile: $(UVISOR_GIT_CFG)
101107
make -C $(UVISOR_DIR)
@@ -104,12 +110,6 @@ update: $(UVISOR_GIT_CFG)
104110
#
105111
# Updating to latest uVisor library version
106112
git -C $(UVISOR_DIR) pull --rebase
107-
#
108-
# Updating checked out version tag
109-
git -C $(UVISOR_DIR) describe --tags --abbrev=40 --dirty > $(TARGET_PREFIX)VERSION.txt
110-
#
111-
# Updated list of authors, sorted by contributions
112-
git -C $(UVISOR_DIR) shortlog -s -n > $(TARGET_PREFIX)AUTHORS.txt
113113

114114
$(UVISOR_GIT_CFG):
115115
rm -rf $(UVISOR_DIR)
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Copyright (c) 2016, ARM Limited, All Rights Reserved
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
6+
* not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#ifndef __UVISOR_API_H__
18+
#define __UVISOR_API_H__
19+
20+
#include "rt_OsEventObserver.h"
21+
#include "api/inc/uvisor_exports.h"
22+
#include "api/inc/unvic_exports.h"
23+
#include "api/inc/debug_exports.h"
24+
#include "api/inc/halt_exports.h"
25+
#include "api/inc/pool_queue_exports.h"
26+
#include "api/inc/page_allocator_exports.h"
27+
#include <stdint.h>
28+
29+
#define UVISOR_API_MAGIC 0x5C9411B4
30+
#define UVISOR_API_VERSION (10)
31+
32+
UVISOR_EXTERN_C_BEGIN
33+
34+
extern void uvisor_init(void);
35+
36+
typedef struct {
37+
uint32_t magic;
38+
uint32_t (*get_version)(uint32_t);
39+
40+
void (*init)(void);
41+
42+
void (*irq_enable)(uint32_t irqn);
43+
void (*irq_disable)(uint32_t irqn);
44+
void (*irq_disable_all)(void);
45+
void (*irq_enable_all)(void);
46+
void (*irq_set_vector)(uint32_t irqn, uint32_t vector);
47+
uint32_t (*irq_get_vector)(uint32_t irqn);
48+
void (*irq_set_priority)(uint32_t irqn, uint32_t priority);
49+
uint32_t (*irq_get_priority)(uint32_t irqn);
50+
void (*irq_set_pending)(uint32_t irqn);
51+
uint32_t (*irq_get_pending)(uint32_t irqn);
52+
void (*irq_clear_pending)(uint32_t irqn);
53+
int (*irq_get_level)(void);
54+
void (*irq_system_reset)(TResetReason reason);
55+
56+
int (*page_malloc)(UvisorPageTable * const table);
57+
int (*page_free)(const UvisorPageTable * const table);
58+
59+
int (*box_namespace)(int box_id, char *box_namespace, size_t length);
60+
61+
void (*debug_init)(const TUvisorDebugDriver * const driver);
62+
void (*error)(THaltUserError reason);
63+
void (*vmpu_mem_invalidate)(void);
64+
65+
int (*pool_init)(uvisor_pool_t *, void *, size_t, size_t, int);
66+
int (*pool_queue_init)(uvisor_pool_queue_t *, uvisor_pool_t *, void *, size_t, size_t, int);
67+
uvisor_pool_slot_t (*pool_allocate)(uvisor_pool_t *, uint32_t);
68+
void (*pool_queue_enqueue)(uvisor_pool_queue_t *, uvisor_pool_slot_t);
69+
uvisor_pool_slot_t (*pool_free)(uvisor_pool_t *, uvisor_pool_slot_t);
70+
uvisor_pool_slot_t (*pool_queue_dequeue)(uvisor_pool_queue_t *, uvisor_pool_slot_t);
71+
uvisor_pool_slot_t (*pool_queue_dequeue_first)(uvisor_pool_queue_t *);
72+
uvisor_pool_slot_t (*pool_queue_find_first)(uvisor_pool_queue_t *, TQueryFN_Ptr, void *);
73+
74+
OsEventObserver os_event_observer;
75+
} UVISOR_PACKED UvisorApi;
76+
77+
extern UvisorApi uvisor_api;
78+
79+
static UVISOR_FORCEINLINE uint32_t uvisor_get_version(void)
80+
{
81+
return uvisor_api.get_version(UVISOR_API_VERSION);
82+
}
83+
84+
UVISOR_EXTERN_C_END
85+
86+
#endif /* __UVISOR_API_H__ */

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <stdint.h>
2525

2626
UVISOR_EXTERN const uint32_t __uvisor_mode;
27+
UVISOR_EXTERN void const * const main_cfg_ptr;
2728

2829
#define UVISOR_DISABLED 0
2930
#define UVISOR_PERMISSIVE 1
@@ -58,7 +59,7 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
5859
acl_list_count \
5960
}; \
6061
\
61-
extern const __attribute__((section(".keep.uvisor.cfgtbl_ptr_first"), aligned(4))) void * const main_cfg_ptr = &main_cfg;
62+
UVISOR_EXTERN const __attribute__((section(".keep.uvisor.cfgtbl_ptr_first"), aligned(4))) void * const main_cfg_ptr = &main_cfg;
6263

6364
/* Creates a global page heap with at least `minimum_number_of_pages` each of size `page_size` in bytes.
6465
* The total page heap size is at least `minimum_number_of_pages * page_size`. */
@@ -106,7 +107,10 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
106107
acl_list_count \
107108
}; \
108109
\
109-
extern const __attribute__((section(".keep.uvisor.cfgtbl_ptr"), aligned(4))) void * const box_name ## _cfg_ptr = &box_name ## _cfg;
110+
UVISOR_EXTERN const __attribute__((section(".keep.uvisor.cfgtbl_ptr"), aligned(4))) void * const box_name ## _cfg_ptr = &box_name ## _cfg;
111+
112+
#define UVISOR_BOX_EXTERN(box_name) \
113+
UVISOR_EXTERN const __attribute__((section(".keep.uvisor.cfgtbl_ptr"), aligned(4))) void * const box_name ## _cfg_ptr;
110114

111115
#define __UVISOR_BOX_CONFIG_NOCONTEXT(box_name, acl_list, stack_size) \
112116
__UVISOR_BOX_CONFIG(box_name, acl_list, UVISOR_ARRAY_COUNT(acl_list), stack_size, 0) \
@@ -153,13 +157,4 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
153157

154158
#define uvisor_ctx (*__uvisor_ps)
155159

156-
/* Copy the box namespace of the specified box ID to the memory provided by
157-
* box_namespace. The box_namespace's length must be at least
158-
* MAX_BOX_NAMESPACE_LENGTH bytes. Return how many bytes were copied into
159-
* box_namespace. Return UVISOR_ERROR_INVALID_BOX_ID if the provided box ID is
160-
* invalid. Return UVISOR_ERROR_BUFFER_TOO_SMALL if the provided box_namespace
161-
* is too small to hold MAX_BOX_NAMESPACE_LENGTH bytes. Return
162-
* UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS if the box is anonymous. */
163-
UVISOR_EXTERN int uvisor_box_namespace(int box_id, char *box_namespace, size_t length);
164-
165160
#endif /* __UVISOR_API_BOX_CONFIG_H__ */

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

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,29 @@
1717
#ifndef __UVISOR_API_BOX_ID_H__
1818
#define __UVISOR_API_BOX_ID_H__
1919

20-
#include "api/inc/uvisor_exports.h"
20+
#include "api/inc/api.h"
21+
22+
UVISOR_EXTERN_C_BEGIN
2123

2224
/* Return the numeric box ID of the current box. */
23-
UVISOR_EXTERN int uvisor_box_id_self(void);
25+
int uvisor_box_id_self(void);
2426

2527
/* Return the numeric box ID of the box that is calling through the most recent
2628
* secure gateway. Return -1 if there is no secure gateway calling box. */
27-
UVISOR_EXTERN int uvisor_box_id_caller(void) UVISOR_DEPRECATED;
29+
int uvisor_box_id_caller(void) UVISOR_DEPRECATED;
30+
31+
/* Copy the box namespace of the specified box ID to the memory provided by
32+
* box_namespace. The box_namespace's length must be at least
33+
* MAX_BOX_NAMESPACE_LENGTH bytes. Return how many bytes were copied into
34+
* box_namespace. Return UVISOR_ERROR_INVALID_BOX_ID if the provided box ID is
35+
* invalid. Return UVISOR_ERROR_BUFFER_TOO_SMALL if the provided box_namespace
36+
* is too small to hold MAX_BOX_NAMESPACE_LENGTH bytes. Return
37+
* UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS if the box is anonymous. */
38+
static UVISOR_FORCEINLINE int uvisor_box_namespace(int box_id, char *box_namespace, size_t length)
39+
{
40+
return uvisor_api.box_namespace(box_id, box_namespace, length);
41+
}
42+
43+
UVISOR_EXTERN_C_END
2844

2945
#endif /* __UVISOR_API_BOX_ID_H__ */

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
#include "api/inc/debug_exports.h"
2121
#include "api/inc/uvisor_exports.h"
2222

23-
UVISOR_EXTERN void uvisor_debug_init(const TUvisorDebugDriver * const driver);
23+
UVISOR_EXTERN_C_BEGIN
24+
25+
static UVISOR_FORCEINLINE void uvisor_debug_init(const TUvisorDebugDriver * const driver)
26+
{
27+
uvisor_api.debug_init(driver);
28+
}
29+
30+
UVISOR_EXTERN_C_END
2431

2532
#endif /* __UVISOR_API_DEBUG_H__ */

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@
1919

2020
#include "api/inc/halt_exports.h"
2121
#include "api/inc/uvisor_exports.h"
22+
#include "api/inc/api.h"
2223

23-
UVISOR_EXTERN void uvisor_error(THaltUserError reason);
24+
UVISOR_EXTERN_C_BEGIN
25+
26+
static UVISOR_FORCEINLINE void uvisor_error(THaltUserError reason)
27+
{
28+
uvisor_api.error(reason);
29+
}
30+
31+
UVISOR_EXTERN_C_END
2432

2533
#endif /* __UVISOR_API_ERROR_H__ */

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

Lines changed: 0 additions & 60 deletions
This file was deleted.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define UVISOR_ERROR_OUT_OF_STRUCTURES (-7)
2626
#define UVISOR_ERROR_INVALID_PARAMETERS (-8)
2727
#define UVISOR_ERROR_NOT_IMPLEMENTED (-9)
28+
#define UVISOR_ERROR_TIMEOUT (-10)
2829

2930

3031
#define UVISOR_ERROR_CLASS_MASK (0xFFFF0000UL)

0 commit comments

Comments
 (0)