24
24
25
25
UVISOR_EXTERN const uint32_t __uvisor_mode ;
26
26
27
+ /** @defgroup box_config Box configuration
28
+ *
29
+ * @brief Creating and configuring secure boxes
30
+ * @{
31
+ */
32
+
27
33
#define UVISOR_DISABLED 0
28
34
#define UVISOR_PERMISSIVE 1
29
35
#define UVISOR_ENABLED 2
@@ -54,14 +60,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
54
60
\
55
61
extern const __attribute__((section(".keep.uvisor.cfgtbl_ptr_first"), aligned(4))) void * const main_cfg_ptr = &main_cfg;
56
62
57
- /* Creates a global page heap with at least `minimum_number_of_pages` each of size `page_size` in bytes.
63
+ /** Creates a global page heap with at least `minimum_number_of_pages` each of size `page_size` in bytes.
58
64
* The total page heap size is at least `minimum_number_of_pages * page_size`. */
59
65
#define UVISOR_SET_PAGE_HEAP (page_size , minimum_number_of_pages ) \
60
66
const uint32_t __uvisor_page_size = (page_size); \
61
67
uint8_t __attribute__((section(".keep.uvisor.page_heap"))) \
62
68
main_page_heap_reserved[ (page_size) * (minimum_number_of_pages) ]
63
69
64
70
71
+ /** @cond UVISOR_INTERNAL */
65
72
/* this macro selects an overloaded macro (variable number of arguments) */
66
73
#define __UVISOR_BOX_MACRO (_1 , _2 , _3 , _4 , NAME , ...) NAME
67
74
@@ -121,13 +128,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
121
128
#define UVISOR_BOX_CONFIG (...) \
122
129
UVISOR_BOX_CONFIG_ACL(__VA_ARGS__)
123
130
124
- /* Use this macro before box defintion (for example, UVISOR_BOX_CONFIG) to
131
+ /** @endcond */
132
+
133
+ /** Use this macro before box defintion (for example, `UVISOR_BOX_CONFIG`) to
125
134
* define the name of your box. If you don't want a name, use this macro with
126
- * box_namespace as NULL. */
135
+ * box_namespace as ` NULL` . */
127
136
#define UVISOR_BOX_NAMESPACE (box_namespace ) \
128
137
static const char *const __uvisor_box_namespace = box_namespace
129
138
130
- /* Use this macro before UVISOR_BOX_CONFIG to define the function the main
139
+ /** Use this macro before ` UVISOR_BOX_CONFIG` to define the function the main
131
140
* thread of your box will use for its body. If you don't want a main thread,
132
141
* too bad: you have to have one. */
133
142
#define UVISOR_BOX_MAIN (function , priority , stack_size ) \
@@ -139,20 +148,30 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
139
148
140
149
#define uvisor_ctx (*__uvisor_ps)
141
150
142
- /* Return the numeric box ID of the current box. */
151
+ /** @} */
152
+
153
+ /** @defgroup box_info Box Information
154
+ *
155
+ * @brief Accessing information about own box and other boxes
156
+ * @{
157
+ */
158
+
159
+ /** @brief Return the numeric box ID of the current box. */
143
160
UVISOR_EXTERN int uvisor_box_id_self (void );
144
161
145
- /* Return the numeric box ID of the box that is calling through the most recent
146
- * secure gateway. Return -1 if there is no secure gateway calling box. */
162
+ /** @brief Return the numeric box ID of the box that is calling through the most recent
163
+ * secure gateway. @return -1 if there is no secure gateway calling box. */
147
164
UVISOR_EXTERN int uvisor_box_id_caller (void );
148
165
149
- /* Copy the box namespace of the specified box ID to the memory provided by
166
+ /** Copy the box namespace of the specified box ID to the memory provided by
150
167
* box_namespace. The box_namespace's length must be at least
151
- * MAX_BOX_NAMESPACE_LENGTH bytes. Return how many bytes were copied into
152
- * box_namespace. Return UVISOR_ERROR_INVALID_BOX_ID if the provided box ID is
153
- * invalid. Return UVISOR_ERROR_BUFFER_TOO_SMALL if the provided box_namespace
154
- * is too small to hold MAX_BOX_NAMESPACE_LENGTH bytes. Return
155
- * UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS if the box is anonymous. */
168
+ * `UVISOR_MAX_BOX_NAMESPACE_LENGTH` bytes. Return how many bytes were copied into
169
+ * box_namespace. Return ` UVISOR_ERROR_INVALID_BOX_ID` if the provided box ID is
170
+ * invalid. Return ` UVISOR_ERROR_BUFFER_TOO_SMALL` if the provided box_namespace
171
+ * is too small to hold ` MAX_BOX_NAMESPACE_LENGTH` bytes. Return
172
+ * ` UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS` if the box is anonymous. */
156
173
UVISOR_EXTERN int uvisor_box_namespace (int box_id , char * box_namespace , size_t length );
157
174
175
+ /** @} */
176
+
158
177
#endif /* __UVISOR_API_BOX_CONFIG_H__ */
0 commit comments