Global¶
- group Global_osEvent
osEvent globals
lorem
Macros¶
- group Macros_osEvent_h
Variables¶
- group Variables_osEvent_h
API’s¶
- group Apis_osEvent_h
Getters¶
- group Getters_osEvent_h
Functions
-
CosmOS_BooleanType *osEvent_getOsEventHandleCores(CosmOS_OsEventConfigurationType *osEvent)¶
Get handleCores pointer.
- Parameters
osEvent – [in] configuration pointer
- Returns
CosmOS_BooleanType *
-
CosmOS_BooleanType osEvent_getOsEventHandleCore(CosmOS_OsEventConfigurationType *osEvent, BitWidthType coreId)¶
-
BitWidthType osEvent_getOsEventSpinlockId(CosmOS_OsEventConfigurationType *osEvent)¶
Get spinlockId.
- Parameters
osEvent – [in] configuration pointer
- Returns
BitWidthType
-
CosmOS_GenericVoidType *osEvent_getOsEventFuncs(CosmOS_OsEventConfigurationType *osEvent)¶
Get eventFuncs.
- Parameters
osEvent – [in] configuration pointer
- Returns
CosmOS_GenericVoidType *
-
CosmOS_GenericVoidType osEvent_getOsEventFunc(CosmOS_OsEventConfigurationType *osEvent, BitWidthType event)¶
-
BitWidthType osEvent_getOsEventNumberOfEventFuncs(CosmOS_OsEventConfigurationType *osEvent)¶
Get numberOfEventFuncs.
- Parameters
osEvent – [in] configuration pointer
- Returns
BitWidthType
-
BitWidthType osEvent_getOsEvent(CosmOS_OsEventConfigurationType *osEvent)¶
Get event.
- Parameters
osEvent – [in] configuration pointer
- Returns
BitWidthType
-
AddressType *osEvent_getOsEventDataPool(CosmOS_OsEventConfigurationType *osEvent)¶
Get dataPool pointer.
- Parameters
osEvent – [in] configuration pointer
- Returns
AddressType *
-
BitWidthType osEvent_getOsEventDataPoolSize(CosmOS_OsEventConfigurationType *osEvent)¶
Get dataPoolSize.
- Parameters
osEvent – [in] configuration pointer
- Returns
BitWidthType
-
CosmOS_BooleanType *osEvent_getOsEventHandleCores(CosmOS_OsEventConfigurationType *osEvent)¶
Setters¶
- group Setters_osEvent_h
Functions
-
void osEvent_setOsEventHandleCore(CosmOS_OsEventConfigurationType *osEvent, BitWidthType coreId, CosmOS_BooleanType paramHandleCore)¶
-
void osEvent_setOsEvent(CosmOS_OsEventConfigurationType *osEvent, BitWidthType paramEvent)¶
-
void osEvent_setOsEventHandleCore(CosmOS_OsEventConfigurationType *osEvent, BitWidthType coreId, CosmOS_BooleanType paramHandleCore)¶
General¶
- group General_osEvent_h
Functions
-
void osEvent_triggerEventInternal(BitWidthType id, CosmOS_BooleanType *handleCores, BitWidthType event)¶
OS trigger event internal function. This function cannot be called from the unprivileged context directly.
The implementation contains obtaining of operating system configuration structure used to get number of cores and event configuration structure by calling functions os_getOsNumberOfCores and os_getOsEventCfg. CILcore_getCoreId call returns then id of the current core. Then os event and the data pointer are set in the event variable by calling functions osEvent_setOsEvent and osEvent_setOsEventData. After this point the for loop is implemented that iterates over all cores, to set cores which handle this event except the current core - it remains False, by calling function osEvent_setOsEventHandleCore. In the end other cores are signalized by calling CILcore_triggerEvent function.
- Parameters
id – [in] is used during the system call dispatching
handleCores – [in] pointer to the array with all handleCores booleans
event – [in] required event to trigger
- Returns
none
-
CosmOS_OsEventStateType osEvent_triggerEvent(BitWidthType event, CosmOS_BooleanType *handleCores, AddressType *data, BitWidthType size)¶
OS event trigger function.
The implementation contains obtaining of operating system configuration structure used to get number of cores and event configuration structure by calling functions os_getOsNumberOfCores and os_getOsEventCfg. CILcore_getCoreId call returns then id of the current core. Next the number of event handler functions is obtained by calling function osEvent_getOsEventNumberOfEventFuncs. If the event number is less than numberOfEventFuncs the OS_EVENT_STATE_ENUM__ERROR_INVALID_EVENT is returned from the function. Otherwise a for loop is implemented that iterates over all cores except the current core to check if there is atleast one core that should handle this event, otherwise the function returns value OS_EVENT_STATE_ENUM__ERROR_ATLEAST_ONE_CORE_MUST_HANDLE_EVENT. If there is atleast one core except the current one that should handle this event the function osEvent_getOsEventSpinlockId gets the spinlockId of the event spinlock used in the function spinlock_trySpinlock. Do-while loop is implemented to try to get spinlock. Then a do-while loop is implemented to check if there is any unhandled event, if yes we wait in this loop till the event will be handled and proceed afterwards. Next the CILcore_isInPrivilegedMode function is called to check if the core is in privileged mode, and call osEvent_triggerEventInternal internal function which sets system internal event variable as systemCall or a normal function call. After this point the spinlock can be again unlocked by calling function spinlock_releaseSpinlock and assertion is implemented to check if the spinlock was released. In the end the return value is set to OS_EVENT_STATE_ENUM__OK and returned from the function.
- Parameters
event – [in] required event to trigger
handleCores – [in] pointer to the array with all handleCores booleans
data – [in] pointer to the data passed to the event
size – [in] of the data to copy
- Returns
none
-
void osEvent_dispatchEvent(void)¶
OS dispatch event function.
The implementation contains obtaining of operating system configuration structure used to get event configuration structure by calling function os_getOsEventCfg. CILcore_getCoreId call returns then id of the current core used as parameter in the function osEvent_getOsEventHandleCore to check if the current core should handle the event, if yes the function osEvent_getOsEvent is called to get the event number and then the number of event handler function is obtained by calling the function osEvent_getOsEventNumberOfEventFuncs. Assertion checks if the event number is less than number of event handler functions (as these are mapped together) and event handler is then obtained by osEvent_getOsEventFunc. Another assertion checks if the handles is not null pointer and event handler is called right afterwards. Then the function osEvent_setOsEventHandleCore is called to set handleCore variable for this core to handled (False).
- Parameters
none –
- Returns
none
-
void osEvent_triggerEventInternal(BitWidthType id, CosmOS_BooleanType *handleCores, BitWidthType event)¶