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

宏定义 | |
| #define | LOS_ERRNO_DYN_SHM_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x00) |
| #define | LOS_ERRNO_DYN_SHM_INPUT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x01) |
| #define | LOS_ERRNO_DYN_SHM_INIT_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x02) |
| #define | LOS_ERRNO_DYN_SHM_ALREADY_MAPPED LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x03) |
| #define | LOS_ERRNO_DYN_SHM_INIT_REPEATEDLY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x04) |
| #define | LOS_ERRNO_DYN_SHM_IN_ISR LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x05) |
| #define | LOS_ERRNO_DYN_SHM_NOT_READY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x06) |
函数 | |
| UINT32 | LOS_DynShmInit (DynShmConfig *config) |
| Init dynamic shared memory module. | |
| UINT32 | LOS_DynShmMap (UADDR inAddr, UINT32 size, DynShmMemType memType, UINTPTR *outAddr) |
| Setup Mapping from input address to output address. | |
| UINT32 | LOS_DynShmUnmap (UINTPTR virAddr, UINT32 size) |
| Destroy Mapping from input address to output address. | |
| UINT32 | LOS_DynShmAddrTranslate (UADDR inAddr, UADDR *outAddr, DynShmTransType optType) |
| Translate address from input to output. | |
| void * | LOS_DynShmBulkMalloc (DynShmBulkMem *mem) |
| Malloc memory in bulk. | |
| UINT32 | LOS_DynShmBulkFree (DynShmBulkMem *mem) |
| Malloc memory in bulk. | |
| #define LOS_ERRNO_DYN_SHM_ALREADY_MAPPED LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x03) |
Dynamic shared memory error code: The input addr is already mapped before.
Value: 0x02002303.
Solution: Check the addr, and unmap firstly, then map it again.
| #define LOS_ERRNO_DYN_SHM_IN_ISR LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x05) |
Dynamic shared memory error code: The API is called in ISR.
Value: 0x02002305.
Solution: Check your code and make sure the API is only called in ISR.
| #define LOS_ERRNO_DYN_SHM_INIT_FAILED LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x02) |
Dynamic shared memory error code: initialization failure.
Value: 0x02002302.
Solution: Check whether the mutex is created successfully.
| #define LOS_ERRNO_DYN_SHM_INIT_REPEATEDLY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x04) |
Dynamic shared memory error code: The module has been initialized more than once.
Value: 0x02002304.
Solution: Check your code and make sure LOS_DynShmInit is only called once.
| #define LOS_ERRNO_DYN_SHM_INPUT_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x01) |
Dynamic shared memory error code: The input is invalid.
Value: 0x02002301.
Solution: Check the input.
| #define LOS_ERRNO_DYN_SHM_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x00) |
Dynamic shared memory error code: The request for memory fails.
Value: 0x02002300.
Solution: Increase the size of virtual space.
| #define LOS_ERRNO_DYN_SHM_NOT_READY LOS_ERRNO_OS_ERROR(LOS_MOD_DYN_SHM, 0x06) |
Dynamic shared memory error code: The module has not been initialized well.
Value: 0x02002306.
Solution: Make sure APIs which starts with LOS_DynShm in the module are called after DynShm has been initialized well.
|
extern |
Translate address from input to output.
| inAddr | [IN] The input address. |
| outAddr | [OUT] The virtual address corresponding to inAddr. It must be 8-bytes aligned. |
| optType | [OUT] Translation direction. |
| LOS_ERRNO_DYN_SHM_INPUT_INVALID | The passed-in inAddr and optType is invalid. |
| LOS_OK | The address translation is done successfully. |
|
extern |
Malloc memory in bulk.
| dmaBuf | [IN] The allocated physical buffer by request. |
| virAddr | [IN] The mapped virtual address by LiteOS. |
| phyAddr | [IN] The allocated physical address by request. |
| size | [IN] The size of allocated memory. |
| type | [IN] The type of allocated memory. |
| LOS_ERRNO_DYN_SHM_INPUT_INVALID | The passed-in virAddr and size is invalid. |
| LOS_OK | The mapping is destroyed successfully. |
|
extern |
Malloc memory in bulk.
| dmaBuf | [OUT] The allocated physical buffer by request. |
| virAddr | [OUT] The mapped virtual address by LiteOS. |
| phyAddr | [IN] The allocated physical address by request. |
| size | [IN] The size of allocated memory. |
| type | [IN] The type of allocated memory. |
| NULL | The allocation is fail. |
| #non-zero | The allocation is successful. |
|
extern |
Init dynamic shared memory module.
| config | [IN] The user's configuration parameter. |
| LOS_ERRNO_DYN_SHM_INPUT_INVALID | The passed-in config is invalid. |
| LOS_ERRNO_DYN_SHM_INIT_FAILED | The mutex is created failed. |
| LOS_OK | The shm module is successfully inited. |
|
extern |
Setup Mapping from input address to output address.
| inAddr | [IN] The input address. 0 is legal parameter since it is not LiteOS virtual address. |
| size | [IN] The mapping area size. |
| memType | [IN] The type of mapping memory, including security and cache. |
| outAddr | [OUT] The address is virtual and managed by LiteOS. It must be 4-bytes aligned. |
| LOS_ERRNO_DYN_SHM_INPUT_INVALID | The passed-in config is invalid. |
| LOS_ERRNO_DYN_SHM_NO_MEMORY | The virtual space is not enough. |
| LOS_ERRNO_DYN_SHM_ALREADY_MAPPED | The mapping is already setup, do not repeatedly map. |
| LOS_OK | The mapping is setup successfully. |
Destroy Mapping from input address to output address.
| virAddr | [IN] The input address. Zero address will return failure since it cannot be found forever in virtual space. |
| size | [IN] The unmapping area size. |
| LOS_ERRNO_DYN_SHM_INPUT_INVALID | The passed-in virAddr and size is invalid. |
| LOS_OK | The mapping is destroyed successfully. |