2525
2626UVISOR_EXTERN const uint32_t __uvisor_mode ;
2727
28+ /** @defgroup box_config Box configuration
29+ *
30+ * @brief Creating and configuring secure boxes
31+ * @{
32+ */
33+
2834#define UVISOR_DISABLED 0
2935#define UVISOR_PERMISSIVE 1
3036#define UVISOR_ENABLED 2
@@ -60,14 +66,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
6066 \
6167 extern const __attribute__((section(".keep.uvisor.cfgtbl_ptr_first"), aligned(4))) void * const main_cfg_ptr = &main_cfg;
6268
63- /* Creates a global page heap with at least `minimum_number_of_pages` each of size `page_size` in bytes.
69+ /** Creates a global page heap with at least `minimum_number_of_pages` each of size `page_size` in bytes.
6470 * The total page heap size is at least `minimum_number_of_pages * page_size`. */
6571#define UVISOR_SET_PAGE_HEAP (page_size , minimum_number_of_pages ) \
6672 const uint32_t __uvisor_page_size = (page_size); \
6773 uint8_t __attribute__((section(".keep.uvisor.page_heap"))) \
6874 main_page_heap_reserved[ (page_size) * (minimum_number_of_pages) ]
6975
7076
77+ /** @cond UVISOR_INTERNAL */
7178/* this macro selects an overloaded macro (variable number of arguments) */
7279#define __UVISOR_BOX_MACRO (_1 , _2 , _3 , _4 , NAME , ...) NAME
7380
@@ -135,13 +142,15 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
135142#define UVISOR_BOX_CONFIG (...) \
136143 UVISOR_BOX_CONFIG_ACL(__VA_ARGS__)
137144
138- /* Use this macro before box defintion (for example, UVISOR_BOX_CONFIG) to
145+ /** @endcond */
146+
147+ /** Use this macro before box defintion (for example, `UVISOR_BOX_CONFIG`) to
139148 * define the name of your box. If you don't want a name, use this macro with
140- * box_namespace as NULL. */
149+ * box_namespace as ` NULL` . */
141150#define UVISOR_BOX_NAMESPACE (box_namespace ) \
142151 static const char *const __uvisor_box_namespace = box_namespace
143152
144- /* Use this macro before UVISOR_BOX_CONFIG to define the function the main
153+ /** Use this macro before ` UVISOR_BOX_CONFIG` to define the function the main
145154 * thread of your box will use for its body. If you don't want a main thread,
146155 * too bad: you have to have one. */
147156#define UVISOR_BOX_MAIN (function , priority , stack_size ) \
@@ -153,13 +162,21 @@ UVISOR_EXTERN const uint32_t __uvisor_mode;
153162
154163#define uvisor_ctx (*__uvisor_ps)
155164
156- /* Copy the box namespace of the specified box ID to the memory provided by
165+ /** @} */
166+
167+ /** @addtogroup box_info
168+ * @{
169+ */
170+
171+ /** Copy the box namespace of the specified box ID to the memory provided by
157172 * 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. */
173+ * `UVISOR_MAX_BOX_NAMESPACE_LENGTH` bytes. Return how many bytes were copied into
174+ * box_namespace. Return ` UVISOR_ERROR_INVALID_BOX_ID` if the provided box ID is
175+ * invalid. Return ` UVISOR_ERROR_BUFFER_TOO_SMALL` if the provided box_namespace
176+ * is too small to hold ` MAX_BOX_NAMESPACE_LENGTH` bytes. Return
177+ * ` UVISOR_ERROR_BOX_NAMESPACE_ANONYMOUS` if the box is anonymous. */
163178UVISOR_EXTERN int uvisor_box_namespace (int box_id , char * box_namespace , size_t length );
164179
180+ /** @} */
181+
165182#endif /* __UVISOR_API_BOX_CONFIG_H__ */
0 commit comments