diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-11-05 20:56:55 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-11-05 20:56:55 +0000 |
commit | 48d294c62faa98341ff461decdd74b5f8c5f12d2 (patch) | |
tree | e7efd010ae1d9b69adaf19440c69d9e84ad01cd5 | |
parent | 2f4fcf6b6772a41102d7eb416a63786b7b9680e9 (diff) | |
download | ChibiOS-48d294c62faa98341ff461decdd74b5f8c5f12d2.tar.gz ChibiOS-48d294c62faa98341ff461decdd74b5f8c5f12d2.tar.bz2 ChibiOS-48d294c62faa98341ff461decdd74b5f8c5f12d2.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@499 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | docs/reports/MSP430F1611-0.75.txt | 4 | ||||
-rw-r--r-- | readme.txt | 1 | ||||
-rw-r--r-- | src/chschd.c | 12 | ||||
-rw-r--r-- | src/include/scheduler.h | 8 |
4 files changed, 18 insertions, 7 deletions
diff --git a/docs/reports/MSP430F1611-0.75.txt b/docs/reports/MSP430F1611-0.75.txt index 2bd16df83..88ce0dde1 100644 --- a/docs/reports/MSP430F1611-0.75.txt +++ b/docs/reports/MSP430F1611-0.75.txt @@ -71,5 +71,9 @@ Settings: MCLK=DCOCLK 750Khz --- Score : 5432 bytes/S
--- Result: SUCCESS
---------------------------------------------------------------------------
+--- Test Case 20 (Benchmark, virtual timers set/reset)
+--- Score : 5636 timers/S
+--- Result: SUCCESS
+---------------------------------------------------------------------------
Final result: SUCCESS
diff --git a/readme.txt b/readme.txt index 3c5edfa75..b2508d42c 100644 --- a/readme.txt +++ b/readme.txt @@ -77,6 +77,7 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, - Added a new benchmark to the test suite (timers set/reset performance).
- Renamed the macro fifo_init() to queue_init() because it is used to init
both FIFO queues and priority queues.
+- Fixes and improvements to the documentation.
*** 0.7.3 ***
- FIX: Fixed a bug in chThdSleepUntil(), this API is no more a macro now.
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 diff --git a/src/include/scheduler.h b/src/include/scheduler.h index 194187be9..dbeb8ee1e 100644 --- a/src/include/scheduler.h +++ b/src/include/scheduler.h @@ -57,8 +57,14 @@ * @extends ThreadsQueue */ typedef struct { - ThreadsQueue r_queue; + /** Next \p Thread in the ready list.*/ + Thread *p_next; + /** Previous \p Thread in the ready list.*/ + Thread *p_prev; + /* End of the fields shared with the ThreadsQueue structure. */ + /** The thread priority.*/ tprio_t r_prio; + /* End of the fields shared with the Thread structure. */ #ifdef CH_USE_ROUNDROBIN cnt_t r_preempt; #endif |