ChibiOS/RT Logo ChibiOS/RT

Architecture - Reference Manual - Guides

Defines

Configuration
[Kernel]

Collaboration diagram for Configuration:


Description

Kernel related settings and hooks.

Defines

#define CH_FREQUENCY   1000
 System tick frequency.
#define CH_TIME_QUANTUM   20
 Round robin interval.
#define CH_USE_NESTED_LOCKS   FALSE
 Nested locks.
#define CH_MEMCORE_SIZE   0
 Managed RAM size.
#define CH_OPTIMIZE_SPEED   TRUE
 OS optimization.
#define CH_CURRP_REGISTER_CACHE   "reg"
 Exotic optimization.
#define CH_USE_REGISTRY   TRUE
 Threads registry APIs.
#define CH_USE_WAITEXIT   TRUE
 Threads synchronization APIs.
#define CH_USE_SEMAPHORES   TRUE
 Semaphores APIs.
#define CH_USE_SEMAPHORES_PRIORITY   FALSE
 Semaphores queuing mode.
#define CH_USE_SEMSW   TRUE
 Atomic semaphore API.
#define CH_USE_MUTEXES   TRUE
 Mutexes APIs.
#define CH_USE_CONDVARS   TRUE
 Conditional Variables APIs.
#define CH_USE_CONDVARS_TIMEOUT   TRUE
 Conditional Variables APIs with timeout.
#define CH_USE_EVENTS   TRUE
 Events Flags APIs.
#define CH_USE_EVENTS_TIMEOUT   TRUE
 Events Flags APIs with timeout.
#define CH_USE_MESSAGES   TRUE
 Synchronous Messages APIs.
#define CH_USE_MESSAGES_PRIORITY   FALSE
 Synchronous Messages queuing mode.
#define CH_USE_MAILBOXES   TRUE
 Mailboxes APIs.
#define CH_USE_QUEUES   TRUE
 I/O Queues APIs.
#define CH_USE_MEMCORE   TRUE
 Core Memory Manager APIs.
#define CH_USE_HEAP   TRUE
 Heap Allocator APIs.
#define CH_USE_MALLOC_HEAP   FALSE
 C-runtime allocator.
#define CH_USE_MEMPOOLS   TRUE
 Memory Pools Allocator APIs.
#define CH_USE_DYNAMIC   TRUE
 Dynamic Threads APIs.
#define CH_DBG_ENABLE_CHECKS   FALSE
 Debug option, parameters checks.
#define CH_DBG_ENABLE_ASSERTS   FALSE
 Debug option, consistency checks.
#define CH_DBG_ENABLE_TRACE   FALSE
 Debug option, trace buffer.
#define CH_DBG_ENABLE_STACK_CHECK   FALSE
 Debug option, stack checks.
#define CH_DBG_FILL_THREADS   FALSE
 Debug option, stacks initialization.
#define CH_DBG_THREADS_PROFILING   TRUE
 Debug option, threads profiling.
#define THREAD_EXT_FIELDS
 Threads descriptor structure hook.
#define THREAD_EXT_INIT(tp)
 Threads initialization hook.
#define THREAD_EXT_EXIT(tp)
 Threads finalization hook.
#define IDLE_LOOP_HOOK()
 Idle Loop hook.

Define Documentation

#define CH_FREQUENCY   1000

System tick frequency.

Frequency of the system timer that drives the system ticks. This setting also defines the system tick time unit.

Definition at line 51 of file chconf.h.

#define CH_TIME_QUANTUM   20

Round robin interval.

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.

Definition at line 66 of file chconf.h.

#define CH_USE_NESTED_LOCKS   FALSE

Nested locks.

If enabled then the use of nested chSysLock() / chSysUnlock() operations is allowed.
For performance and code size reasons the recommended setting is to leave this option disabled.
You may use this option if you need to merge ChibiOS/RT with external libraries that require nested lock/unlock operations.

Note:
T he default is FALSE.

Definition at line 81 of file chconf.h.

#define CH_MEMCORE_SIZE   0

