Changeset 111b9b9 in mainline for kernel/generic/src/ipc


Ignore:
Timestamp:
2023-02-11T19:13:44Z (2 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4777e02
Parents:
76e17d7c
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2022-08-15 17:46:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-11 19:13:44)
Message:

Reimplement waitq using thread_wait/wakeup

This adds a few functions to the thread API which can be
summarized as "stop running until woken up by others".
The ordering and context-switching concerns are thus yeeted
to this abstraction and waitq only deals with maintaining
the queues. Overall, this makes the control flow in waitq
much easier to navigate.

Location:
kernel/generic/src/ipc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/event.c

    r76e17d7c r111b9b9  
    169169                                    true);
    170170
    171                                 waitq_wakeup(&event->answerbox->wq,
    172                                     WAKEUP_FIRST);
     171                                waitq_wake_one(&event->answerbox->wq);
    173172
    174173                                if (mask)
  • kernel/generic/src/ipc/ipc.c

    r76e17d7c r111b9b9  
    326326                irq_spinlock_unlock(&callerbox->lock, true);
    327327
    328         waitq_wakeup(&callerbox->wq, WAKEUP_FIRST);
     328        waitq_wake_one(&callerbox->wq);
    329329}
    330330
     
    416416        irq_spinlock_unlock(&box->lock, true);
    417417
    418         waitq_wakeup(&box->wq, WAKEUP_FIRST);
     418        waitq_wake_one(&box->wq);
    419419}
    420420
     
    555555        errno_t rc;
    556556
    557         rc = waitq_sleep_timeout(&box->wq, usec, flags, NULL);
     557        rc = _waitq_sleep_timeout(&box->wq, usec, flags);
    558558        if (rc != EOK)
    559559                return rc;
  • kernel/generic/src/ipc/irq.c

    r76e17d7c r111b9b9  
    429429        irq_spinlock_unlock(&irq->notif_cfg.answerbox->irq_lock, false);
    430430
    431         waitq_wakeup(&irq->notif_cfg.answerbox->wq, WAKEUP_FIRST);
     431        waitq_wake_one(&irq->notif_cfg.answerbox->wq);
    432432}
    433433
  • kernel/generic/src/ipc/sysipc.c

    r76e17d7c r111b9b9  
    871871sys_errno_t sys_ipc_poke(void)
    872872{
    873         waitq_wakeup(&TASK->answerbox.wq, WAKEUP_FIRST);
     873        waitq_wake_one(&TASK->answerbox.wq);
    874874        return EOK;
    875875}
Note: See TracChangeset for help on using the changeset viewer.