void fiber_abort(void) { _context_exit(_nanokernel.current); if (_ScbIsInThreadMode()) { _nano_fiber_swap(); } else { _ScbPendsvSet(); } }
/** * * @brief Abort the current task * * Possible reasons for a task aborting: * * - the task explicitly aborts itself by calling this routine * - the task implicitly aborts by returning from its entry point * - the task encounters a fatal exception * * @return N/A */ void _TaskAbort(void) { const int taskAbortCode = 1; if (_ScbIsInThreadMode()) { _task_ioctl(_k_current_task->id, taskAbortCode); } else { cmd_packet.Comm = _K_SVC_TASK_OP; cmd_packet.args.g1.task = _k_current_task->id; cmd_packet.args.g1.opt = taskAbortCode; cmd_packet.alloc = false; _k_current_task->args = &cmd_packet; nano_isr_stack_push(&_k_command_stack, (uint32_t) &cmd_packet); _ScbPendsvSet(); } }
static void software_reboot(void) { extern void _do_software_reboot(void); extern void _force_exit_one_nested_irq(void); /* * force enable interrupts locked via PRIMASK if somehow disabled: the * boot code does not enable them */ __asm__ volatile("cpsie i" :::); if (_ScbIsInThreadMode()) { _do_software_reboot(); } else { __asm__ volatile( "ldr r0, =_force_exit_one_nested_irq\n\t" "bx r0\n\t" :::); } }