Skip to content

Commit 6808692

Browse files
committed
tuxedo: fix resume/suspend of higher prio thread within the same ISR
1 parent 9048464 commit 6808692

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tuxedo/thread.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,18 @@ void KThreadSuspend(KThread* t)
133133
t->state = KTHR_STATE_WAITING;
134134
t->wait.queue = NULL;
135135

136-
if (self == t) {
137-
KThread* next = KThreadFindRunnable(s_firstThread);
136+
KThread* next = NULL;
137+
if (t == self || t == __ppc_next_ctx) {
138+
next = KThreadFindRunnable(s_firstThread);
139+
}
140+
141+
if (t == self) {
138142
KThreadSwitchTo(next, st);
139143
} else {
144+
if (t == __ppc_next_ctx) {
145+
__ppc_next_ctx = next != self ? next : NULL;
146+
}
147+
140148
PPCIrqUnlockByMsr(st);
141149
}
142150
}

0 commit comments

Comments
 (0)