aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--readme.txt7
-rw-r--r--src/chthreads.c3
-rw-r--r--test/testbmk.c21
3 files changed, 16 insertions, 15 deletions
diff --git a/readme.txt b/readme.txt
index c5902c404..51f0be398 100644
--- a/readme.txt
+++ b/readme.txt
@@ -75,8 +75,9 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
*****************************************************************************
*** 0.6.7 ***
-- Improvements to the test framework, now a virtual timer is used instead of
- software loops into the bechmarks in order to have more stable results.
+- OPT: Removed an unrequired initialization from the chThdCreate().
+- OPT: Improvements to the test framework, now a virtual timer is used instead
+ of software loops into the bechmarks in order to have more stable results.
- Added the C++ wrapper entries to the documentation.
*** 0.6.6 ***
@@ -88,8 +89,8 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process,
within the specified time window.
- FIX: Mutex test #1 in the test suite corrected, it failed to... fail.
- FIX: Fixed a problem in the STM32 port USART1 driver.
+- FIX: Fixed a problem in the MMC/SD driver in the LPC2148 demo.
- Added the definitions for packed structures to the chtypes.h files.
-- Fixed a problem in the MMC/SD driver in the LPC2148 demo.
- Improvements to the makefiles, now each source group has its own .mk include
file. Now it is no more required to rewrite everything in each makefile.
diff --git a/src/chthreads.c b/src/chthreads.c
index 797591243..33c75dd45 100644
--- a/src/chthreads.c
+++ b/src/chthreads.c
@@ -33,7 +33,6 @@ void init_thread(tprio_t prio, tmode_t mode, Thread *tp) {
tp->p_tid = nextid++;
tp->p_flags = mode;
tp->p_prio = prio;
- tp->p_rdymsg = RDY_OK;
#ifdef CH_USE_MUTEXES
tp->p_mtxlist = NULL;
tp->p_realprio = prio;
@@ -48,7 +47,7 @@ void init_thread(tprio_t prio, tmode_t mode, Thread *tp) {
tp->p_epending = 0;
#endif
#ifdef CH_USE_EXIT_EVENT
- chEvtInit(&tp->p_exitesource);
+ chEvtInit(&tp->p_exitesource);
#endif
}
diff --git a/test/testbmk.c b/test/testbmk.c
index b0f44f315..18a62bf00 100644
--- a/test/testbmk.c
+++ b/test/testbmk.c
@@ -27,13 +27,13 @@ static unsigned int msg_loop_test(Thread *tp) {
uint32_t n = 0;
test_wait_tick();
test_start_timer(1000);
- while (!test_timer_done) {
+ do {
(void)chMsgSend(tp, 0);
n++;
#if defined(WIN32)
ChkIntSources();
#endif
- }
+ } while (!test_timer_done);
return n;
}
@@ -122,7 +122,7 @@ static void bmk3_teardown(void) {
static msg_t thread2(void *p) {
- return 0;
+ return (msg_t)p;
}
static void bmk3_execute(void) {
@@ -153,7 +153,7 @@ const struct testcase testbmk3 = {
static char *bmk4_gettest(void) {
- return "Benchmark, threads creation/termination";
+ return "Benchmark, threads creation/termination, worst case";
}
static void bmk4_setup(void) {
@@ -165,16 +165,17 @@ static void bmk4_teardown(void) {
static void bmk4_execute(void) {
uint32_t n = 0;
+ void *wap = wa[0];
+ tprio_t prio = chThdGetPriority() - 1;
test_wait_tick();
test_start_timer(1000);
- while (!test_timer_done) {
- threads[0] = chThdCreate(chThdGetPriority()-1, 0, wa[0], STKSIZE, thread2, NULL);
- chThdWait(threads[0]);
+ do {
+ chThdWait(chThdCreate(prio, 0, wap, STKSIZE, thread2, NULL));
n++;
#if defined(WIN32)
ChkIntSources();
#endif
- }
+ } while (!test_timer_done);
test_print("--- Score : ");
test_printn(n);
test_println(" threads/S");
@@ -206,7 +207,7 @@ static void bmk5_execute(void) {
uint32_t n = 0;
test_wait_tick();
test_start_timer(1000);
- while (!test_timer_done) {
+ do {
chIQPutI(&iq, 0);
chIQPutI(&iq, 1);
chIQPutI(&iq, 2);
@@ -219,7 +220,7 @@ static void bmk5_execute(void) {
#if defined(WIN32)
ChkIntSources();
#endif
- }
+ } while (!test_timer_done);
test_print("--- Score : ");
test_printn(n * 4);
test_println(" bytes/S");