Managed RAM size.

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 __heap_base__ and __heap_end__ symbols.
Requires CH_USE_COREMEM.

Definition at line 96 of file chconf.h.

Referenced by core_init().

#define CH_OPTIMIZE_SPEED   TRUE

OS optimization.

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.
The default is TRUE.

Definition at line 112 of file chconf.h.

#define CH_CURRP_REGISTER_CACHE   "reg"

Exotic optimization.

If defined then a CPU register is used as storage for the global currp variable. Caching this variable in a register greatly improves both space and time OS efficiency. A side effect is that one less register has to be saved during the context switch resulting in lower RAM usage and faster context switch.

Note:
This option is only usable with the GCC compiler and is only useful on processors with many registers like ARM cores.
If this option is enabled then ALL the libraries linked to the ChibiOS/RT code must be recompiled with the GCC option -ffixed-<reg>.
This option must be enabled in the Makefile, it is listed here for documentation only.

Definition at line 132 of file chconf.h.

#define CH_USE_REGISTRY   TRUE

Threads registry APIs.

If enabled then the registry APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 146 of file chconf.h.

#define CH_USE_WAITEXIT   TRUE

Threads synchronization APIs.

If enabled then the chThdWait() function is included in the kernel.

Note:
The default is TRUE.

Definition at line 157 of file chconf.h.

#define CH_USE_SEMAPHORES   TRUE

Semaphores APIs.

If enabled then the Semaphores APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 167 of file chconf.h.

#define CH_USE_SEMAPHORES_PRIORITY   FALSE

Semaphores queuing mode.

If enabled then the threads are enqueued on semaphores by priority rather than in FIFO order.

Note:
The default is FALSE. Enable this if you have special requirements.
Requires CH_USE_SEMAPHORES.

Definition at line 179 of file chconf.h.

#define CH_USE_SEMSW   TRUE

Atomic semaphore API.

If enabled then the semaphores the chSemSignalWait() API is included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_SEMAPHORES.

Definition at line 191 of file chconf.h.

#define CH_USE_MUTEXES   TRUE

Mutexes APIs.

If enabled then the mutexes APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 201 of file chconf.h.

#define CH_USE_CONDVARS   TRUE

Conditional Variables APIs.

If enabled then the conditional variables APIs are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_MUTEXES.

Definition at line 213 of file chconf.h.

#define CH_USE_CONDVARS_TIMEOUT   TRUE

Conditional Variables APIs with timeout.

If enabled then the conditional variables APIs with timeout specification are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_CONDVARS.

Definition at line 225 of file chconf.h.

#define CH_USE_EVENTS   TRUE

Events Flags APIs.

If enabled then the event flags APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 235 of file chconf.h.

#define CH_USE_EVENTS_TIMEOUT   TRUE

Events Flags APIs with timeout.

If enabled then the events APIs with timeout specification are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_EVENTS.

Definition at line 247 of file chconf.h.

#define CH_USE_MESSAGES   TRUE

Synchronous Messages APIs.

If enabled then the synchronous messages APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 258 of file chconf.h.

#define CH_USE_MESSAGES_PRIORITY   FALSE

Synchronous Messages queuing mode.

If enabled then messages are served by priority rather than in FIFO order.

Note:
The default is FALSE. Enable this if you have special requirements.
Requires CH_USE_MESSAGES.

Definition at line 270 of file chconf.h.

#define CH_USE_MAILBOXES   TRUE

Mailboxes APIs.

If enabled then the asynchronous messages (mailboxes) APIs are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_SEMAPHORES.

Definition at line 282 of file chconf.h.

#define CH_USE_QUEUES   TRUE

I/O Queues APIs.

If enabled then the I/O queues APIs are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_SEMAPHORES.

Definition at line 293 of file chconf.h.

#define CH_USE_MEMCORE   TRUE

Core Memory Manager APIs.

If enabled then the core memory manager APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 304 of file chconf.h.

#define CH_USE_HEAP   TRUE

