mirror of
https://github.com/apache/nuttx.git
synced 2026-05-25 09:45:55 +08:00
Rename kmalloc to kmm_malloc for consistency
This commit is contained in:
@@ -83,7 +83,7 @@ struct symtab_s;
|
||||
struct binary_s
|
||||
{
|
||||
/* If CONFIG_SCHED_HAVE_PARENT is defined then schedul_unload() will
|
||||
* manage instances of struct binary_s allocated with kmalloc. It
|
||||
* manage instances of struct binary_s allocated with kmm_malloc. It
|
||||
* will keep the binary data in a link list and when SIGCHLD is received
|
||||
* (meaning that the task has exit'ed, schedul_unload() will find the
|
||||
* data, unload the module, and free the structure.
|
||||
@@ -261,13 +261,13 @@ int exec_module(FAR const struct binary_s *bin);
|
||||
* If CONFIG_SCHED_HAVE_PARENT is defined, this function may be called by
|
||||
* the parent of the newly created task to automatically unload the
|
||||
* module when the task exits. This assumes that (1) the caller is the
|
||||
* parent of the created task, (2) that bin was allocated with kmalloc()
|
||||
* parent of the created task, (2) that bin was allocated with kmm_malloc()
|
||||
* or friends. It will also automatically free the structure with kmm_free()
|
||||
* after unloading the module.
|
||||
*
|
||||
* Input Parameter:
|
||||
* pid - The task ID of the child task
|
||||
* bin - This structure must have been allocated with kmalloc() and must
|
||||
* bin - This structure must have been allocated with kmm_malloc() and must
|
||||
* persist until the task unloads
|
||||
*
|
||||
* Returned Value:
|
||||
|
||||
@@ -95,7 +95,7 @@ struct elf_loadinfo_s
|
||||
/* elfalloc is the base address of the memory that is allocated to hold the
|
||||
* ELF program image.
|
||||
*
|
||||
* If CONFIG_ARCH_ADDRENV=n, elfalloc will be allocated using kmalloc() (or
|
||||
* If CONFIG_ARCH_ADDRENV=n, elfalloc will be allocated using kmm_malloc() (or
|
||||
* kzalloc()). If CONFIG_ARCH_ADDRENV-y, then elfalloc will be allocated using
|
||||
* up_addrenv_create(). In either case, there will be a unique instance
|
||||
* of elfalloc (and stack) for each instance of a process.
|
||||
|
||||
@@ -77,7 +77,7 @@ struct nxflat_loadinfo_s
|
||||
/* Data Space (DSpace): This region contains all information that is
|
||||
* referenced as data (other than the stack which is separately allocated).
|
||||
*
|
||||
* If CONFIG_ARCH_ADDRENV=n, DSpace will be allocated using kmalloc() (or
|
||||
* If CONFIG_ARCH_ADDRENV=n, DSpace will be allocated using kmm_malloc() (or
|
||||
* kzalloc()). If CONFIG_ARCH_ADDRENV-y, then DSpace will be allocated using
|
||||
* up_addrenv_create(). In either case, there will be a unique instance
|
||||
* of DSpace (and stack) for each instance of a process.
|
||||
|
||||
@@ -126,8 +126,8 @@ extern "C"
|
||||
# define kmm_trysemaphore() umm_trysemaphore()
|
||||
# define kmm_givesemaphore() umm_givesemaphore()
|
||||
|
||||
# define kmalloc(s) malloc(s)
|
||||
# define kzalloc(s) zalloc(s)
|
||||
# define kmm_malloc(s) malloc(s)
|
||||
# define kmm_zalloc(s) zalloc(s)
|
||||
# define kmm_realloc(p,s) realloc(p,s)
|
||||
# define kmm_memalign(a,s) memalign(a,s)
|
||||
# define kmm_free(p) free(p)
|
||||
@@ -143,8 +143,8 @@ extern "C"
|
||||
# define kmm_trysemaphore() umm_trysemaphore()
|
||||
# define kmm_givesemaphore() umm_givesemaphore()
|
||||
|
||||
# define kmalloc(s) umm_malloc(s)
|
||||
# define kzalloc(s) umm_zalloc(s)
|
||||
# define kmm_malloc(s) umm_malloc(s)
|
||||
# define kmm_zalloc(s) umm_zalloc(s)
|
||||
# define kmm_realloc(p,s) umm_realloc(p,s)
|
||||
# define kmm_memalign(a,s) umm_memalign(a,s)
|
||||
# define kmm_free(p) umm_free(p)
|
||||
@@ -154,8 +154,6 @@ extern "C"
|
||||
* and we can call them directly.
|
||||
*/
|
||||
|
||||
FAR void *kmalloc(size_t size);
|
||||
FAR void *kzalloc(size_t size);
|
||||
#endif
|
||||
|
||||
/* Functions defined in sched/sched_kfree.c **********************************/
|
||||
|
||||
@@ -315,6 +315,12 @@ void kmm_givesemaphore(void);
|
||||
|
||||
FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size);
|
||||
|
||||
/* Functions contained in kmm_malloc.c **************************************/
|
||||
|
||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||
FAR void *kmm_malloc(size_t size);
|
||||
#endif
|
||||
|
||||
/* Functions contained in mm_free.c *****************************************/
|
||||
|
||||
void mm_free(FAR struct mm_heap_s *heap, FAR void *mem);
|
||||
@@ -350,6 +356,12 @@ FAR void *kmm_calloc(size_t n, size_t elem_size);
|
||||
|
||||
FAR void *mm_zalloc(FAR struct mm_heap_s *heap, size_t size);
|
||||
|
||||
/* Functions contained in kmm_zalloc.c **************************************/
|
||||
|
||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||
FAR void *kmm_zalloc(size_t size);
|
||||
#endif
|
||||
|
||||
/* Functions contained in mm_memalign.c *************************************/
|
||||
|
||||
FAR void *mm_memalign(FAR struct mm_heap_s *heap, size_t alignment,
|
||||
|
||||
@@ -483,7 +483,7 @@ extern "C"
|
||||
* inheritance: The caller's window structure may include extensions that
|
||||
* are not visible to NX.
|
||||
*
|
||||
* NOTE: wnd must have been allocated using kmalloc() (or related allocators)
|
||||
* NOTE: wnd must have been allocated using kmm_malloc() (or related allocators)
|
||||
* Once provided to nxfe_constructwindow() that memory is owned and managed
|
||||
* by NX. On certain error conditions or when the window is closed, NX will
|
||||
* free the window.
|
||||
|
||||
@@ -259,7 +259,7 @@ struct dspace_s
|
||||
uint16_t crefs;
|
||||
|
||||
/* This is the allocated D-Space memory region. This may be a physical
|
||||
* address allocated with kmalloc(), or it may be virtual address associated
|
||||
* address allocated with kmm_malloc(), or it may be virtual address associated
|
||||
* with an address environment (if CONFIG_ARCH_ADDRENV=y).
|
||||
*/
|
||||
|
||||
|
||||
@@ -318,7 +318,7 @@
|
||||
* Some hardware supports special memory in which request and descriptor data can
|
||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||
* the request/descriptor memory. If the underlying hardware does not support
|
||||
* such "special" memory, this functions may simply map to kmalloc.
|
||||
* such "special" memory, this functions may simply map to kmm_malloc.
|
||||
*
|
||||
* This interface was optimized under a particular assumption. It was assumed
|
||||
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
||||
@@ -376,7 +376,7 @@
|
||||
* Some hardware supports special memory in which larger IO buffers can
|
||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||
* the request/descriptor memory. If the underlying hardware does not support
|
||||
* such "special" memory, this functions may simply map to kmalloc.
|
||||
* such "special" memory, this functions may simply map to kmm_malloc.
|
||||
*
|
||||
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
|
||||
*
|
||||
@@ -676,7 +676,7 @@ struct usbhost_driver_s
|
||||
* be accessed more efficiently. The following methods provide a mechanism
|
||||
* to allocate and free the transfer descriptor memory. If the underlying
|
||||
* hardware does not support such "special" memory, these functions may
|
||||
* simply map to kmalloc and kmm_free.
|
||||
* simply map to kmm_malloc and kmm_free.
|
||||
*
|
||||
* This interface was optimized under a particular assumption. It was assumed
|
||||
* that the driver maintains a pool of small, pre-allocated buffers for descriptor
|
||||
@@ -691,7 +691,7 @@ struct usbhost_driver_s
|
||||
/* Some hardware supports special memory in which larger IO buffers can
|
||||
* be accessed more efficiently. This method provides a mechanism to allocate
|
||||
* the request/descriptor memory. If the underlying hardware does not support
|
||||
* such "special" memory, this functions may simply map to kmalloc.
|
||||
* such "special" memory, this functions may simply map to kmm_malloc.
|
||||
*
|
||||
* This interface differs from DRVR_ALLOC in that the buffers are variable-sized.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user