Commit 58f7c2f8 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/process: skip trap handling for the root thread

Bottom line: the root thread is special, in that it must always be in
a runnable state, never bear any blocking bit.

Running the trap handler when sched->curr points at the root thread
means that we got a synchronous exception while running regular root
context code on the head stage, which is not related to any action we
might want to perform in the handler for Cobalt threads. Return early
in such a case.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 95d40ec2
......@@ -803,6 +803,11 @@ static inline int handle_exception(struct ipipe_trap_data *d)
sched = xnsched_current();
thread = sched->curr;
trace_cobalt_thread_fault(d);
if (xnthread_test_state(thread, XNROOT))
return 0;
#ifdef IPIPE_KEVT_USERINTRET
if (xnarch_fault_bp_p(d) && user_mode(d->regs)) {
spl_t s;
......@@ -817,11 +822,6 @@ static inline int handle_exception(struct ipipe_trap_data *d)
}
#endif
if (xnthread_test_state(thread, XNROOT))
return 0;
trace_cobalt_thread_fault(d);
if (xnarch_fault_fpu_p(d)) {
#ifdef CONFIG_XENO_ARCH_FPU
spl_t s;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment