Mark3 Realtime Kernel
mark3cfg.h File Reference

Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in order to provide the optimal set of features for a given use case. More...

#include "portcfg.h"

Go to the source code of this file.

Macros

#define KERNEL_DEBUG   (0)
 
#define KERNEL_STACK_CHECK   (1)
 
#define KERNEL_NAMED_THREADS   (1)
 
#define KERNEL_EVENT_FLAGS   (1)
 
#define KERNEL_CONTEXT_SWITCH_CALLOUT   (1)
 
#define KERNEL_THREAD_CREATE_CALLOUT   (1)
 
#define KERNEL_THREAD_EXIT_CALLOUT   (1)
 
#define KERNEL_ROUND_ROBIN   (1)
 
#define KERNEL_EXTENDED_CONTEXT   (1)
 include CPU/Port specific configuration options More...
 

Detailed Description

Mark3 Kernel Configuration This file is used to configure the kernel for your specific application in order to provide the optimal set of features for a given use case.

Note: in the R7 and beyond version of the kernel, all options are enabled by default. As a result, the only configuration options presented are now located within the architecture-specific "portcfg.h".

Definition in file mark3cfg.h.

Macro Definition Documentation

◆ KERNEL_CONTEXT_SWITCH_CALLOUT

#define KERNEL_CONTEXT_SWITCH_CALLOUT   (1)

When enabled, this feature allows a user to define a callback to be executed whenever a context switch occurs. Enabling this provides a means for a user to track thread statistics, but it does result in additional overhead during a context switch.

Definition at line 70 of file mark3cfg.h.

◆ KERNEL_DEBUG

#define KERNEL_DEBUG   (0)

Enable kernel asserts at runtime.

Definition at line 30 of file mark3cfg.h.

◆ KERNEL_EVENT_FLAGS

#define KERNEL_EVENT_FLAGS   (1)

This flag enables the event-flags synchronization object. This feature allows threads to be blocked, waiting on specific condition bits to be set or cleared on an EventFlag object.

While other synchronization objects are enabled by default, this one is configurable because it impacts the Thread object's member data.

Definition at line 62 of file mark3cfg.h.

◆ KERNEL_EXTENDED_CONTEXT

#define KERNEL_EXTENDED_CONTEXT   (1)

include CPU/Port specific configuration options

Provide a special data pointer in the thread object, which may be used to add additional context to a thread. Typically this would be used to implement thread-local-storage.

Definition at line 97 of file mark3cfg.h.

◆ KERNEL_NAMED_THREADS

#define KERNEL_NAMED_THREADS   (1)

Enabling this provides the Thread::SetName() and Thread::GetName() methods, allowing for each thread to be named with a null-terminated const char* string.

Note: the string passed to Thread::SetName() must persist for the lifetime of the thread

Definition at line 52 of file mark3cfg.h.

◆ KERNEL_ROUND_ROBIN

#define KERNEL_ROUND_ROBIN   (1)

Enable round-robin scheduling within each priority level. When selected, this results in a small performance hit during context switching and in the system tick handler, as a special software timer is used to manage the running thread's quantum. Can be disabled to optimize performance if not required.

Definition at line 90 of file mark3cfg.h.

◆ KERNEL_STACK_CHECK

#define KERNEL_STACK_CHECK   (1)

Perform stack-depth checks on threads at each context switch, which is useful in detecting stack overflows / near overflows. Near-overflow detection uses thresholds defined in the target's portcfg.h. Enabling this also adds the Thread::GetStackSlack() method, which allows a thread's stack to be profiled on-demand.

Note: When enabled, the additional stack checks result in a performance hit to context switches and thread initialization.

Definition at line 43 of file mark3cfg.h.

◆ KERNEL_THREAD_CREATE_CALLOUT

#define KERNEL_THREAD_CREATE_CALLOUT   (1)

This feature provides a user-defined kernel callback that is executed whenever a thread is started.

Definition at line 76 of file mark3cfg.h.

◆ KERNEL_THREAD_EXIT_CALLOUT

#define KERNEL_THREAD_EXIT_CALLOUT   (1)

This feature provides a user-defined kernel callback that is executed whenever a thread is terminated.

Definition at line 82 of file mark3cfg.h.