![]() |
NMSIS-Core
Version 1.4.0
NMSIS-Core support for Nuclei processor-based devices
|
Functions that configure and use semaphoresSemaphore is very useful for multi-core cluster without SMP enable. More...
Functions | |
__STATIC_FORCEINLINE uint32_t | CIDU_GetSemaphoreStatus (uint32_t semph_n) |
Get SEMAPHOREn's value. More... | |
__STATIC_FORCEINLINE long | CIDU_CheckSemaphoreAcquired (uint32_t semph_n, uint32_t core_id) |
check SEMAPHOREn's acquired status More... | |
__STATIC_FORCEINLINE long | CIDU_AcquireSemaphore (uint32_t semph_n, uint32_t core_id) |
Acquire the SEMAPHOREn. More... | |
__STATIC_FORCEINLINE void | CIDU_AcquireSemaphore_Block (uint32_t semph_n, uint32_t core_id) |
Keep acquiring the SEMAPHOREn until it has acquired this semaphore successfully. More... | |
__STATIC_FORCEINLINE void | CIDU_ReleaseSemaphore (uint32_t semph_n) |
Release the SEMAPHOREn. More... | |
Functions that configure and use semaphores
Semaphore is very useful for multi-core cluster without SMP enable.
__STATIC_FORCEINLINE long CIDU_AcquireSemaphore | ( | uint32_t | semph_n, |
uint32_t | core_id | ||
) |
Acquire the SEMAPHOREn.
Acuqire the SEMAPHOREn, and check the acquired status
[in] | semph_n | the semaphore id used to protect a critical resource |
[in] | core_id | the core id that wants to access the critical resource |
Definition at line 386 of file core_feature_cidu.h.
References __SW(), CIDU_CheckSemaphoreAcquired(), and CIDU_SEMAPHORE_ADDR.
Referenced by CIDU_AcquireSemaphore_Block().
__STATIC_FORCEINLINE void CIDU_AcquireSemaphore_Block | ( | uint32_t | semph_n, |
uint32_t | core_id | ||
) |
Keep acquiring the SEMAPHOREn until it has acquired this semaphore successfully.
Query that whether SEMAPHOREn has been owned by one core successfully, if not, keep trying.
[in] | semph_n | the semaphore id used to protect a critical resource |
[in] | core_id | the core id that wants to access the critical resource |
Definition at line 408 of file core_feature_cidu.h.
References CIDU_AcquireSemaphore().
__STATIC_FORCEINLINE long CIDU_CheckSemaphoreAcquired | ( | uint32_t | semph_n, |
uint32_t | core_id | ||
) |
check SEMAPHOREn's acquired status
Query that whether SEMAPHOREn has been acquired by one core successfully.
[in] | semph_n | the semaphore id used to protect a critical resource |
[in] | core_id | the core id that wants to access the critical resource |
Definition at line 362 of file core_feature_cidu.h.
References CIDU_GetSemaphoreStatus().
Referenced by CIDU_AcquireSemaphore().
__STATIC_FORCEINLINE uint32_t CIDU_GetSemaphoreStatus | ( | uint32_t | semph_n | ) |
Get SEMAPHOREn's value.
Just query the semaphore n's value
[in] | semph_n | the semaphore id used to protect a critical resource |
Definition at line 339 of file core_feature_cidu.h.
References __LW(), and CIDU_SEMAPHORE_ADDR.
Referenced by CIDU_CheckSemaphoreAcquired().
__STATIC_FORCEINLINE void CIDU_ReleaseSemaphore | ( | uint32_t | semph_n | ) |
Release the SEMAPHOREn.
Release the SEMAPHOREn by writing all 1 to SEMAPHOREn register.
[in] | semph_n | the semaphore id used to protect a critical resource |
Definition at line 427 of file core_feature_cidu.h.
References __SW(), and CIDU_SEMAPHORE_ADDR.