From 1914bcbbf422a9616dd2c1d6906a8ced3548921d Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 16 Mar 2016 11:09:29 +0000 Subject: Removed I/O queues and streams from RT. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9125 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- test/hal/testbuild/chconf.h | 499 -------------------------------------------- test/rt/test.c | 16 +- test/rt/test.mk | 1 - test/rt/testbmk.c | 101 +++------ test/rt/testbuild/chconf.h | 120 ++++------- 5 files changed, 68 insertions(+), 669 deletions(-) delete mode 100644 test/hal/testbuild/chconf.h (limited to 'test') diff --git a/test/hal/testbuild/chconf.h b/test/hal/testbuild/chconf.h deleted file mode 100644 index fa26b1fee..000000000 --- a/test/hal/testbuild/chconf.h +++ /dev/null @@ -1,499 +0,0 @@ -/* - ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/** - * @file templates/chconf.h - * @brief Configuration file template. - * @details A copy of this file must be placed in each project directory, it - * contains the application specific kernel settings. - * - * @addtogroup config - * @details Kernel related settings and hooks. - * @{ - */ - -#ifndef _CHCONF_H_ -#define _CHCONF_H_ - -/*===========================================================================*/ -/** - * @name System timers settings - * @{ - */ -/*===========================================================================*/ - -/** - * @brief System time counter resolution. - * @note Allowed values are 16 or 32 bits. - */ -#define CH_CFG_ST_RESOLUTION 32 - -/** - * @brief System tick frequency. - * @details Frequency of the system timer that drives the system ticks. This - * setting also defines the system tick time unit. - */ -#define CH_CFG_ST_FREQUENCY 10000 - -/** - * @brief Time delta constant for the tick-less mode. - * @note If this value is zero then the system uses the classic - * periodic tick. This value represents the minimum number - * of ticks that is safe to specify in a timeout directive. - * The value one is not valid, timeouts are rounded up to - * this value. - */ -#define CH_CFG_ST_TIMEDELTA 2 - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel parameters and options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Round robin interval. - * @details This constant is the number of system ticks allowed for the - * threads before preemption occurs. Setting this value to zero - * disables the preemption for threads with equal priority and the - * round robin becomes cooperative. Note that higher priority - * threads can still preempt, the kernel is always preemptive. - * @note Disabling the round robin preemption makes the kernel more compact - * and generally faster. - * @note The round robin preemption is not supported in tickless mode and - * must be set to zero in that case. - */ -#define CH_CFG_TIME_QUANTUM 0 - -/** - * @brief Managed RAM size. - * @details Size of the RAM area to be managed by the OS. If set to zero - * then the whole available RAM is used. The core memory is made - * available to the heap allocator and/or can be used directly through - * the simplified core memory allocator. - * - * @note In order to let the OS manage the whole RAM the linker script must - * provide the @p __heap_base__ and @p __heap_end__ symbols. - * @note Requires @p CH_CFG_USE_MEMCORE. - */ -#define CH_CFG_MEMCORE_SIZE 0x20000 - -/** - * @brief Idle thread automatic spawn suppression. - * @details When this option is activated the function @p chSysInit() - * does not spawn the idle thread. The application @p main() - * function becomes the idle thread and must implement an - * infinite loop. - */ -#define CH_CFG_NO_IDLE_THREAD FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Performance options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief OS optimization. - * @details If enabled then time efficient rather than space efficient code - * is used when two possible implementations exist. - * - * @note This is not related to the compiler optimization options. - * @note The default is @p TRUE. - */ -#define CH_CFG_OPTIMIZE_SPEED TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Subsystem options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Time Measurement APIs. - * @details If enabled then the time measurement APIs are included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_TM TRUE - -/** - * @brief Threads registry APIs. - * @details If enabled then the registry APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_REGISTRY TRUE - -/** - * @brief Threads synchronization APIs. - * @details If enabled then the @p chThdWait() function is included in - * the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_WAITEXIT TRUE - -/** - * @brief Semaphores APIs. - * @details If enabled then the Semaphores APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_SEMAPHORES TRUE - -/** - * @brief Semaphores queuing mode. - * @details If enabled then the threads are enqueued on semaphores by - * priority rather than in FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE - -/** - * @brief Mutexes APIs. - * @details If enabled then the mutexes APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MUTEXES TRUE - -/** - * @brief Enables recursive behavior on mutexes. - * @note Recursive mutexes are heavier and have an increased - * memory footprint. - * - * @note The default is @p FALSE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE - -/** - * @brief Conditional Variables APIs. - * @details If enabled then the conditional variables APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MUTEXES. - */ -#define CH_CFG_USE_CONDVARS TRUE - -/** - * @brief Conditional Variables APIs with timeout. - * @details If enabled then the conditional variables APIs with timeout - * specification are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_CONDVARS. - */ -#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE - -/** - * @brief Events Flags APIs. - * @details If enabled then the event flags APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_EVENTS TRUE - -/** - * @brief Events Flags APIs with timeout. - * @details If enabled then the events APIs with timeout specification - * are included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_EVENTS. - */ -#define CH_CFG_USE_EVENTS_TIMEOUT TRUE - -/** - * @brief Synchronous Messages APIs. - * @details If enabled then the synchronous messages APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MESSAGES TRUE - -/** - * @brief Synchronous Messages queuing mode. - * @details If enabled then messages are served by priority rather than in - * FIFO order. - * - * @note The default is @p FALSE. Enable this if you have special - * requirements. - * @note Requires @p CH_CFG_USE_MESSAGES. - */ -#define CH_CFG_USE_MESSAGES_PRIORITY FALSE - -/** - * @brief Mailboxes APIs. - * @details If enabled then the asynchronous messages (mailboxes) APIs are - * included in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_SEMAPHORES. - */ -#define CH_CFG_USE_MAILBOXES TRUE - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_QUEUES TRUE - -/** - * @brief Core Memory Manager APIs. - * @details If enabled then the core memory manager APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMCORE TRUE - -/** - * @brief Heap Allocator APIs. - * @details If enabled then the memory heap allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or - * @p CH_CFG_USE_SEMAPHORES. - * @note Mutexes are recommended. - */ -#define CH_CFG_USE_HEAP TRUE - -/** - * @brief Memory Pools Allocator APIs. - * @details If enabled then the memory pools allocator APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#define CH_CFG_USE_MEMPOOLS TRUE - -/** - * @brief Dynamic Threads APIs. - * @details If enabled then the dynamic threads creation APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - * @note Requires @p CH_CFG_USE_WAITEXIT. - * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. - */ -#define CH_CFG_USE_DYNAMIC TRUE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Debug options - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Debug option, kernel statistics. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_STATISTICS FALSE - -/** - * @brief Debug option, system state check. - * @details If enabled the correct call protocol for system APIs is checked - * at runtime. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_SYSTEM_STATE_CHECK FALSE - -/** - * @brief Debug option, parameters checks. - * @details If enabled then the checks on the API functions input - * parameters are activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_CHECKS FALSE - -/** - * @brief Debug option, consistency checks. - * @details If enabled then all the assertions in the kernel code are - * activated. This includes consistency checks inside the kernel, - * runtime anomalies and port-defined checks. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_ASSERTS FALSE - -/** - * @brief Debug option, trace buffer. - * @details If enabled then the context switch circular trace buffer is - * activated. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_ENABLE_TRACE FALSE - -/** - * @brief Debug option, stack checks. - * @details If enabled then a runtime stack check is performed. - * - * @note The default is @p FALSE. - * @note The stack check is performed in a architecture/port dependent way. - * It may not be implemented or some ports. - * @note The default failure mode is to halt the system with the global - * @p panic_msg variable set to @p NULL. - */ -#define CH_DBG_ENABLE_STACK_CHECK FALSE - -/** - * @brief Debug option, stacks initialization. - * @details If enabled then the threads working area is filled with a byte - * value when a thread is created. This can be useful for the - * runtime measurement of the used stack. - * - * @note The default is @p FALSE. - */ -#define CH_DBG_FILL_THREADS FALSE - -/** - * @brief Debug option, threads profiling. - * @details If enabled then a field is added to the @p thread_t structure that - * counts the system ticks occurred while executing the thread. - * - * @note The default is @p FALSE. - * @note This debug option is not currently compatible with the - * tickless mode. - */ -#define CH_DBG_THREADS_PROFILING FALSE - -/** @} */ - -/*===========================================================================*/ -/** - * @name Kernel hooks - * @{ - */ -/*===========================================================================*/ - -/** - * @brief Threads descriptor structure extension. - * @details User fields added to the end of the @p thread_t structure. - */ -#define CH_CFG_THREAD_EXTRA_FIELDS \ - /* Add threads custom fields here.*/ - -/** - * @brief Threads initialization hook. - * @details User initialization code added to the @p chThdInit() API. - * - * @note It is invoked from within @p chThdInit() and implicitly from all - * the threads creation APIs. - */ -#define CH_CFG_THREAD_INIT_HOOK(tp) { \ - /* Add threads initialization code here.*/ \ -} - -/** - * @brief Threads finalization hook. - * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. - */ -#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ - /* Add threads finalization code here.*/ \ -} - -/** - * @brief Context switch hook. - * @details This hook is invoked just before switching between threads. - */ -#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ - /* Context switch code here.*/ \ -} - -/** - * @brief Idle thread enter hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to activate a power saving mode. - */ -#define CH_CFG_IDLE_ENTER_HOOK() { \ -} - -/** - * @brief Idle thread leave hook. - * @note This hook is invoked within a critical zone, no OS functions - * should be invoked from here. - * @note This macro can be used to deactivate a power saving mode. - */ -#define CH_CFG_IDLE_LEAVE_HOOK() { \ -} - -/** - * @brief Idle Loop hook. - * @details This hook is continuously invoked by the idle thread loop. - */ -#define CH_CFG_IDLE_LOOP_HOOK() { \ - /* Idle loop code here.*/ \ -} - -/** - * @brief System tick event hook. - * @details This hook is invoked in the system tick handler immediately - * after processing the virtual timers queue. - */ -#define CH_CFG_SYSTEM_TICK_HOOK() { \ - /* System tick event code here.*/ \ -} - -/** - * @brief System halt hook. - * @details This hook is invoked in case to a system halting error before - * the system is halted. - */ -#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ - /* System halt code here.*/ \ -} - -/** @} */ - -/*===========================================================================*/ -/* Port-specific settings (override port settings defaulted in chcore.h). */ -/*===========================================================================*/ - -#endif /* _CHCONF_H_ */ - -/** @} */ diff --git a/test/rt/test.c b/test/rt/test.c index f4a08eeea..09f0ea91c 100644 --- a/test/rt/test.c +++ b/test/rt/test.c @@ -36,7 +36,6 @@ #include "testheap.h" #include "testpools.h" #include "testdyn.h" -#include "testqueues.h" #include "testbmk.h" /* @@ -53,7 +52,6 @@ static ROMCONST struct testcase * ROMCONST *patterns[] = { patternheap, patternpools, patterndyn, - patternqueues, patternbmk, NULL }; @@ -95,13 +93,13 @@ void test_printn(uint32_t n) { char buf[16], *p; if (!n) - chSequentialStreamPut(chp, '0'); + streamPut(chp, '0'); else { p = buf; while (n) *p++ = (n % 10) + '0', n /= 10; while (p > buf) - chSequentialStreamPut(chp, *--p); + streamPut(chp, *--p); } } @@ -113,7 +111,7 @@ void test_printn(uint32_t n) { void test_print(const char *msgp) { while (*msgp) - chSequentialStreamPut(chp, *msgp++); + streamPut(chp, *msgp++); } /** @@ -124,7 +122,7 @@ void test_print(const char *msgp) { void test_println(const char *msgp) { test_print(msgp); - chSequentialStreamWrite(chp, (const uint8_t *)"\r\n", 2); + streamWrite(chp, (const uint8_t *)"\r\n", 2); } /* @@ -139,7 +137,7 @@ static void print_tokens(void) { char *cp = tokens_buffer; while (cp < tokp) - chSequentialStreamPut(chp, *cp++); + streamPut(chp, *cp++); } /** @@ -304,8 +302,8 @@ static void print_line(void) { unsigned i; for (i = 0; i < 76; i++) - chSequentialStreamPut(chp, '-'); - chSequentialStreamWrite(chp, (const uint8_t *)"\r\n", 2); + streamPut(chp, '-'); + streamWrite(chp, (const uint8_t *)"\r\n", 2); } /** diff --git a/test/rt/test.mk b/test/rt/test.mk index 03de3c89a..8e929df3c 100644 --- a/test/rt/test.mk +++ b/test/rt/test.mk @@ -9,7 +9,6 @@ TESTSRC = ${CHIBIOS}/test/rt/test.c \ ${CHIBIOS}/test/rt/testheap.c \ ${CHIBIOS}/test/rt/testpools.c \ ${CHIBIOS}/test/rt/testdyn.c \ - ${CHIBIOS}/test/rt/testqueues.c \ ${CHIBIOS}/test/rt/testsys.c \ ${CHIBIOS}/test/rt/testbmk.c diff --git a/test/rt/testbmk.c b/test/rt/testbmk.c index 3cc713089..b5d4e4a6d 100644 --- a/test/rt/testbmk.c +++ b/test/rt/testbmk.c @@ -48,7 +48,6 @@ * - @subpage test_benchmarks_010 * - @subpage test_benchmarks_011 * - @subpage test_benchmarks_012 - * - @subpage test_benchmarks_013 * . * @file testbmk.c Kernel Benchmarks * @brief Kernel Benchmarks source file @@ -448,57 +447,8 @@ ROMCONST struct testcase testbmk8 = { bmk8_execute }; -#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__) /** - * @page test_benchmarks_009 I/O Queues throughput - * - *

