INOS
CINOSKernel Class Reference

Public Member Functions

virtual void AddIdle (void *apFunction, void *apObject)
 Add idle handler. The given function is called whenever the CPU goes into idle state IMPORTANT things to notice :
 
void AddFinalyse (void *apFunction, void *apObject)
 Add kernel finalyse callback, it is called after the kernel has booted all cores and just before it goes into running state.
 
void AddBootedCallback (void *apFunction, void *apObject)
 Add kernel booted callback, it is called after the kernel has entered the running state. Usage example:
 

Static Public Member Functions

static int32 GetKernelState ()
 Get kernel state. Valid values are.
 

Friends

end of doxygen exclude friend void Suspend (uint32 auTaskState, uint32 auFlags)
 Suspend current task from execution. Note that upon Resume, the interrupt state will be restored to the one at the time of calling Suspend, or in other words if interrupts were disabled at calling Suspend, they are still disabled after Resume. Any hold locks are NOT released. If this is required, use SuspendEx instead.
 
void SuspendEx (uint32 auTaskState, SINOSCoreLock *apLock, CINOSTask *apTask)
 Suspend current task from execution and release the given lock. The lock will be released completely, means that even if it was acquired multiple times (recursively), it'll be completely released (means: be set to 0). This is required, as the function will cause the calling task to suspend - and therefore it'll not continue execution and therefore, any core locks MUST be released in order to not disturb other cores. Note that upon Resume, any previously held lock will NOT be re-acquired. This is in contrast to interrupt state at the time of calling Suspend, which will be restored - but core locks will NOT. This is because it could add unwanted jitter to the Resumed()-ed task. Therefore, the caller needs to take additional action in order to lock any previously held core locks again.
 
void Goodbye ()
 Suspend current task from execution without saving its context.
 
void Resume (class CINOSTask *apTask, uint32 auFlags)
 Resume given task and put it into ready list.
 
void Resume (tTaskId aidTask, uint32 auFlags)
 Resume given task and put it into ready list.
 
void Ready (class CINOSTask *apTask, uint32 auFlags)
 Put given task into ready list but do not schedule. This method is normally used in conjunction with Schedule.
 
void Ready (tTaskId aidTask, uint32 auFlags)
 Put given task into ready list but do not schedule. This method is normally used in conjunction with Schedule.
 
uint32 SwitchCore (uint32 auCoreId)
 Switch current task to the given core.
 
void Schedule ()
 Do an explicite schedule. This method is normally used in in conjunction with Ready In case of using a multi core system (INOS_MULTICORE), the very same rules related to core locks are valid as for Suspend(). Read these notes carefully.
 
void Schedule (uint32 auCoreId)
 Do an explicite schedule or given core. This method is normally used in in conjunction with Ready In case of using a multi core system (INOS_MULTICORE), be aware that this function may call the overloaded function Schedule() (the version taking no arguments), which may alter any "core locks" as explained there.
 
void Relinquish ()
 Give other tasks with the same priority a chance to run. For more info see section Relinquish.
 
void Exit (uint32 auExitCode)
 Terminate actual task.
 
void ChangePriority (uint32 auPriority)
 Change priority of current task and do a reschedule if necessary. For more info see section Priority.
 
class CINOSTaskActualTask ()
 Return pointer to actual running task.
 

Member Function Documentation

◆ AddBootedCallback()

void CINOSKernel::AddBootedCallback ( void apFunction,
void apObject 
)

Add kernel booted callback, it is called after the kernel has entered the running state. Usage example:

KERNEL.AddBootedCallback(P_TYP_CLS_FCT(MyClass, this, void, MyClass::OnKernelBooted, ()), this);

◆ AddIdle()

virtual void CINOSKernel::AddIdle ( void apFunction,
void apObject 
)
virtual

Add idle handler. The given function is called whenever the CPU goes into idle state IMPORTANT things to notice :

  • always immediately return from function to avoid blocking other idle handlers
  • using floating point instructions is NOT allowed
  • be aware of the fact, that the function is called with full CPU speed!

◆ GetKernelState()

static int32 CINOSKernel::GetKernelState ( )
inlinestatic

Get kernel state. Valid values are.

eStaPreboot = -1,
eStaBootingCore0 = 0,
eStaBootingCore1 = 1,
eStaBootingCore2 = 2,
eStaBootingCore3 = 3,
eStaBootingCore4 = 4,
eStaBootingCore5 = 5,
eStaBootingCore6 = 6,
eStaBootingCore7 = 7,
eStaBootingCore8 = 8,
eStaBootingCore9 = 9,
eStaBootingCore10 = 10,
eStaBootingCore11 = 11,
eStaBootingCore12 = 12,
eStaBootingCore13 = 13,
eStaBootingCore14 = 14,
eStaBootingCore15 = 15,
eStaSyncTimebase = 64,
eStaFinalyse = 65,
eStaRunning = 66,
Returns
none

