diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-05 17:33:50 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-04-05 17:33:50 +0000 |
commit | 3607bf2b4b1f2087cfb52ab4591f2ac347698a9c (patch) | |
tree | 0c034fe7e16b4d77846b1c3dea995474238da4f0 /nuttx/include | |
parent | 9f054efd67930f2dd6ef2a2f4e28eea3d8b10431 (diff) | |
download | px4-nuttx-3607bf2b4b1f2087cfb52ab4591f2ac347698a9c.tar.gz px4-nuttx-3607bf2b4b1f2087cfb52ab4591f2ac347698a9c.tar.bz2 px4-nuttx-3607bf2b4b1f2087cfb52ab4591f2ac347698a9c.zip |
More separation of kernel- and user-memory management
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3468 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/kmalloc.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/nuttx/include/nuttx/kmalloc.h b/nuttx/include/nuttx/kmalloc.h index 08b1b319b..aafe150fd 100644 --- a/nuttx/include/nuttx/kmalloc.h +++ b/nuttx/include/nuttx/kmalloc.h @@ -41,10 +41,12 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> #ifndef CONFIG_NUTTX_KERNEL # include <stdlib.h> +# include <nuttx/mm.h> #endif /**************************************************************************** @@ -74,13 +76,23 @@ extern "C" { #ifndef CONFIG_NUTTX_KERNEL -# define kmalloc(s) malloc(s) -# define kzalloc(s) zalloc(s) -# define krealloc(p,s) realloc(p,s) -# define kfree(p) free(p) +# define kmm_initialize(h,s) mm_initialize(h,s) +# define kmm_addregion(h,s) mm_addregion(h,s) +# define kmm_trysemaphore(h,s) mm_trysemaphore(h,s) +# define kmm_givesemaphore(h,s) mm_givesemaphore(h,s) + +# define kmalloc(s) malloc(s) +# define kzalloc(s) zalloc(s) +# define krealloc(p,s) realloc(p,s) +# define kfree(p) free(p) #else +KMALLOC_EXTERN void kmm_initialize(FAR void *heap_start, size_t heap_size); +KMALLOC_EXTERN void kmm_addregion(FAR void *heapstart, size_t heapsize); +KMALLOC_EXTERN int kmm_trysemaphore(void); +KMALLOC_EXTERN void kmm_givesemaphore(void); + KMALLOC_EXTERN FAR void *kmalloc(size_t); KMALLOC_EXTERN FAR void *kzalloc(size_t); KMALLOC_EXTERN FAR void *krealloc(FAR void*, size_t); |