@@ -156,20 +156,15 @@ void debug_fault(THaltError reason, uint32_t lr, uint32_t sp)
156
156
DEBUG_PRINT_END ();
157
157
}
158
158
159
- static void __debug_reboot (void )
159
+ static void debug_die (void )
160
160
{
161
- UVISOR_SVC (UVISOR_SVC_ID_DEBUG_REBOOT , "" );
161
+ UVISOR_SVC (UVISOR_SVC_ID_HALT_USER_ERR , "" , DEBUG_BOX_HALT );
162
162
}
163
163
164
- /* This function must be called as an SVCall handler.
165
- * All debug handlers that are required to reboot upon exit should use the
166
- * __debug_reboot function as return value, which triggers the SVCall. This note
167
- * applies to uVisor internally, as the actual debug box does not need to care
168
- * about this. */
164
+ /* FIXME: The halt will be replaced with a proper return code. An ACL will be
165
+ * created to allow single boxes to reset the device. */
169
166
void debug_reboot (void )
170
167
{
171
- /* FIXME: The halt will be replaced with a proper return code. An ACL will
172
- * be created to allow single boxes to reset the device. */
173
168
if (!g_debug_box .initialized || g_active_box != g_debug_box .box_id ) {
174
169
HALT_ERROR (NOT_ALLOWED , "This function can only be called from the context of an initialized debug box.\n\r" );
175
170
}
@@ -180,8 +175,7 @@ void debug_reboot(void)
180
175
}
181
176
182
177
/* FIXME: Currently it is not possible to return to a regular execution flow
183
- * after the execution of the debug box handler. It is possible to
184
- * reboot, though. */
178
+ * after the execution of the debug box handler. */
185
179
static void debug_deprivilege_and_return (void * debug_handler , void * return_handler ,
186
180
uint32_t a0 , uint32_t a1 , uint32_t a2 , uint32_t a3 )
187
181
{
@@ -230,7 +224,7 @@ void debug_halt_error(THaltError reason)
230
224
/* If the debug box does not exist (or it has not been initialized yet), or
231
225
* the debug box was already called once, just loop forever. */
232
226
if (!g_debug_box .initialized || debugged_once_before ) {
233
- while (1 );
227
+ while (1 );
234
228
} else {
235
229
/* Remember that debug_deprivilege_and_return() has been called once.
236
230
* We'll reboot after the debug handler is run, so this will go back to
@@ -239,8 +233,8 @@ void debug_halt_error(THaltError reason)
239
233
240
234
/* The following arguments are passed to the destination function:
241
235
* 1. reason
242
- * Upon return from the debug handler, the system will reboot . */
243
- debug_deprivilege_and_return (g_debug_box .driver -> halt_error , __debug_reboot , reason , 0 , 0 , 0 );
236
+ * Upon return from the debug handler, we will die . */
237
+ debug_deprivilege_and_return (g_debug_box .driver -> halt_error , debug_die , reason , 0 , 0 , 0 );
244
238
}
245
239
}
246
240
0 commit comments