Friends And Related Symbol Documentation

◆ ActualTask

class CINOSTask * ActualTask ( )
friend

Return pointer to actual running task.

Returns
Pointer to actual task

◆ ChangePriority

void ChangePriority ( uint32  auPriority)
friend

Change priority of current task and do a reschedule if necessary. For more info see section Priority.

Parameters
auPriorityRequired new priority
Returns
none

◆ Exit

void Exit ( uint32  auExitCode)
friend

Terminate actual task.

Parameters
auExitCodeExit code

◆ Goodbye

void Goodbye ( )
friend

Suspend current task from execution without saving its context.

Returns
none

◆ Ready [1/2]

void Ready ( class CINOSTask apTask,
uint32  auFlags 
)
friend

Put given task into ready list but do not schedule. This method is normally used in conjunction with Schedule.

Parameters
apTaskPointer to task to be put into ready list
auFlagsAdditional flags (usually only for internal use)
Returns
none

◆ Ready [2/2]

void Ready ( tTaskId  aidTask,
uint32  auFlags 
)
friend

Put given task into ready list but do not schedule. This method is normally used in conjunction with Schedule.

Parameters
aidTaskId of task to be put into ready list
auFlagsAdditional flags (usually only for internal use)
Returns
none

◆ Relinquish

void Relinquish ( )
friend

Give other tasks with the same priority a chance to run. For more info see section Relinquish.

Returns
none

◆ Resume [1/2]

void Resume ( class CINOSTask apTask,
uint32  auFlags 
)
friend

Resume given task and put it into ready list.

Parameters
apTaskPointer to task to be resumed
auFlagsAdditional flags (usually only for internal use)
Returns
none

◆ Resume [2/2]

void Resume ( tTaskId  aidTask,
uint32  auFlags 
)
friend

Resume given task and put it into ready list.

Parameters
aidTaskId of task to be resumed
auFlagsAdditional flags (usually only for internal use)
Returns
none

◆ Schedule [1/2]

void Schedule ( )
friend

Do an explicite schedule. This method is normally used in in conjunction with Ready In case of using a multi core system (INOS_MULTICORE), the very same rules related to core locks are valid as for Suspend(). Read these notes carefully.

Returns
none

◆ Schedule [2/2]

void Schedule ( uint32  auCoreId)
friend

Do an explicite schedule or given core. This method is normally used in in conjunction with Ready In case of using a multi core system (INOS_MULTICORE), be aware that this function may call the overloaded function Schedule() (the version taking no arguments), which may alter any "core locks" as explained there.

Returns
none

◆ Suspend

end of doxygen exclude friend void Suspend ( uint32  auTaskState,
uint32  auFlags 
)
friend

Suspend current task from execution. Note that upon Resume, the interrupt state will be restored to the one at the time of calling Suspend, or in other words if interrupts were disabled at calling Suspend, they are still disabled after Resume. Any hold locks are NOT released. If this is required, use SuspendEx instead.

Parameters
auStateRequired task state
auFlagsAdditional flags (usually only for internal use)
Returns
none

◆ SuspendEx

void SuspendEx ( uint32  auTaskState,
SINOSCoreLock apLock,
CINOSTask apTask 
)
friend

Suspend current task from execution and release the given lock. The lock will be released completely, means that even if it was acquired multiple times (recursively), it'll be completely released (means: be set to 0). This is required, as the function will cause the calling task to suspend - and therefore it'll not continue execution and therefore, any core locks MUST be released in order to not disturb other cores. Note that upon Resume, any previously held lock will NOT be re-acquired. This is in contrast to interrupt state at the time of calling Suspend, which will be restored - but core locks will NOT. This is because it could add unwanted jitter to the Resumed()-ed task. Therefore, the caller needs to take additional action in order to lock any previously held core locks again.

Parameters
auStateRequired task state
apLockPointer lock to be unlocked
apTaskPointer to task be atomically resumed AFTER suspend
Returns
none

◆ SwitchCore

uint32 SwitchCore ( uint32  auCoreId)
friend

Switch current task to the given core.

Parameters
auCoreIdId of core the task has to run om
Returns
INOS_OK or an appropriate error code

The documentation for this class was generated from the following file: