![]() |
Home |
|
FlagsField Flags controls various options of the kernel itself. Currently, the following flags are available: RF_TCPUTIMEIf set, RTKernel-32 will accumulate the CPU time consumed by each task. This flag is set by default by the Debug Version of RTKernel-32 only. RF_ICPUTIMEIf set, RTKernel-32 will accumulate the CPU time consumed by each interrupt handler. When RF_ICPUTIME is set, RF_TCPUTIME is also set automatically. RF_ICPUTIME is is not set by default by either kernel. This flag can severely degrade interrupt latency, primarily depending on the speed of the high resolution timer driver being used. For example, the Pentium timer is very fast and thus will not degrade performance significantly. However, the default PC timer driver may be too slow for many systems. Use RF_ICPUTIME only for testing and performance analysis. RF_PREEMPTIVESetting this flag instructs RTKernel-32 to start up in preemptive mode. It is set by default only in the multiprocessor kernel. You can change the scheduling mode at any time using RTKPreemptionsON and RTKPreemptionsOFF. RF_AUTOINITSpecifies that RTKernel-32 should automatically initialize itself on the first call to RTKCreateThread. This flag is set by default. If you attempt to create tasks before the kernel is initialized and this flag is not set, RTKernel-32 will generate a fatal error message. With automatic initialization, RTKCreateThread calls RTKernelInit(RTKConfig.MainPriority); and there is no need for the application to call RTKernelInit explicitly. RF_TRACEThis flag instructs RTKernelInit to enable the kernel tracer. It is set by default and recognized by RTKernel-32's Debug Version and is ignored by the Standard Version. RF_FPCONTEXTThis flag is not set by default. If set, RTKernel-32 will by default maintain a floating point context for each task. Note that RF_FPCONTEXT only specifies RTKernel-32's default behavior. You can specify a floating point context for each task in the call to RTKCreateThread or RTKRTLCreateThread, overriding the default set by RF_FPCONTEXT. In addition, floating point context swapping can be switched on and off dynamically at run time using RTKProtect8087 and RTKFree8087. RF_STACKCHECKSThis flag is set by default and recognized only by the kernel's Debug Version. When set, it causes RTKernel-32 to call RTKStackCheck on entry to every RTKernel-32 API function. This flag can be set and reset dynamically at run-time. It is checked on every kernel entry. You must reset this flag at least temporarily if the stack is set to some data area not allocated by RTKernel-32. RF_PULSWIN32This flag is not set by default. If it is set, RTKPulse behaves just like the Win32 PulseEvent function. If no task is being released by the call to RTKPulse, the event is left in a signalled state. RTKernel-32's default behavior is to always reset the event, regardless of the number of tasks released. You should set this flag if you prefer Win32's behavior (see Function PulseEvent for details). RF_WIN32CS_MUTEXIf set, RTKernel-32 will use mutex semaphores to implement Win32 critical sections. It primarily affects function InitializeCriticalSection. Only critical sections created while flag RF_WIN32CS_MUTEX is set will be implemented as RTKernel-32 mutex semaphores. Please note that certain restrictions apply to mutex semaphores as described in section: Semaphores, paragraph "Resource". These restrictions (resources must be released in reverse order) also apply to all critical sections created while RF_WIN32CS_MUTEX is set. RF_WIN32MUTEX_MUTEXIf set, RTKernel-32 will use mutex semaphores to implement Win32 Mutex semaphores. By default, binary semaphores with recursion support are used. RF_NAMED_WIN32CSIf set, the semaphore associated with A Win32 critical section is assigned a uniquely allocated name in the format "W32 CS address", where address is the hexadecimal address of the critical section object. If RF_NAMED_WIN32CS is not set, all Win32 critical section semaphores get the same name "Win32 CS", which reduces the memory requirement of each critical section by 16 bytes. This flag is set by default. RF_IRQDISABLEThis flag instructs RTKernel-32 to disable the IRQ which is currently being serviced. RF_IRQDISABLE is useful for buggy interrupt controllers which will not properly queue lower or equal priority interrupts while an interrupt is being serviced. RF_IRQDISABLE only applies to interrupts handled through the shared IRQ API and is not set by default. Some affected interrupt controllers might not require this flag if programmed to Nested Mode instead of the Special Fully Nested Mode, as supported through RTTarget-32 boot flag BF_NO_FNESTED. RF_NO_MPThis flag instructs the multiprocessor kernel to use only a single CPU. This flag can be useful during debugging. It is not set by default. It is ignored by the single-processor kernel. RF_TRACE_TIME_USInstructs the kernel tracer to record and display tracer events with microsecond time stamps. If neither RF_TRACE_TIME_US nor RF_TRACE_TIME_NS are set, no time stamps are recorded. RF_TRACE_TIME_NSInstructs the kernel tracer to record and display tracer events with nanosecond time stamps. If neither RF_TRACE_TIME_US nor RF_TRACE_TIME_NS are set, no time stamps are recorded. RF_LCPUTIMEInstructs RTKernel-32 to measure the maximum time a Spinlock is looked. Function RTKGetSpinlockTime can be used to query this time. This flag is only evaluated by the RTKernel-32 Debug Version. RF_TRACE_KLOCKInstructs RTKernel-32 to trace Spinlock operations of the lock used to protect RTKernel-32 itself (the Kernel Lock). By default, the Kernel Lock is not traced to avoid flooding the tracer with entries most users are not interested in. This flag is only evaluated by the multiprocessor version of the RTKernel-32 Debug Version. RF_FAST_MPInstructs RTKernel-32's multiprocessor scheduler to favor throughput over real-time response time. This option can delay some switches to high priority threads by about 1-2 microseconds, but some task switches can be optimized away, reducing RTKernel-32's execution time. The effect grows with the number of CPUs and priority levels used. This flag is ignored by the single-processor scheduler. RF_NO_EXIT_TASKInstructs RTKernelInit not to call RTKInstallExitTask automatically. By default, RTKernel-32 installs an Exit Task if run under the RTTarget-32 debugger. RF_CALL_ALL_ISRSThis flag causes all shared handlers installed on an IRQ to get called, even if a handler returns a value > 0. This flag is required when a program is running under the RTTarget-32 Debug Monitor and the Monitor's communication port and the application both use the same IRQ. RTKernel-32's default system driver SYSRT32 sets this flag automatically if the program is running under the Monitor. If no interrupt is shared with the Monitor, the application can safely unset this flag after its RTKernelInit call to improve interrupt performance.
|