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 <>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <>
parent 95d40ec2
......@@ -803,6 +803,11 @@ static inline int handle_exception(struct ipipe_trap_data *d)
sched = xnsched_current();
thread = sched->curr;
if (xnthread_test_state(thread, XNROOT))
return 0;
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)
if (xnthread_test_state(thread, XNROOT))
return 0;
if (xnarch_fault_fpu_p(d)) {
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