Fixed bug 2846336.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/stable_1.2.x@1126 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2009-08-29 08:44:30 +00:00
parent 77d822dba1
commit d932ac1121
4 changed files with 9 additions and 10 deletions

View File

@ -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).

View File

@ -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

View File

@ -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. */

View File

@ -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); \
} \
} \