Heap Allocator APIs.

If enabled then the memory heap allocator APIs are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_COREMEM and either CH_USE_MUTEXES or CH_USE_SEMAPHORES.
Mutexes are recommended.

Definition at line 318 of file chconf.h.

#define CH_USE_MALLOC_HEAP   FALSE

C-runtime allocator.

If enabled the the heap allocator APIs just wrap the C-runtime malloc() and free() functions.

Note:
The default is FALSE.
Requires CH_USE_HEAP.
The C-runtime may or may not require CH_USE_COREMEM, see the appropriate documentation.

Definition at line 332 of file chconf.h.

#define CH_USE_MEMPOOLS   TRUE

Memory Pools Allocator APIs.

If enabled then the memory pools allocator APIs are included in the kernel.

Note:
The default is TRUE.

Definition at line 343 of file chconf.h.

#define CH_USE_DYNAMIC   TRUE

Dynamic Threads APIs.

If enabled then the dynamic threads creation APIs are included in the kernel.

Note:
The default is TRUE.
Requires CH_USE_WAITEXIT.
Requires CH_USE_HEAP and/or CH_USE_MEMPOOLS.

Definition at line 356 of file chconf.h.

#define CH_DBG_ENABLE_CHECKS   FALSE

Debug option, parameters checks.

If enabled then the checks on the API functions input parameters are activated.

Note:
The default is FALSE.

Definition at line 371 of file chconf.h.

#define CH_DBG_ENABLE_ASSERTS   FALSE

Debug option, consistency checks.

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 FALSE.

Definition at line 383 of file chconf.h.

#define CH_DBG_ENABLE_TRACE   FALSE

Debug option, trace buffer.

If enabled then the context switch circular trace buffer is activated.

Note:
The default is FALSE.

Definition at line 394 of file chconf.h.

#define CH_DBG_ENABLE_STACK_CHECK   FALSE

Debug option, stack checks.

If enabled then a runtime stack check is performed.

Note:
The default is FALSE.
The stack check is performed in a architecture/port dependent way. It may not be implemented or some ports.
The default failure mode is to halt the system with the global panic_msg variable set to NULL.

Definition at line 408 of file chconf.h.

#define CH_DBG_FILL_THREADS   FALSE

Debug option, stacks initialization.

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 FALSE.

Definition at line 420 of file chconf.h.

#define CH_DBG_THREADS_PROFILING   TRUE

Debug option, threads profiling.

If enabled then a field is added to the Thread structure that counts the system ticks occurred while executing the thread.

Note:
The default is TRUE.
This debug option is defaulted to TRUE because it is required by some test cases into the test suite.

Definition at line 433 of file chconf.h.

#define THREAD_EXT_FIELDS
Value:
struct {                                                                \
  /* Add threads custom fields here.*/                                  \
};

Threads descriptor structure hook.

User fields added to the end of the Thread structure.

Definition at line 445 of file chconf.h.

#define THREAD_EXT_INIT (   tp  ) 
Value:
{                                           \
  /* Add threads initialization code here.*/                            \
}

Threads initialization hook.

User initialization code added to the chThdInit() API.

Note:
It is invoked from within chThdInit() and implicitily from all the threads creation APIs.

Definition at line 459 of file chconf.h.

Referenced by init_thread().

#define THREAD_EXT_EXIT (   tp  ) 
Value:
{                                           \
  /* Add threads finalization code here.*/                              \
}

Threads finalization hook.

User finalization code added to the chThdExit() API.

Note:
It is inserted into lock zone.
It is also invoked when the threads simply return in order to terminate.

Definition at line 473 of file chconf.h.

Referenced by chThdExit().

#define IDLE_LOOP_HOOK (  ) 
Value:
{                                              \
  /* Idle loop code here.*/                                             \
}

Idle Loop hook.

This hook is continuously invoked by the idle thread loop.

Definition at line 483 of file chconf.h.


Generated on Sun Nov 28 2010 14:09:56 for ChibiOS/RT by doxygen 1.7.1