From 4d832fdf1c1ca932d16198df7b3c04dcd083e7e2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 12 Feb 2010 18:51:48 +0000 Subject: [PATCH] Few fixes to the new code after the batch build test. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1592 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- docs/reports/STM32F103-72.txt | 12 +-- docs/reports/kernel.txt | 162 +++++++++++++++---------------- os/hal/platforms/Linux/console.c | 3 +- os/hal/platforms/Win32/console.c | 3 +- os/kernel/include/events.h | 6 +- os/kernel/src/chregistry.c | 9 +- 6 files changed, 100 insertions(+), 95 deletions(-) diff --git a/docs/reports/STM32F103-72.txt b/docs/reports/STM32F103-72.txt index 9df015768..f044cf410 100644 --- a/docs/reports/STM32F103-72.txt +++ b/docs/reports/STM32F103-72.txt @@ -5,7 +5,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) *** ChibiOS/RT test suite *** -*** Kernel: 1.5.0unstable +*** Kernel: 1.5.1unstable *** Architecture: ARM Cortex-M3 *** GCC Version: 4.4.2 @@ -105,11 +105,11 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.5 (Benchmark, threads, full cycle) ---- Score : 173605 threads/S +--- Score : 146984 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.6 (Benchmark, threads, create only) ---- Score : 222517 threads/S +--- Score : 203029 threads/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.7 (Benchmark, mass reschedulation, 5 threads) @@ -117,7 +117,7 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.8 (Benchmark, round robin context switching) ---- Score : 505284 reschedulations/S, 505284 ctxswc/S +--- Score : 505288 reschedulations/S, 505288 ctxswc/S --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.9 (Benchmark, I/O Queues throughput) @@ -137,8 +137,8 @@ Settings: SYSCLK=72, ACR=0x12 (2 wait states) --- Result: SUCCESS ---------------------------------------------------------------------------- --- Test Case 11.13 (Benchmark, RAM footprint) ---- System: 300 bytes ---- Thread: 60 bytes +--- System: 332 bytes +--- Thread: 68 bytes --- Timer : 20 bytes --- Semaph: 12 bytes --- EventS: 4 bytes diff --git a/docs/reports/kernel.txt b/docs/reports/kernel.txt index db6d927d6..ea3e28c5d 100644 --- a/docs/reports/kernel.txt +++ b/docs/reports/kernel.txt @@ -2,131 +2,131 @@ Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -O2 -mthumb -Kernel Size = 5236 +Kernel Size = 5428 Platform : ARM Cortex-M3 OS Setup : Minimal kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -O2 -mthumb -Kernel Size = 1332 +Kernel Size = 1468 Platform : ARM Cortex-M3 OS Setup : Full kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -Os -mthumb +Kernel Size = 5224 + +Platform : ARM Cortex-M3 +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -mthumb +Kernel Size = 1416 + +Platform : ARM Cortex-M3 +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" +Kernel Size = 5028 + +Platform : ARM Cortex-M3 +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" +Kernel Size = 1368 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -O2 +Kernel Size = 7964 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -O2 +Kernel Size = 2160 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os +Kernel Size = 7708 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os +Kernel Size = 2112 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" +Kernel Size = 7404 + +Platform : ARM7TDMI (ARM mode) +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" +Kernel Size = 2048 + +Platform : ARM7TDMI (THUMB mode) +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -O2 -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING +Kernel Size = 5220 + +Platform : ARM7TDMI (THUMB mode) +OS Setup : Minimal kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -O2 -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING +Kernel Size = 1468 + +Platform : ARM7TDMI (THUMB mode) +OS Setup : Full kernel +Compiler : arm-elf-gcc (GCC) 4.4.2 +Options : -Os -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING Kernel Size = 5044 -Platform : ARM Cortex-M3 -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -mthumb -Kernel Size = 1284 - -Platform : ARM Cortex-M3 -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -Kernel Size = 4844 - -Platform : ARM Cortex-M3 -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -Kernel Size = 1236 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -O2 -Kernel Size = 7892 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -O2 -Kernel Size = 1956 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -Kernel Size = 7648 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -Kernel Size = 1908 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -Kernel Size = 7344 - -Platform : ARM7TDMI (ARM mode) -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -Kernel Size = 1844 - -Platform : ARM7TDMI (THUMB mode) -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -O2 -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 5140 - -Platform : ARM7TDMI (THUMB mode) -OS Setup : Minimal kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -O2 -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 1336 - -Platform : ARM7TDMI (THUMB mode) -OS Setup : Full kernel -Compiler : arm-elf-gcc (GCC) 4.4.2 -Options : -Os -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 4968 - Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -Os -mthumb -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 1316 +Kernel Size = 1448 Platform : ARM7TDMI (THUMB mode) OS Setup : Full kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 4776 +Kernel Size = 4848 Platform : ARM7TDMI (THUMB mode) OS Setup : Minimal kernel Compiler : arm-elf-gcc (GCC) 4.4.2 Options : -Os -mthumb -ffixed-r7 -DCH_CURRP_REGISTER_CACHE=\"r7\" -DTHUMB -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING -Kernel Size = 1272 +Kernel Size = 1404 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -Kernel Size = 5456 +Kernel Size = 5640 Platform : MSP430 OS Setup : Minimal kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -O2 -Kernel Size = 1160 +Kernel Size = 1260 Platform : MSP430 OS Setup : Full kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -Kernel Size = 5396 +Kernel Size = 5576 Platform : MSP430 OS Setup : Minimal kernel Compiler : msp430-gcc (GCC) 3.2.3 Options : -Os -Kernel Size = 1160 +Kernel Size = 1260 diff --git a/os/hal/platforms/Linux/console.c b/os/hal/platforms/Linux/console.c index 7c6bd705d..20443dcaf 100644 --- a/os/hal/platforms/Linux/console.c +++ b/os/hal/platforms/Linux/console.c @@ -107,8 +107,7 @@ static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) { } static const struct BaseChannelVMT vmt = { - {writes, reads}, - {putwouldblock, getwouldblock, putt, gett, writet, readt} + writes, reads, putwouldblock, getwouldblock, putt, gett, writet, readt }; /*===========================================================================*/ diff --git a/os/hal/platforms/Win32/console.c b/os/hal/platforms/Win32/console.c index 7c6bd705d..20443dcaf 100644 --- a/os/hal/platforms/Win32/console.c +++ b/os/hal/platforms/Win32/console.c @@ -107,8 +107,7 @@ static size_t readt(void *ip, uint8_t *bp, size_t n, systime_t time) { } static const struct BaseChannelVMT vmt = { - {writes, reads}, - {putwouldblock, getwouldblock, putt, gett, writet, readt} + writes, reads, putwouldblock, getwouldblock, putt, gett, writet, readt }; /*===========================================================================*/ diff --git a/os/kernel/include/events.h b/os/kernel/include/events.h index b333e07c5..42f415b73 100644 --- a/os/kernel/include/events.h +++ b/os/kernel/include/events.h @@ -145,9 +145,9 @@ extern "C" { #endif #if !CH_OPTIMIZE_SPEED && CH_USE_EVENTS_TIMEOUT -#define chEvtWaitOne(ewmask) chEvtWaitOneTimeout(emask, TIME_INFINITE) -#define chEvtWaitAny(ewmask) chEvtWaitAnyTimeout(emask, TIME_INFINITE) -#define chEvtWaitAll(ewmask) chEvtWaitAllTimeout(emask, TIME_INFINITE) +#define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE) +#define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE) +#define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE) #endif #endif /* CH_USE_EVENTS */ diff --git a/os/kernel/src/chregistry.c b/os/kernel/src/chregistry.c index 05573acbf..b6555df40 100644 --- a/os/kernel/src/chregistry.c +++ b/os/kernel/src/chregistry.c @@ -43,7 +43,10 @@ Thread *chRegFirstThread(void) { Thread *tp; chSysLock(); - (tp = rlist.p_newer)->p_refs++; + tp = rlist.p_newer; +#if CH_USE_DYNAMIC + tp->p_refs++; +#endif chSysUnlock(); return tp; } @@ -60,14 +63,18 @@ Thread *chRegFirstThread(void) { Thread *chRegNextThread(Thread *tp) { chSysLock(); +#if CH_USE_DYNAMIC chDbgAssert(tp->p_refs > 0, "chRegNextThread(), #1", "not referenced"); tp->p_refs--; +#endif if (tp->p_newer != (Thread *)&rlist) { tp = tp->p_newer; +#if CH_USE_DYNAMIC chDbgAssert(tp->p_refs < 255, "chRegNextThread(), #2", "too many references"); tp->p_refs++; +#endif } else tp = NULL;