Backport struct qh changes from master.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka
2022-04-21 13:01:30 +09:00
parent daca396027
commit fdbe91600d
4 changed files with 132 additions and 80 deletions

View File

@@ -267,7 +267,7 @@ chx_cpu_sched_unlock (void)
void
chx_handle_intr (void)
{
struct chx_pq *p;
struct chx_qh *q;
register uint32_t irq_num;
asm volatile ("mrs %0, IPSR\n\t"
@@ -276,16 +276,20 @@ chx_handle_intr (void)
chx_disable_intr (irq_num);
chx_spin_lock (&q_intr.lock);
FOR_QUEUE (p, (&q_intr.q), struct chx_pq *)
if (p->v == irq_num)
{ /* should be one at most. */
struct chx_px *px = (struct chx_px *)p;
for (q = q_intr.q.next; q != &q_intr.q; q = q->next)
{
struct chx_pq *p = (struct chx_pq *)q;
ll_dequeue (p);
chx_wakeup (p);
chx_request_preemption (px->master->prio);
break;
}
if (p->v == irq_num)
{ /* should be one at most. */
struct chx_px *px = (struct chx_px *)p;
ll_dequeue (p);
chx_wakeup (p);
chx_request_preemption (px->master->prio);
break;
}
}
chx_spin_unlock (&q_intr.lock);
}