|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
函数 | |
| void * | osal_kmalloc (unsigned long size, unsigned int osal_gfp_flag) |
| Alloc dynamic memory. | |
| void * | osal_kzalloc (unsigned long size, unsigned int osal_gfp_flag) |
| Alloc dynamic memory. | |
| void * | osal_kmalloc_align (unsigned int size, unsigned int osal_gfp_flag, unsigned int boundary) |
| alloc aligned dynamic memory. | |
| void * | osal_kzalloc_align (unsigned int size, unsigned int osal_gfp_flag, unsigned int boundary) |
| alloc aligned dynamic memory. | |
| void | osal_kfree (void *addr) |
| Free dynamic memory. | |
| void * | osal_vmalloc (unsigned long size) |
| alloc virtually contiguous memory. | |
| void * | osal_vzalloc (unsigned long size) |
| alloc virtually contiguous memory. | |
| void | osal_vfree (void *addr) |
| release memory allocd by vmalloc(). | |
| int | osal_pool_mem_init (void *pool, unsigned int size) |
| Initialize dynamic memory. | |
| void * | osal_pool_mem_alloc (void *pool, unsigned int size) |
| alloc dynamic memory. | |
| void * | osal_pool_mem_alloc_align (void *pool, unsigned int size, unsigned int boundary) |
| alloc aligned memory. | |
| void | osal_pool_mem_free (void *pool, const void *addr) |
| Free dynamic memory. | |
| int | osal_pool_mem_deinit (void *pool) |
| Deinitialize dynamic memory. | |
| osal_blockmem_status | osal_blockmem_get_status (unsigned long phyaddr, unsigned int size) |
| Get the block mem status. | |
| void * | osal_ioremap (unsigned long phys_addr, unsigned long size) |
| Map bus memory into CPU space. | |
| void * | osal_ioremap_nocache (unsigned long phys_addr, unsigned long size) |
| Map bus memory into CPU space. | |
| void * | osal_ioremap_cached (unsigned long phys_addr, unsigned long size) |
| Map bus memory into CPU space. | |
| void | osal_iounmap (void *addr, unsigned long size) |
| Free a IO remapping. | |
| void * | osal_ioremap_wc (unsigned long phys_addr, unsigned long size) |
| map memory into CPU space write combined. | |
| void * | osal_phys_to_virt (unsigned long addr) |
| Change physical addresses to virtual addresses. | |
| unsigned long | osal_virt_to_phys (const void *virt_addr) |
| Change virtual addresses to physical addresses. | |
| void * | osal_blockmem_vmap (unsigned long phys_addr, unsigned long size) |
| Maps size from phys_addr into contiguous kernel virtual space. | |
| void | osal_blockmem_vunmap (const void *virt_addr) |
| Free the virtually contiguous memory area. | |
| void | osal_blockmem_free (unsigned long phys_addr, unsigned long size) |
| Free the reserved memory which has been defined in product. | |
| unsigned long | osal_copy_from_user (void *to, const void *from, unsigned long n) |
| copy_from_user. | |
| unsigned long | osal_copy_to_user (void *to, const void *from, unsigned long n) |
| copy_to_user. | |
| int | osal_access_ok (int type, const void *addr, unsigned long size) |
| Check whether the user space memory block is available. | |
| int osal_access_ok | ( | int | type, |
| const void * | addr, | ||
| unsigned long | size | ||
| ) |
Check whether the user space memory block is available.
| type | [in] Access type. 0:read, 1:write. |
| addr | [in] A pointer variable to user space that points to the beginning of a memory block to be checked. |
| size | [in] Size of the memory block to be checked. |
| true | user space memory block is available. |
| false | user space memory block is unavailable. |
| void osal_blockmem_free | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
Free the reserved memory which has been defined in product.
| phys_addr | physical address |
| size | Size of the address to be manipulated |
| osal_blockmem_status osal_blockmem_get_status | ( | unsigned long | phyaddr, |
| unsigned int | size | ||
| ) |
Get the block mem status.
| phyaddr | physical address |
| size | Size of the address to be manipulated |
| OSAL_BLOCKMEM_VALID | The block mem is valid. |
| OSAL_BLOCKMEM_INVALID_PHYADDR | The block mem is invalid. |
| OSAL_BLOCKMEM_INVALID_SIZE | The block mem is invalid. |
| void * osal_blockmem_vmap | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
Maps size from phys_addr into contiguous kernel virtual space.
| phys_addr | physical address |
| size | Size of the address to be manipulated |
| void osal_blockmem_vunmap | ( | const void * | virt_addr | ) |
Free the virtually contiguous memory area.
| virt_addr | virtual address |
| unsigned long osal_copy_from_user | ( | void * | to, |
| const void * | from, | ||
| unsigned long | n | ||
| ) |
copy_from_user.
| to | [out] The kernel address to which the data is copied. |
| from | [in] The user space address of the data to be copied. |
| n | [in] Length of data to be copied (unit: bytes). |
| unsigned long osal_copy_to_user | ( | void * | to, |
| const void * | from, | ||
| unsigned long | n | ||
| ) |
copy_to_user.
| to | [out] The user space address to which the data is copied. |
| from | [in] The kernel address of the data to be copied. |
| n | [in] Length of data to be copied (unit: bytes). |
| void * osal_ioremap | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
Map bus memory into CPU space.
| phys_addr | [in] bus address of the memory |
| size | [in] size of the resource to map |
| void * osal_ioremap_cached | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
Map bus memory into CPU space.
| phys_addr | [in] bus address of the memory |
| size | [in] size of the resource to map |
| void * osal_ioremap_nocache | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
Map bus memory into CPU space.
| phys_addr | [in] bus address of the memory |
| size | [in] size of the resource to map |
| void * osal_ioremap_wc | ( | unsigned long | phys_addr, |
| unsigned long | size | ||
| ) |
map memory into CPU space write combined.
| phys_addr | [in] bus address of the memory |
| size | [in] size of the resource to map |
| void osal_iounmap | ( | void * | addr, |
| unsigned long | size | ||
| ) |
Free a IO remapping.
| addr | [in] virtual address from ioremap_*. |
| size | [in] size of the resource to map |
| void osal_kfree | ( | void * | addr | ) |
Free dynamic memory.
| addr | [in] Starting address of the memory block to be freed. |
| void * osal_kmalloc | ( | unsigned long | size, |
| unsigned int | osal_gfp_flag | ||
| ) |
Alloc dynamic memory.
| size | [in] How many bytes of memory are required. |
| osal_gfp_flag | [in] The type of memory to alloc. This parameter is not used in liteos and freertos. In linux, it must include one of the following access modes: OSAL_GFP_ATOMIC, OSAL_GFP_DMA, OSAL_GFP_KERNEL. OSAL_GFP_ZERO can be bitwise-or'd in flags, Then, the memory is set to zero. |
| void * osal_kmalloc_align | ( | unsigned int | size, |
| unsigned int | osal_gfp_flag, | ||
| unsigned int | boundary | ||
| ) |
alloc aligned dynamic memory.
| size | [in] Size of the memory block to be allocd (unit: byte). |
| osal_gfp_flag | [in] The type of memory to alloc. This parameter is not used in liteos and freertos. In linux, it must include one of the following access modes: OSAL_GFP_ATOMIC, OSAL_GFP_DMA, OSAL_GFP_KERNEL. OSAL_GFP_ZERO can be bitwise-or'd in flags, Then, the memory is set to zero. |
| boundary | [in] Boundary on which the memory is aligned. (unit: byte). |
| void * osal_kzalloc | ( | unsigned long | size, |
| unsigned int | osal_gfp_flag | ||
| ) |
Alloc dynamic memory.
| size | [in] How many bytes of memory are required. |
| osal_gfp_flag | [in] The type of memory to alloc. This parameter is not used in liteos and freertos. In linux, it must include one of the following access modes: OSAL_GFP_ATOMIC, OSAL_GFP_DMA, OSAL_GFP_KERNEL. OSAL_GFP_ZERO can be bitwise-or'd in flags, Then, the memory is set to zero. |
| void * osal_kzalloc_align | ( | unsigned int | size, |
| unsigned int | osal_gfp_flag, | ||
| unsigned int | boundary | ||
| ) |
alloc aligned dynamic memory.
| size | [in] Size of the memory block to be allocd (unit: byte). |
| osal_gfp_flag | [in] The type of memory to alloc. This parameter is not used in liteos and freertos. In linux, it must include one of the following access modes: OSAL_GFP_ATOMIC, OSAL_GFP_DMA, OSAL_GFP_KERNEL. OSAL_GFP_ZERO can be bitwise-or'd in flags, Then, the memory is set to zero. |
| boundary | [in] Boundary on which the memory is aligned. (unit: byte). |
| void * osal_phys_to_virt | ( | unsigned long | addr | ) |
Change physical addresses to virtual addresses.
| addr | physical address |
| void * osal_pool_mem_alloc | ( | void * | pool, |
| unsigned int | size | ||
| ) |
alloc dynamic memory.
| pool | [in] Pointer to the memory pool that contains the memory block to be allocd. |
| size | [in] Size of the memory block to be allocd (unit: byte). |
| NULL | The memory fails to be allocd. |
| VOID* | The memory is successfully allocd, and the API returns the pointer to the allocd memory block. |
| void * osal_pool_mem_alloc_align | ( | void * | pool, |
| unsigned int | size, | ||
| unsigned int | boundary | ||
| ) |
alloc aligned memory.
| pool | [in] Pointer to the memory pool that contains the memory block to be allocd. |
| size | [in] Size of the memory block to be allocd (unit: byte). |
| boundary | [in] Boundary on which the memory is aligned. (unit: byte). |
| int osal_pool_mem_deinit | ( | void * | pool | ) |
Deinitialize dynamic memory.
| pool | [in] Starting address of memory. |
| OSAL_FAILURE | The dynamic memory fails to be deinitialized. |
| OSAL_SUCCESS | The dynamic memory is successfully deinitialized. |
| void osal_pool_mem_free | ( | void * | pool, |
| const void * | addr | ||
| ) |
Free dynamic memory.
| pool | [in] Pointer to the memory pool that contains the dynamic memory block to be freed. |
| addr | [in] Starting address of the memory block to be freed. |
| int osal_pool_mem_init | ( | void * | pool, |
| unsigned int | size | ||
| ) |
Initialize dynamic memory.
| pool | [in] Starting address of memory. |
| size | [in] Memory size. |
| void osal_vfree | ( | void * | addr | ) |
release memory allocd by vmalloc().
| addr | [in] Starting address of the memory block to be freed. |
| unsigned long osal_virt_to_phys | ( | const void * | virt_addr | ) |
Change virtual addresses to physical addresses.
| void * osal_vmalloc | ( | unsigned long | size | ) |
alloc virtually contiguous memory.
| size | [in] How many bytes of memory are required. |
| void * osal_vzalloc | ( | unsigned long | size | ) |
alloc virtually contiguous memory.
| size | [in] How many bytes of memory are required. |