From 2e4ba09bb54f415e7f8fd66f4ccddbf421612820 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sun, 16 Jun 2013 16:12:33 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@5860 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chcond.c | 4 ++-- os/kernel/src/chqueues.c | 8 ++++---- os/kernel/src/chsem.c | 32 ++++++++++++++++---------------- os/kernel/src/chthreads.c | 2 +- 4 files changed, 23 insertions(+), 23 deletions(-) (limited to 'os/kernel/src') diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index c217bf6fd..0e404808f 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -68,7 +68,7 @@ void chCondSignal(CondVar *cp) { chDbgCheck(cp != NULL, "chCondSignal"); chSysLock(); - if (notempty(&cp->c_queue)) + if (queue_notempty(&cp->c_queue)) chSchWakeupS(fifo_remove(&cp->c_queue), RDY_OK); chSysUnlock(); } @@ -89,7 +89,7 @@ void chCondSignalI(CondVar *cp) { chDbgCheckClassI(); chDbgCheck(cp != NULL, "chCondSignalI"); - if (notempty(&cp->c_queue)) + if (queue_notempty(&cp->c_queue)) chSchReadyI(fifo_remove(&cp->c_queue))->p_u.rdymsg = RDY_OK; } diff --git a/os/kernel/src/chqueues.c b/os/kernel/src/chqueues.c index 871e499a0..fa2bd527b 100644 --- a/os/kernel/src/chqueues.c +++ b/os/kernel/src/chqueues.c @@ -113,7 +113,7 @@ void chIQResetI(InputQueue *iqp) { iqp->q_rdptr = iqp->q_wrptr = iqp->q_buffer; iqp->q_counter = 0; - while (notempty(&iqp->q_waiting)) + while (queue_notempty(&iqp->q_waiting)) chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_RESET; } @@ -142,7 +142,7 @@ msg_t chIQPutI(InputQueue *iqp, uint8_t b) { if (iqp->q_wrptr >= iqp->q_top) iqp->q_wrptr = iqp->q_buffer; - if (notempty(&iqp->q_waiting)) + if (queue_notempty(&iqp->q_waiting)) chSchReadyI(fifo_remove(&iqp->q_waiting))->p_u.rdymsg = Q_OK; return Q_OK; @@ -293,7 +293,7 @@ void chOQResetI(OutputQueue *oqp) { oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer; oqp->q_counter = chQSizeI(oqp); - while (notempty(&oqp->q_waiting)) + while (queue_notempty(&oqp->q_waiting)) chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_RESET; } @@ -366,7 +366,7 @@ msg_t chOQGetI(OutputQueue *oqp) { if (oqp->q_rdptr >= oqp->q_top) oqp->q_rdptr = oqp->q_buffer; - if (notempty(&oqp->q_waiting)) + if (queue_notempty(&oqp->q_waiting)) chSchReadyI(fifo_remove(&oqp->q_waiting))->p_u.rdymsg = Q_OK; return b; diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index 2dc7ee354..7ea365291 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -131,8 +131,8 @@ void chSemResetI(Semaphore *sp, cnt_t n) { chDbgCheckClassI(); chDbgCheck((sp != NULL) && (n >= 0), "chSemResetI"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemResetI(), #1", "inconsistent semaphore"); @@ -179,8 +179,8 @@ msg_t chSemWaitS(Semaphore *sp) { chDbgCheckClassS(); chDbgCheck(sp != NULL, "chSemWaitS"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemWaitS(), #1", "inconsistent semaphore"); @@ -244,8 +244,8 @@ msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time) { chDbgCheckClassS(); chDbgCheck(sp != NULL, "chSemWaitTimeoutS"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemWaitTimeoutS(), #1", "inconsistent semaphore"); @@ -271,8 +271,8 @@ msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time) { void chSemSignal(Semaphore *sp) { chDbgCheck(sp != NULL, "chSemSignal"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemSignal(), #1", "inconsistent semaphore"); @@ -297,8 +297,8 @@ void chSemSignalI(Semaphore *sp) { chDbgCheckClassI(); chDbgCheck(sp != NULL, "chSemSignalI"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemSignalI(), #1", "inconsistent semaphore"); @@ -328,8 +328,8 @@ void chSemAddCounterI(Semaphore *sp, cnt_t n) { chDbgCheckClassI(); chDbgCheck((sp != NULL) && (n > 0), "chSemAddCounterI"); - chDbgAssert(((sp->s_cnt >= 0) && isempty(&sp->s_queue)) || - ((sp->s_cnt < 0) && notempty(&sp->s_queue)), + chDbgAssert(((sp->s_cnt >= 0) && queue_isempty(&sp->s_queue)) || + ((sp->s_cnt < 0) && queue_notempty(&sp->s_queue)), "chSemAddCounterI(), #1", "inconsistent semaphore"); @@ -360,12 +360,12 @@ msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw) { msg_t msg; chDbgCheck((sps != NULL) && (spw != NULL), "chSemSignalWait"); - chDbgAssert(((sps->s_cnt >= 0) && isempty(&sps->s_queue)) || - ((sps->s_cnt < 0) && notempty(&sps->s_queue)), + chDbgAssert(((sps->s_cnt >= 0) && queue_isempty(&sps->s_queue)) || + ((sps->s_cnt < 0) && queue_notempty(&sps->s_queue)), "chSemSignalWait(), #1", "inconsistent semaphore"); - chDbgAssert(((spw->s_cnt >= 0) && isempty(&spw->s_queue)) || - ((spw->s_cnt < 0) && notempty(&spw->s_queue)), + chDbgAssert(((spw->s_cnt >= 0) && queue_isempty(&spw->s_queue)) || + ((spw->s_cnt < 0) && queue_notempty(&spw->s_queue)), "chSemSignalWait(), #2", "inconsistent semaphore"); diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c index 7652cbfb1..37d25eb7b 100644 --- a/os/kernel/src/chthreads.c +++ b/os/kernel/src/chthreads.c @@ -364,7 +364,7 @@ void chThdExitS(msg_t msg) { THREAD_EXT_EXIT_HOOK(tp); #endif #if CH_USE_WAITEXIT - while (notempty(&tp->p_waiting)) + while (list_notempty(&tp->p_waiting)) chSchReadyI(list_remove(&tp->p_waiting)); #endif #if CH_USE_REGISTRY -- cgit v1.2.3