RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Related to RKH port

Configuration options related to RKH port. More...

Macros

#define RKH_CFGPORT_SMA_THREAD_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_THREAD_EN is set to 1, each SMA (active object) has its own thread of execution. More...
 
#define RKH_CFGPORT_SMA_THREAD_DATA_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_THREAD_EN and RKH_CFGPORT_SMA_THREAD_DATA_EN are set to 1, each SMA (active object) has its own thread of execution and its own object data. More...
 
#define RKH_CFGPORT_NATIVE_SCHEDULER_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_SCHEDULER_EN is set to 1 then RKH will include the simple, cooperative, and nonpreemptive scheduler RKHS. When RKH_CFGPORT_NATIVE_SCHEDULER_EN is enabled RKH also will automatically define RKH_EQ_TYPE, RKH_SMA_BLOCK(), RKH_SMA_READY(), RKH_SMA_UNREADY(), and assume the native priority scheme. More...
 
#define RKH_CFGPORT_NATIVE_EQUEUE_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_EQUEUE_EN is set to 1 and the native event queue is enabled (see RKH_CFG_RQ_EN) then RKH will include its own implementation of rkh_sma_post_fifo(), rkh_sma_post_lifo(), and rkh_sma_get() functions. More...
 
#define RKH_CFGPORT_NATIVE_DYN_EVT_EN   RKH_ENABLED
 If the RKH_CFGPORT_NATIVE_DYN_EVT_EN is set to 1 and the native fixed-size memory block facility is enabled (see RKH_CFG_MP_EN) then RKH will include its own implementation of dynamic memory management. When RKH_CFGPORT_NATIVE_DYN_EVT_EN is enabled RKH also will automatically define RKH_DYNE_TYPE, RKH_DYNE_INIT(), RKH_DYNE_GET_ESIZE(), RKH_DYNE_GET(), and RKH_DYNE_PUT(). More...
 
#define RKH_CFGPORT_REENTRANT_EN   RKH_ENABLED
 If the RKH_CFGPORT_REENTRANT_EN is set to 1, the RKH event dispatch allows to be invoked from several threads of executions. Enable this only if the application is based on a multi-thread architecture. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_PTR   32u
 Specify the size of void pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TRC_SYM() macro. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_FUN_PTR   32u
 Specify the size of function pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TUSR_FUN() and RKH_TRC_FUN() macros. More...
 
#define RKH_CFGPORT_TRC_SIZEOF_TSTAMP   32u
 Specify the number of bytes (size) used by the trace record timestamp. The valid values [in bits] are 8, 16 or 32. Default is 16. More...
 
#define RKH_CFGPORT_SMA_QSTO_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_QSTO_EN is set to 1 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the external event queue storage argument, qs. More...
 
#define RKH_CFGPORT_SMA_STK_EN   RKH_ENABLED
 If the RKH_CFGPORT_SMA_STK_EN is set to 0 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the thread's stack related arguments, stks and stksize. More...
 
#define RKH_DIS_INTERRUPT()
 RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done. This allows RKH to protect critical code from being entered simultaneously. To hide the implementation method chosen by the processor, compiler, etc, RKH defines two macros to unconditionally disable and enable interrupts: RKH_DIS_INTERRUPT() and RKH_ENA_INTERRUPT() respectively. Obviously, they resides in rkhport.h file, which the user always need to provide. More...
 
#define RKH_CPUSR_TYPE
 RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done. More...
 

Detailed Description

Configuration options related to RKH port.

Macro Definition Documentation

#define RKH_CFGPORT_SMA_THREAD_EN   RKH_ENABLED

If the RKH_CFGPORT_SMA_THREAD_EN is set to 1, each SMA (active object) has its own thread of execution.

Type value
Boolean
Range value
Default configuration:
RKH_DISABLED

Definition at line 2066 of file rkhitl.h.

#define RKH_CFGPORT_SMA_THREAD_DATA_EN   RKH_ENABLED

If the RKH_CFGPORT_SMA_THREAD_EN and RKH_CFGPORT_SMA_THREAD_DATA_EN are set to 1, each SMA (active object) has its own thread of execution and its own object data.

Type value
Boolean
Range value
Default configuration:
RKH_DISABLED

Definition at line 2078 of file rkhitl.h.

#define RKH_CFGPORT_NATIVE_SCHEDULER_EN   RKH_ENABLED

If the RKH_CFGPORT_NATIVE_SCHEDULER_EN is set to 1 then RKH will include the simple, cooperative, and nonpreemptive scheduler RKHS. When RKH_CFGPORT_NATIVE_SCHEDULER_EN is enabled RKH also will automatically define RKH_EQ_TYPE, RKH_SMA_BLOCK(), RKH_SMA_READY(), RKH_SMA_UNREADY(), and assume the native priority scheme.

Type value
Boolean
Range value
Default configuration:
RKH_ENABLED

Definition at line 2092 of file rkhitl.h.

#define RKH_CFGPORT_NATIVE_EQUEUE_EN   RKH_ENABLED

If the RKH_CFGPORT_NATIVE_EQUEUE_EN is set to 1 and the native event queue is enabled (see RKH_CFG_RQ_EN) then RKH will include its own implementation of rkh_sma_post_fifo(), rkh_sma_post_lifo(), and rkh_sma_get() functions.

Type value
Boolean
Range value
Default configuration:
RKH_ENABLED

Definition at line 2105 of file rkhitl.h.

#define RKH_CFGPORT_NATIVE_DYN_EVT_EN   RKH_ENABLED

If the RKH_CFGPORT_NATIVE_DYN_EVT_EN is set to 1 and the native fixed-size memory block facility is enabled (see RKH_CFG_MP_EN) then RKH will include its own implementation of dynamic memory management. When RKH_CFGPORT_NATIVE_DYN_EVT_EN is enabled RKH also will automatically define RKH_DYNE_TYPE, RKH_DYNE_INIT(), RKH_DYNE_GET_ESIZE(), RKH_DYNE_GET(), and RKH_DYNE_PUT().

Type value
Boolean
Range value
Default configuration:
RKH_ENABLED

Definition at line 2120 of file rkhitl.h.

#define RKH_CFGPORT_REENTRANT_EN   RKH_ENABLED

If the RKH_CFGPORT_REENTRANT_EN is set to 1, the RKH event dispatch allows to be invoked from several threads of executions. Enable this only if the application is based on a multi-thread architecture.

Type value
Boolean
Range value
Default configuration:
RKH_DISABLED

Definition at line 2132 of file rkhitl.h.

#define RKH_CFGPORT_TRC_SIZEOF_PTR   32u

Specify the size of void pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TRC_SYM() macro.

Type value
Integer
Range value
[8, 16, 32]
Default configuration:
32

Definition at line 2143 of file rkhitl.h.

#define RKH_CFGPORT_TRC_SIZEOF_FUN_PTR   32u

Specify the size of function pointer. The valid values [in bits] are 16 or 32. Default is 32. See RKH_TUSR_FUN() and RKH_TRC_FUN() macros.

Type value
Integer
Range value
[8, 16, 32]
Default configuration:
32

Definition at line 2154 of file rkhitl.h.

#define RKH_CFGPORT_TRC_SIZEOF_TSTAMP   32u

Specify the number of bytes (size) used by the trace record timestamp. The valid values [in bits] are 8, 16 or 32. Default is 16.

Type value
Integer
Range value
[8, 16, 32]
Default configuration:
16

Definition at line 2165 of file rkhitl.h.

#define RKH_CFGPORT_SMA_QSTO_EN   RKH_ENABLED

If the RKH_CFGPORT_SMA_QSTO_EN is set to 1 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the external event queue storage argument, qs.

Type value
Boolean
Range value
Default configuration:
RKH_ENABLED

Definition at line 2177 of file rkhitl.h.

#define RKH_CFGPORT_SMA_STK_EN   RKH_ENABLED

If the RKH_CFGPORT_SMA_STK_EN is set to 0 then RKH_SMA_ACTIVATE() macro invokes the rkh_sma_activate() function ignoring the thread's stack related arguments, stks and stksize.

Type value
Boolean
Range value
Default configuration:
RKH_DISABLED

Definition at line 2189 of file rkhitl.h.

#define RKH_DIS_INTERRUPT ( )

RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done. This allows RKH to protect critical code from being entered simultaneously. To hide the implementation method chosen by the processor, compiler, etc, RKH defines two macros to unconditionally disable and enable interrupts: RKH_DIS_INTERRUPT() and RKH_ENA_INTERRUPT() respectively. Obviously, they resides in rkhport.h file, which the user always need to provide.

Example for HCS08 CW6.3 from C:

#define RKH_DIS_INTERRUPT() DisableInterrupts
#define RKH_ENA_INTERRUPT() EnableInterrupts

Definition at line 2281 of file rkhitl.h.

#define RKH_CPUSR_TYPE

RKH need to disable interrupts in order to access critical sections of code, and re-enable interrupts when done.

This allows RKH to protect critical code from being entered simultaneously from either multiple SMAs or ISRs. Every processor generally provide instructions to disable/enable interrupts and the C compiler must have a mechanism to perform these operations directly from C. Some compilers will allows to insert in-line assembly language statements in the C source code. This makes it quite easy to insert processor instructions to enable and disable interrupts. Other compilers will actually contain language extensions to enable and disable interrupts directly from C. To hide the implementation method chosen by the compiler manufacturer, RKH defines two macros to disable and enable interrupts: RKH_ENTER_CRITICAL() and RKH_EXIT_CRITICAL().

The RKH_ENTER_CRITICAL() macro saves the interrupt disable status onto the stack and then, disable interrupts. RKH_EXIT_CRITICAL() would simply be implemented by restoring the interrupt status from the stack. Using this scheme, if it's called a RKH service with either interrupts enabled or disabled then, the status would be preserved across the call. If calls a RKH service with interrupts disabled, is potentially extending the interrupt latency of application. The application can use RKH_ENTER_CRITICAL() and RKH_EXIT_CRITICAL() to also protect critical sections of code. As a general rule, should always call RKH services with interrupts enabled!.

Note
These macros are internal to RKH and the user application should not call it.

Example for x86, VC2008, and win32 single thread:

//#define RKH_CPUSR_TYPE
#define RKH_ENTER_CRITICAL( dummy ) EnterCriticalSection(&csection)
#define RKH_EXIT_CRITICAL( dummy ) LeaveCriticalSection(&csection)

Definition at line 2325 of file rkhitl.h.