From 7bd8164f8ff6ffd0a9458d44e18097582adae201 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 20 Jan 2010 14:39:34 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1532 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chsem.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'os/kernel/src/chsem.c') diff --git a/os/kernel/src/chsem.c b/os/kernel/src/chsem.c index dba765da9..c78d52f74 100644 --- a/os/kernel/src/chsem.c +++ b/os/kernel/src/chsem.c @@ -86,7 +86,7 @@ void chSemResetI(Semaphore *sp, cnt_t n) { cnt = sp->s_cnt; sp->s_cnt = n; while (cnt++ < 0) - chSchReadyI(lifo_remove(&sp->s_queue))->p_rdymsg = RDY_RESET; + chSchReadyI(lifo_remove(&sp->s_queue))->p_u.rdymsg = RDY_RESET; } /** @@ -120,9 +120,9 @@ msg_t chSemWaitS(Semaphore *sp) { if (--sp->s_cnt < 0) { sem_insert(currp, &sp->s_queue); - currp->p_wtsemp = sp; - chSchGoSleepS(PRWTSEM); - return currp->p_rdymsg; + currp->p_u.wtobjp = sp; + chSchGoSleepS(THD_STATE_WTSEM); + return currp->p_u.rdymsg; } return RDY_OK; } @@ -174,8 +174,8 @@ msg_t chSemWaitTimeoutS(Semaphore *sp, systime_t time) { return RDY_TIMEOUT; } sem_insert(currp, &sp->s_queue); - currp->p_wtsemp = sp; - return chSchGoSleepTimeoutS(PRWTSEM, time); + currp->p_u.wtobjp = sp; + return chSchGoSleepTimeoutS(THD_STATE_WTSEM, time); } return RDY_OK; } @@ -213,7 +213,7 @@ void chSemSignalI(Semaphore *sp) { /* NOTE: It is done this way in order to allow a tail call on chSchReadyI().*/ Thread *tp = fifo_remove(&sp->s_queue); - tp->p_rdymsg = RDY_OK; + tp->p_u.rdymsg = RDY_OK; chSchReadyI(tp); } } @@ -236,12 +236,12 @@ msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw) { chSysLock(); if (sps->s_cnt++ < 0) - chSchReadyI(fifo_remove(&sps->s_queue))->p_rdymsg = RDY_OK; + chSchReadyI(fifo_remove(&sps->s_queue))->p_u.rdymsg = RDY_OK; if (--spw->s_cnt < 0) { sem_insert(currp, &spw->s_queue); - currp->p_wtsemp = spw; - chSchGoSleepS(PRWTSEM); - msg = currp->p_rdymsg; + currp->p_u.wtobjp = spw; + chSchGoSleepS(THD_STATE_WTSEM); + msg = currp->p_u.rdymsg; } else { chSchRescheduleS(); -- cgit v1.2.3