diff --git a/readme.txt b/readme.txt index 758b93f8c..dc877ca88 100644 --- a/readme.txt +++ b/readme.txt @@ -3,6 +3,7 @@ ***************************************************************************** *** 1.2.4 *** +- FIX: Fixed GCC 4.4.x aliasing warnings (bug 2846336). - FIX: Modified linker scripts for GCC 4.4.x (bug 2846302). - FIX: Fixed the CH_OPTIMIZE_SPEED option in the CM3 port (bug 2846278). - FIX: Fixed GCC 4.4.x related problems in CM3 port (bug 2846162). diff --git a/src/chschd.c b/src/chschd.c index aefe4355b..f072a8c3f 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -44,7 +44,7 @@ ReadyList rlist; */ void scheduler_init(void) { - queue_init(&rlist); + queue_init(&rlist.r_queue); rlist.r_prio = NOPRIO; #if CH_USE_ROUNDROBIN rlist.r_preempt = CH_TIME_QUANTUM; @@ -89,7 +89,7 @@ void chSchGoSleepS(tstate_t newstate) { Thread *otp; (otp = currp)->p_state = newstate; - (currp = fifo_remove((void *)&rlist))->p_state = PRCURR; + (currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR; #if CH_USE_ROUNDROBIN rlist.r_preempt = CH_TIME_QUANTUM; #endif @@ -198,7 +198,7 @@ void chSchDoRescheduleI(void) { Thread *otp = currp; /* pick the first thread from the ready queue and makes it current */ - (currp = fifo_remove((void *)&rlist))->p_state = PRCURR; + (currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR; chSchReadyI(otp); #if CH_USE_ROUNDROBIN rlist.r_preempt = CH_TIME_QUANTUM; @@ -215,7 +215,7 @@ void chSchDoRescheduleI(void) { void chSchRescheduleS(void) { /* first thread in the runnable queue has higher priority than the running * thread? */ - if (firstprio(&rlist) > currp->p_prio) + if (firstprio(&rlist.r_queue) > currp->p_prio) chSchDoRescheduleI(); } @@ -228,7 +228,7 @@ void chSchRescheduleS(void) { * @retval FALSE if a reschedulation is not required. */ bool_t chSchRescRequiredI(void) { - tprio_t p1 = firstprio(&rlist); + tprio_t p1 = firstprio(&rlist.r_queue); tprio_t p2 = currp->p_prio; #if CH_USE_ROUNDROBIN /* If the running thread has not reached its time quantum, reschedule only diff --git a/src/include/scheduler.h b/src/include/scheduler.h index 4149eab17..b10a9aa8e 100644 --- a/src/include/scheduler.h +++ b/src/include/scheduler.h @@ -71,10 +71,7 @@ * @extends ThreadsQueue */ typedef struct { - Thread *p_next; /**< Next @p Thread in the ready list.*/ - Thread *p_prev; /**< Previous @p Thread in the ready - list.*/ - /* End of the fields shared with the ThreadsQueue structure. */ + ThreadsQueue r_queue; /**< Threads queue.*/ tprio_t r_prio; /**< This field must be initialized to zero.*/ /* End of the fields shared with the Thread structure. */ diff --git a/src/include/vt.h b/src/include/vt.h index 45ed3b275..58c171a0b 100644 --- a/src/include/vt.h +++ b/src/include/vt.h @@ -96,7 +96,8 @@ extern VTList vtlist; while (!(vtp = vtlist.vt_next)->vt_time) { \ vtfunc_t fn = vtp->vt_func; \ vtp->vt_func = NULL; \ - (vtp->vt_next->vt_prev = (void *)&vtlist)->vt_next = vtp->vt_next;\ + vtp->vt_next->vt_prev = (void *)&vtlist; \ + (&vtlist)->vt_next = vtp->vt_next; \ fn(vtp->vt_par); \ } \ } \