From 071e9457b0645f07a90485bd7a7c68fa5e34801b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Sep 2008 12:18:39 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@421 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-GCC/chconf.h | 17 ----------------- demos/ARM7-AT91SAM7X-WEB-GCC/chconf.h | 17 ----------------- demos/ARM7-LPC214x-G++/chconf.h | 17 ----------------- demos/ARM7-LPC214x-GCC-minimal/chconf.h | 17 ----------------- demos/ARM7-LPC214x-GCC/chconf.h | 17 ----------------- demos/ARMCM3-STM32F103-GCC/chconf.h | 17 ----------------- demos/AVR-AT90CANx-GCC/chconf.h | 17 ----------------- demos/AVR-ATmega128-GCC/chconf.h | 17 ----------------- demos/MSP430-MSP430x1611-GCC/chconf.h | 17 ----------------- demos/Win32-MinGW/chconf.h | 17 ----------------- readme.txt | 5 +++-- src/chsleep.c | 4 ---- src/chthreads.c | 4 ---- src/include/threads.h | 10 ---------- src/templates/chconf.h | 17 ----------------- 15 files changed, 3 insertions(+), 207 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-GCC/chconf.h b/demos/ARM7-AT91SAM7X-GCC/chconf.h index 8d31e854a..f06a707b6 100644 --- a/demos/ARM7-AT91SAM7X-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/chconf.h b/demos/ARM7-AT91SAM7X-WEB-GCC/chconf.h index 8d31e854a..f06a707b6 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/chconf.h +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/ARM7-LPC214x-G++/chconf.h b/demos/ARM7-LPC214x-G++/chconf.h index c9b0b4c50..847a62d4a 100644 --- a/demos/ARM7-LPC214x-G++/chconf.h +++ b/demos/ARM7-LPC214x-G++/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/ARM7-LPC214x-GCC-minimal/chconf.h b/demos/ARM7-LPC214x-GCC-minimal/chconf.h index e81935083..1302dac3e 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/chconf.h +++ b/demos/ARM7-LPC214x-GCC-minimal/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -//#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ //#define CH_USE_WAITEXIT diff --git a/demos/ARM7-LPC214x-GCC/chconf.h b/demos/ARM7-LPC214x-GCC/chconf.h index 8d31e854a..f06a707b6 100644 --- a/demos/ARM7-LPC214x-GCC/chconf.h +++ b/demos/ARM7-LPC214x-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/ARMCM3-STM32F103-GCC/chconf.h b/demos/ARMCM3-STM32F103-GCC/chconf.h index 8d31e854a..f06a707b6 100644 --- a/demos/ARMCM3-STM32F103-GCC/chconf.h +++ b/demos/ARMCM3-STM32F103-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/AVR-AT90CANx-GCC/chconf.h b/demos/AVR-AT90CANx-GCC/chconf.h index 594d28272..132bc4f15 100644 --- a/demos/AVR-AT90CANx-GCC/chconf.h +++ b/demos/AVR-AT90CANx-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/AVR-ATmega128-GCC/chconf.h b/demos/AVR-ATmega128-GCC/chconf.h index 7ff7df502..58f0fca7e 100644 --- a/demos/AVR-ATmega128-GCC/chconf.h +++ b/demos/AVR-ATmega128-GCC/chconf.h @@ -46,23 +46,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/MSP430-MSP430x1611-GCC/chconf.h b/demos/MSP430-MSP430x1611-GCC/chconf.h index 2205cdd33..8087f679f 100644 --- a/demos/MSP430-MSP430x1611-GCC/chconf.h +++ b/demos/MSP430-MSP430x1611-GCC/chconf.h @@ -47,23 +47,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/demos/Win32-MinGW/chconf.h b/demos/Win32-MinGW/chconf.h index 0912c3f6d..f16918f72 100644 --- a/demos/Win32-MinGW/chconf.h +++ b/demos/Win32-MinGW/chconf.h @@ -51,23 +51,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT diff --git a/readme.txt b/readme.txt index 3b01853f4..088e4fc5f 100644 --- a/readme.txt +++ b/readme.txt @@ -92,8 +92,9 @@ Win32-MinGW - ChibiOS/RT simulator and demo into a WIN32 process, - FIX: Corrected the wrong definition of the chThdResumeI() macro. - CHANGE: Now the chThdResume() asserts that the thread is in PRSUSPEND state rather than test it. -- CHANGE: Removed the CH_USE_SUSPEND and CH_USE_RESUME configuration options - in order to make the chconf.h file simpler. +- CHANGE: Removed the CH_USE_TERMINATE, CH_USE_SLEEP, CH_USE_SUSPEND and + CH_USE_RESUME configuration options in order to make the chconf.h file + simpler. The related functions are very small and almost always required. - Added new test cases to the test suite. *** 0.6.10 *** diff --git a/src/chsleep.c b/src/chsleep.c index 7f9f161f1..1fc686120 100644 --- a/src/chsleep.c +++ b/src/chsleep.c @@ -24,7 +24,6 @@ #include -#ifdef CH_USE_SLEEP /** * Suspends the invoking thread for the specified time. * @param time the system ticks number @@ -32,12 +31,9 @@ void chThdSleep(systime_t time) { chSysLock(); - chSchGoSleepTimeoutS(PRSLEEP, time); - chSysUnlock(); } -#endif /* CH_USE_SLEEP */ #ifdef CH_USE_SYSTEMTIME /** diff --git a/src/chthreads.c b/src/chthreads.c index e95abbe73..2069fe389 100644 --- a/src/chthreads.c +++ b/src/chthreads.c @@ -204,7 +204,6 @@ void chThdResume(Thread *tp) { chSysUnlock(); } -#ifdef CH_USE_TERMINATE /** * Requests a thread termination. * @param tp the pointer to the thread @@ -215,12 +214,9 @@ void chThdResume(Thread *tp) { void chThdTerminate(Thread *tp) { chSysLock(); - tp->p_flags |= P_TERMINATE; - chSysUnlock(); } -#endif /** * Terminates the current thread by specifying an exit status code. diff --git a/src/include/threads.h b/src/include/threads.h index b74ba60b4..89acd9add 100644 --- a/src/include/threads.h +++ b/src/include/threads.h @@ -135,14 +135,10 @@ struct Thread { /** Thread state: After termination.*/ #define PREXIT 10 -#ifdef CH_USE_TERMINATE /** Thread option: Termination requested flag.*/ #define P_TERMINATE 1 -#endif -#ifdef CH_USE_RESUME /** Thread option: Create suspended thread.*/ #define P_SUSPENDED 2 -#endif #ifdef CH_USE_MESSAGES_PRIORITY /** Thread option: Serve messages by priority instead of FIFO order.*/ #define P_MSGBYPRIO 4 @@ -179,15 +175,9 @@ extern "C" { size_t wsize, tfunc_t pf); void chThdSetPriority(tprio_t newprio); void chThdExit(msg_t msg); -#ifdef CH_USE_RESUME void chThdResume(Thread *tp); -#endif -#ifdef CH_USE_SUSPEND void chThdSuspend(Thread **tpp); -#endif -#ifdef CH_USE_TERMINATE void chThdTerminate(Thread *tp); -#endif #ifdef CH_USE_WAITEXIT msg_t chThdWait(Thread *tp); #endif diff --git a/src/templates/chconf.h b/src/templates/chconf.h index 65ae9870e..1f6fc879e 100644 --- a/src/templates/chconf.h +++ b/src/templates/chconf.h @@ -47,23 +47,6 @@ * included in the kernel.*/ #define CH_USE_SYSTEMTIME -/** Configuration option: if specified then the \p chThdSleep() function is - * included in the kernel. - * @note requires \p CH_USE_VIRTUAL_TIMERS.*/ -#define CH_USE_SLEEP - -/** Configuration option: if specified then the \p chThdResume() - * function is included in the kernel.*/ -#define CH_USE_RESUME - -/** Configuration option: if specified then the \p chThdSuspend() - * function is included in the kernel.*/ -#define CH_USE_SUSPEND - -/** Configuration option: if specified then the \p chThdTerminate() - * and \p chThdShouldTerminate() functions are included in the kernel.*/ -#define CH_USE_TERMINATE - /** Configuration option: if specified then the \p chThdWait() function * is included in the kernel.*/ #define CH_USE_WAITEXIT -- cgit v1.2.3