diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-01-20 14:39:34 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-01-20 14:39:34 +0000 |
commit | 7bd8164f8ff6ffd0a9458d44e18097582adae201 (patch) | |
tree | 9ef74756d9e59459d68294ed32c6d951364d7947 /os/kernel/src/chschd.c | |
parent | ca013cf8e4235a3024361009f21eb1a2d5677acf (diff) | |
download | ChibiOS-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/chschd.c')
-rw-r--r-- | os/kernel/src/chschd.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 15f7a1a16..f7be9c6a8 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -60,7 +60,7 @@ Thread *chSchReadyI(Thread *tp) { #endif Thread *cp; - tp->p_state = PRREADY; + tp->p_state = THD_STATE_READY; cp = (Thread *)&rlist.r_queue; do { cp = cp->p_next; @@ -82,7 +82,7 @@ void chSchGoSleepS(tstate_t newstate) { Thread *otp; (otp = currp)->p_state = newstate; - (currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR; + (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT; #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif @@ -99,21 +99,21 @@ static void wakeup(void *p) { #if CH_USE_SEMAPHORES || CH_USE_MUTEXES || CH_USE_CONDVARS switch (tp->p_state) { #if CH_USE_SEMAPHORES - case PRWTSEM: - chSemFastSignalI(tp->p_wtsemp); + case THD_STATE_WTSEM: + chSemFastSignalI((Semaphore *)tp->p_u.wtobjp); /* Falls into, intentional. */ #endif #if CH_USE_MUTEXES - case PRWTMTX: + case THD_STATE_WTMTX: #endif #if CH_USE_CONDVARS - case PRWTCOND: + case THD_STATE_WTCOND: #endif /* States requiring dequeuing.*/ dequeue(tp); } #endif - chSchReadyI(tp)->p_rdymsg = RDY_TIMEOUT; + chSchReadyI(tp)->p_u.rdymsg = RDY_TIMEOUT; } /** @@ -149,7 +149,7 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { } else chSchGoSleepS(newstate); - return currp->p_rdymsg; + return currp->p_u.rdymsg; } /** @@ -166,7 +166,7 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { */ void chSchWakeupS(Thread *ntp, msg_t msg) { - ntp->p_rdymsg = msg; + ntp->p_u.rdymsg = msg; /* If the waken thread has a not-greater priority than the current * one then it is just inserted in the ready list else it made * running immediately and the invoking thread goes in the ready @@ -179,7 +179,7 @@ void chSchWakeupS(Thread *ntp, msg_t msg) { #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif - (currp = ntp)->p_state = PRCURR; + (currp = ntp)->p_state = THD_STATE_CURRENT; chDbgTrace(otp, ntp); chSysSwitchI(otp, ntp); } @@ -195,7 +195,7 @@ void chSchDoRescheduleI(void) { Thread *otp = currp; /* Pick the first thread from the ready queue and makes it current.*/ - (currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR; + (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT; chSchReadyI(otp); #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; @@ -258,7 +258,7 @@ void chSchDoYieldS(void) { * ready list there is at least one thread with priority equal or higher * than the current one. */ - otp->p_state = PRREADY; + otp->p_state = THD_STATE_READY; do { cp = cp->p_prev; } while (cp->p_prio < otp->p_prio); @@ -267,7 +267,7 @@ void chSchDoYieldS(void) { otp->p_next->p_prev = cp->p_next = otp; /* Pick the first thread from the ready queue and makes it current.*/ - (currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR; + (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT; #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif |