aboutsummaryrefslogtreecommitdiffstats
path: root/src/chschd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/chschd.c')
-rw-r--r--src/chschd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/chschd.c b/src/chschd.c
index 52d2b5566..1f8b2413d 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -34,7 +34,7 @@ ReadyList rlist;
*/
void chSchInit(void) {
- queue_init(&rlist.r_queue);
+ queue_init(&rlist);
rlist.r_prio = NOPRIO;
#ifdef CH_USE_ROUNDROBIN
rlist.r_preempt = CH_TIME_QUANTUM;
@@ -60,7 +60,7 @@ Thread *chSchReadyI(Thread *tp) {
Thread *cp;
tp->p_state = PRREADY;
- cp = rlist.r_queue.p_next;
+ cp = rlist.p_next;
while (cp->p_prio >= tp->p_prio)
cp = cp->p_next;
/* Insertion on p_prev.*/
@@ -81,7 +81,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((void *)&rlist))->p_state = PRCURR;
#ifdef CH_USE_ROUNDROBIN
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
@@ -178,7 +178,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((void *)&rlist))->p_state = PRCURR;
chSchReadyI(otp);
#ifdef CH_USE_ROUNDROBIN
rlist.r_preempt = CH_TIME_QUANTUM;
@@ -200,7 +200,7 @@ void chSchDoRescheduleI(void) {
void chSchRescheduleS(void) {
/* first thread in the runnable queue has higher priority than the running
* thread? */
- if (firstprio(&rlist.r_queue) > currp->p_prio)
+ if (firstprio(&rlist) > currp->p_prio)
chSchDoRescheduleI();
}
@@ -211,7 +211,7 @@ void chSchRescheduleS(void) {
* @retval FALSE if a reschedulation is not required.
*/
bool_t chSchRescRequiredI(void) {
- tprio_t p1 = firstprio(&rlist.r_queue);
+ tprio_t p1 = firstprio(&rlist);
tprio_t p2 = currp->p_prio;
#ifdef CH_USE_ROUNDROBIN
/* If the running thread has not reached its time quantum, reschedule only