aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chsem.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-20 14:39:34 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-01-20 14:39:34 +0000
commit7bd8164f8ff6ffd0a9458d44e18097582adae201 (patch)
tree9ef74756d9e59459d68294ed32c6d951364d7947 /os/kernel/src/chsem.c
parentca013cf8e4235a3024361009f21eb1a2d5677acf (diff)
downloadChibiOS-7bd8164f8ff6ffd0a9458d44e18097582adae201.tar.gz
ChibiOS-7bd8164f8ff6ffd0a9458d44e18097582adae201.tar.bz2
ChibiOS-7bd8164f8ff6ffd0a9458d44e18097582adae201.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1532 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chsem.c')
-rw-r--r--os/kernel/src/chsem.c22
1 files changed, 11 insertions, 11 deletions
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();