Changeset 4c78104 in mainline for kernel/generic/src/synch/waitq.c


Ignore:
Timestamp:
2023-02-09T16:55:34Z (2 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e994898
Parents:
c0b54c9
Message:

Get rid of waitq_count_get/set

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/synch/waitq.c

    rc0b54c9 r4c78104  
    7575        irq_spinlock_initialize(&wq->lock, "wq.lock");
    7676        list_initialize(&wq->sleepers);
     77}
     78
     79void waitq_initialize_with_count(waitq_t *wq, int count)
     80{
     81        memsetb(wq, sizeof(*wq), 0);
     82        irq_spinlock_initialize(&wq->lock, "wq.lock");
     83        list_initialize(&wq->sleepers);
     84        wq->missed_wakeups = count;
    7785}
    7886
     
    545553}
    546554
    547 /** Get the missed wakeups count.
    548  *
    549  * @param wq    Pointer to wait queue.
    550  * @return      The wait queue's missed_wakeups count.
    551  */
    552 int waitq_count_get(waitq_t *wq)
    553 {
    554         int cnt;
    555 
    556         irq_spinlock_lock(&wq->lock, true);
    557         cnt = wq->missed_wakeups;
    558         irq_spinlock_unlock(&wq->lock, true);
    559 
    560         return cnt;
    561 }
    562 
    563 /** Set the missed wakeups count.
    564  *
    565  * @param wq    Pointer to wait queue.
    566  * @param val   New value of the missed_wakeups count.
    567  */
    568 void waitq_count_set(waitq_t *wq, int val)
    569 {
    570         irq_spinlock_lock(&wq->lock, true);
    571         wq->missed_wakeups = val;
    572         irq_spinlock_unlock(&wq->lock, true);
    573 }
    574 
    575555/** @}
    576556 */
Note: See TracChangeset for help on using the changeset viewer.