2424
2525UVISOR_EXTERN const uint32_t __uvisor_mode ;
2626
27+ /** @defgroup box_config Box configuration
28+ *
29+ * @brief Creating and configuring secure boxes
30+ * @{
31+ */
32+
2733#define UVISOR_DISABLED 0
2834#define UVISOR_PERMISSIVE 1
2935#define UVISOR_ENABLED 2
@@ -54,14 +60,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
5460 \
5561 extern const __attribute__((section(".keep.uvisor.cfgtbl_ptr_first"), aligned(4))) void * const main_cfg_ptr = &main_cfg;
5662
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.
5864 * The total page heap size is at least `minimum_number_of_pages * page_size`. */
5965#define UVISOR_SET_PAGE_HEAP (page_size , minimum_number_of_pages ) \
6066 const uint32_t __uvisor_page_size = (page_size); \
6167 uint8_t __attribute__((section(".keep.uvisor.page_heap"))) \
6268 main_page_heap_reserved[ (page_size) * (minimum_number_of_pages) ]
6369
6470
71+ /** @cond UVISOR_INTERNAL */
6572/* this macro selects an overloaded macro (variable number of arguments) */
6673#define __UVISOR_BOX_MACRO (_1 , _2 , _3 , _4 , NAME , ...) NAME
6774
@@ -121,13 +128,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
121128#define UVISOR_BOX_CONFIG (...) \
122129 UVISOR_BOX_CONFIG_ACL(__VA_ARGS__)
123130
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
125134 * 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` . */
127136#define UVISOR_BOX_NAMESPACE (box_namespace ) \
128137 static const char *const __uvisor_box_namespace = box_namespace
129138
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
131140 * thread of your box will use for its body. If you don't want a main thread,
132141 * too bad: you have to have one. */
133142#define UVISOR_BOX_MAIN (function , priority , stack_size ) \
@@ -139,20 +148,30 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
139148
140149#define uvisor_ctx (*__uvisor_ps)
141150
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. */
143160UVISOR_EXTERN int uvisor_box_id_self (void );
144161
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. */
147164UVISOR_EXTERN int uvisor_box_id_caller (void );
148165
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
150167 * 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. */
156173UVISOR_EXTERN int uvisor_box_namespace (int box_id , char * box_namespace , size_t length );
157174
175+ /** @} */
176+
158177#endif /* __UVISOR_API_BOX_CONFIG_H__ */
0 commit comments