diff options
-rw-r--r-- | readme.txt | 3 | ||||
-rw-r--r-- | src/chlists.c | 7 | ||||
-rw-r--r-- | src/chschd.c | 2 | ||||
-rw-r--r-- | src/include/inline.h | 6 | ||||
-rw-r--r-- | test/test.c | 2 | ||||
-rw-r--r-- | todo.txt | 1 |
6 files changed, 13 insertions, 8 deletions
diff --git a/readme.txt b/readme.txt index 808dac082..18184bf5c 100644 --- a/readme.txt +++ b/readme.txt @@ -89,6 +89,9 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, introducing a new API category "Time").
- OPT: Small optimization to the Cortex-M3 port code, improved thread
related performance scores and smaller code.
+- OPT: Improved ready list and priority ordered lists code, saved some tens
+ of bytes here and there in the kernel.
+- Modified the test thread function to return the global test result flag.
- Removed testcond.c|h and moved the test cases into testmtx.c. Mutexes and
condvars have to be tested together.
- Added architecture diagram to the documentation.
diff --git a/src/chlists.c b/src/chlists.c index a3ec568a0..82be1923d 100644 --- a/src/chlists.c +++ b/src/chlists.c @@ -38,11 +38,12 @@ void prio_insert(Thread *tp, ThreadsQueue *tqp) {
/* cp iterates over the queue */
- Thread *cp = tqp->p_next;
- /* not end of queue? and cp has equal or higher priority than tp? */
- while ((cp != (Thread *)tqp) && (cp->p_prio >= tp->p_prio))
+ Thread *cp = (Thread *)tqp;
+ do {
/* iterate to next thread in queue */
cp = cp->p_next;
+ /* not end of queue? and cp has equal or higher priority than tp? */
+ } while ((cp != (Thread *)tqp) && (cp->p_prio >= tp->p_prio));
/* insert before cp, point tp to next and prev in queue */
tp->p_prev = (tp->p_next = cp)->p_prev;
/* make prev point to tp, and cp point back to tp */
diff --git a/src/chschd.c b/src/chschd.c index 6bb03aab2..82718342f 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -61,7 +61,7 @@ Thread *chSchReadyI(Thread *tp) { Thread *cp; tp->p_state = PRREADY; - cp = (void *)&rlist; + cp = (Thread *)&rlist; do { cp = cp->p_next; } while (cp->p_prio >= tp->p_prio); diff --git a/src/include/inline.h b/src/include/inline.h index 0da909f8f..45396c9a1 100644 --- a/src/include/inline.h +++ b/src/include/inline.h @@ -35,10 +35,10 @@ #if CH_OPTIMIZE_SPEED
static INLINE void prio_insert(Thread *tp, ThreadsQueue *tqp) {
- Thread *cp = tqp->p_next;
- while ((cp != (Thread *)tqp) && (cp->p_prio >= tp->p_prio))
+ Thread *cp = (Thread *)tqp;
+ do {
cp = cp->p_next;
- /* Insertion on p_prev.*/
+ } while ((cp != (Thread *)tqp) && (cp->p_prio >= tp->p_prio));
tp->p_prev = (tp->p_next = cp)->p_prev;
tp->p_prev->p_next = cp->p_prev = tp;
}
diff --git a/test/test.c b/test/test.c index 3be813bb2..887d56ecc 100644 --- a/test/test.c +++ b/test/test.c @@ -275,5 +275,5 @@ msg_t TestThread(void *p) { else
test_println("SUCCESS");
- return 0;
+ return (msg_t)global_fail;
}
@@ -39,6 +39,7 @@ X Abstract I/O channels rather than just serial ports. ? Multiple heaps, disjoint heaps, heaps in heaps.
- Update C++ wrapper (Heap, Pools, Mailboxes and any new feature).
- Think about making threads return void.
+- Add tests documentation to the general documentation via doxygen.
Ideas for 2.x.x:
- High resolution timers and tickless kernel.
|