|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|

宏定义 | |
| #define | LOS_ERRNO_RWSEM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x00) |
| #define | LOS_ERRNO_RWSEM_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x01) |
| #define | LOS_ERRNO_RWSEM_ALL_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x02) |
| #define | LOS_ERRNO_RWSEM_PEND_INTERR LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x03) |
| #define | LOS_ERRNO_RWSEM_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x04) |
| #define | LOS_ERRNO_RWSEM_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x05) |
| #define | LOS_ERRNO_RWSEM_PENDED LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x06) |
| #define | LOS_ERRNO_RWSEM_INVALID_STATUS LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x07) |
| #define | LOS_ERRNO_RWSEM_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x08) |
函数 | |
| UINT32 | LOS_RwsemCreate (UINT32 *semHandle) |
| Create a RW semaphore. | |
| UINT32 | LOS_RwsemDelete (UINT32 semHandle) |
| Delete a RW semaphore. | |
| UINT32 | LOS_RwsemPendRead (UINT32 semHandle, UINT32 timeout) |
| Request a RW semaphore. | |
| UINT32 | LOS_RwsemPostRead (UINT32 semHandle) |
| Release a RW semaphore. | |
| UINT32 | LOS_RwsemPendWrite (UINT32 semHandle, UINT32 timeout) |
| Request a RW semaphore. | |
| UINT32 | LOS_RwsemPostWrite (UINT32 semHandle) |
| Release a RW semaphore. | |
| UINT32 | LOS_RwsemDowngradeWrite (UINT32 semHandle) |
| Release a RW semaphore. | |
| #define LOS_ERRNO_RWSEM_ALL_BUSY LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x02) |
RW Semaphore error code: No RW semaphore control structure is available.
Value: 0x02002202.
Solution: Perform corresponding operations based on the requirements in the code context.
| #define LOS_ERRNO_RWSEM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x00) |
RW Semaphore error code: Invalid parameter.
Value: 0x02002200.
Solution: Change the passed-in invalid parameter value to a valid value.
| #define LOS_ERRNO_RWSEM_INVALID_STATUS LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x07) |
RW Semaphore error code: Invalid status.
Value: 0x02002207.
Solution: Use the pend and post APIs in pairs.
| #define LOS_ERRNO_RWSEM_PEND_IN_LOCK LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x04) |
RW Semaphore error code: The task is unable to request a semaphore because task scheduling is locked.
Value: 0x02002204.
Solution: Do not call the API when task scheduling is locked.
| #define LOS_ERRNO_RWSEM_PEND_INTERR LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x03) |
RW Semaphore error code: The API is called during an interrupt, which is forbidden.
Value: 0x02002203.
Solution: Do not call the API during an interrupt.
| #define LOS_ERRNO_RWSEM_PENDED LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x06) |
RW Semaphore error code: The waiting queue for the RW semaphore is not empty.
Value: 0x02002206.
Solution: Delete the RW semaphore after awaking all tasks that are waiting on the semaphore.
| #define LOS_ERRNO_RWSEM_PTR_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x01) |
RW Semaphore error code: Null pointer.
Value: 0x02002201.
Solution: Change the passed-in null pointer to a valid non-null pointer.
| #define LOS_ERRNO_RWSEM_TIMEOUT LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x05) |
RW Semaphore error code: The request for a RW semaphore times out.
Value: 0x02002205.
Solution: Change the passed-in parameter value to the value within the valid range.
| #define LOS_ERRNO_RWSEM_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_RWSEM, 0x08) |
RW Semaphore error code: The RW semaphore is not immediately available.
Value: 0x02002208.
Solution: Obtain the RW semaphore only when the semaphore is available.
Create a RW semaphore.
| semHandle | [OUT] ID of the RW semaphore control structure that is initialized. |
| LOS_ERRNO_RWSEM_PTR_NULL | The passed-in semHandle value is NULL. |
| LOS_ERRNO_RWSEM_ALL_BUSY | No RW semaphore control structure is available. |
| LOS_OK | The RW semaphore is successfully created. |
Delete a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be deleted. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| LOS_ERRNO_RWSEM_INVALID | The passed-in RW semHandle value is invalid. |
| LOS_ERRNO_RWSEM_PENDED | The waiting queue for the RW semaphore is not empty. |
| LOS_OK | The RW semaphore control structure is successfully deleted. |
Release a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be downgraded. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| LOS_ERRNO_RWSEM_INVALID | The passed-in RW semHandle value is invalid. |
| LOS_ERRNO_RWSEM_INVALID_STATUS | Invalid status. |
| LOS_OK | The RW semaphore is successfully released. |
Request a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be requested. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| timeout | [IN] Timeout interval for waiting on the RW semaphore. The value range is [0, 0xFFFFFFFF]. If the value is set to 0, the RW semaphore is not waited on. If the value is set to 0xFFFFFFFF, the RW semaphore is waited on forever(unit: Tick). |
| LOS_ERRNO_RWSEM_INVALID | The passed-in semHandle value is invalid. |
| LOS_ERRNO_RWSEM_PEND_INTERR | The API is called during an interrupt, which is forbidden. |
| LOS_ERRNO_RWSEM_PEND_IN_LOCK | The task is unable to request a RW semaphore because task scheduling is locked. |
| LOS_ERRNO_RWSEM_TIMEOUT | The request for the RW semaphore times out. |
| LOS_OK | The RW semaphore request succeeds. |
Request a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be requested. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| timeout | [IN] Timeout interval for waiting on the RW semaphore. The value range is [0, 0xFFFFFFFF]. If the value is set to 0, the RW semaphore is not waited on. If the value is set to 0xFFFFFFFF, the RWsemaphore is waited on forever(unit: Tick). |
| LOS_ERRNO_RWSEM_INVALID | The passed-in semHandle value is invalid. |
| LOS_ERRNO_RWSEM_PEND_INTERR | The API is called during an interrupt, which is forbidden. |
| LOS_ERRNO_RWSEM_PEND_IN_LOCK | The task is unable to request a RW semaphore because task scheduling is locked. |
| LOS_ERRNO_RWSEM_TIMEOUT | The request for the semaphore times out. |
| LOS_OK | The RW semaphore request succeeds. |
Release a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be released. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| LOS_ERRNO_RWSEM_INVALID | The passed-in semHandle value is invalid. |
| LOS_ERRNO_RWSEM_INVALID_STATUS | Invalid status. |
| LOS_OK | The RW semaphore is successfully released. |
Release a RW semaphore.
| semHandle | [IN] ID of the RW semaphore control structure to be released. The ID of the RW semaphore control structure is obtained from semaphore creation. |
| LOS_ERRNO_RWSEM_INVALID | The passed-in semHandle value is invalid. |
| LOS_ERRNO_RWSEM_INVALID_STATUS | Invalid status. |
| LOS_OK | The RW semaphore is successfully released. |