aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chsem.c
diff options
context:
space:
mode:
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();