Description

- * Four bytes are written and then read from an @p InputQueue into a continuous - * loop.
- * The performance is calculated by measuring the number of iterations after - * a second of continuous operations. - */ - -static void bmk9_execute(void) { - uint32_t n; - static uint8_t ib[16]; - static input_queue_t iq; - - chIQObjectInit(&iq, ib, sizeof(ib), NULL, NULL); - n = 0; - test_wait_tick(); - test_start_timer(1000); - do { - chSysLock(); - chIQPutI(&iq, 0); - chIQPutI(&iq, 1); - chIQPutI(&iq, 2); - chIQPutI(&iq, 3); - chSysUnlock(); - (void)chIQGet(&iq); - (void)chIQGet(&iq); - (void)chIQGet(&iq); - (void)chIQGet(&iq); - n++; -#if defined(SIMULATOR) - _sim_check_for_interrupts(); -#endif - } while (!test_timer_done); - test_print("--- Score : "); - test_printn(n * 4); - test_println(" bytes/S"); -} - -ROMCONST struct testcase testbmk9 = { - "Benchmark, I/O Queues throughput", - NULL, - NULL, - bmk9_execute -}; -#endif /* CH_CFG_USE_QUEUES */ - -/** - * @page test_benchmarks_010 Virtual Timers set/reset performance + * @page test_benchmarks_009 Virtual Timers set/reset performance * *

Description

* A virtual timer is set and immediately reset into a continuous loop.
@@ -508,7 +458,7 @@ ROMCONST struct testcase testbmk9 = { static void tmo(void *param) {(void)param;} -static void bmk10_execute(void) { +static void bmk09_execute(void) { static virtual_timer_t vt1, vt2; uint32_t n = 0; @@ -531,16 +481,16 @@ static void bmk10_execute(void) { test_println(" timers/S"); } -ROMCONST struct testcase testbmk10 = { +ROMCONST struct testcase testbmk9 = { "Benchmark, virtual timers set/reset", NULL, NULL, - bmk10_execute + bmk09_execute }; #if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__) /** - * @page test_benchmarks_011 Semaphores wait/signal performance + * @page test_benchmarks_010 Semaphores wait/signal performance * *

Description

* A counting semaphore is taken/released into a continuous loop, no Context @@ -549,12 +499,12 @@ ROMCONST struct testcase testbmk10 = { * a second of continuous operations. */ -static void bmk11_setup(void) { +static void bmk10_setup(void) { chSemObjectInit(&sem1, 1); } -static void bmk11_execute(void) { +static void bmk10_execute(void) { uint32_t n = 0; test_wait_tick(); @@ -578,17 +528,17 @@ static void bmk11_execute(void) { test_println(" wait+signal/S"); } -ROMCONST struct testcase testbmk11 = { +ROMCONST struct testcase testbmk10 = { "Benchmark, semaphores wait/signal", - bmk11_setup, + bmk10_setup, NULL, - bmk11_execute + bmk10_execute }; #endif #if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__) /** - * @page test_benchmarks_012 Mutexes lock/unlock performance + * @page test_benchmarks_011 Mutexes lock/unlock performance * *

Description

* A mutex is locked/unlocked into a continuous loop, no Context Switch happens @@ -597,12 +547,12 @@ ROMCONST struct testcase testbmk11 = { * a second of continuous operations. */ -static void bmk12_setup(void) { +static void bmk11_setup(void) { chMtxObjectInit(&mtx1); } -static void bmk12_execute(void) { +static void bmk11_execute(void) { uint32_t n = 0; test_wait_tick(); @@ -626,22 +576,22 @@ static void bmk12_execute(void) { test_println(" lock+unlock/S"); } -ROMCONST struct testcase testbmk12 = { +ROMCONST struct testcase testbmk11 = { "Benchmark, mutexes lock/unlock", - bmk12_setup, + bmk11_setup, NULL, - bmk12_execute + bmk11_execute }; #endif /** - * @page test_benchmarks_013 RAM Footprint + * @page test_benchmarks_012 RAM Footprint * *

Description

* The memory size of the various kernel objects is printed. */ -static void bmk13_execute(void) { +static void bmk12_execute(void) { test_print("--- System: "); test_printn(sizeof(ch_system_t)); @@ -675,7 +625,7 @@ static void bmk13_execute(void) { test_printn(sizeof(condition_variable_t)); test_println(" bytes"); #endif -#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__) +#if 0 test_print("--- Queue : "); test_printn(sizeof(io_queue_t)); test_println(" bytes"); @@ -687,11 +637,11 @@ static void bmk13_execute(void) { #endif } -ROMCONST struct testcase testbmk13 = { +ROMCONST struct testcase testbmk12 = { "Benchmark, RAM footprint", NULL, NULL, - bmk13_execute + bmk12_execute }; /** @@ -711,17 +661,14 @@ ROMCONST struct testcase * ROMCONST patternbmk[] = { &testbmk7, #endif &testbmk8, -#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__) &testbmk9, -#endif - &testbmk10, #if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__) - &testbmk11, + &testbmk10, #endif #if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__) - &testbmk12, + &testbmk11, #endif - &testbmk13, + &testbmk12, #endif NULL }; diff --git a/test/rt/testbuild/chconf.h b/test/rt/testbuild/chconf.h index 5b21d70b8..89e9ff04c 100644 --- a/test/rt/testbuild/chconf.h +++ b/test/rt/testbuild/chconf.h @@ -28,6 +28,8 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ +#define _CHIBIOS_RT_CONF_ + /*===========================================================================*/ /** * @name System timers settings @@ -39,18 +41,14 @@ * @brief System time counter resolution. * @note Allowed values are 16 or 32 bits. */ -#if !defined(CH_CFG_ST_RESOLUTION) || defined(__DOXIGEN__) #define CH_CFG_ST_RESOLUTION 32 -#endif /** * @brief System tick frequency. * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#if !defined(CH_CFG_ST_FREQUENCY) || defined(__DOXIGEN__) #define CH_CFG_ST_FREQUENCY 1000 -#endif /** * @brief Time delta constant for the tick-less mode. @@ -60,9 +58,7 @@ * The value one is not valid, timeouts are rounded up to * this value. */ -#if !defined(CH_CFG_ST_TIMEDELTA) || defined(__DOXIGEN__) #define CH_CFG_ST_TIMEDELTA 0 -#endif /** @} */ @@ -85,9 +81,7 @@ * @note The round robin preemption is not supported in tickless mode and * must be set to zero in that case. */ -#if !defined(CH_CFG_TIME_QUANTUM) || defined(__DOXIGEN__) #define CH_CFG_TIME_QUANTUM 20 -#endif /** * @brief Managed RAM size. @@ -100,9 +94,7 @@ * provide the @p __heap_base__ and @p __heap_end__ symbols. * @note Requires @p CH_CFG_USE_MEMCORE. */ -#if !defined(CH_CFG_MEMCORE_SIZE) || defined(__DOXIGEN__) #define CH_CFG_MEMCORE_SIZE 0x20000 -#endif /** * @brief Idle thread automatic spawn suppression. @@ -111,9 +103,7 @@ * function becomes the idle thread and must implement an * infinite loop. */ -#if !defined(CH_CFG_NO_IDLE_THREAD) || defined(__DOXIGEN__) #define CH_CFG_NO_IDLE_THREAD FALSE -#endif /** @} */ @@ -132,9 +122,7 @@ * @note This is not related to the compiler optimization options. * @note The default is @p TRUE. */ -#if !defined(CH_CFG_OPTIMIZE_SPEED) || defined(__DOXIGEN__) #define CH_CFG_OPTIMIZE_SPEED TRUE -#endif /** @} */ @@ -152,9 +140,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_TM) || defined(__DOXIGEN__) #define CH_CFG_USE_TM TRUE -#endif /** * @brief Threads registry APIs. @@ -162,9 +148,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_REGISTRY) || defined(__DOXIGEN__) #define CH_CFG_USE_REGISTRY TRUE -#endif /** * @brief Threads synchronization APIs. @@ -173,9 +157,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_WAITEXIT) || defined(__DOXIGEN__) #define CH_CFG_USE_WAITEXIT TRUE -#endif /** * @brief Semaphores APIs. @@ -183,9 +165,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_SEMAPHORES) || defined(__DOXIGEN__) #define CH_CFG_USE_SEMAPHORES TRUE -#endif /** * @brief Semaphores queuing mode. @@ -196,9 +176,7 @@ * requirements. * @note Requires @p CH_CFG_USE_SEMAPHORES. */ -#if !defined(CH_CFG_USE_SEMAPHORES_PRIORITY) || defined(__DOXIGEN__) #define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE -#endif /** * @brief Mutexes APIs. @@ -206,9 +184,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_MUTEXES) || defined(__DOXIGEN__) #define CH_CFG_USE_MUTEXES TRUE -#endif /** * @brief Enables recursive behavior on mutexes. @@ -218,9 +194,7 @@ * @note The default is @p FALSE. * @note Requires @p CH_CFG_USE_MUTEXES. */ -#if !defined(CH_CFG_USE_MUTEXES_RECURSIVE) || defined(__DOXIGEN__) #define CH_CFG_USE_MUTEXES_RECURSIVE FALSE -#endif /** * @brief Conditional Variables APIs. @@ -230,9 +204,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_CFG_USE_MUTEXES. */ -#if !defined(CH_CFG_USE_CONDVARS) || defined(__DOXIGEN__) #define CH_CFG_USE_CONDVARS TRUE -#endif /** * @brief Conditional Variables APIs with timeout. @@ -242,9 +214,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_CFG_USE_CONDVARS. */ -#if !defined(CH_CFG_USE_CONDVARS_TIMEOUT) || defined(__DOXIGEN__) #define CH_CFG_USE_CONDVARS_TIMEOUT TRUE -#endif /** * @brief Events Flags APIs. @@ -252,9 +222,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_EVENTS) || defined(__DOXIGEN__) #define CH_CFG_USE_EVENTS TRUE -#endif /** * @brief Events Flags APIs with timeout. @@ -264,9 +232,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_CFG_USE_EVENTS. */ -#if !defined(CH_CFG_USE_EVENTS_TIMEOUT) || defined(__DOXIGEN__) #define CH_CFG_USE_EVENTS_TIMEOUT TRUE -#endif /** * @brief Synchronous Messages APIs. @@ -275,9 +241,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_MESSAGES) || defined(__DOXIGEN__) #define CH_CFG_USE_MESSAGES TRUE -#endif /** * @brief Synchronous Messages queuing mode. @@ -288,9 +252,7 @@ * requirements. * @note Requires @p CH_CFG_USE_MESSAGES. */ -#if !defined(CH_CFG_USE_MESSAGES_PRIORITY) || defined(__DOXIGEN__) #define CH_CFG_USE_MESSAGES_PRIORITY FALSE -#endif /** * @brief Mailboxes APIs. @@ -300,19 +262,7 @@ * @note The default is @p TRUE. * @note Requires @p CH_CFG_USE_SEMAPHORES. */ -#if !defined(CH_CFG_USE_MAILBOXES) || defined(__DOXIGEN__) #define CH_CFG_USE_MAILBOXES TRUE -#endif - -/** - * @brief I/O Queues APIs. - * @details If enabled then the I/O queues APIs are included in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_CFG_USE_QUEUES) || defined(__DOXIGEN__) -#define CH_CFG_USE_QUEUES TRUE -#endif /** * @brief Core Memory Manager APIs. @@ -321,9 +271,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_MEMCORE) || defined(__DOXIGEN__) #define CH_CFG_USE_MEMCORE TRUE -#endif /** * @brief Heap Allocator APIs. @@ -335,9 +283,7 @@ * @p CH_CFG_USE_SEMAPHORES. * @note Mutexes are recommended. */ -#if !defined(CH_CFG_USE_HEAP) || defined(__DOXIGEN__) #define CH_CFG_USE_HEAP TRUE -#endif /** * @brief Memory Pools Allocator APIs. @@ -346,9 +292,7 @@ * * @note The default is @p TRUE. */ -#if !defined(CH_CFG_USE_MEMPOOLS) || defined(__DOXIGEN__) #define CH_CFG_USE_MEMPOOLS TRUE -#endif /** * @brief Dynamic Threads APIs. @@ -359,9 +303,7 @@ * @note Requires @p CH_CFG_USE_WAITEXIT. * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. */ -#if !defined(CH_CFG_USE_DYNAMIC) || defined(__DOXIGEN__) #define CH_CFG_USE_DYNAMIC TRUE -#endif /** @} */ @@ -377,9 +319,7 @@ * * @note The default is @p FALSE. */ -#if !defined(CH_DBG_STATISTICS) || defined(__DOXIGEN__) #define CH_DBG_STATISTICS FALSE -#endif /** * @brief Debug option, system state check. @@ -388,9 +328,7 @@ * * @note The default is @p FALSE. */ -#if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXIGEN__) #define CH_DBG_SYSTEM_STATE_CHECK FALSE -#endif /** * @brief Debug option, parameters checks. @@ -399,9 +337,7 @@ * * @note The default is @p FALSE. */ -#if !defined(CH_DBG_ENABLE_CHECKS) || defined(__DOXIGEN__) #define CH_DBG_ENABLE_CHECKS FALSE -#endif /** * @brief Debug option, consistency checks. @@ -411,20 +347,23 @@ * * @note The default is @p FALSE. */ -#if !defined(CH_DBG_ENABLE_ASSERTS) || defined(__DOXIGEN__) #define CH_DBG_ENABLE_ASSERTS FALSE -#endif /** * @brief Debug option, trace buffer. * @details If enabled then the context switch circular trace buffer is * activated. * - * @note The default is @p FALSE. + * @note The default is @p CH_DBG_TRACE_MASK_NONE. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_NONE + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_NONE. */ -#if !defined(CH_DBG_ENABLE_TRACE) || defined(__DOXIGEN__) -#define CH_DBG_ENABLE_TRACE FALSE -#endif +#define CH_DBG_TRACE_BUFFER_SIZE 128 /** * @brief Debug option, stack checks. @@ -436,9 +375,7 @@ * @note The default failure mode is to halt the system with the global * @p panic_msg variable set to @p NULL. */ -#if !defined(CH_DBG_ENABLE_STACK_CHECK) || defined(__DOXIGEN__) #define CH_DBG_ENABLE_STACK_CHECK FALSE -#endif /** * @brief Debug option, stacks initialization. @@ -448,9 +385,7 @@ * * @note The default is @p FALSE. */ -#if !defined(CH_DBG_FILL_THREADS) || defined(__DOXIGEN__) #define CH_DBG_FILL_THREADS FALSE -#endif /** * @brief Debug option, threads profiling. @@ -461,9 +396,7 @@ * @note This debug option is not currently compatible with the * tickless mode. */ -#if !defined(CH_DBG_THREADS_PROFILING) || defined(__DOXIGEN__) -#define CH_DBG_THREADS_PROFILING TRUE -#endif +#define CH_DBG_THREADS_PROFILING FALSE /** @} */ @@ -495,10 +428,6 @@ /** * @brief Threads finalization hook. * @details User finalization code added to the @p chThdExit() API. - * - * @note It is inserted into lock zone. - * @note It is also invoked when the threads simply return in order to - * terminate. */ #define CH_CFG_THREAD_EXIT_HOOK(tp) { \ /* Add threads finalization code here.*/ \ @@ -512,6 +441,20 @@ /* Context switch code here.*/ \ } +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + /** * @brief Idle thread enter hook. * @note This hook is invoked within a critical zone, no OS functions @@ -519,6 +462,7 @@ * @note This macro can be used to activate a power saving mode. */ #define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ } /** @@ -528,6 +472,7 @@ * @note This macro can be used to deactivate a power saving mode. */ #define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ } /** @@ -556,6 +501,15 @@ /* System halt code here.*/ \ } +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + /** @} */ /*===========================================================================*/ -- cgit v1.2.3