Global¶
- group Global_CILmutex
CILmutex globals.
lorem
Macros¶
- group Macros_CILmutex_h
Variables¶
- group Variables_CILmutex_h
API’s¶
- group Apis_CILmutex_h
Getters¶
- group Getters_CILmutex_h
Setters¶
- group Setters_CILmutex_h
General¶
- group General_CILmutex_h
Functions
-
CosmOS_MutexStateType CILmutex_tryMutex(AddressType *mutexPointer)¶
Try to get mutex. This function cannot be called from the unprivileged context directly. DEMO.
The implementation contains disabling interrupts before any other instructions are executed. Then the value 1 is loaded to the register R1. The R0 register as it has argument 1 role in the procedure call standard holds address of the mutex and the value from this address is then loaded to the R3 register to compare it with value 0. If the mutex is free (value in its address is 0) the value 1 is stored to the mutex address and state MUTEX_STATE_ENUM__SUCCESSFULLY_LOCKED to the register R1, otherwise the state stored to R1 is MUTEX_STATE_ENUM__OCCUPIED. The mutexState is then loaded with the R1 value. After this point interrupts are enabled again and the mutexState is returned from the function.
- Parameters
mutexPointer – [in] pointer to the mutex variable that stores mutex value
- Returns
CosmOS_MutexStateType
-
CosmOS_MutexStateType CILmutex_releaseMutex(AddressType *mutexPointer)¶
Release mutex. This function cannot be called from the unprivileged context directly. DEMO.
The implementation contains disabling interrupts before any other instructions are executed. Then the value 0 is loaded to the register R1. The R0 register as it has argument 1 role in the procedure call standard holds address of the mutex. The R1 value is then stored to the mutex address. The mutexState is then loaded with the R1 value. After this point interrupts are enabled again and the mutexState is returned from the function.
- Parameters
mutexPointer – [in] pointer to the mutex variable that stores mutex value
- Returns
CosmOS_MutexStateType
-
CosmOS_MutexStateType CILmutex_tryMutex(AddressType *mutexPointer)¶