From 1c52dce21617ec129ec139d246e98cce6b07b458 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 9 Mar 2013 21:12:20 +0000 Subject: [PATCH] More changes for a kernel-mode allocator (more to be done) git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5724 42af7a65-404d-4744-a932-0658087f49c3 --- Documentation/NuttxPortingGuide.html | 15 +- arch/8051/src/up_allocateheap.c | 6 +- arch/arm/src/common/up_allocateheap.c | 12 +- arch/arm/src/dm320/dm320_allocateheap.c | 17 +- arch/arm/src/dm320/dm320_framebuffer.c | 21 +- arch/arm/src/dm320/dm320_usbdev.c | 11 +- arch/arm/src/imx/imx_allocateheap.c | 11 +- arch/arm/src/lpc17xx/lpc17_allocateheap.c | 12 +- arch/arm/src/lpc17xx/lpc17_usbdev.c | 11 +- arch/arm/src/lpc214x/lpc214x_usbdev.c | 11 +- arch/arm/src/lpc31xx/lpc31_allocateheap.c | 12 +- arch/arm/src/lpc31xx/lpc31_usbdev.c | 9 +- arch/arm/src/lpc43xx/lpc43_allocateheap.c | 12 +- arch/arm/src/lpc43xx/lpc43_usb0dev.c | 9 +- arch/arm/src/sam3u/sam3u_allocateheap.c | 12 +- arch/arm/src/stm32/stm32_allocateheap.c | 12 +- arch/arm/src/stm32/stm32_otgfsdev.c | 9 +- arch/arm/src/stm32/stm32_usbdev.c | 5 +- arch/avr/src/at90usb/at90usb_usbdev.c | 11 +- arch/avr/src/common/up_allocateheap.c | 13 +- arch/hc/src/common/up_allocateheap.c | 14 +- arch/mips/src/common/up_allocateheap.c | 14 +- arch/mips/src/pic32mx/pic32mx-usbdev.c | 7 +- arch/rgmp/src/nuttx.c | 2 +- arch/sh/src/common/up_allocateheap.c | 14 +- arch/sim/src/up_allocateheap.c | 14 +- arch/sim/src/up_deviceimage.c | 21 +- arch/x86/src/common/up_allocateheap.c | 13 +- arch/z16/src/common/up_allocateheap.c | 11 +- arch/z80/src/common/up_allocateheap.c | 11 +- arch/z80/src/ez80/ez80_i2c.c | 13 +- arch/z80/src/z8/z8_i2c.c | 6 +- binfmt/binfmt_execmodule.c | 4 +- binfmt/binfmt_unloadmodule.c | 5 +- binfmt/libelf/libelf_addrenv.c | 6 +- binfmt/libelf/libelf_ctors.c | 2 +- binfmt/libelf/libelf_dtors.c | 2 +- binfmt/libelf/libelf_iobuffer.c | 2 +- binfmt/libelf/libelf_unload.c | 4 +- binfmt/libnxflat/libnxflat_addrenv.c | 6 +- configs/README.txt | 2 - configs/amber/hello/defconfig | 2 - configs/avr32dev1/nsh/defconfig | 2 - configs/avr32dev1/ostest/defconfig | 2 - configs/c5471evm/httpd/defconfig | 2 - configs/c5471evm/nettest/defconfig | 2 - configs/c5471evm/nsh/defconfig | 2 - configs/c5471evm/ostest/defconfig | 2 - configs/compal_e88/nsh_highram/defconfig | 2 - configs/compal_e99/nsh_compalram/defconfig | 2 - configs/compal_e99/nsh_highram/defconfig | 2 - configs/demo9s12ne64/ostest/defconfig | 2 - configs/ea3131/locked/mklocked.sh | 9 +- configs/ea3131/src/up_usbmsc.c | 9 +- configs/ea3152/src/up_usbmsc.c | 7 +- configs/eagle100/httpd/defconfig | 2 - configs/eagle100/nettest/defconfig | 2 - configs/eagle100/nsh/defconfig | 2 - configs/eagle100/nxflat/defconfig | 2 - configs/eagle100/ostest/defconfig | 2 - configs/eagle100/thttpd/defconfig | 2 - configs/ez80f910200zco/dhcpd/defconfig | 2 - configs/ez80f910200zco/httpd/defconfig | 2 - configs/ez80f910200zco/nettest/defconfig | 2 - configs/ez80f910200zco/nsh/defconfig | 2 - configs/ez80f910200zco/poll/defconfig | 2 - configs/hymini-stm32v/buttons/defconfig | 2 - configs/hymini-stm32v/nsh/defconfig | 2 - configs/hymini-stm32v/nsh2/defconfig | 2 - configs/hymini-stm32v/nx/defconfig | 2 - configs/hymini-stm32v/nxlines/defconfig | 2 - configs/hymini-stm32v/usbserial/defconfig | 2 - configs/hymini-stm32v/usbstorage/defconfig | 2 - configs/kwikstik-k40/ostest/defconfig | 2 - configs/lincoln60/nsh/defconfig | 2 - configs/lincoln60/ostest/defconfig | 2 - configs/lm3s6432-s2e/nsh/defconfig | 2 - configs/lm3s6432-s2e/ostest/defconfig | 2 - configs/lm3s8962-ek/nsh/defconfig | 2 - configs/lm3s8962-ek/nx/defconfig | 2 - configs/lm3s8962-ek/ostest/defconfig | 2 - configs/lpc4330-xplorer/nsh/defconfig | 2 - configs/lpc4330-xplorer/ostest/defconfig | 2 - configs/lpcxpresso-lpc1768/dhcpd/defconfig | 2 - configs/lpcxpresso-lpc1768/nsh/defconfig | 2 - configs/lpcxpresso-lpc1768/nx/defconfig | 2 - configs/lpcxpresso-lpc1768/ostest/defconfig | 2 - configs/lpcxpresso-lpc1768/thttpd/defconfig | 2 - .../lpcxpresso-lpc1768/usbstorage/defconfig | 2 - configs/m68332evb/defconfig | 2 - configs/mbed/hidkbd/defconfig | 2 - configs/mbed/nsh/defconfig | 2 - configs/mcu123-lpc214x/composite/defconfig | 2 - configs/mcu123-lpc214x/ostest/defconfig | 2 - configs/mcu123-lpc214x/usbserial/defconfig | 2 - configs/mcu123-lpc214x/usbstorage/defconfig | 2 - configs/micropendous3/hello/defconfig | 2 - configs/mirtoo/nsh/defconfig | 2 - configs/mirtoo/nxffs/defconfig | 2 - configs/mirtoo/ostest/defconfig | 2 - configs/mx1ads/ostest/defconfig | 2 - configs/ne64badge/ostest/defconfig | 2 - configs/ntosd-dm320/nettest/defconfig | 2 - configs/ntosd-dm320/nsh/defconfig | 2 - configs/ntosd-dm320/ostest/defconfig | 2 - configs/ntosd-dm320/poll/defconfig | 2 - configs/ntosd-dm320/thttpd/defconfig | 2 - configs/ntosd-dm320/udp/defconfig | 2 - configs/ntosd-dm320/uip/defconfig | 2 - configs/nucleus2g/nsh/defconfig | 2 - configs/nucleus2g/ostest/defconfig | 2 - configs/nucleus2g/usbserial/defconfig | 2 - configs/nucleus2g/usbstorage/defconfig | 2 - configs/olimex-lpc1766stk/ftpc/defconfig | 2 - configs/olimex-lpc1766stk/nx/defconfig | 2 - configs/olimex-lpc1766stk/ostest/defconfig | 2 - .../olimex-lpc1766stk/slip-httpd/defconfig | 2 - configs/olimex-lpc1766stk/thttpd/defconfig | 2 - configs/olimex-lpc1766stk/usbserial/defconfig | 2 - .../olimex-lpc1766stk/usbstorage/defconfig | 2 - configs/olimex-lpc2378/nsh/defconfig | 2 - configs/olimex-lpc2378/ostest/defconfig | 2 - configs/olimex-stm32-p107/nsh/defconfig | 2 - configs/olimex-stm32-p107/ostest/defconfig | 2 - configs/olimex-strp711/nettest/defconfig | 2 - configs/olimex-strp711/nsh/defconfig | 2 - configs/olimex-strp711/ostest/defconfig | 2 - configs/pcblogic-pic32mx/nsh/defconfig | 2 - configs/pcblogic-pic32mx/ostest/defconfig | 2 - configs/pic32-starterkit/nsh/defconfig | 2 - configs/pic32-starterkit/nsh2/defconfig | 2 - configs/pic32-starterkit/ostest/defconfig | 2 - configs/pic32mx7mmb/nsh/defconfig | 2 - configs/pic32mx7mmb/ostest/defconfig | 2 - configs/pjrc-8051/defconfig | 2 - configs/qemu-i486/nsh/defconfig | 2 - configs/qemu-i486/ostest/defconfig | 2 - configs/rgmp/arm/default/defconfig | 2 - configs/rgmp/arm/nsh/defconfig | 2 - configs/rgmp/x86/cxxtest/defconfig | 4 - configs/rgmp/x86/default/defconfig | 2 - configs/rgmp/x86/helloxx/defconfig | 4 - configs/rgmp/x86/nsh/defconfig | 2 - configs/sam3u-ek/knsh/defconfig | 12 +- configs/sam3u-ek/nsh/defconfig | 2 - configs/sam3u-ek/nx/defconfig | 2 - configs/sam3u-ek/ostest/defconfig | 2 - configs/sam3u-ek/touchscreen/defconfig | 2 - configs/sim/mount/defconfig | 2 - configs/sim/nettest/defconfig | 2 - configs/sim/nsh2/defconfig | 2 - configs/sim/nx/defconfig | 2 - configs/sim/nx11/defconfig | 2 - configs/sim/nxffs/defconfig | 2 - configs/sim/pashello/defconfig | 2 - configs/sim/touchscreen/defconfig | 2 - configs/skp16c26/ostest/defconfig | 2 - configs/stm3210e-eval/RIDE/defconfig | 2 - configs/stm3210e-eval/buttons/defconfig | 2 - configs/stm3210e-eval/composite/defconfig | 2 - configs/stm3210e-eval/nsh/defconfig | 2 - configs/stm3210e-eval/nsh2/defconfig | 2 - configs/stm3210e-eval/nx/defconfig | 2 - configs/stm3210e-eval/nxconsole/defconfig | 2 - configs/stm3210e-eval/nxlines/defconfig | 2 - configs/stm3210e-eval/nxtext/defconfig | 2 - configs/stm3210e-eval/ostest/defconfig | 2 - configs/stm3210e-eval/pm/defconfig | 2 - configs/stm3210e-eval/usbserial/defconfig | 2 - configs/stm3210e-eval/usbstorage/defconfig | 2 - configs/stm3220g-eval/dhcpd/defconfig | 2 - configs/stm3220g-eval/nettest/defconfig | 2 - configs/stm3220g-eval/nsh/defconfig | 2 - configs/stm3220g-eval/nsh2/defconfig | 2 - configs/stm3220g-eval/ostest/defconfig | 2 - configs/stm3220g-eval/telnetd/defconfig | 2 - configs/stm3240g-eval/dhcpd/defconfig | 2 - configs/stm3240g-eval/nettest/defconfig | 2 - configs/stm3240g-eval/nsh/defconfig | 2 - configs/stm3240g-eval/nsh2/defconfig | 2 - configs/stm3240g-eval/nxconsole/defconfig | 2 - configs/stm3240g-eval/nxwm/defconfig | 2 - configs/stm3240g-eval/ostest/defconfig | 2 - configs/stm3240g-eval/telnetd/defconfig | 2 - configs/stm3240g-eval/webserver/defconfig | 2 - configs/stm32f4discovery/pm/defconfig | 2 - configs/sure-pic32mx/nsh/defconfig | 2 - configs/sure-pic32mx/ostest/defconfig | 2 - configs/sure-pic32mx/usbnsh/defconfig | 2 - configs/teensy/hello/defconfig | 2 - configs/teensy/nsh/defconfig | 2 - configs/teensy/usbstorage/defconfig | 2 - configs/twr-k60n512/nsh/defconfig | 2 - configs/twr-k60n512/ostest/defconfig | 2 - configs/ubw32/nsh/defconfig | 2 - configs/us7032evb1/nsh/defconfig | 2 - configs/us7032evb1/ostest/defconfig | 2 - configs/vsn/nsh/defconfig | 2 - drivers/net/e1000.c | 1 + drivers/pwm.c | 7 +- drivers/sensors/lm75.c | 8 +- drivers/sensors/qencoder.c | 7 +- drivers/usbdev/usbmsc.c | 2 +- fs/fat/fs_mkfatfs.c | 22 +- fs/fs_closedir.c | 6 +- fs/fs_fdopen.c | 2 +- fs/fs_foreachinode.c | 7 +- fs/fs_opendir.c | 6 +- fs/mmap/fs_munmap.c | 6 +- fs/mmap/fs_rammap.c | 6 +- fs/romfs/fs_romfsutil.c | 7 +- graphics/nxbe/nxbe_clipper.c | 8 +- graphics/nxbe/nxbe_colormap.c | 7 +- graphics/nxmu/nx_connect.c | 8 +- graphics/nxmu/nx_eventhandler.c | 6 +- graphics/nxmu/nx_kbdin.c | 8 +- graphics/nxmu/nxfe.h | 4 +- graphics/nxmu/nxmu_constructwindow.c | 8 +- graphics/nxmu/nxmu_kbdin.c | 6 +- graphics/nxsu/nx_close.c | 6 +- graphics/nxsu/nx_open.c | 6 +- graphics/nxsu/nx_openwindow.c | 6 +- graphics/nxsu/nxfe.h | 6 +- graphics/nxsu/nxsu_constructwindow.c | 10 +- include/nuttx/arch.h | 25 +- include/nuttx/kmalloc.h | 61 +++- include/stdio.h | 85 ++--- libc/lib_internal.h | 16 +- libc/misc/lib_sendfile.c | 8 +- libc/spawn/lib_psfa_addclose.c | 4 +- libc/spawn/lib_psfa_adddup2.c | 4 +- libc/spawn/lib_psfa_addopen.c | 5 +- libc/spawn/lib_psfa_destroy.c | 4 +- libc/stdio/lib_asprintf.c | 2 + libc/stdio/lib_libdtoa.c | 4 +- libc/string/lib_strdup.c | 3 +- libxx/libxx_cxa_atexit.cxx | 5 +- libxx/libxx_delete.cxx | 7 +- libxx/libxx_deletea.cxx | 7 +- libxx/libxx_internal.hxx | 22 +- libxx/libxx_new.cxx | 7 +- libxx/libxx_newa.cxx | 5 +- mm/Kconfig | 6 + mm/Makefile | 13 +- mm/kmm_addregion.c | 113 ------- mm/kmm_initialize.c | 113 ------- mm/kmm_kfree.c | 110 ------- mm/kmm_kmalloc.c | 110 ------- mm/kmm_krealloc.c | 111 ------- mm/kmm_kzalloc.c | 110 ------- mm/kmm_semaphore.c | 140 -------- mm/mm_initialize.c | 7 - mm/mm_kernel.c | 282 ++++++++++++++++ mm/mm_kerneluser.c | 306 ++++++++++++++++++ mm/{umm_semaphore.c => mm_user.c} | 66 +++- mm/umm_addregion.c | 81 ----- mm/umm_initialize.c | 81 ----- net/uip/uip_igmpgroup.c | 8 +- net/uip/uip_tcpbacklog.c | 7 +- net/uip/uip_tcpreadahead.c | 4 +- sched/group_create.c | 2 +- sched/os_bringup.c | 6 +- sched/os_start.c | 18 +- sched/sched_garbage.c | 30 +- 264 files changed, 1277 insertions(+), 1648 deletions(-) delete mode 100644 mm/kmm_addregion.c delete mode 100644 mm/kmm_initialize.c delete mode 100644 mm/kmm_kfree.c delete mode 100644 mm/kmm_kmalloc.c delete mode 100644 mm/kmm_krealloc.c delete mode 100644 mm/kmm_kzalloc.c delete mode 100644 mm/kmm_semaphore.c create mode 100644 mm/mm_kernel.c create mode 100644 mm/mm_kerneluser.c rename mm/{umm_semaphore.c => mm_user.c} (64%) delete mode 100644 mm/umm_addregion.c delete mode 100644 mm/umm_initialize.c diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 0670ec11cb..3b268c0a56 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -1870,14 +1870,11 @@ The system can be re-made subsequently by just typing make.

Prototype: void up_allocate_heap(FAR void **heap_start, size_t *heap_size);

Description. - The heap may be statically allocated by - defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - are not defined, then this function will be called to - dynamically set aside the heap region. + This function will be called to dynamically set aside the heap region.

- This API is NOT required if CONFIG_HEAP_BASE - is defined. + For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the size of the unprotected, user-space heap. + If a protected kernel-space heap is provided, the kernel heap must be allocated (and protected) by an analogous up_allocate_kheap().

4.1.15 up_interrupt_context()

@@ -6551,12 +6548,6 @@ int ret = sigaction(SIGCHLD, &sa, NULL);
  • CONFIG_PTHREAD_STACK_DEFAULT: Default pthread stack size
  • -
  • - CONFIG_HEAP_BASE: The beginning of the heap -
  • -
  • - CONFIG_HEAP_SIZE: The size of the heap -
  • diff --git a/arch/8051/src/up_allocateheap.c b/arch/8051/src/up_allocateheap.c index f2238507ad..2f6a894907 100644 --- a/arch/8051/src/up_allocateheap.c +++ b/arch/8051/src/up_allocateheap.c @@ -70,10 +70,8 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside + * the heap region. * ************************************************************/ diff --git a/arch/arm/src/common/up_allocateheap.c b/arch/arm/src/common/up_allocateheap.c index d4b763196e..12cbfcfa8e 100644 --- a/arch/arm/src/common/up_allocateheap.c +++ b/arch/arm/src/common/up_allocateheap.c @@ -68,10 +68,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/dm320/dm320_allocateheap.c b/arch/arm/src/dm320/dm320_allocateheap.c index 5d4b900935..1383b93dae 100644 --- a/arch/arm/src/dm320/dm320_allocateheap.c +++ b/arch/arm/src/dm320/dm320_allocateheap.c @@ -1,7 +1,7 @@ /************************************************************ * dm320/dm320_allocateheap.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,10 +68,17 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside + * the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both + * kernel- and user-space heaps (CONFIG_MM_KERNEL_HEAP=y), + * this function provides the size of the unprotected, + * user-space heap. + * + * If a protected kernel-space heap is provided, the kernel + * heap must be allocated (and protected) by an analogous + * up_allocate_kheap(). * ************************************************************/ diff --git a/arch/arm/src/dm320/dm320_framebuffer.c b/arch/arm/src/dm320/dm320_framebuffer.c index 1b1197d532..8b5aec444b 100644 --- a/arch/arm/src/dm320/dm320_framebuffer.c +++ b/arch/arm/src/dm320/dm320_framebuffer.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/dm320/dm320_framebuffer.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ #include #include +#include #include #include "up_arch.h" @@ -674,10 +675,10 @@ static int dm320_allocvideomemory(void) { #ifndef CONFIG_DM320_VID0_DISABLE #ifndef CONFIG_DM320_DISABLE_PINGPONG - g_vid0base = (FAR void *)malloc(2 * DM320_VID0_FBLEN); + g_vid0base = (FAR void *)kmalloc(2 * DM320_VID0_FBLEN); g_vid0ppbase = (FAR char*)g_vid0base + DM320_VID0_FBLEN; #else - g_vid0base = (FAR void *)malloc(DM320_VID0_FBLEN); + g_vid0base = (FAR void *)kmalloc(DM320_VID0_FBLEN); #endif if (!g_vid0base) { @@ -686,7 +687,7 @@ static int dm320_allocvideomemory(void) #endif #ifndef CONFIG_DM320_VID1_DISABLE - g_vid1base = (FAR void *)malloc(DM320_VID1_FBLEN); + g_vid1base = (FAR void *)kmalloc(DM320_VID1_FBLEN); if (!g_vid1base) { goto errout; @@ -694,7 +695,7 @@ static int dm320_allocvideomemory(void) #endif #ifndef CONFIG_DM320_OSD0_DISABLE - g_osd0base = (FAR void *)malloc(DM320_OSD0_FBLEN); + g_osd0base = (FAR void *)kmalloc(DM320_OSD0_FBLEN); if (!g_osd0base) { goto errout; @@ -702,7 +703,7 @@ static int dm320_allocvideomemory(void) #endif #ifndef CONFIG_DM320_OSD1_DISABLE - g_osd1base = (FAR void *)malloc(DM320_OSD1_FBLEN); + g_osd1base = (FAR void *)kmalloc(DM320_OSD1_FBLEN); if (!g_osd1base) { goto errout; @@ -725,7 +726,7 @@ static void dm320_freevideomemory(void) #ifndef CONFIG_DM320_VID0_DISABLE if (g_vid0base) { - free(g_vid0base); + kfree(g_vid0base); g_vid0base = NULL; #ifndef CONFIG_DM320_DISABLE_PINGPONG g_vid0ppbase = NULL; @@ -736,7 +737,7 @@ static void dm320_freevideomemory(void) #ifndef CONFIG_DM320_VID1_DISABLE if (g_vid1base != 0) { - free(g_vid1base); + kfree(g_vid1base); g_vid1base = NULL; } #endif @@ -744,7 +745,7 @@ static void dm320_freevideomemory(void) #ifndef CONFIG_DM320_OSD0_DISABLE if (g_osd0base != 0) { - free(g_osd0base); + kfree(g_osd0base); g_osd0base = NULL; } #endif @@ -752,7 +753,7 @@ static void dm320_freevideomemory(void) #ifndef CONFIG_DM320_OSD1_DISABLE if (g_osd1base != 0) { - free(g_osd1base); + kfree(g_osd1base); g_osd1base = NULL; } #endif diff --git a/arch/arm/src/dm320/dm320_usbdev.c b/arch/arm/src/dm320/dm320_usbdev.c index c924db1976..b30aba72c5 100644 --- a/arch/arm/src/dm320/dm320_usbdev.c +++ b/arch/arm/src/dm320/dm320_usbdev.c @@ -1,7 +1,7 @@ /******************************************************************************* * arch/arm/src/dm320/dm320_usbdev.c * - * Copyright (C) 2008-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -1936,7 +1937,7 @@ static FAR struct usbdev_req_s *dm320_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct dm320_ep_s *)ep)->epphy); - privreq = (FAR struct dm320_req_s *)malloc(sizeof(struct dm320_req_s)); + privreq = (FAR struct dm320_req_s *)kmalloc(sizeof(struct dm320_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(DM320_TRACEERR_ALLOCFAIL), 0); @@ -1968,7 +1969,7 @@ static void dm320_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct dm320_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -1987,7 +1988,7 @@ static void *dm320_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) #ifdef CONFIG_USBDEV_DMAMEMORY return usbdev_dma_alloc(bytes); #else - return malloc(bytes); + return kmalloc(bytes); #endif } #endif @@ -2008,7 +2009,7 @@ static void dm320_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #ifdef CONFIG_USBDEV_DMAMEMORY usbdev_dma_free(buf); #else - free(buf); + kfree(buf); #endif } #endif diff --git a/arch/arm/src/imx/imx_allocateheap.c b/arch/arm/src/imx/imx_allocateheap.c index 3279ddbd9e..37b05eb7f5 100644 --- a/arch/arm/src/imx/imx_allocateheap.c +++ b/arch/arm/src/imx/imx_allocateheap.c @@ -72,9 +72,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/arch/arm/src/lpc17xx/lpc17_allocateheap.c index b09220a532..620b46a8e5 100644 --- a/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/arch/arm/src/lpc17xx/lpc17_allocateheap.c @@ -182,10 +182,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/lpc17xx/lpc17_usbdev.c b/arch/arm/src/lpc17xx/lpc17_usbdev.c index 753f82326b..938d0c8a78 100644 --- a/arch/arm/src/lpc17xx/lpc17_usbdev.c +++ b/arch/arm/src/lpc17xx/lpc17_usbdev.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -2658,7 +2659,7 @@ static FAR struct usbdev_req_s *lpc17_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc17_ep_s *)ep)->epphy); - privreq = (FAR struct lpc17_req_s *)malloc(sizeof(struct lpc17_req_s)); + privreq = (FAR struct lpc17_req_s *)kmalloc(sizeof(struct lpc17_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(LPC17_TRACEERR_ALLOCFAIL), 0); @@ -2690,7 +2691,7 @@ static void lpc17_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct lpc17_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -2711,7 +2712,7 @@ static FAR void *lpc17_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes usbtrace(TRACE_EPALLOCBUFFER, privep->epphy); - /* Find a free DMA description */ + /* Find a free DMA description */ #error "LOGIC INCOMPLETE" @@ -2728,7 +2729,7 @@ static FAR void *lpc17_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbytes #else usbtrace(TRACE_EPALLOCBUFFER, privep->epphy); - return malloc(bytes); + return kmalloc(bytes); #endif } @@ -2767,7 +2768,7 @@ static void lpc17_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #else usbtrace(TRACE_EPFREEBUFFER, privep->epphy); - free(buf); + kfree(buf); #endif } diff --git a/arch/arm/src/lpc214x/lpc214x_usbdev.c b/arch/arm/src/lpc214x/lpc214x_usbdev.c index 78dc86992a..da55c67dbb 100644 --- a/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -2622,7 +2623,7 @@ static FAR struct usbdev_req_s *lpc214x_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc214x_ep_s *)ep)->epphy); - privreq = (FAR struct lpc214x_req_s *)malloc(sizeof(struct lpc214x_req_s)); + privreq = (FAR struct lpc214x_req_s *)kmalloc(sizeof(struct lpc214x_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_ALLOCFAIL), 0); @@ -2654,7 +2655,7 @@ static void lpc214x_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_ #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct lpc214x_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -2675,7 +2676,7 @@ static FAR void *lpc214x_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbyt usbtrace(TRACE_EPALLOCBUFFER, privep->epphy); - /* Find a free DMA description */ + /* Find a free DMA description */ #error "LOGIC INCOMPLETE" @@ -2692,7 +2693,7 @@ static FAR void *lpc214x_epallocbuffer(FAR struct usbdev_ep_s *ep, uint16_t nbyt #else usbtrace(TRACE_EPALLOCBUFFER, privep->epphy); - return malloc(bytes); + return kmalloc(bytes); #endif } @@ -2731,7 +2732,7 @@ static void lpc214x_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #else usbtrace(TRACE_EPFREEBUFFER, privep->epphy); - free(buf); + kfree(buf); #endif } diff --git a/arch/arm/src/lpc31xx/lpc31_allocateheap.c b/arch/arm/src/lpc31xx/lpc31_allocateheap.c index 204fdf6c1f..f57c343ef9 100644 --- a/arch/arm/src/lpc31xx/lpc31_allocateheap.c +++ b/arch/arm/src/lpc31xx/lpc31_allocateheap.c @@ -157,10 +157,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE - * and CONFIG_HEAP_SIZE. If these are not defined, then this function - * will be called to dynamically set aside the heap region to the end - * of SRAM. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * * SRAM layout: * Start of SRAM: .data diff --git a/arch/arm/src/lpc31xx/lpc31_usbdev.c b/arch/arm/src/lpc31xx/lpc31_usbdev.c index ddeb1bf6bf..1449d5e5bf 100644 --- a/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/arch/arm/src/lpc31xx/lpc31_usbdev.c @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -1949,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc31_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc31_ep_s *)ep)->epphy); - privreq = (FAR struct lpc31_req_s *)malloc(sizeof(struct lpc31_req_s)); + privreq = (FAR struct lpc31_req_s *)kmalloc(sizeof(struct lpc31_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(LPC31_TRACEERR_ALLOCFAIL), 0); @@ -1981,7 +1982,7 @@ static void lpc31_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct lpc31_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -2000,7 +2001,7 @@ static void *lpc31_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) #ifdef CONFIG_USBDEV_DMAMEMORY return usbdev_dma_alloc(bytes); #else - return malloc(bytes); + return kmalloc(bytes); #endif } #endif @@ -2021,7 +2022,7 @@ static void lpc31_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #ifdef CONFIG_USBDEV_DMAMEMORY usbdev_dma_free(buf); #else - free(buf); + kfree(buf); #endif } #endif diff --git a/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/arch/arm/src/lpc43xx/lpc43_allocateheap.c index ef96bcb0cc..c33f9f1ede 100644 --- a/arch/arm/src/lpc43xx/lpc43_allocateheap.c +++ b/arch/arm/src/lpc43xx/lpc43_allocateheap.c @@ -228,10 +228,14 @@ const uint32_t g_heapbase = (uint32_t)&_ebss + CONFIG_IDLETHREAD_STACKSIZE; * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/arch/arm/src/lpc43xx/lpc43_usb0dev.c index d0af116d65..379dbc435f 100644 --- a/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/arch/arm/src/lpc43xx/lpc43_usb0dev.c @@ -58,6 +58,7 @@ #include #include +#include #include #include #include @@ -1949,7 +1950,7 @@ static FAR struct usbdev_req_s *lpc43_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct lpc43_ep_s *)ep)->epphy); - privreq = (FAR struct lpc43_req_s *)malloc(sizeof(struct lpc43_req_s)); + privreq = (FAR struct lpc43_req_s *)kmalloc(sizeof(struct lpc43_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(LPC43_TRACEERR_ALLOCFAIL), 0); @@ -1981,7 +1982,7 @@ static void lpc43_epfreereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct lpc43_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -2000,7 +2001,7 @@ static void *lpc43_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) #ifdef CONFIG_USBDEV_DMAMEMORY return usbdev_dma_alloc(bytes); #else - return malloc(bytes); + return kmalloc(bytes); #endif } #endif @@ -2021,7 +2022,7 @@ static void lpc43_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #ifdef CONFIG_USBDEV_DMAMEMORY usbdev_dma_free(buf); #else - free(buf); + kfree(buf); #endif } #endif diff --git a/arch/arm/src/sam3u/sam3u_allocateheap.c b/arch/arm/src/sam3u/sam3u_allocateheap.c index a5236e74d6..99e2d9e865 100644 --- a/arch/arm/src/sam3u/sam3u_allocateheap.c +++ b/arch/arm/src/sam3u/sam3u_allocateheap.c @@ -94,10 +94,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index b70a29b447..149de86489 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -356,10 +356,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/arm/src/stm32/stm32_otgfsdev.c b/arch/arm/src/stm32/stm32_otgfsdev.c index ece965b01d..3986106d84 100644 --- a/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/arch/arm/src/stm32/stm32_otgfsdev.c @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -4230,7 +4231,7 @@ static FAR struct usbdev_req_s *stm32_ep_allocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct stm32_ep_s *)ep)->epphy); - privreq = (FAR struct stm32_req_s *)malloc(sizeof(struct stm32_req_s)); + privreq = (FAR struct stm32_req_s *)kmalloc(sizeof(struct stm32_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0); @@ -4262,7 +4263,7 @@ static void stm32_ep_freereq(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct stm32_ep_s *)ep)->epphy); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -4281,7 +4282,7 @@ static void *stm32_ep_allocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) #ifdef CONFIG_USBDEV_DMAMEMORY return usbdev_dma_alloc(bytes); #else - return malloc(bytes); + return kmalloc(bytes); #endif } #endif @@ -4302,7 +4303,7 @@ static void stm32_ep_freebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #ifdef CONFIG_USBDEV_DMAMEMORY usbdev_dma_free(buf); #else - free(buf); + kfree(buf); #endif } #endif diff --git a/arch/arm/src/stm32/stm32_usbdev.c b/arch/arm/src/stm32/stm32_usbdev.c index 6036eb3d5f..ab39677837 100644 --- a/arch/arm/src/stm32/stm32_usbdev.c +++ b/arch/arm/src/stm32/stm32_usbdev.c @@ -52,6 +52,7 @@ #include #include +#include #include #include #include @@ -2762,7 +2763,7 @@ static struct usbdev_req_s *stm32_epallocreq(struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog)); - privreq = (struct stm32_req_s *)malloc(sizeof(struct stm32_req_s)); + privreq = (struct stm32_req_s *)kmalloc(sizeof(struct stm32_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(STM32_TRACEERR_ALLOCFAIL), 0); @@ -2790,7 +2791,7 @@ static void stm32_epfreereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) #endif usbtrace(TRACE_EPFREEREQ, USB_EPNO(ep->eplog)); - free(privreq); + kfree(privreq); } /**************************************************************************** diff --git a/arch/avr/src/at90usb/at90usb_usbdev.c b/arch/avr/src/at90usb/at90usb_usbdev.c index 0e3ac64876..a5fb64c365 100644 --- a/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/arch/avr/src/at90usb/at90usb_usbdev.c @@ -1,7 +1,7 @@ /******************************************************************************* * arch/arm/src/at90usb/at90usb_usbdev.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -2286,7 +2287,7 @@ static FAR struct usbdev_req_s *avr_epallocreq(FAR struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, ((FAR struct avr_ep_s *)ep)->ep.eplog); - privreq = (FAR struct avr_req_s *)malloc(sizeof(struct avr_req_s)); + privreq = (FAR struct avr_req_s *)kmalloc(sizeof(struct avr_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(AVR_TRACEERR_ALLOCFAIL), 0); @@ -2319,7 +2320,7 @@ static void avr_epfreereq(FAR struct usbdev_ep_s *ep, #endif usbtrace(TRACE_EPFREEREQ, ((FAR struct avr_ep_s *)ep)->ep.eplog); - free(privreq); + kfree(privreq); } /******************************************************************************* @@ -2338,7 +2339,7 @@ static void *avr_epallocbuffer(FAR struct usbdev_ep_s *ep, unsigned bytes) #ifdef CONFIG_USBDEV_DMAMEMORY return usbdev_dma_alloc(bytes); #else - return malloc(bytes); + return kmalloc(bytes); #endif } #endif @@ -2359,7 +2360,7 @@ static void avr_epfreebuffer(FAR struct usbdev_ep_s *ep, FAR void *buf) #ifdef CONFIG_USBDEV_DMAMEMORY usbdev_dma_free(buf); #else - free(buf); + kfree(buf); #endif } #endif diff --git a/arch/avr/src/common/up_allocateheap.c b/arch/avr/src/common/up_allocateheap.c index b4a7cde024..3a67ff6a74 100644 --- a/arch/avr/src/common/up_allocateheap.c +++ b/arch/avr/src/common/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/avr/src/common/up_allocateheap.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,9 +68,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/hc/src/common/up_allocateheap.c b/arch/hc/src/common/up_allocateheap.c index fc86faca5d..b107baaa53 100644 --- a/arch/hc/src/common/up_allocateheap.c +++ b/arch/hc/src/common/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/hc/src/common/up_allocateheap.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,10 +67,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/mips/src/common/up_allocateheap.c b/arch/mips/src/common/up_allocateheap.c index f29b2685f2..b8c449ff12 100644 --- a/arch/mips/src/common/up_allocateheap.c +++ b/arch/mips/src/common/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/common/up_allocateheap.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,10 +68,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/mips/src/pic32mx/pic32mx-usbdev.c b/arch/mips/src/pic32mx/pic32mx-usbdev.c index 8d9f7c058f..5e0f2db3b1 100644 --- a/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/arch/mips/src/pic32mx/pic32mx-usbdev.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/mips/src/pic32mx/pic32mx_usbdev.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -57,6 +57,7 @@ #include #include +#include #include #include #include @@ -3313,7 +3314,7 @@ static struct usbdev_req_s *pic32mx_epallocreq(struct usbdev_ep_s *ep) #endif usbtrace(TRACE_EPALLOCREQ, USB_EPNO(ep->eplog)); - privreq = (struct pic32mx_req_s *)malloc(sizeof(struct pic32mx_req_s)); + privreq = (struct pic32mx_req_s *)kmalloc(sizeof(struct pic32mx_req_s)); if (!privreq) { usbtrace(TRACE_DEVERROR(PIC32MX_TRACEERR_ALLOCFAIL), 0); @@ -3341,7 +3342,7 @@ static void pic32mx_epfreereq(struct usbdev_ep_s *ep, struct usbdev_req_s *req) #endif usbtrace(TRACE_EPFREEREQ, USB_EPNO(ep->eplog)); - free(privreq); + kfree(privreq); } /**************************************************************************** diff --git a/arch/rgmp/src/nuttx.c b/arch/rgmp/src/nuttx.c index 6cb300f82e..63e925b8cf 100644 --- a/arch/rgmp/src/nuttx.c +++ b/arch/rgmp/src/nuttx.c @@ -161,7 +161,7 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) void up_release_stack(struct tcb_s *dtcb) { if (dtcb->stack_alloc_ptr) { - free(dtcb->stack_alloc_ptr); + kfree(dtcb->stack_alloc_ptr); } dtcb->stack_alloc_ptr = NULL; diff --git a/arch/sh/src/common/up_allocateheap.c b/arch/sh/src/common/up_allocateheap.c index e19b2c18e9..ad1935d9a5 100644 --- a/arch/sh/src/common/up_allocateheap.c +++ b/arch/sh/src/common/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/sh/src/common/up_allocateheap.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -67,10 +67,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/sim/src/up_allocateheap.c b/arch/sim/src/up_allocateheap.c index 47400ec7c3..ffdb695188 100644 --- a/arch/sim/src/up_allocateheap.c +++ b/arch/sim/src/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * up_allocateheap.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -71,10 +71,14 @@ static uint8_t sim_heap[SIM_HEAP_SIZE]; * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by - * defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE. If these - * are not defined, then this function will be called to - * dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/sim/src/up_deviceimage.c b/arch/sim/src/up_deviceimage.c index e32f649275..e1f2210f24 100644 --- a/arch/sim/src/up_deviceimage.c +++ b/arch/sim/src/up_deviceimage.c @@ -43,9 +43,13 @@ # include #else # include + # include # include # include + +# include + # include "up_internal.h" #endif @@ -55,6 +59,8 @@ #ifdef VFAT_STANDALONE # define sdbg(format, arg...) printf(format, ##arg) +# define kmalloc(size) malloc(size) +# define kfree(mem) free(mem) #endif /**************************************************************************** @@ -224,7 +230,8 @@ char *up_deviceimage(void) /* Allocate a buffer to hold the decompressed buffer. We may have * to reallocate this a few times to get the size right. */ - pbuffer = (char*)malloc(bufsize); + + pbuffer = (char*)kmalloc(bufsize); /* Set up the input buffer */ @@ -253,7 +260,7 @@ char *up_deviceimage(void) case Z_STREAM_ERROR: sdbg("inflate FAILED: ret=%d msg=\"%s\"\n", ret, strm.msg ? strm.msg : "No message" ); (void)inflateEnd(&strm); - free(pbuffer); + kfree(pbuffer); return NULL; } @@ -265,10 +272,10 @@ char *up_deviceimage(void) if (strm.avail_out == 0) { int newbufsize = bufsize + 128*1024; - char *newbuffer = realloc(pbuffer, newbufsize); + char *newbuffer = krealloc(pbuffer, newbufsize); if (!newbuffer) { - free(pbuffer); + kfree(pbuffer); return NULL; } else @@ -285,10 +292,10 @@ char *up_deviceimage(void) */ int newbufsize = bufsize - strm.avail_out; - char *newbuffer = realloc(pbuffer, newbufsize); + char *newbuffer = krealloc(pbuffer, newbufsize); if (!newbuffer) { - free(pbuffer); + kfree(pbuffer); return NULL; } else @@ -344,7 +351,7 @@ int main(int argc, char **argv, char **envp) if (deviceimage) { printf("Inflate SUCCEEDED\n"); - free(deviceimage); + kfree(deviceimage); return 0; } else diff --git a/arch/x86/src/common/up_allocateheap.c b/arch/x86/src/common/up_allocateheap.c index 74b169df32..b56f9b59a0 100644 --- a/arch/x86/src/common/up_allocateheap.c +++ b/arch/x86/src/common/up_allocateheap.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/x86/src/common/up_allocateheap.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -68,9 +68,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/z16/src/common/up_allocateheap.c b/arch/z16/src/common/up_allocateheap.c index 62ea870e9c..b137400112 100644 --- a/arch/z16/src/common/up_allocateheap.c +++ b/arch/z16/src/common/up_allocateheap.c @@ -83,9 +83,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/z80/src/common/up_allocateheap.c b/arch/z80/src/common/up_allocateheap.c index 734d678e7e..c3e06ef128 100644 --- a/arch/z80/src/common/up_allocateheap.c +++ b/arch/z80/src/common/up_allocateheap.c @@ -85,9 +85,14 @@ * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ diff --git a/arch/z80/src/ez80/ez80_i2c.c b/arch/z80/src/ez80/ez80_i2c.c index dbc817442c..6668704dcd 100644 --- a/arch/z80/src/ez80/ez80_i2c.c +++ b/arch/z80/src/ez80/ez80_i2c.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/ez80/ez80_i2c.c * - * Copyright(C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright(C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include +#include #include #include @@ -747,10 +748,10 @@ static int i2c_read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen) for (retry = 0; retry < 100; retry++) { - /* Enter MASTER TRANSMIT mode by setting the STA bit in the I2C_CTL - * register to 1. The I2C then tests the I2C bus and transmits a START - * condition when the bus is free. - */ + /* Enter MASTER TRANSMIT mode by setting the STA bit in the I2C_CTL + * register to 1. The I2C then tests the I2C bus and transmits a START + * condition when the bus is free. + */ i2c_start(); @@ -920,7 +921,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) /* Now, allocate an I2C instance for this caller */ - i2c = (FAR struct ez80_i2cdev_s *)malloc(sizeof(FAR struct ez80_i2cdev_s)); + i2c = (FAR struct ez80_i2cdev_s *)kmalloc(sizeof(FAR struct ez80_i2cdev_s)); if (i2c) { /* Initialize the allocated instance */ diff --git a/arch/z80/src/z8/z8_i2c.c b/arch/z80/src/z8/z8_i2c.c index e90bd40365..59cd2fc2bd 100644 --- a/arch/z80/src/z8/z8_i2c.c +++ b/arch/z80/src/z8/z8_i2c.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/z80/src/z8/z8_i2c.c * - * Copyright(C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright(C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -48,6 +48,7 @@ #include #include +#include #include #include /* eZ8 Register definitions */ @@ -592,7 +593,7 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) /* Now, allocate an I2C instance for this caller */ - i2c = (FAR struct z8_i2cdev_s *)malloc(sizeof(FAR struct z8_i2cdev_s)); + i2c = (FAR struct z8_i2cdev_s *)kmalloc(sizeof(FAR struct z8_i2cdev_s)); if (i2c) { /* Initialize the allocated instance */ @@ -600,5 +601,6 @@ FAR struct i2c_dev_s *up_i2cinitialize(int port) i2c->ops = &g_ops; i2c->brg = g_currbrg; } + return (FAR struct i2c_dev_s *)i2c; } diff --git a/binfmt/binfmt_execmodule.c b/binfmt/binfmt_execmodule.c index 09ad4ee6c0..b56dd470fb 100644 --- a/binfmt/binfmt_execmodule.c +++ b/binfmt/binfmt_execmodule.c @@ -166,7 +166,7 @@ int exec_module(FAR const struct binary_s *binp) /* Allocate the stack for the new task */ #ifndef CONFIG_CUSTOM_STACK - stack = (FAR uint32_t*)kmalloc(binp->stacksize); + stack = (FAR uint32_t*)kumalloc(binp->stacksize); if (!tcb) { err = ENOMEM; @@ -246,7 +246,7 @@ errout_with_stack: #ifndef CONFIG_CUSTOM_STACK tcb->cmn.stack_alloc_ptr = NULL; sched_releasetcb(&tcb->cmn); - kfree(stack); + kufree(stack); #else sched_releasetcb(&tcb->cmn); #endif diff --git a/binfmt/binfmt_unloadmodule.c b/binfmt/binfmt_unloadmodule.c index 365f26a341..50f8dcb431 100644 --- a/binfmt/binfmt_unloadmodule.c +++ b/binfmt/binfmt_unloadmodule.c @@ -1,7 +1,7 @@ /**************************************************************************** * binfmt/binfmt_loadmodule.c * - * Copyright (C) 2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ #include #include +#include #include #include "binfmt_internal.h" @@ -183,7 +184,7 @@ int unload_module(FAR const struct binary_s *binp) if (binp->alloc[i]) { bvdbg("Freeing alloc[%d]: %p\n", i, binp->alloc[i]); - free((FAR void *)binp->alloc[i]); + kufree((FAR void *)binp->alloc[i]); } } diff --git a/binfmt/libelf/libelf_addrenv.c b/binfmt/libelf/libelf_addrenv.c index 193062a540..d2b9870b66 100644 --- a/binfmt/libelf/libelf_addrenv.c +++ b/binfmt/libelf/libelf_addrenv.c @@ -68,7 +68,7 @@ * * Description: * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, - * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using kuzalloc(). If CONFIG_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. @@ -116,7 +116,7 @@ int elf_addrenv_alloc(FAR struct elf_loadinfo_s *loadinfo, size_t envsize) #else /* Allocate memory to hold the ELF image */ - loadinfo->elfalloc = (uintptr_t)kzalloc(envsize); + loadinfo->elfalloc = (uintptr_t)kuzalloc(envsize); if (!loadinfo->elfalloc) { return -ENOMEM; @@ -167,7 +167,7 @@ void elf_addrenv_free(FAR struct elf_loadinfo_s *loadinfo) if (loadinfo->elfalloc != 0) { - kfree((FAR void *)loadinfo->elfalloc); + kufree((FAR void *)loadinfo->elfalloc); loadinfo->elfalloc = 0; } diff --git a/binfmt/libelf/libelf_ctors.c b/binfmt/libelf/libelf_ctors.c index 20f1256e2e..af9c7bba4b 100644 --- a/binfmt/libelf/libelf_ctors.c +++ b/binfmt/libelf/libelf_ctors.c @@ -163,7 +163,7 @@ int elf_loadctors(FAR struct elf_loadinfo_s *loadinfo) { /* Allocate memory to hold a copy of the .ctor section */ - loadinfo->ctoralloc = (binfmt_ctor_t*)kmalloc(ctorsize); + loadinfo->ctoralloc = (binfmt_ctor_t*)kumalloc(ctorsize); if (!loadinfo->ctoralloc) { bdbg("Failed to allocate memory for .ctors\n"); diff --git a/binfmt/libelf/libelf_dtors.c b/binfmt/libelf/libelf_dtors.c index c0c73a3373..638284f0b1 100644 --- a/binfmt/libelf/libelf_dtors.c +++ b/binfmt/libelf/libelf_dtors.c @@ -163,7 +163,7 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo) { /* Allocate memory to hold a copy of the .dtor section */ - loadinfo->ctoralloc = (binfmt_dtor_t*)kmalloc(dtorsize); + loadinfo->ctoralloc = (binfmt_dtor_t*)kumalloc(dtorsize); if (!loadinfo->ctoralloc) { bdbg("Failed to allocate memory for .dtors\n"); diff --git a/binfmt/libelf/libelf_iobuffer.c b/binfmt/libelf/libelf_iobuffer.c index ead99ca099..b2d54b3ca7 100644 --- a/binfmt/libelf/libelf_iobuffer.c +++ b/binfmt/libelf/libelf_iobuffer.c @@ -1,7 +1,7 @@ /**************************************************************************** * binfmt/libelf/elf_iobuffer.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without diff --git a/binfmt/libelf/libelf_unload.c b/binfmt/libelf/libelf_unload.c index 539e5faf7b..7f7a3cf911 100644 --- a/binfmt/libelf/libelf_unload.c +++ b/binfmt/libelf/libelf_unload.c @@ -92,7 +92,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo) #ifdef CONFIG_BINFMT_CONSTRUCTORS if (loadinfo->ctoralloc != 0) { - kfree(loadinfo->ctoralloc); + kufree(loadinfo->ctoralloc); loadinfo->ctoralloc = NULL; } @@ -101,7 +101,7 @@ int elf_unload(struct elf_loadinfo_s *loadinfo) if (loadinfo->dtoralloc != 0) { - kfree(loadinfo->dtoralloc); + kufree(loadinfo->dtoralloc); loadinfo->dtoralloc = NULL; } diff --git a/binfmt/libnxflat/libnxflat_addrenv.c b/binfmt/libnxflat/libnxflat_addrenv.c index 2d9255b286..d31e7fda09 100644 --- a/binfmt/libnxflat/libnxflat_addrenv.c +++ b/binfmt/libnxflat/libnxflat_addrenv.c @@ -69,7 +69,7 @@ * * Description: * Allocate memory for the ELF image (elfalloc). If CONFIG_ADDRENV=n, - * elfalloc will be allocated using kzalloc(). If CONFIG_ADDRENV-y, then + * elfalloc will be allocated using kuzalloc(). If CONFIG_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. @@ -164,7 +164,7 @@ errout_with_dspace: #else /* Allocate (and zero) memory to hold the ELF image */ - dspace->region = (FAR uint8_t *)kzalloc(envsize); + dspace->region = (FAR uint8_t *)kuzalloc(envsize); if (!dspace->region) { kfree(dspace); @@ -222,7 +222,7 @@ void nxflat_addrenv_free(FAR struct nxflat_loadinfo_s *loadinfo) if (dspace->region) { - kfree(dspace->region); + kufree(dspace->region); } #endif diff --git a/configs/README.txt b/configs/README.txt index d4486daaf8..726018e678 100644 --- a/configs/README.txt +++ b/configs/README.txt @@ -1671,8 +1671,6 @@ defconfig -- This is a configuration file similar to the Linux for the main user thread that begins at the user_start() entry point. CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size - CONFIG_HEAP_BASE - The beginning of the heap - CONFIG_HEAP_SIZE - The size of the heap appconfig -- This is another configuration file that is specific to the application. This file is copied into the application build directory diff --git a/configs/amber/hello/defconfig b/configs/amber/hello/defconfig index 8bdb55db48..9cf1c32da6 100644 --- a/configs/amber/hello/defconfig +++ b/configs/amber/hello/defconfig @@ -419,5 +419,3 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/avr32dev1/nsh/defconfig b/configs/avr32dev1/nsh/defconfig index 6c8b5b416e..525cf6024e 100755 --- a/configs/avr32dev1/nsh/defconfig +++ b/configs/avr32dev1/nsh/defconfig @@ -429,5 +429,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/avr32dev1/ostest/defconfig b/configs/avr32dev1/ostest/defconfig index a48883ddab..a88b630f2a 100755 --- a/configs/avr32dev1/ostest/defconfig +++ b/configs/avr32dev1/ostest/defconfig @@ -429,5 +429,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/c5471evm/httpd/defconfig b/configs/c5471evm/httpd/defconfig index 88fc0afe25..21dd2a160a 100644 --- a/configs/c5471evm/httpd/defconfig +++ b/configs/c5471evm/httpd/defconfig @@ -256,8 +256,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/c5471evm/nettest/defconfig b/configs/c5471evm/nettest/defconfig index 15258409ed..d4a7082bdd 100644 --- a/configs/c5471evm/nettest/defconfig +++ b/configs/c5471evm/nettest/defconfig @@ -256,8 +256,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/c5471evm/nsh/defconfig b/configs/c5471evm/nsh/defconfig index db54c255c7..4c94c022bc 100644 --- a/configs/c5471evm/nsh/defconfig +++ b/configs/c5471evm/nsh/defconfig @@ -256,8 +256,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/c5471evm/ostest/defconfig b/configs/c5471evm/ostest/defconfig index f5893d546e..d2a470f9ed 100644 --- a/configs/c5471evm/ostest/defconfig +++ b/configs/c5471evm/ostest/defconfig @@ -256,8 +256,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/compal_e88/nsh_highram/defconfig b/configs/compal_e88/nsh_highram/defconfig index 46884c31bc..d0eecc7edb 100644 --- a/configs/compal_e88/nsh_highram/defconfig +++ b/configs/compal_e88/nsh_highram/defconfig @@ -277,8 +277,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/compal_e99/nsh_compalram/defconfig b/configs/compal_e99/nsh_compalram/defconfig index 621f68f1e6..e0a1c34ab0 100644 --- a/configs/compal_e99/nsh_compalram/defconfig +++ b/configs/compal_e99/nsh_compalram/defconfig @@ -279,8 +279,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/compal_e99/nsh_highram/defconfig b/configs/compal_e99/nsh_highram/defconfig index 52eb1d9382..d92810960f 100644 --- a/configs/compal_e99/nsh_highram/defconfig +++ b/configs/compal_e99/nsh_highram/defconfig @@ -324,8 +324,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/demo9s12ne64/ostest/defconfig b/configs/demo9s12ne64/ostest/defconfig index 3222b63eea..f52952232a 100755 --- a/configs/demo9s12ne64/ostest/defconfig +++ b/configs/demo9s12ne64/ostest/defconfig @@ -399,5 +399,3 @@ CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=256 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ea3131/locked/mklocked.sh b/configs/ea3131/locked/mklocked.sh index 731accde3d..776247997d 100755 --- a/configs/ea3131/locked/mklocked.sh +++ b/configs/ea3131/locked/mklocked.sh @@ -2,7 +2,7 @@ ########################################################################### # configs/ea3131/locked/mklocked.sh # -# Copyright (C) 2010-2012 Gregory Nutt. All rights reserved. +# Copyright (C) 2010-2013 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -155,12 +155,7 @@ fi echo "EXTERN(dq_addfirst)" >>ld-locked.inc echo "EXTERN(up_initial_state)" >>ld-locked.inc - -answer=$(checkconfig CONFIG_HEAP_BASE) -if [ $answer = n ]; then - echo "EXTERN(up_allocate_heap)" >>ld-locked.inc -fi - +echo "EXTERN(up_allocate_heap)" >>ld-locked.inc echo "EXTERN(mm_initialize)" >>ld-locked.inc echo "EXTERN(irq_initialize)" >>ld-locked.inc echo "EXTERN(wd_initialize)" >>ld-locked.inc diff --git a/configs/ea3131/src/up_usbmsc.c b/configs/ea3131/src/up_usbmsc.c index e1869af4d5..b91bc35981 100644 --- a/configs/ea3131/src/up_usbmsc.c +++ b/configs/ea3131/src/up_usbmsc.c @@ -1,7 +1,7 @@ /**************************************************************************** * configs/ea3131/src/up_usbmsc.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Configure and register the SAM3U MMC/SD SDIO block driver. @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -88,7 +89,7 @@ int usbmsc_archinitialize(void) uint8_t *pbuffer; int ret; - pbuffer = (uint8_t *) malloc (BUFFER_SIZE); + pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE); if (!pbuffer) { lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", @@ -107,7 +108,7 @@ int usbmsc_archinitialize(void) { printf("create_ramdisk: Failed to register ramdisk at %s: %d\n", g_source, -ret); - free(pbuffer); + kfree(pbuffer); return ret; } @@ -118,7 +119,7 @@ int usbmsc_archinitialize(void) { printf("create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n", g_source); - /* free(pbuffer); -- RAM disk is registered */ + /* kfree(pbuffer); -- RAM disk is registered */ return ret; } diff --git a/configs/ea3152/src/up_usbmsc.c b/configs/ea3152/src/up_usbmsc.c index ee67f0eede..311ecb7418 100644 --- a/configs/ea3152/src/up_usbmsc.c +++ b/configs/ea3152/src/up_usbmsc.c @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -88,7 +89,7 @@ int usbmsc_archinitialize(void) uint8_t *pbuffer; int ret; - pbuffer = (uint8_t *) malloc (BUFFER_SIZE); + pbuffer = (uint8_t *)kmalloc(BUFFER_SIZE); if (!pbuffer) { lowsyslog("usbmsc_archinitialize: Failed to allocate ramdisk of size %d\n", @@ -107,7 +108,7 @@ int usbmsc_archinitialize(void) { printf("create_ramdisk: Failed to register ramdisk at %s: %d\n", g_source, -ret); - free(pbuffer); + kfree(pbuffer); return ret; } @@ -118,7 +119,7 @@ int usbmsc_archinitialize(void) { printf("create_ramdisk: Failed to create FAT filesystem on ramdisk at %s\n", g_source); - /* free(pbuffer); -- RAM disk is registered */ + /* kfree(pbuffer); -- RAM disk is registered */ return ret; } diff --git a/configs/eagle100/httpd/defconfig b/configs/eagle100/httpd/defconfig index bb66364458..91e77446f4 100644 --- a/configs/eagle100/httpd/defconfig +++ b/configs/eagle100/httpd/defconfig @@ -348,5 +348,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/eagle100/nettest/defconfig b/configs/eagle100/nettest/defconfig index 8f969ee795..136c1d1839 100644 --- a/configs/eagle100/nettest/defconfig +++ b/configs/eagle100/nettest/defconfig @@ -331,5 +331,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/eagle100/nsh/defconfig b/configs/eagle100/nsh/defconfig index c15c3a7ae1..a13167d6b9 100644 --- a/configs/eagle100/nsh/defconfig +++ b/configs/eagle100/nsh/defconfig @@ -333,5 +333,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/eagle100/nxflat/defconfig b/configs/eagle100/nxflat/defconfig index 3cce495db9..738478fe61 100644 --- a/configs/eagle100/nxflat/defconfig +++ b/configs/eagle100/nxflat/defconfig @@ -334,5 +334,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/eagle100/ostest/defconfig b/configs/eagle100/ostest/defconfig index eb050ac9f5..7a2b681be4 100644 --- a/configs/eagle100/ostest/defconfig +++ b/configs/eagle100/ostest/defconfig @@ -328,5 +328,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/eagle100/thttpd/defconfig b/configs/eagle100/thttpd/defconfig index 7e1282368f..ab52ef6dce 100644 --- a/configs/eagle100/thttpd/defconfig +++ b/configs/eagle100/thttpd/defconfig @@ -372,5 +372,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=8192 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ez80f910200zco/dhcpd/defconfig b/configs/ez80f910200zco/dhcpd/defconfig index 043526165c..f3c4864f82 100644 --- a/configs/ez80f910200zco/dhcpd/defconfig +++ b/configs/ez80f910200zco/dhcpd/defconfig @@ -430,5 +430,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ez80f910200zco/httpd/defconfig b/configs/ez80f910200zco/httpd/defconfig index 329b970535..f972aacfd9 100644 --- a/configs/ez80f910200zco/httpd/defconfig +++ b/configs/ez80f910200zco/httpd/defconfig @@ -438,5 +438,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ez80f910200zco/nettest/defconfig b/configs/ez80f910200zco/nettest/defconfig index 94eedae20f..345508d9eb 100644 --- a/configs/ez80f910200zco/nettest/defconfig +++ b/configs/ez80f910200zco/nettest/defconfig @@ -423,5 +423,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ez80f910200zco/nsh/defconfig b/configs/ez80f910200zco/nsh/defconfig index f6e6e9d565..2ce04493df 100644 --- a/configs/ez80f910200zco/nsh/defconfig +++ b/configs/ez80f910200zco/nsh/defconfig @@ -423,5 +423,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ez80f910200zco/poll/defconfig b/configs/ez80f910200zco/poll/defconfig index 23c9fe747d..141f0a2a72 100644 --- a/configs/ez80f910200zco/poll/defconfig +++ b/configs/ez80f910200zco/poll/defconfig @@ -423,5 +423,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/buttons/defconfig b/configs/hymini-stm32v/buttons/defconfig index fc258df0c4..11f2b4cb35 100644 --- a/configs/hymini-stm32v/buttons/defconfig +++ b/configs/hymini-stm32v/buttons/defconfig @@ -485,5 +485,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/nsh/defconfig b/configs/hymini-stm32v/nsh/defconfig index 146068df40..4a79848634 100755 --- a/configs/hymini-stm32v/nsh/defconfig +++ b/configs/hymini-stm32v/nsh/defconfig @@ -470,5 +470,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/nsh2/defconfig b/configs/hymini-stm32v/nsh2/defconfig index a2cac61fa5..b5c8a6a9be 100644 --- a/configs/hymini-stm32v/nsh2/defconfig +++ b/configs/hymini-stm32v/nsh2/defconfig @@ -589,5 +589,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/nx/defconfig b/configs/hymini-stm32v/nx/defconfig index e0bcdfa00c..d81a0df57f 100644 --- a/configs/hymini-stm32v/nx/defconfig +++ b/configs/hymini-stm32v/nx/defconfig @@ -578,5 +578,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/nxlines/defconfig b/configs/hymini-stm32v/nxlines/defconfig index 7bfebcf2cf..516884b80c 100644 --- a/configs/hymini-stm32v/nxlines/defconfig +++ b/configs/hymini-stm32v/nxlines/defconfig @@ -586,5 +586,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/usbserial/defconfig b/configs/hymini-stm32v/usbserial/defconfig index a677d28044..ca793bae7d 100755 --- a/configs/hymini-stm32v/usbserial/defconfig +++ b/configs/hymini-stm32v/usbserial/defconfig @@ -502,5 +502,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/hymini-stm32v/usbstorage/defconfig b/configs/hymini-stm32v/usbstorage/defconfig index 759e46cf11..1982faaf07 100755 --- a/configs/hymini-stm32v/usbstorage/defconfig +++ b/configs/hymini-stm32v/usbstorage/defconfig @@ -492,5 +492,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/kwikstik-k40/ostest/defconfig b/configs/kwikstik-k40/ostest/defconfig index 912233ed9b..6eca2332ad 100755 --- a/configs/kwikstik-k40/ostest/defconfig +++ b/configs/kwikstik-k40/ostest/defconfig @@ -467,5 +467,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lincoln60/nsh/defconfig b/configs/lincoln60/nsh/defconfig index 2c28dbf8c1..3dee4607a2 100644 --- a/configs/lincoln60/nsh/defconfig +++ b/configs/lincoln60/nsh/defconfig @@ -447,5 +447,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lincoln60/ostest/defconfig b/configs/lincoln60/ostest/defconfig index f1743b67a3..874489c8f8 100644 --- a/configs/lincoln60/ostest/defconfig +++ b/configs/lincoln60/ostest/defconfig @@ -486,5 +486,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lm3s6432-s2e/nsh/defconfig b/configs/lm3s6432-s2e/nsh/defconfig index b1a0a02c52..d8fb2f6003 100644 --- a/configs/lm3s6432-s2e/nsh/defconfig +++ b/configs/lm3s6432-s2e/nsh/defconfig @@ -347,5 +347,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lm3s6432-s2e/ostest/defconfig b/configs/lm3s6432-s2e/ostest/defconfig index 5858bb76dc..44d1c46f53 100644 --- a/configs/lm3s6432-s2e/ostest/defconfig +++ b/configs/lm3s6432-s2e/ostest/defconfig @@ -344,5 +344,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lm3s8962-ek/nsh/defconfig b/configs/lm3s8962-ek/nsh/defconfig index 842bc39812..20937822ee 100755 --- a/configs/lm3s8962-ek/nsh/defconfig +++ b/configs/lm3s8962-ek/nsh/defconfig @@ -346,5 +346,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lm3s8962-ek/nx/defconfig b/configs/lm3s8962-ek/nx/defconfig index 329d33de97..c779e71ea2 100755 --- a/configs/lm3s8962-ek/nx/defconfig +++ b/configs/lm3s8962-ek/nx/defconfig @@ -413,5 +413,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lm3s8962-ek/ostest/defconfig b/configs/lm3s8962-ek/ostest/defconfig index c9b6fa9cf5..60a0ed9685 100755 --- a/configs/lm3s8962-ek/ostest/defconfig +++ b/configs/lm3s8962-ek/ostest/defconfig @@ -343,5 +343,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpc4330-xplorer/nsh/defconfig b/configs/lpc4330-xplorer/nsh/defconfig index 5d75e72223..b2b7befee1 100644 --- a/configs/lpc4330-xplorer/nsh/defconfig +++ b/configs/lpc4330-xplorer/nsh/defconfig @@ -608,5 +608,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpc4330-xplorer/ostest/defconfig b/configs/lpc4330-xplorer/ostest/defconfig index 005ff71742..4318b951fb 100644 --- a/configs/lpc4330-xplorer/ostest/defconfig +++ b/configs/lpc4330-xplorer/ostest/defconfig @@ -585,5 +585,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/configs/lpcxpresso-lpc1768/dhcpd/defconfig index 56c9364485..e3cba7b38c 100755 --- a/configs/lpcxpresso-lpc1768/dhcpd/defconfig +++ b/configs/lpcxpresso-lpc1768/dhcpd/defconfig @@ -484,5 +484,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/nsh/defconfig b/configs/lpcxpresso-lpc1768/nsh/defconfig index 3bece6f210..0c959cd6db 100755 --- a/configs/lpcxpresso-lpc1768/nsh/defconfig +++ b/configs/lpcxpresso-lpc1768/nsh/defconfig @@ -494,5 +494,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/nx/defconfig b/configs/lpcxpresso-lpc1768/nx/defconfig index cd95b4bce0..3d1347a28c 100755 --- a/configs/lpcxpresso-lpc1768/nx/defconfig +++ b/configs/lpcxpresso-lpc1768/nx/defconfig @@ -546,5 +546,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/ostest/defconfig b/configs/lpcxpresso-lpc1768/ostest/defconfig index 8ffed2c254..a6c496313a 100755 --- a/configs/lpcxpresso-lpc1768/ostest/defconfig +++ b/configs/lpcxpresso-lpc1768/ostest/defconfig @@ -472,5 +472,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/thttpd/defconfig b/configs/lpcxpresso-lpc1768/thttpd/defconfig index b34f645302..a6915762af 100755 --- a/configs/lpcxpresso-lpc1768/thttpd/defconfig +++ b/configs/lpcxpresso-lpc1768/thttpd/defconfig @@ -511,5 +511,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=8192 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/lpcxpresso-lpc1768/usbstorage/defconfig b/configs/lpcxpresso-lpc1768/usbstorage/defconfig index f5de5234ab..4419dca113 100755 --- a/configs/lpcxpresso-lpc1768/usbstorage/defconfig +++ b/configs/lpcxpresso-lpc1768/usbstorage/defconfig @@ -468,5 +468,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/m68332evb/defconfig b/configs/m68332evb/defconfig index 0beaea91e4..affc6e1e1e 100644 --- a/configs/m68332evb/defconfig +++ b/configs/m68332evb/defconfig @@ -207,8 +207,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/mbed/hidkbd/defconfig b/configs/mbed/hidkbd/defconfig index 580921ba9e..77f7f19de6 100644 --- a/configs/mbed/hidkbd/defconfig +++ b/configs/mbed/hidkbd/defconfig @@ -476,5 +476,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mbed/nsh/defconfig b/configs/mbed/nsh/defconfig index 7d5bf4617c..89eb1115fe 100755 --- a/configs/mbed/nsh/defconfig +++ b/configs/mbed/nsh/defconfig @@ -447,5 +447,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mcu123-lpc214x/composite/defconfig b/configs/mcu123-lpc214x/composite/defconfig index 2ecfe470f1..9c5c72730e 100644 --- a/configs/mcu123-lpc214x/composite/defconfig +++ b/configs/mcu123-lpc214x/composite/defconfig @@ -420,5 +420,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mcu123-lpc214x/ostest/defconfig b/configs/mcu123-lpc214x/ostest/defconfig index 1e505868bb..3291fcf17a 100644 --- a/configs/mcu123-lpc214x/ostest/defconfig +++ b/configs/mcu123-lpc214x/ostest/defconfig @@ -339,5 +339,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mcu123-lpc214x/usbserial/defconfig b/configs/mcu123-lpc214x/usbserial/defconfig index 127416ad24..14b685d482 100644 --- a/configs/mcu123-lpc214x/usbserial/defconfig +++ b/configs/mcu123-lpc214x/usbserial/defconfig @@ -348,5 +348,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mcu123-lpc214x/usbstorage/defconfig b/configs/mcu123-lpc214x/usbstorage/defconfig index 17b99e16ed..e607109022 100644 --- a/configs/mcu123-lpc214x/usbstorage/defconfig +++ b/configs/mcu123-lpc214x/usbstorage/defconfig @@ -361,5 +361,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/micropendous3/hello/defconfig b/configs/micropendous3/hello/defconfig index 2708c5d52e..3bbe436cdf 100644 --- a/configs/micropendous3/hello/defconfig +++ b/configs/micropendous3/hello/defconfig @@ -414,5 +414,3 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mirtoo/nsh/defconfig b/configs/mirtoo/nsh/defconfig index 9beaf67280..bd7cd7deb6 100644 --- a/configs/mirtoo/nsh/defconfig +++ b/configs/mirtoo/nsh/defconfig @@ -494,5 +494,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mirtoo/nxffs/defconfig b/configs/mirtoo/nxffs/defconfig index 50929eb0e4..237165bc7c 100644 --- a/configs/mirtoo/nxffs/defconfig +++ b/configs/mirtoo/nxffs/defconfig @@ -537,5 +537,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mirtoo/ostest/defconfig b/configs/mirtoo/ostest/defconfig index f2d234e37b..97793666e0 100644 --- a/configs/mirtoo/ostest/defconfig +++ b/configs/mirtoo/ostest/defconfig @@ -470,5 +470,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/mx1ads/ostest/defconfig b/configs/mx1ads/ostest/defconfig index cc0111f204..b030db568d 100644 --- a/configs/mx1ads/ostest/defconfig +++ b/configs/mx1ads/ostest/defconfig @@ -319,8 +319,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ne64badge/ostest/defconfig b/configs/ne64badge/ostest/defconfig index a730c93ebf..6a0820dc9d 100755 --- a/configs/ne64badge/ostest/defconfig +++ b/configs/ne64badge/ostest/defconfig @@ -405,5 +405,3 @@ CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=256 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ntosd-dm320/nettest/defconfig b/configs/ntosd-dm320/nettest/defconfig index 3d2127e90e..de3face95f 100644 --- a/configs/ntosd-dm320/nettest/defconfig +++ b/configs/ntosd-dm320/nettest/defconfig @@ -315,8 +315,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/nsh/defconfig b/configs/ntosd-dm320/nsh/defconfig index 2311083740..aa1514e3dd 100644 --- a/configs/ntosd-dm320/nsh/defconfig +++ b/configs/ntosd-dm320/nsh/defconfig @@ -346,8 +346,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/ostest/defconfig b/configs/ntosd-dm320/ostest/defconfig index 0d73331428..5f2dd8b518 100644 --- a/configs/ntosd-dm320/ostest/defconfig +++ b/configs/ntosd-dm320/ostest/defconfig @@ -311,8 +311,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/poll/defconfig b/configs/ntosd-dm320/poll/defconfig index 85ee21df40..6a40da06d6 100644 --- a/configs/ntosd-dm320/poll/defconfig +++ b/configs/ntosd-dm320/poll/defconfig @@ -322,8 +322,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/thttpd/defconfig b/configs/ntosd-dm320/thttpd/defconfig index 593ac48aef..deecffaf42 100644 --- a/configs/ntosd-dm320/thttpd/defconfig +++ b/configs/ntosd-dm320/thttpd/defconfig @@ -390,8 +390,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/udp/defconfig b/configs/ntosd-dm320/udp/defconfig index 2282bb8eef..7ee1480b8d 100644 --- a/configs/ntosd-dm320/udp/defconfig +++ b/configs/ntosd-dm320/udp/defconfig @@ -323,8 +323,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/ntosd-dm320/uip/defconfig b/configs/ntosd-dm320/uip/defconfig index 883c4bf3a5..3807959b8f 100644 --- a/configs/ntosd-dm320/uip/defconfig +++ b/configs/ntosd-dm320/uip/defconfig @@ -323,8 +323,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=4096 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/nucleus2g/nsh/defconfig b/configs/nucleus2g/nsh/defconfig index a3a88204a6..21b8523ddd 100755 --- a/configs/nucleus2g/nsh/defconfig +++ b/configs/nucleus2g/nsh/defconfig @@ -470,5 +470,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/nucleus2g/ostest/defconfig b/configs/nucleus2g/ostest/defconfig index 77f7a8a310..146c62284b 100755 --- a/configs/nucleus2g/ostest/defconfig +++ b/configs/nucleus2g/ostest/defconfig @@ -447,5 +447,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/nucleus2g/usbserial/defconfig b/configs/nucleus2g/usbserial/defconfig index 64c093b047..5e2332fa01 100755 --- a/configs/nucleus2g/usbserial/defconfig +++ b/configs/nucleus2g/usbserial/defconfig @@ -460,5 +460,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/nucleus2g/usbstorage/defconfig b/configs/nucleus2g/usbstorage/defconfig index 1339379395..e8cef68696 100755 --- a/configs/nucleus2g/usbstorage/defconfig +++ b/configs/nucleus2g/usbstorage/defconfig @@ -461,5 +461,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/ftpc/defconfig b/configs/olimex-lpc1766stk/ftpc/defconfig index f14885bef9..a42addc8bb 100755 --- a/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/configs/olimex-lpc1766stk/ftpc/defconfig @@ -552,5 +552,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/nx/defconfig b/configs/olimex-lpc1766stk/nx/defconfig index e1aee80472..ef4658776d 100755 --- a/configs/olimex-lpc1766stk/nx/defconfig +++ b/configs/olimex-lpc1766stk/nx/defconfig @@ -576,5 +576,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/ostest/defconfig b/configs/olimex-lpc1766stk/ostest/defconfig index 5dcefc0f48..1ab11500c7 100755 --- a/configs/olimex-lpc1766stk/ostest/defconfig +++ b/configs/olimex-lpc1766stk/ostest/defconfig @@ -486,5 +486,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/slip-httpd/defconfig b/configs/olimex-lpc1766stk/slip-httpd/defconfig index 33e3d9f419..a83dc8d6a6 100755 --- a/configs/olimex-lpc1766stk/slip-httpd/defconfig +++ b/configs/olimex-lpc1766stk/slip-httpd/defconfig @@ -524,5 +524,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=8192 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/thttpd/defconfig b/configs/olimex-lpc1766stk/thttpd/defconfig index 47efdd95f9..0486934629 100755 --- a/configs/olimex-lpc1766stk/thttpd/defconfig +++ b/configs/olimex-lpc1766stk/thttpd/defconfig @@ -519,5 +519,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=8192 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/usbserial/defconfig b/configs/olimex-lpc1766stk/usbserial/defconfig index 06d41b6f1b..82abd21743 100755 --- a/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/configs/olimex-lpc1766stk/usbserial/defconfig @@ -487,5 +487,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc1766stk/usbstorage/defconfig b/configs/olimex-lpc1766stk/usbstorage/defconfig index fe39eeb5ca..a95c337a0e 100755 --- a/configs/olimex-lpc1766stk/usbstorage/defconfig +++ b/configs/olimex-lpc1766stk/usbstorage/defconfig @@ -488,5 +488,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc2378/nsh/defconfig b/configs/olimex-lpc2378/nsh/defconfig index 6e45f7f460..5ca117490b 100755 --- a/configs/olimex-lpc2378/nsh/defconfig +++ b/configs/olimex-lpc2378/nsh/defconfig @@ -269,5 +269,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-lpc2378/ostest/defconfig b/configs/olimex-lpc2378/ostest/defconfig index dd9d9578d4..669c5853cb 100755 --- a/configs/olimex-lpc2378/ostest/defconfig +++ b/configs/olimex-lpc2378/ostest/defconfig @@ -269,5 +269,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-stm32-p107/nsh/defconfig b/configs/olimex-stm32-p107/nsh/defconfig index 1a0eca109b..07c84516af 100644 --- a/configs/olimex-stm32-p107/nsh/defconfig +++ b/configs/olimex-stm32-p107/nsh/defconfig @@ -563,5 +563,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-stm32-p107/ostest/defconfig b/configs/olimex-stm32-p107/ostest/defconfig index 6d5901312b..ed04400606 100644 --- a/configs/olimex-stm32-p107/ostest/defconfig +++ b/configs/olimex-stm32-p107/ostest/defconfig @@ -516,5 +516,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-strp711/nettest/defconfig b/configs/olimex-strp711/nettest/defconfig index d36b42bb98..2da2a6b5cb 100755 --- a/configs/olimex-strp711/nettest/defconfig +++ b/configs/olimex-strp711/nettest/defconfig @@ -403,5 +403,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-strp711/nsh/defconfig b/configs/olimex-strp711/nsh/defconfig index 10b408df68..0e080c7b31 100644 --- a/configs/olimex-strp711/nsh/defconfig +++ b/configs/olimex-strp711/nsh/defconfig @@ -372,5 +372,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/olimex-strp711/ostest/defconfig b/configs/olimex-strp711/ostest/defconfig index 47e55c944b..0e4e25417f 100644 --- a/configs/olimex-strp711/ostest/defconfig +++ b/configs/olimex-strp711/ostest/defconfig @@ -372,5 +372,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pcblogic-pic32mx/nsh/defconfig b/configs/pcblogic-pic32mx/nsh/defconfig index d59e2b7d20..f7f9b951de 100644 --- a/configs/pcblogic-pic32mx/nsh/defconfig +++ b/configs/pcblogic-pic32mx/nsh/defconfig @@ -468,5 +468,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pcblogic-pic32mx/ostest/defconfig b/configs/pcblogic-pic32mx/ostest/defconfig index 1cf57ca4ce..61976be335 100644 --- a/configs/pcblogic-pic32mx/ostest/defconfig +++ b/configs/pcblogic-pic32mx/ostest/defconfig @@ -456,5 +456,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pic32-starterkit/nsh/defconfig b/configs/pic32-starterkit/nsh/defconfig index 16448a95fe..2c88881daa 100644 --- a/configs/pic32-starterkit/nsh/defconfig +++ b/configs/pic32-starterkit/nsh/defconfig @@ -672,5 +672,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pic32-starterkit/nsh2/defconfig b/configs/pic32-starterkit/nsh2/defconfig index a50ac506c4..23deb44711 100644 --- a/configs/pic32-starterkit/nsh2/defconfig +++ b/configs/pic32-starterkit/nsh2/defconfig @@ -671,5 +671,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pic32-starterkit/ostest/defconfig b/configs/pic32-starterkit/ostest/defconfig index 39f7d04af6..b1b99e4c62 100644 --- a/configs/pic32-starterkit/ostest/defconfig +++ b/configs/pic32-starterkit/ostest/defconfig @@ -668,5 +668,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pic32mx7mmb/nsh/defconfig b/configs/pic32mx7mmb/nsh/defconfig index eb4b64e72d..23adc8f5bb 100644 --- a/configs/pic32mx7mmb/nsh/defconfig +++ b/configs/pic32mx7mmb/nsh/defconfig @@ -788,5 +788,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pic32mx7mmb/ostest/defconfig b/configs/pic32mx7mmb/ostest/defconfig index 4595913cdd..1148aac377 100644 --- a/configs/pic32mx7mmb/ostest/defconfig +++ b/configs/pic32mx7mmb/ostest/defconfig @@ -668,5 +668,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/pjrc-8051/defconfig b/configs/pjrc-8051/defconfig index 43c2347a9f..d2dea8a627 100644 --- a/configs/pjrc-8051/defconfig +++ b/configs/pjrc-8051/defconfig @@ -206,8 +206,6 @@ CONFIG_IDLETHREAD_STACKSIZE= CONFIG_USERMAIN_STACKSIZE= CONFIG_PTHREAD_STACK_MIN= CONFIG_PTHREAD_STACK_DEFAULT= -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/qemu-i486/nsh/defconfig b/configs/qemu-i486/nsh/defconfig index a482e6face..44bf3df28d 100644 --- a/configs/qemu-i486/nsh/defconfig +++ b/configs/qemu-i486/nsh/defconfig @@ -307,8 +307,6 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/qemu-i486/ostest/defconfig b/configs/qemu-i486/ostest/defconfig index 4a23316382..1c3e510a44 100644 --- a/configs/qemu-i486/ostest/defconfig +++ b/configs/qemu-i486/ostest/defconfig @@ -223,8 +223,6 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/rgmp/arm/default/defconfig b/configs/rgmp/arm/default/defconfig index 88843e365d..8bff713c82 100644 --- a/configs/rgmp/arm/default/defconfig +++ b/configs/rgmp/arm/default/defconfig @@ -217,8 +217,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/rgmp/arm/nsh/defconfig b/configs/rgmp/arm/nsh/defconfig index 47c685aae4..8c43c376ef 100644 --- a/configs/rgmp/arm/nsh/defconfig +++ b/configs/rgmp/arm/nsh/defconfig @@ -218,8 +218,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/rgmp/x86/cxxtest/defconfig b/configs/rgmp/x86/cxxtest/defconfig index 2b19192e43..230ed41df4 100644 --- a/configs/rgmp/x86/cxxtest/defconfig +++ b/configs/rgmp/x86/cxxtest/defconfig @@ -382,8 +382,6 @@ CONFIG_NSH_NETMASK=0xffffff00 # for the main user thread that begins at the user_start() entry point. # CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size # CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size -# CONFIG_HEAP_BASE - The beginning of the heap -# CONFIG_HEAP_SIZE - The size of the heap # CONFIG_BOOT_RUNFROMFLASH=n CONFIG_BOOT_COPYTORAM=n @@ -392,8 +390,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= CONFIG_USER_ENTRYPOINT="cxxtest_main" # diff --git a/configs/rgmp/x86/default/defconfig b/configs/rgmp/x86/default/defconfig index 383e0ff5fd..5289217a8b 100644 --- a/configs/rgmp/x86/default/defconfig +++ b/configs/rgmp/x86/default/defconfig @@ -228,8 +228,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= ########################################## diff --git a/configs/rgmp/x86/helloxx/defconfig b/configs/rgmp/x86/helloxx/defconfig index 9266bad812..ca0d17bf4a 100644 --- a/configs/rgmp/x86/helloxx/defconfig +++ b/configs/rgmp/x86/helloxx/defconfig @@ -374,8 +374,6 @@ CONFIG_NSH_NETMASK=0xffffff00 # for the main user thread that begins at the user_start() entry point. # CONFIG_PTHREAD_STACK_MIN - Minimum pthread stack size # CONFIG_PTHREAD_STACK_DEFAULT - Default pthread stack size -# CONFIG_HEAP_BASE - The beginning of the heap -# CONFIG_HEAP_SIZE - The size of the heap # CONFIG_BOOT_RUNFROMFLASH=n CONFIG_BOOT_COPYTORAM=n @@ -384,8 +382,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= CONFIG_USER_ENTRYPOINT="helloxx_main" # diff --git a/configs/rgmp/x86/nsh/defconfig b/configs/rgmp/x86/nsh/defconfig index 6f10b234a2..b07b7d9a97 100644 --- a/configs/rgmp/x86/nsh/defconfig +++ b/configs/rgmp/x86/nsh/defconfig @@ -227,8 +227,6 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/sam3u-ek/knsh/defconfig b/configs/sam3u-ek/knsh/defconfig index bbd3662c11..1a8db473b7 100755 --- a/configs/sam3u-ek/knsh/defconfig +++ b/configs/sam3u-ek/knsh/defconfig @@ -57,10 +57,12 @@ CONFIG_ARCH_DMA=n # # Identify toolchain and linker options # -CONFIG_SAM3U_CODESOURCERYW=n -CONFIG_SAM3U_CODESOURCERYL=n -CONFIG_SAM3U_DEVKITARM=n -CONFIG_SAM3U_BUILDROOT=y +CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y +CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYL=n +CONFIG_ARMV7M_TOOLCHAIN_CODESOURCERYW=n +CONFIG_ARMV7M_TOOLCHAIN_DEVKITARM=n +CONFIG_ARMV7M_TOOLCHAIN_GNU_EABI=n +CONFIG_ARMV7M_OABI_TOOLCHAIN=y # # Cortex-M3 features @@ -485,5 +487,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sam3u-ek/nsh/defconfig b/configs/sam3u-ek/nsh/defconfig index 034fe37a8e..7a6c12eab7 100755 --- a/configs/sam3u-ek/nsh/defconfig +++ b/configs/sam3u-ek/nsh/defconfig @@ -459,5 +459,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sam3u-ek/nx/defconfig b/configs/sam3u-ek/nx/defconfig index 29fd3dd6ea..e7c85ee932 100755 --- a/configs/sam3u-ek/nx/defconfig +++ b/configs/sam3u-ek/nx/defconfig @@ -485,5 +485,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sam3u-ek/ostest/defconfig b/configs/sam3u-ek/ostest/defconfig index e8321a896d..82510c7d4f 100755 --- a/configs/sam3u-ek/ostest/defconfig +++ b/configs/sam3u-ek/ostest/defconfig @@ -459,5 +459,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sam3u-ek/touchscreen/defconfig b/configs/sam3u-ek/touchscreen/defconfig index dc41a75ea0..843ba06b4e 100755 --- a/configs/sam3u-ek/touchscreen/defconfig +++ b/configs/sam3u-ek/touchscreen/defconfig @@ -569,5 +569,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/mount/defconfig b/configs/sim/mount/defconfig index be62a96deb..0d61f7750a 100644 --- a/configs/sim/mount/defconfig +++ b/configs/sim/mount/defconfig @@ -221,5 +221,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/nettest/defconfig b/configs/sim/nettest/defconfig index 643ee1c9f5..bedbbbc233 100644 --- a/configs/sim/nettest/defconfig +++ b/configs/sim/nettest/defconfig @@ -220,5 +220,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/nsh2/defconfig b/configs/sim/nsh2/defconfig index ce6563fe9d..50c7adc5af 100644 --- a/configs/sim/nsh2/defconfig +++ b/configs/sim/nsh2/defconfig @@ -368,5 +368,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/nx/defconfig b/configs/sim/nx/defconfig index de73491ab3..ecf3da3b17 100644 --- a/configs/sim/nx/defconfig +++ b/configs/sim/nx/defconfig @@ -321,5 +321,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/nx11/defconfig b/configs/sim/nx11/defconfig index 1702045f38..c65fa3d36f 100644 --- a/configs/sim/nx11/defconfig +++ b/configs/sim/nx11/defconfig @@ -317,5 +317,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=16384 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/nxffs/defconfig b/configs/sim/nxffs/defconfig index 7899f119d4..c18a77a62a 100644 --- a/configs/sim/nxffs/defconfig +++ b/configs/sim/nxffs/defconfig @@ -230,5 +230,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/pashello/defconfig b/configs/sim/pashello/defconfig index 56f6b8a326..d26e28add2 100644 --- a/configs/sim/pashello/defconfig +++ b/configs/sim/pashello/defconfig @@ -209,5 +209,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sim/touchscreen/defconfig b/configs/sim/touchscreen/defconfig index 25e0471856..bfa9bcbad0 100644 --- a/configs/sim/touchscreen/defconfig +++ b/configs/sim/touchscreen/defconfig @@ -316,5 +316,3 @@ CONFIG_IDLETHREAD_STACKSIZE=4096 CONFIG_USERMAIN_STACKSIZE=4096 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=8192 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/skp16c26/ostest/defconfig b/configs/skp16c26/ostest/defconfig index 40ff5b3a14..3cc34ca186 100644 --- a/configs/skp16c26/ostest/defconfig +++ b/configs/skp16c26/ostest/defconfig @@ -315,8 +315,6 @@ CONFIG_IDLETHREAD_STACKSIZE=256 CONFIG_USERMAIN_STACKSIZE=256 CONFIG_PTHREAD_STACK_MIN=64 CONFIG_PTHREAD_STACK_DEFAULT=256 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # # Maintain legacy build behavior (revisit) diff --git a/configs/stm3210e-eval/RIDE/defconfig b/configs/stm3210e-eval/RIDE/defconfig index ee2b68793f..43b88084ff 100755 --- a/configs/stm3210e-eval/RIDE/defconfig +++ b/configs/stm3210e-eval/RIDE/defconfig @@ -474,5 +474,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/buttons/defconfig b/configs/stm3210e-eval/buttons/defconfig index 3c8fca2227..81a1f3a527 100644 --- a/configs/stm3210e-eval/buttons/defconfig +++ b/configs/stm3210e-eval/buttons/defconfig @@ -501,5 +501,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/composite/defconfig b/configs/stm3210e-eval/composite/defconfig index c9504c5160..6ead077f4b 100755 --- a/configs/stm3210e-eval/composite/defconfig +++ b/configs/stm3210e-eval/composite/defconfig @@ -566,5 +566,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nsh/defconfig b/configs/stm3210e-eval/nsh/defconfig index 718dcfa8a6..af154810eb 100755 --- a/configs/stm3210e-eval/nsh/defconfig +++ b/configs/stm3210e-eval/nsh/defconfig @@ -486,5 +486,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nsh2/defconfig b/configs/stm3210e-eval/nsh2/defconfig index 49d5dbf8c4..d5e19733f9 100644 --- a/configs/stm3210e-eval/nsh2/defconfig +++ b/configs/stm3210e-eval/nsh2/defconfig @@ -727,5 +727,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nx/defconfig b/configs/stm3210e-eval/nx/defconfig index 788fe7216f..f4a3cb4e3b 100644 --- a/configs/stm3210e-eval/nx/defconfig +++ b/configs/stm3210e-eval/nx/defconfig @@ -605,5 +605,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nxconsole/defconfig b/configs/stm3210e-eval/nxconsole/defconfig index 9e7ed363fd..ccfea526ef 100644 --- a/configs/stm3210e-eval/nxconsole/defconfig +++ b/configs/stm3210e-eval/nxconsole/defconfig @@ -633,5 +633,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nxlines/defconfig b/configs/stm3210e-eval/nxlines/defconfig index 8832fb0b8d..580b28019a 100644 --- a/configs/stm3210e-eval/nxlines/defconfig +++ b/configs/stm3210e-eval/nxlines/defconfig @@ -629,5 +629,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/nxtext/defconfig b/configs/stm3210e-eval/nxtext/defconfig index aa9284c5f0..46a25103e9 100644 --- a/configs/stm3210e-eval/nxtext/defconfig +++ b/configs/stm3210e-eval/nxtext/defconfig @@ -629,5 +629,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/ostest/defconfig b/configs/stm3210e-eval/ostest/defconfig index 9e9a4e123f..5fa10f497d 100755 --- a/configs/stm3210e-eval/ostest/defconfig +++ b/configs/stm3210e-eval/ostest/defconfig @@ -494,5 +494,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/pm/defconfig b/configs/stm3210e-eval/pm/defconfig index 224953ec21..be0b25194c 100644 --- a/configs/stm3210e-eval/pm/defconfig +++ b/configs/stm3210e-eval/pm/defconfig @@ -772,5 +772,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/usbserial/defconfig b/configs/stm3210e-eval/usbserial/defconfig index 66069d5ad2..bb9568ff22 100755 --- a/configs/stm3210e-eval/usbserial/defconfig +++ b/configs/stm3210e-eval/usbserial/defconfig @@ -520,5 +520,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3210e-eval/usbstorage/defconfig b/configs/stm3210e-eval/usbstorage/defconfig index b4d15ae8c2..0d3034495b 100755 --- a/configs/stm3210e-eval/usbstorage/defconfig +++ b/configs/stm3210e-eval/usbstorage/defconfig @@ -507,5 +507,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/dhcpd/defconfig b/configs/stm3220g-eval/dhcpd/defconfig index 627136ebba..fecf193d6b 100644 --- a/configs/stm3220g-eval/dhcpd/defconfig +++ b/configs/stm3220g-eval/dhcpd/defconfig @@ -639,5 +639,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/nettest/defconfig b/configs/stm3220g-eval/nettest/defconfig index 39c1bb8edf..7df818c889 100644 --- a/configs/stm3220g-eval/nettest/defconfig +++ b/configs/stm3220g-eval/nettest/defconfig @@ -632,5 +632,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/nsh/defconfig b/configs/stm3220g-eval/nsh/defconfig index 7513abed83..fab3bfd16f 100644 --- a/configs/stm3220g-eval/nsh/defconfig +++ b/configs/stm3220g-eval/nsh/defconfig @@ -854,5 +854,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/nsh2/defconfig b/configs/stm3220g-eval/nsh2/defconfig index f1417ef066..d14e7664ea 100644 --- a/configs/stm3220g-eval/nsh2/defconfig +++ b/configs/stm3220g-eval/nsh2/defconfig @@ -841,5 +841,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/ostest/defconfig b/configs/stm3220g-eval/ostest/defconfig index fbd7a0c1bc..dc23e0ab55 100644 --- a/configs/stm3220g-eval/ostest/defconfig +++ b/configs/stm3220g-eval/ostest/defconfig @@ -732,5 +732,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3220g-eval/telnetd/defconfig b/configs/stm3220g-eval/telnetd/defconfig index 18ed2babbe..5a0d96c6b4 100644 --- a/configs/stm3220g-eval/telnetd/defconfig +++ b/configs/stm3220g-eval/telnetd/defconfig @@ -644,8 +644,6 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # Application configuration diff --git a/configs/stm3240g-eval/dhcpd/defconfig b/configs/stm3240g-eval/dhcpd/defconfig index 91682111bf..a49e94ea30 100644 --- a/configs/stm3240g-eval/dhcpd/defconfig +++ b/configs/stm3240g-eval/dhcpd/defconfig @@ -645,5 +645,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/nettest/defconfig b/configs/stm3240g-eval/nettest/defconfig index 257a4d2520..0fdb75229e 100644 --- a/configs/stm3240g-eval/nettest/defconfig +++ b/configs/stm3240g-eval/nettest/defconfig @@ -638,5 +638,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/nsh/defconfig b/configs/stm3240g-eval/nsh/defconfig index 018aafdcfd..47f1a4b4cb 100644 --- a/configs/stm3240g-eval/nsh/defconfig +++ b/configs/stm3240g-eval/nsh/defconfig @@ -847,5 +847,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/nsh2/defconfig b/configs/stm3240g-eval/nsh2/defconfig index 1c59b74a41..d62098eba6 100644 --- a/configs/stm3240g-eval/nsh2/defconfig +++ b/configs/stm3240g-eval/nsh2/defconfig @@ -704,5 +704,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/nxconsole/defconfig b/configs/stm3240g-eval/nxconsole/defconfig index bd8be9f5d3..bc9161d30b 100644 --- a/configs/stm3240g-eval/nxconsole/defconfig +++ b/configs/stm3240g-eval/nxconsole/defconfig @@ -810,5 +810,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/nxwm/defconfig b/configs/stm3240g-eval/nxwm/defconfig index 34eaa9ec6d..a7ac5e38c3 100644 --- a/configs/stm3240g-eval/nxwm/defconfig +++ b/configs/stm3240g-eval/nxwm/defconfig @@ -879,5 +879,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/ostest/defconfig b/configs/stm3240g-eval/ostest/defconfig index 87cafe7784..7359f210a5 100644 --- a/configs/stm3240g-eval/ostest/defconfig +++ b/configs/stm3240g-eval/ostest/defconfig @@ -737,5 +737,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm3240g-eval/telnetd/defconfig b/configs/stm3240g-eval/telnetd/defconfig index faab76377f..efc548d0b3 100644 --- a/configs/stm3240g-eval/telnetd/defconfig +++ b/configs/stm3240g-eval/telnetd/defconfig @@ -650,8 +650,6 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # Application configuration diff --git a/configs/stm3240g-eval/webserver/defconfig b/configs/stm3240g-eval/webserver/defconfig index f736a198b9..85274ad4fc 100644 --- a/configs/stm3240g-eval/webserver/defconfig +++ b/configs/stm3240g-eval/webserver/defconfig @@ -847,5 +847,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/stm32f4discovery/pm/defconfig b/configs/stm32f4discovery/pm/defconfig index 7a04e6557c..5e39043650 100644 --- a/configs/stm32f4discovery/pm/defconfig +++ b/configs/stm32f4discovery/pm/defconfig @@ -728,8 +728,6 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # Application configuration diff --git a/configs/sure-pic32mx/nsh/defconfig b/configs/sure-pic32mx/nsh/defconfig index a5977733c9..c552dec224 100644 --- a/configs/sure-pic32mx/nsh/defconfig +++ b/configs/sure-pic32mx/nsh/defconfig @@ -528,5 +528,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sure-pic32mx/ostest/defconfig b/configs/sure-pic32mx/ostest/defconfig index 52562f76a2..86c4bbdd94 100644 --- a/configs/sure-pic32mx/ostest/defconfig +++ b/configs/sure-pic32mx/ostest/defconfig @@ -457,5 +457,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/sure-pic32mx/usbnsh/defconfig b/configs/sure-pic32mx/usbnsh/defconfig index 3ab4563e99..404decf127 100644 --- a/configs/sure-pic32mx/usbnsh/defconfig +++ b/configs/sure-pic32mx/usbnsh/defconfig @@ -525,5 +525,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/teensy/hello/defconfig b/configs/teensy/hello/defconfig index cc2b6c9c1a..91305456d3 100644 --- a/configs/teensy/hello/defconfig +++ b/configs/teensy/hello/defconfig @@ -414,5 +414,3 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/teensy/nsh/defconfig b/configs/teensy/nsh/defconfig index 0cc8777315..7f332a3b0d 100755 --- a/configs/teensy/nsh/defconfig +++ b/configs/teensy/nsh/defconfig @@ -413,5 +413,3 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=512 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/teensy/usbstorage/defconfig b/configs/teensy/usbstorage/defconfig index 590a6f8bbe..307c3e888c 100755 --- a/configs/teensy/usbstorage/defconfig +++ b/configs/teensy/usbstorage/defconfig @@ -433,5 +433,3 @@ CONFIG_IDLETHREAD_STACKSIZE=512 CONFIG_USERMAIN_STACKSIZE=512 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=512 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/twr-k60n512/nsh/defconfig b/configs/twr-k60n512/nsh/defconfig index aaa1ea96fb..7040494008 100644 --- a/configs/twr-k60n512/nsh/defconfig +++ b/configs/twr-k60n512/nsh/defconfig @@ -469,5 +469,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/twr-k60n512/ostest/defconfig b/configs/twr-k60n512/ostest/defconfig index 12eb4855d3..fecbfd0290 100644 --- a/configs/twr-k60n512/ostest/defconfig +++ b/configs/twr-k60n512/ostest/defconfig @@ -466,5 +466,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/ubw32/nsh/defconfig b/configs/ubw32/nsh/defconfig index c9718ca8d0..bb3babe31f 100644 --- a/configs/ubw32/nsh/defconfig +++ b/configs/ubw32/nsh/defconfig @@ -503,5 +503,3 @@ CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/us7032evb1/nsh/defconfig b/configs/us7032evb1/nsh/defconfig index 5bf0bd71d6..5d4e0632dc 100644 --- a/configs/us7032evb1/nsh/defconfig +++ b/configs/us7032evb1/nsh/defconfig @@ -328,5 +328,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/us7032evb1/ostest/defconfig b/configs/us7032evb1/ostest/defconfig index 5b40baf88c..2126cc930e 100644 --- a/configs/us7032evb1/ostest/defconfig +++ b/configs/us7032evb1/ostest/defconfig @@ -328,5 +328,3 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=1024 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=1024 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= diff --git a/configs/vsn/nsh/defconfig b/configs/vsn/nsh/defconfig index 1a59feb9e1..35f787bfc1 100755 --- a/configs/vsn/nsh/defconfig +++ b/configs/vsn/nsh/defconfig @@ -519,8 +519,6 @@ CONFIG_IDLETHREAD_STACKSIZE=1024 CONFIG_USERMAIN_STACKSIZE=2048 CONFIG_PTHREAD_STACK_MIN=256 CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_HEAP_BASE= -CONFIG_HEAP_SIZE= # Application configuration diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index cae6f39b40..e894a1dd28 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -52,6 +52,7 @@ #include #include +#include #include #include diff --git a/drivers/pwm.c b/drivers/pwm.c index 62fb4d2fb2..6e33c902bf 100644 --- a/drivers/pwm.c +++ b/drivers/pwm.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/pwm.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ #include #include +#include #include #include #include @@ -587,14 +588,14 @@ int pwm_register(FAR const char *path, FAR struct pwm_lowerhalf_s *dev) /* Allocate the upper-half data structure */ - upper = (FAR struct pwm_upperhalf_s *)zalloc(sizeof(struct pwm_upperhalf_s)); + upper = (FAR struct pwm_upperhalf_s *)kzalloc(sizeof(struct pwm_upperhalf_s)); if (!upper) { pwmdbg("Allocation failed\n"); return -ENOMEM; } - /* Initialize the PWM device structure (it was already zeroed by zalloc()) */ + /* Initialize the PWM device structure (it was already zeroed by kzalloc()) */ sem_init(&upper->exclsem, 0, 1); #ifdef CONFIG_PWM_PULSECOUNT diff --git a/drivers/sensors/lm75.c b/drivers/sensors/lm75.c index 2d3346447b..2884f29c6b 100644 --- a/drivers/sensors/lm75.c +++ b/drivers/sensors/lm75.c @@ -2,7 +2,7 @@ * drivers/sensors/lm75.c * Character driver for the STMicro LM-75 Temperature Sensor * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -513,7 +514,7 @@ int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, uint8_t ad /* Initialize the LM-75 device structure */ - priv = (FAR struct lm75_dev_s *)malloc(sizeof(struct lm75_dev_s)); + priv = (FAR struct lm75_dev_s *)kmalloc(sizeof(struct lm75_dev_s)); if (!priv) { lm75dbg("Failed to allocate instance\n"); @@ -530,8 +531,9 @@ int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c, uint8_t ad if (ret < 0) { lm75dbg("Failed to register driver: %d\n", ret); - free(priv); + kfree(priv); } + return ret; } #endif /* CONFIG_I2C && CONFIG_I2C_LM75 */ diff --git a/drivers/sensors/qencoder.c b/drivers/sensors/qencoder.c index a56adec9ae..d9f3d76255 100644 --- a/drivers/sensors/qencoder.c +++ b/drivers/sensors/qencoder.c @@ -1,7 +1,7 @@ /**************************************************************************** * drivers/sensors/qencoder.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,7 @@ #include #include +#include #include #include #include @@ -381,14 +382,14 @@ int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower) /* Allocate the upper-half data structure */ - upper = (FAR struct qe_upperhalf_s *)zalloc(sizeof(struct qe_upperhalf_s)); + upper = (FAR struct qe_upperhalf_s *)kzalloc(sizeof(struct qe_upperhalf_s)); if (!upper) { qedbg("Allocation failed\n"); return -ENOMEM; } - /* Initialize the PWM device structure (it was already zeroed by zalloc()) */ + /* Initialize the PWM device structure (it was already zeroed by kzalloc()) */ sem_init(&upper->exclsem, 0, 1); upper->lower = lower; diff --git a/drivers/usbdev/usbmsc.c b/drivers/usbdev/usbmsc.c index 68b61814a7..8dafbae5db 100644 --- a/drivers/usbdev/usbmsc.c +++ b/drivers/usbdev/usbmsc.c @@ -1472,7 +1472,7 @@ int usbmsc_bindlun(FAR void *handle, FAR const char *drvrpath, else if (priv->iosize < geo.geo_sectorsize) { void *tmp; - tmp = (uint8_t*)realloc(priv->iobuffer, geo.geo_sectorsize); + tmp = (uint8_t*)krealloc(priv->iobuffer, geo.geo_sectorsize); if (!tmp) { usbtrace(TRACE_CLSERROR(USBMSC_TRACEERR_REALLOCIOBUFFER), geo.geo_sectorsize); diff --git a/fs/fat/fs_mkfatfs.c b/fs/fat/fs_mkfatfs.c index 384aa93567..ed7ed2a662 100644 --- a/fs/fat/fs_mkfatfs.c +++ b/fs/fat/fs_mkfatfs.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fat/fs_writefat.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,7 @@ #include #include +#include #include #include #include @@ -277,7 +278,7 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt) /* Allocate a buffer that will be working sector memory */ - var.fv_sect = (uint8_t*)malloc(var.fv_sectorsize); + var.fv_sect = (uint8_t*)kmalloc(var.fv_sectorsize); if (!var.fv_sect) { fdbg("Failed to allocate working buffers\n"); @@ -298,15 +299,16 @@ errout: if (var.fv_sect) { - free(var.fv_sect); + kfree(var.fv_sect); } - /* Return any reported errors */ + /* Return any reported errors */ - if (ret < 0) - { - errno = -ret; - return ERROR; - } - return OK; + if (ret < 0) + { + errno = -ret; + return ERROR; + } + + return OK; } diff --git a/fs/fs_closedir.c b/fs/fs_closedir.c index cd499f5390..6aeed03a5a 100644 --- a/fs/fs_closedir.c +++ b/fs/fs_closedir.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_closedir.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -135,13 +135,13 @@ int closedir(FAR DIR *dirp) /* Then release the container */ - kfree(idir); + kufree(idir); return OK; #ifndef CONFIG_DISABLE_MOUNTPOINT errout_with_inode: inode_release(inode); - kfree(idir); + kufree(idir); #endif errout: diff --git a/fs/fs_fdopen.c b/fs/fs_fdopen.c index 5d1c67c349..0e43876a1a 100644 --- a/fs/fs_fdopen.c +++ b/fs/fs_fdopen.c @@ -222,7 +222,7 @@ FAR struct file_struct *fs_fdopen(int fd, int oflags, FAR struct tcb_s *tcb) /* Allocate the IO buffer */ - stream->fs_bufstart = kmalloc(CONFIG_STDIO_BUFFER_SIZE); + stream->fs_bufstart = kumalloc(CONFIG_STDIO_BUFFER_SIZE); if (!stream->fs_bufstart) { err = ENOMEM; diff --git a/fs/fs_foreachinode.c b/fs/fs_foreachinode.c index c5874c669b..8d93825fdb 100644 --- a/fs/fs_foreachinode.c +++ b/fs/fs_foreachinode.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_foreachinode.c * - * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,6 +44,7 @@ #include #include +#include #include #include "fs_internal.h" @@ -187,7 +188,7 @@ int foreach_inode(foreach_inode_t handler, FAR void *arg) /* Allocate the mountpoint info structure */ - info = (FAR struct inode_path_s *)malloc(sizeof(struct inode_path_s)); + info = (FAR struct inode_path_s *)kmalloc(sizeof(struct inode_path_s)); if (!info) { return -ENOMEM; @@ -207,7 +208,7 @@ int foreach_inode(foreach_inode_t handler, FAR void *arg) /* Free the info structure and return the result */ - free(info); + kfree(info); return ret; #else diff --git a/fs/fs_opendir.c b/fs/fs_opendir.c index 1c87c984dd..c1f44a9d13 100644 --- a/fs/fs_opendir.c +++ b/fs/fs_opendir.c @@ -1,7 +1,7 @@ /**************************************************************************** * fs/fs_opendir.c * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -232,7 +232,7 @@ FAR DIR *opendir(FAR const char *path) * container. */ - dir = (FAR struct fs_dirent_s *)kzalloc(sizeof(struct fs_dirent_s)); + dir = (FAR struct fs_dirent_s *)kuzalloc(sizeof(struct fs_dirent_s)); if (!dir) { /* Insufficient memory to complete the operation.*/ @@ -303,7 +303,7 @@ FAR DIR *opendir(FAR const char *path) /* Nasty goto's make error handling simpler */ errout_with_direntry: - kfree(dir); + kufree(dir); errout_with_semaphore: inode_semgive(); diff --git a/fs/mmap/fs_munmap.c b/fs/mmap/fs_munmap.c index 5d9416d454..3088ac7d73 100644 --- a/fs/mmap/fs_munmap.c +++ b/fs/mmap/fs_munmap.c @@ -151,7 +151,7 @@ int munmap(FAR void *start, size_t length) /* Get the offset from the beginning of the region and the actual number * of bytes to "unmap". All mappings must extend to the end of the region. * There is no support for free a block of memory but leaving a block of - * memory at the end. This is a consequence of using realloc() to + * memory at the end. This is a consequence of using kurealloc() to * simulate the unmapping. */ @@ -186,7 +186,7 @@ int munmap(FAR void *start, size_t length) /* Then free the region */ - kfree(curr); + kufree(curr); } /* No.. We have been asked to "unmap' only a portion of the memory @@ -195,7 +195,7 @@ int munmap(FAR void *start, size_t length) else { - newaddr = krealloc(curr->addr, sizeof(struct fs_rammap_s) + length); + newaddr = kurealloc(curr->addr, sizeof(struct fs_rammap_s) + length); DEBUGASSERT(newaddr == (FAR void*)(curr->addr)); curr->length = length; } diff --git a/fs/mmap/fs_rammap.c b/fs/mmap/fs_rammap.c index f43541cc9b..8a75c3d612 100644 --- a/fs/mmap/fs_rammap.c +++ b/fs/mmap/fs_rammap.c @@ -139,7 +139,7 @@ FAR void *rammap(int fd, size_t length, off_t offset) /* Allocate a region of memory of the specified size */ - alloc = (FAR uint8_t *)kmalloc(sizeof(struct fs_rammap_s) + length); + alloc = (FAR uint8_t *)kumalloc(sizeof(struct fs_rammap_s) + length); if (!alloc) { fdbg("Region allocation failed, length: %d\n", (int)length); @@ -232,13 +232,13 @@ FAR void *rammap(int fd, size_t length, off_t offset) return map->addr; errout_with_region: - kfree(alloc); + kufree(alloc); errout: set_errno(err); return MAP_FAILED; errout_with_errno: - kfree(alloc); + kufree(alloc); return MAP_FAILED; } diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c index 4857fb6d33..5a1d9a9003 100644 --- a/fs/romfs/fs_romfsutil.c +++ b/fs/romfs/fs_romfsutil.c @@ -1,7 +1,7 @@ /**************************************************************************** * rm/romfs/fs_romfsutil.h * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: Linux/Documentation/filesystems/romfs.txt @@ -51,6 +51,7 @@ #include #include +#include #include #include @@ -555,7 +556,7 @@ int romfs_hwconfigure(struct romfs_mountpt_s *rm) /* Allocate the device cache buffer for normal sector accesses */ - rm->rm_buffer = (uint8_t*)malloc(rm->rm_hwsectorsize); + rm->rm_buffer = (uint8_t*)kmalloc(rm->rm_hwsectorsize); if (!rm->rm_buffer) { return -ENOMEM; @@ -643,7 +644,7 @@ int romfs_fileconfigure(struct romfs_mountpt_s *rm, struct romfs_file_s *rf) /* Create a file buffer to support partial sector accesses */ - rf->rf_buffer = (uint8_t*)malloc(rm->rm_hwsectorsize); + rf->rf_buffer = (uint8_t*)kmalloc(rm->rm_hwsectorsize); if (!rf->rf_buffer) { return -ENOMEM; diff --git a/graphics/nxbe/nxbe_clipper.c b/graphics/nxbe/nxbe_clipper.c index cdbd421c05..1c33dd2431 100644 --- a/graphics/nxbe/nxbe_clipper.c +++ b/graphics/nxbe/nxbe_clipper.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxbe/nxbe_clipper.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,9 @@ #include #include +#include #include + #include "nxbe.h" /**************************************************************************** @@ -113,7 +115,7 @@ static inline void nxbe_pushrectangle(FAR struct nxbe_clipstack_s *stack, int mxrects = stack->mxrects ? 2 * stack->mxrects : NX_INITIAL_STACKSIZE; struct nxbe_cliprect_s *newstack; - newstack = realloc(stack->stack, sizeof(struct nxbe_cliprect_s) * mxrects); + newstack = krealloc(stack->stack, sizeof(struct nxbe_cliprect_s) * mxrects); if (!newstack) { gdbg("Failed to reallocate stack\n"); @@ -258,7 +260,7 @@ void nxbe_clipper(FAR struct nxbe_window_s *wnd, if (stack.stack) { - free(stack.stack); + kfree(stack.stack); } } diff --git a/graphics/nxbe/nxbe_colormap.c b/graphics/nxbe/nxbe_colormap.c index e338773820..89e6baace0 100644 --- a/graphics/nxbe/nxbe_colormap.c +++ b/graphics/nxbe/nxbe_colormap.c @@ -45,6 +45,8 @@ #include #include +#include + #include "nxbe.h" /**************************************************************************** @@ -100,11 +102,12 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev) */ size = 3 * CONFIG_NX_NCOLORS * sizeof(uint8_t); - alloc = (uint8_t*)malloc(size); + alloc = (uint8_t*)kmalloc(size); if (alloc == NULL) { return -ENOMEM; } + memset(alloc, 0xff, size); /* Then get pointers to each color table */ @@ -149,7 +152,7 @@ int nxbe_colormap(FAR NX_DRIVERTYPE *dev) ret = dev->putcmap(dev, &cmap); - free(alloc); + kfree(alloc); return ret; } #endif diff --git a/graphics/nxmu/nx_connect.c b/graphics/nxmu/nx_connect.c index 4d91b54d5b..2c14579ee6 100644 --- a/graphics/nxmu/nx_connect.c +++ b/graphics/nxmu/nx_connect.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nx_connect.c * - * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -47,7 +47,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -130,7 +132,7 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname) /* Allocate the NX client structure */ - conn = (FAR struct nxfe_conn_s *)zalloc(sizeof(struct nxfe_conn_s)); + conn = (FAR struct nxfe_conn_s *)kzalloc(sizeof(struct nxfe_conn_s)); if (!conn) { errno = ENOMEM; @@ -213,7 +215,7 @@ errout_with_wmq: errout_with_rmq: mq_close(conn->crdmq); errout_with_conn: - free(conn); + kfree(conn); errout: return NULL; } diff --git a/graphics/nxmu/nx_eventhandler.c b/graphics/nxmu/nx_eventhandler.c index 944bb12d11..815f9f583b 100644 --- a/graphics/nxmu/nx_eventhandler.c +++ b/graphics/nxmu/nx_eventhandler.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nx_eventhandler.c * - * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,7 +46,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -96,7 +98,7 @@ static inline void nx_disconnected(FAR struct nxfe_conn_s *conn) /* And free the client structure */ - free(conn); + kfree(conn); } /**************************************************************************** diff --git a/graphics/nxmu/nx_kbdin.c b/graphics/nxmu/nx_kbdin.c index b4b91298b4..69d96ea91d 100644 --- a/graphics/nxmu/nx_kbdin.c +++ b/graphics/nxmu/nx_kbdin.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxmu/nx_kbdin.c * - * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,9 @@ #include #include +#include #include + #include "nxfe.h" #ifdef CONFIG_NX_KBD @@ -96,7 +98,7 @@ int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch) */ size = sizeof(struct nxsvrmsg_kbdin_s) + nch - 1; - outmsg = (FAR struct nxsvrmsg_kbdin_s *)malloc(size); + outmsg = (FAR struct nxsvrmsg_kbdin_s *)kmalloc(size); if (!outmsg) { errno = ENOMEM; @@ -115,7 +117,7 @@ int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch) ret = nxmu_sendserver(conn, outmsg, size); - free(outmsg); + kfree(outmsg); return ret; } diff --git a/graphics/nxmu/nxfe.h b/graphics/nxmu/nxfe.h index b9e02616ce..311cedbc60 100644 --- a/graphics/nxmu/nxfe.h +++ b/graphics/nxmu/nxfe.h @@ -492,10 +492,10 @@ extern "C" { * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (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. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect diff --git a/graphics/nxmu/nxmu_constructwindow.c b/graphics/nxmu/nxmu_constructwindow.c index e5f6dcc9ab..5392c28b73 100644 --- a/graphics/nxmu/nxmu_constructwindow.c +++ b/graphics/nxmu/nxmu_constructwindow.c @@ -43,7 +43,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -81,10 +83,10 @@ * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (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. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect @@ -113,7 +115,7 @@ int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd, if (!conn || !cb) { - free(wnd); + kfree(wnd); errno = EINVAL; return ERROR; } diff --git a/graphics/nxmu/nxmu_kbdin.c b/graphics/nxmu/nxmu_kbdin.c index 0308c2bfa8..f156a4151a 100644 --- a/graphics/nxmu/nxmu_kbdin.c +++ b/graphics/nxmu/nxmu_kbdin.c @@ -44,7 +44,9 @@ #include #include +#include #include + #include "nxfe.h" #ifdef CONFIG_NX_KBD @@ -94,7 +96,7 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch) */ size = sizeof(struct nxclimsg_kbdin_s) + nch - 1; - outmsg = (FAR struct nxclimsg_kbdin_s *)malloc(size); + outmsg = (FAR struct nxclimsg_kbdin_s *)kmalloc(size); if (outmsg) { /* Give the keypad input only to the top child */ @@ -109,7 +111,7 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch) } (void)nxmu_sendclientwindow(fe->be.topwnd, outmsg, size); - free(outmsg); + kfree(outmsg); } } diff --git a/graphics/nxsu/nx_close.c b/graphics/nxsu/nx_close.c index b48a2fca2d..c1b9d15372 100644 --- a/graphics/nxsu/nx_close.c +++ b/graphics/nxsu/nx_close.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_close.c * - * Copyright (C) 2008-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -86,6 +88,6 @@ void nx_close(NXHANDLE handle) { - free(handle); + kfree(handle); } diff --git a/graphics/nxsu/nx_open.c b/graphics/nxsu/nx_open.c index 72a2db0589..d8efcee41b 100644 --- a/graphics/nxsu/nx_open.c +++ b/graphics/nxsu/nx_open.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_open.c * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,7 +45,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -195,7 +197,7 @@ NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev) /* Allocate the NX state structure */ - fe = (FAR struct nxfe_state_s *)zalloc(sizeof(struct nxfe_state_s)); + fe = (FAR struct nxfe_state_s *)kzalloc(sizeof(struct nxfe_state_s)); if (!fe) { errno = ENOMEM; diff --git a/graphics/nxsu/nx_openwindow.c b/graphics/nxsu/nx_openwindow.c index 64f4ed76dd..b002f1566e 100644 --- a/graphics/nxsu/nx_openwindow.c +++ b/graphics/nxsu/nx_openwindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_openwindow.c * - * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -103,7 +105,7 @@ NXWINDOW nx_openwindow(NXHANDLE handle, FAR const struct nx_callback_s *cb, /* Pre-allocate the window structure */ - wnd = (FAR struct nxbe_window_s *)zalloc(sizeof(struct nxbe_window_s)); + wnd = (FAR struct nxbe_window_s *)kzalloc(sizeof(struct nxbe_window_s)); if (!wnd) { errno = ENOMEM; diff --git a/graphics/nxsu/nxfe.h b/graphics/nxsu/nxfe.h index 528224fc16..40c310d1a9 100644 --- a/graphics/nxsu/nxfe.h +++ b/graphics/nxsu/nxfe.h @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nxfe.h * - * Copyright (C) 2008-2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -103,10 +103,10 @@ EXTERN const struct nx_callback_s g_bkgdcb; * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (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. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect diff --git a/graphics/nxsu/nxsu_constructwindow.c b/graphics/nxsu/nxsu_constructwindow.c index f812b3f839..194a621060 100644 --- a/graphics/nxsu/nxsu_constructwindow.c +++ b/graphics/nxsu/nxsu_constructwindow.c @@ -1,7 +1,7 @@ /**************************************************************************** * graphics/nxsu/nx_openwindow.c * - * Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,9 @@ #include #include +#include #include + #include "nxfe.h" /**************************************************************************** @@ -81,10 +83,10 @@ * inheritance: The caller's window structure may include extensions that * are not visible to NX. * - * NOTE: wnd must have been allocated using malloc() (or related allocators) + * NOTE: wnd must have been allocated using kmalloc() (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. + * free the window. * * Input Parameters: * handle - The handle returned by nx_connect @@ -113,7 +115,7 @@ int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd, if (!fe || !cb) { - free(wnd); + kfree(wnd); errno = EINVAL; return ERROR; } diff --git a/include/nuttx/arch.h b/include/nuttx/arch.h index 2afe7166fd..8f3a906bbe 100644 --- a/include/nuttx/arch.h +++ b/include/nuttx/arch.h @@ -369,14 +369,31 @@ void up_schedule_sigaction(FAR struct tcb_s *tcb, sig_deliver_t sigdeliver); * Name: up_allocate_heap * * Description: - * The heap may be statically allocated by defining CONFIG_HEAP_BASE and - * CONFIG_HEAP_SIZE. If these are not defined, then this function will be - * called to dynamically set aside the heap region. + * This function will be called to dynamically set aside the heap region. + * + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function provides the + * size of the unprotected, user-space heap. + * + * If a protected kernel-space heap is provided, the kernel heap must be + * allocated (and protected) by an analogous up_allocate_kheap(). * ****************************************************************************/ -#ifndef CONFIG_HEAP_BASE void up_allocate_heap(FAR void **heap_start, size_t *heap_size); + +/**************************************************************************** + * Name: up_allocate_kheap + * + * Description: + * For the kernel build (CONFIG_NUTTX_KERNEL=y) with both kernel- and + * user-space heaps (CONFIG_MM_KERNEL_HEAP=y), this function allocates + * (and protects) the kernel-space heap. + * + ****************************************************************************/ + +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) +void up_allocate_kheap(FAR void **heap_start, size_t *heap_size); #endif /**************************************************************************** diff --git a/include/nuttx/kmalloc.h b/include/nuttx/kmalloc.h index 95ae33e32b..6a9c0da5b9 100644 --- a/include/nuttx/kmalloc.h +++ b/include/nuttx/kmalloc.h @@ -47,6 +47,8 @@ #include +#if !defined(CONFIG_NUTTX_KERNEL) || defined(__KERNEL__) + /**************************************************************************** * Public Types ****************************************************************************/ @@ -73,9 +75,43 @@ extern "C" * be used for both the kernel- and user-mode objects. */ +/* This familiy of allocators is used to manage user-accessible memory + * from the kernel. + */ + #ifndef CONFIG_NUTTX_KERNEL -# define kmm_initialize(h,s) umm_initialize(h,s) +# define kumm_initialize(h,s) umm_initialize(h,s) +# define kumm_addregion(h,s) umm_addregion(h,s) +# define kumm_trysemaphore() umm_trysemaphore() +# define kumm_givesemaphore() umm_givesemaphore() + +# define kumalloc(s) malloc(s) +# define kuzalloc(s) zalloc(s) +# define kurealloc(p,s) realloc(p,s) +# define kufree(p) free(p) + +#else + +/* This familiy of allocators is used to manage kernel protected memory */ + +void kumm_initialize(FAR void *heap_start, size_t heap_size); +void kumm_addregion(FAR void *heapstart, size_t heapsize); +int kumm_trysemaphore(void); +void kumm_givesemaphore(void); + +FAR void *kumalloc(size_t size); +FAR void *kuzalloc(size_t size); +FAR void *kurealloc(FAR void *oldmem, size_t newsize); +void kufree(FAR void *mem); + +#endif + +/* This familiy of allocators is used to manage kernel protected memory */ + +#ifndef CONFIG_NUTTX_KERNEL + +# define kmm_initialize(h,s) /* Initialization done by kumm_initialize */ # define kmm_addregion(h,s) umm_addregion(h,s) # define kmm_trysemaphore() umm_trysemaphore() # define kmm_givesemaphore() umm_givesemaphore() @@ -85,6 +121,18 @@ extern "C" # define krealloc(p,s) realloc(p,s) # define kfree(p) free(p) +#elif !defined(CONFIG_MM_KERNEL_HEAP) + +# define kmm_initialize(h,s) /* Initialization done by kumm_initialize */ +# define kmm_addregion(h,s) kumm_addregion(h,s) +# define kmm_trysemaphore() kumm_trysemaphore() +# define kmm_givesemaphore() kumm_givesemaphore() + +# define kmalloc(s) kumalloc(s) +# define kzalloc(s) kuzalloc(s) +# define krealloc(p,s) kurealloc(p,s) +# define kfree(p) kufree(p) + #else void kmm_initialize(FAR void *heap_start, size_t heap_size); @@ -92,10 +140,12 @@ void kmm_addregion(FAR void *heapstart, size_t heapsize); int kmm_trysemaphore(void); void kmm_givesemaphore(void); -FAR void *kmalloc(size_t); -FAR void *kzalloc(size_t); -FAR void *krealloc(FAR void*, size_t); -void kfree(FAR void*); +FAR void *kmalloc(size_t size); +FAR void *kzalloc(size_t size); +FAR void *krealloc(FAR void *oldmem, size_t newsize); +void kfree(FAR void *mem); + +bool kmm_heapmember(FAR void *mem); #endif @@ -124,4 +174,5 @@ void sched_garbagecollection(void); } #endif +#endif /* !CONFIG_NUTTX_KERNEL || __KERNEL__ */ #endif /* __INCLUDE_NUTTX_KMALLOC_H */ diff --git a/include/stdio.h b/include/stdio.h index 8796861a40..7a1b052709 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/stdio.h * - * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -88,65 +88,66 @@ typedef struct file_struct FILE; * Public Variables ****************************************************************************/ -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - #undef EXTERN #if defined(__cplusplus) #define EXTERN extern "C" -extern "C" { +extern "C" +{ #else #define EXTERN extern #endif +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + /* ANSI-like File System Interfaces */ /* Operations on streams (FILE) */ -EXTERN void clearerr(register FILE *stream); -EXTERN int fclose(FAR FILE *stream); -EXTERN int fflush(FAR FILE *stream); -EXTERN int feof(FAR FILE *stream); -EXTERN int ferror(FAR FILE *stream); -EXTERN int fileno(FAR FILE *stream); -EXTERN int fgetc(FAR FILE *stream); -EXTERN int fgetpos(FAR FILE *stream, FAR fpos_t *pos); -EXTERN char *fgets(FAR char *s, int n, FAR FILE *stream); -EXTERN FAR FILE *fopen(FAR const char *path, FAR const char *type); -EXTERN int fprintf(FAR FILE *stream, FAR const char *format, ...); -EXTERN int fputc(int c, FAR FILE *stream); -EXTERN int fputs(FAR const char *s, FAR FILE *stream); -EXTERN size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream); -EXTERN int fseek(FAR FILE *stream, long int offset, int whence); -EXTERN int fsetpos(FAR FILE *stream, FAR fpos_t *pos); -EXTERN long ftell(FAR FILE *stream); -EXTERN size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream); -EXTERN FAR char *gets(FAR char *s); -EXTERN int ungetc(int c, FAR FILE *stream); +void clearerr(register FILE *stream); +int fclose(FAR FILE *stream); +int fflush(FAR FILE *stream); +int feof(FAR FILE *stream); +int ferror(FAR FILE *stream); +int fileno(FAR FILE *stream); +int fgetc(FAR FILE *stream); +int fgetpos(FAR FILE *stream, FAR fpos_t *pos); +char *fgets(FAR char *s, int n, FAR FILE *stream); +FAR FILE *fopen(FAR const char *path, FAR const char *type); +int fprintf(FAR FILE *stream, FAR const char *format, ...); +int fputc(int c, FAR FILE *stream); +int fputs(FAR const char *s, FAR FILE *stream); +size_t fread(FAR void *ptr, size_t size, size_t n_items, FAR FILE *stream); +int fseek(FAR FILE *stream, long int offset, int whence); +int fsetpos(FAR FILE *stream, FAR fpos_t *pos); +long ftell(FAR FILE *stream); +size_t fwrite(FAR const void *ptr, size_t size, size_t n_items, FAR FILE *stream); +FAR char *gets(FAR char *s); +int ungetc(int c, FAR FILE *stream); /* Operations on the stdout stream, buffers, paths, and the whole printf-family */ -EXTERN int printf(const char *format, ...); -EXTERN int puts(FAR const char *s); -EXTERN int rename(FAR const char *oldpath, FAR const char *newpath); -EXTERN int sprintf(FAR char *buf, const char *format, ...); -EXTERN int asprintf (FAR char **ptr, const char *fmt, ...); -EXTERN int snprintf(FAR char *buf, size_t size, const char *format, ...); -EXTERN int sscanf(const char *buf, const char *fmt, ...); -EXTERN void perror(FAR const char *s); +int printf(const char *format, ...); +int puts(FAR const char *s); +int rename(FAR const char *oldpath, FAR const char *newpath); +int sprintf(FAR char *buf, const char *format, ...); +int asprintf (FAR char **ptr, const char *fmt, ...); +int snprintf(FAR char *buf, size_t size, const char *format, ...); +int sscanf(const char *buf, const char *fmt, ...); +void perror(FAR const char *s); -EXTERN int vprintf(FAR const char *format, va_list ap); -EXTERN int vfprintf(FAR FILE *stream, const char *format, va_list ap); -EXTERN int vsprintf(FAR char *buf, const char *format, va_list ap); -EXTERN int avsprintf(FAR char **ptr, const char *fmt, va_list ap); -EXTERN int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap); -EXTERN int vsscanf(char *buf, const char *s, va_list ap); +int vprintf(FAR const char *format, va_list ap); +int vfprintf(FAR FILE *stream, const char *format, va_list ap); +int vsprintf(FAR char *buf, const char *format, va_list ap); +int avsprintf(FAR char **ptr, const char *fmt, va_list ap); +int vsnprintf(FAR char *buf, size_t size, const char *format, va_list ap); +int vsscanf(char *buf, const char *s, va_list ap); /* POSIX-like File System Interfaces */ -EXTERN FAR FILE *fdopen(int fd, FAR const char *type); -EXTERN int statfs(FAR const char *path, FAR struct statfs *buf); +FAR FILE *fdopen(int fd, FAR const char *type); +int statfs(FAR const char *path, FAR struct statfs *buf); #undef EXTERN #if defined(__cplusplus) diff --git a/libc/lib_internal.h b/libc/lib_internal.h index 17adff4178..76a37de0d1 100644 --- a/libc/lib_internal.h +++ b/libc/lib_internal.h @@ -104,10 +104,19 @@ * Public Variables ****************************************************************************/ +#undef EXTERN +#if defined(__cplusplus) +#define EXTERN extern "C" +extern "C" +{ +#else +#define EXTERN extern +#endif + /* Debug output is initially disabled */ #ifdef CONFIG_SYSLOG_ENABLE -extern bool g_syslogenable; +EXTERN bool g_syslogenable; #endif /**************************************************************************** @@ -200,4 +209,9 @@ double lib_expi(size_t n); float lib_sqrtapprox(float x); #endif +#undef EXTERN +#if defined(__cplusplus) +} +#endif + #endif /* __LIB_LIB_INTERNAL_H */ diff --git a/libc/misc/lib_sendfile.c b/libc/misc/lib_sendfile.c index 8a38dc317e..f66c309182 100644 --- a/libc/misc/lib_sendfile.c +++ b/libc/misc/lib_sendfile.c @@ -1,7 +1,7 @@ /************************************************************************ * libc/misc/lib_streamsem.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -45,6 +45,8 @@ #include #include +#include "lib_internal.h" + #if CONFIG_NSOCKET_DESCRIPTORS > 0 || CONFIG_NFILE_DESCRIPTORS > 0 /************************************************************************ @@ -143,7 +145,7 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) /* Allocate an I/O buffer */ - iobuffer = (FAR void *)malloc(CONFIG_LIB_SENDFILE_BUFSIZE); + iobuffer = (FAR void *)lib_malloc(CONFIG_LIB_SENDFILE_BUFSIZE); if (!iobuffer) { set_errno(ENOMEM); @@ -261,7 +263,7 @@ ssize_t sendfile(int outfd, int infd, off_t *offset, size_t count) /* Release the I/O buffer */ - free(iobuffer); + lib_free(iobuffer); /* Return the current file position */ diff --git a/libc/spawn/lib_psfa_addclose.c b/libc/spawn/lib_psfa_addclose.c index 1c72f0f828..4f813f65c2 100644 --- a/libc/spawn/lib_psfa_addclose.c +++ b/libc/spawn/lib_psfa_addclose.c @@ -46,6 +46,8 @@ #include +#include "lib_internal.h" + /**************************************************************************** * Global Functions ****************************************************************************/ @@ -81,7 +83,7 @@ int posix_spawn_file_actions_addclose(FAR posix_spawn_file_actions_t *file_actio /* Allocate the action list entry */ entry = (FAR struct spawn_close_file_action_s *) - zalloc(sizeof(struct spawn_close_file_action_s)); + lib_zalloc(sizeof(struct spawn_close_file_action_s)); if (!entry) { diff --git a/libc/spawn/lib_psfa_adddup2.c b/libc/spawn/lib_psfa_adddup2.c index deb3cbdb33..a10f476f1b 100644 --- a/libc/spawn/lib_psfa_adddup2.c +++ b/libc/spawn/lib_psfa_adddup2.c @@ -46,6 +46,8 @@ #include +#include "lib_internal.h" + /**************************************************************************** * Global Functions ****************************************************************************/ @@ -84,7 +86,7 @@ int posix_spawn_file_actions_adddup2(FAR posix_spawn_file_actions_t *file_action /* Allocate the action list entry */ entry = (FAR struct spawn_dup2_file_action_s *) - zalloc(sizeof(struct spawn_close_file_action_s)); + lib_zalloc(sizeof(struct spawn_close_file_action_s)); if (!entry) { diff --git a/libc/spawn/lib_psfa_addopen.c b/libc/spawn/lib_psfa_addopen.c index 66bbd813a6..d9f5b849f6 100644 --- a/libc/spawn/lib_psfa_addopen.c +++ b/libc/spawn/lib_psfa_addopen.c @@ -47,6 +47,8 @@ #include +#include "lib_internal.h" + /**************************************************************************** * Global Functions ****************************************************************************/ @@ -97,8 +99,7 @@ int posix_spawn_file_actions_addopen(FAR posix_spawn_file_actions_t *file_action /* Allocate the action list entry of this size */ - entry = (FAR struct spawn_open_file_action_s *)zalloc(alloc); - + entry = (FAR struct spawn_open_file_action_s *)lib_zalloc(alloc); if (!entry) { return ENOMEM; diff --git a/libc/spawn/lib_psfa_destroy.c b/libc/spawn/lib_psfa_destroy.c index a21886645c..d80dbd9783 100644 --- a/libc/spawn/lib_psfa_destroy.c +++ b/libc/spawn/lib_psfa_destroy.c @@ -45,6 +45,8 @@ #include +#include "lib_internal.h" + /**************************************************************************** * Global Functions ****************************************************************************/ @@ -86,7 +88,7 @@ int posix_spawn_file_actions_destroy(FAR posix_spawn_file_actions_t *file_action /* Get the pointer to the next element before destroying the current one */ next = curr->flink; - free(curr); + lib_free(curr); } /* Mark the list empty */ diff --git a/libc/stdio/lib_asprintf.c b/libc/stdio/lib_asprintf.c index 20ca6de326..c08d7360a6 100644 --- a/libc/stdio/lib_asprintf.c +++ b/libc/stdio/lib_asprintf.c @@ -40,6 +40,8 @@ #include #include +#include "lib_internal.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/libc/stdio/lib_libdtoa.c b/libc/stdio/lib_libdtoa.c index 29f61fd76e..a9a86817cf 100644 --- a/libc/stdio/lib_libdtoa.c +++ b/libc/stdio/lib_libdtoa.c @@ -44,6 +44,8 @@ * Included Files ****************************************************************************/ +#include "lib_internal.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -293,7 +295,7 @@ static void lib_dtoa(FAR struct lib_outstream_s *obj, int fmt, int prec, #if 0 if (digalloc) { - free(digalloc); + lib_free(digalloc); } #endif } diff --git a/libc/string/lib_strdup.c b/libc/string/lib_strdup.c index a5b3a1e8c1..38eed709c5 100644 --- a/libc/string/lib_strdup.c +++ b/libc/string/lib_strdup.c @@ -1,7 +1,7 @@ /************************************************************************ * libc/string//lib_strdup.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -58,5 +58,6 @@ FAR char *strdup(const char *s) strcpy(news, s); } } + return news; } diff --git a/libxx/libxx_cxa_atexit.cxx b/libxx/libxx_cxa_atexit.cxx index cd31f94f61..d7a82fe5b7 100644 --- a/libxx/libxx_cxa_atexit.cxx +++ b/libxx/libxx_cxa_atexit.cxx @@ -39,7 +39,6 @@ #include -#include #include #include "libxx_internal.hxx" @@ -91,7 +90,7 @@ extern "C" DEBUGASSERT(alloc && alloc->func); alloc->func(alloc->arg); - free(alloc); + lib_free(alloc); } #endif @@ -124,7 +123,7 @@ extern "C" // information. FAR struct __cxa_atexit_s *alloc = - (FAR struct __cxa_atexit_s *)malloc(sizeof(struct __cxa_atexit_s)); + (FAR struct __cxa_atexit_s *)lib_malloc(sizeof(struct __cxa_atexit_s)); if (alloc) { diff --git a/libxx/libxx_delete.cxx b/libxx/libxx_delete.cxx index d9203a2280..4de6f338a8 100644 --- a/libxx/libxx_delete.cxx +++ b/libxx/libxx_delete.cxx @@ -1,7 +1,7 @@ //*************************************************************************** // libxx/libxx_new.cxx // -// Copyright (C) 2009 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -38,7 +38,8 @@ //*************************************************************************** #include -#include + +#include "libxx_internal.hxx" //*************************************************************************** // Definitions @@ -58,5 +59,5 @@ void operator delete(void* ptr) { - free(ptr); + lib_free(ptr); } diff --git a/libxx/libxx_deletea.cxx b/libxx/libxx_deletea.cxx index e7cfee647b..a25a607177 100644 --- a/libxx/libxx_deletea.cxx +++ b/libxx/libxx_deletea.cxx @@ -1,7 +1,7 @@ //*************************************************************************** // libxx/libxx_newa.cxx // -// Copyright (C) 2009 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -38,7 +38,8 @@ //*************************************************************************** #include -#include + +#include "libxx_internal.hxx" //*************************************************************************** // Definitions @@ -58,5 +59,5 @@ void operator delete[](void *ptr) { - free(ptr); + lib_free(ptr); } diff --git a/libxx/libxx_internal.hxx b/libxx/libxx_internal.hxx index fe84c763ed..74d5526ce5 100644 --- a/libxx/libxx_internal.hxx +++ b/libxx/libxx_internal.hxx @@ -1,7 +1,7 @@ //*************************************************************************** // lib/libxx_internal.h // -// Copyright (C) 2012 Gregory Nutt. All rights reserved. +// Copyright (C) 2012-2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -46,6 +46,26 @@ // Definitions //*************************************************************************** +// The NuttX C library an be build in two modes: (1) as a standard, C-libary +// that can be used by normal, user-space applications, or (2) as a special, +// kernel-mode C-library only used within the OS. If NuttX is not being +// built as separated kernel- and user-space modules, then only the first +// mode is supported. + +#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) +# include +# define lib_malloc(s) kmalloc(s) +# define lib_zalloc(s) kzalloc(s) +# define lib_realloc(p,s) krealloc(p,s) +# define lib_free(p) kfree(p) +#else +# include +# define lib_malloc(s) malloc(s) +# define lib_zalloc(s) zalloc(s) +# define lib_realloc(p,s) realloc(p,s) +# define lib_free(p) free(p) +#endif + //*************************************************************************** // Public Types //***************************************************************************/ diff --git a/libxx/libxx_new.cxx b/libxx/libxx_new.cxx index 0563b65805..3158e86059 100644 --- a/libxx/libxx_new.cxx +++ b/libxx/libxx_new.cxx @@ -1,7 +1,7 @@ //*************************************************************************** // libxx/libxx_new.cxx // -// Copyright (C) 2009 Gregory Nutt. All rights reserved. +// Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved. // Author: Gregory Nutt // // Redistribution and use in source and binary forms, with or without @@ -39,9 +39,10 @@ #include #include -#include #include +#include "libxx_internal.hxx" + //*************************************************************************** // Definitions //*************************************************************************** @@ -84,7 +85,7 @@ void *operator new(unsigned int nbytes) // Perform the allocation - void *alloc = malloc(nbytes); + void *alloc = lib_malloc(nbytes); #ifdef CONFIG_DEBUG if (alloc == 0) diff --git a/libxx/libxx_newa.cxx b/libxx/libxx_newa.cxx index ad78068653..b5b2803568 100644 --- a/libxx/libxx_newa.cxx +++ b/libxx/libxx_newa.cxx @@ -39,9 +39,10 @@ #include #include -#include #include +#include "libxx_internal.hxx" + //*************************************************************************** // Definitions //*************************************************************************** @@ -84,7 +85,7 @@ void *operator new[](unsigned int nbytes) // Perform the allocation - void *alloc = malloc(nbytes); + void *alloc = lib_malloc(nbytes); #ifdef CONFIG_DEBUG if (alloc == 0) diff --git a/mm/Kconfig b/mm/Kconfig index 991972f32e..57b039fa92 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -27,6 +27,12 @@ config MM_KERNEL_HEAP necessary. If you wish to secure the kernel data as well, then this option should be selected. + The kernel heap size that is used is provided a a platform-specific + up_allocate_kheap() interface. This configuration setting is made + available to that platform specific code. However, the + up_allocate_kheap() interface may chose to ignore this setting if it + has a more appropriate heap allocation strategy. + config MM_KERNEL_HEAPSIZE int "Kernal heap size" default 8192 diff --git a/mm/Makefile b/mm/Makefile index 12a237bb75..baae6b4df3 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -35,17 +35,24 @@ -include $(TOPDIR)/Make.defs +# Core allocator logic + ASRCS = CSRCS = mm_initialize.c mm_sem.c mm_addfreechunk.c mm_size2ndx.c CSRCS += mm_shrinkchunk.c mm_malloc.c mm_zalloc.c mm_calloc.c mm_realloc.c CSRCS += mm_memalign.c mm_free.c mm_mallinfo.c -CSRCS += umm_initialize.c umm_addregion.c umm_semaphore.c +# Allocator instances +CSRCS += mm_user.c ifeq ($(CONFIG_NUTTX_KERNEL),y) -CSRCS += kmm_initialize.c kmm_addregion.c kmm_semaphore.c -CSRCS += kmm_kmalloc.c kmm_kzalloc.c kmm_krealloc.c kmm_kfree.c +CSRCS += mm_kerneluser.c +ifeq ($(CONFIG_NUTTX_KERNEL),y) +CSRCS += mm_kernel.c endif +endif + +# An optional granule allocator ifeq ($(CONFIG_GRAN),y) CSRCS += mm_graninit.c mm_granalloc.c mm_granfree.c mm_grancritical.c diff --git a/mm/kmm_addregion.c b/mm/kmm_addregion.c deleted file mode 100644 index 979b285ed8..0000000000 --- a/mm/kmm_addregion.c +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************ - * mm/kmm_addregion.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KADDREGION(h,s) ((kmaddregion_t)CONFIG_USER_MMADDREGION)(h,s) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef void (*kmaddregion_t)(FAR void*, size_t); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kmm_addregion - * - * Description: - * This is a simple redirection to the user-space mm_addregion() - * function. - * - * Parameters: - * heap_start - Address of the beginning of the memory region - * heap_size - The size (in bytes) if the memory region. - * - * Return Value: - * None - * - * Assumptions: - * 1. mm_addregion() resides in user-space - * 2. The address of the user space mm_addregion() is provided in - * user_map.h - * 3. The user-space mm_addregion() is callable from kernel-space. - * - ************************************************************************/ - -void kmm_addregion(FAR void *heap_start, size_t heap_size) -{ - return KADDREGION(heap_start, heap_size); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_initialize.c b/mm/kmm_initialize.c deleted file mode 100644 index c5f5df05d0..0000000000 --- a/mm/kmm_initialize.c +++ /dev/null @@ -1,113 +0,0 @@ -/************************************************************************ - * mm/kmm_initialize.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KINITIALIZE(h,s) ((kminitialize_t)CONFIG_USER_MMINIT)(h,s) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef void (*kminitialize_t)(FAR void*, size_t); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kmm_initialize - * - * Description: - * This is a simple redirection to the user-space mm_initialize() - * function. - * - * Parameters: - * heap_start - Address of the beginning of the (initial) memory region - * heap_size - The size (in bytes) if the (initial) memory region. - * - * Return Value: - * None - * - * Assumptions: - * 1. mm_initialize() resides in user-space - * 2. The address of the user space mm_initialize() is provided in - * user_map.h - * 3. The user-space mm_initialize() is callable from kernel-space. - * - ************************************************************************/ - -void kmm_initialize(FAR void *heap_start, size_t heap_size) -{ - return KINITIALIZE(heap_start, heap_size); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_kfree.c b/mm/kmm_kfree.c deleted file mode 100644 index c4e31ebfa1..0000000000 --- a/mm/kmm_kfree.c +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************ - * mm/kmm_kfree.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KFREE(p) ((kfree_t)CONFIG_USER_FREE)(p) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef void (*kfree_t)(FAR void *); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kfree - * - * Description: - * This is a simple redirection to the user-space free() function. - * - * Parameters: - * None - * - * Return Value: - * None - * - * Assumptions: - * 1. free() resides in user-space - * 2. The address of the user space free() is provided in user_map.h - * 3. The user-space free() is callable from kernel-space. - * - ************************************************************************/ - -void kfree(FAR void *mem) -{ - return KFREE(mem); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_kmalloc.c b/mm/kmm_kmalloc.c deleted file mode 100644 index e2c3473422..0000000000 --- a/mm/kmm_kmalloc.c +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************ - * mm/kmm_kmalloc.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KMALLOC(s) ((kmalloc_t)CONFIG_USER_MALLOC)(s) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef FAR void *(*kmalloc_t)(size_t); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kmalloc - * - * Description: - * This is a simple redirection to the user-space malloc() function. - * - * Parameters: - * size - Size (in bytes) of the memory region to be allocated. - * - * Return Value: - * The address of the allocated memory (NULL on failure to allocate) - * - * Assumptions: - * 1. malloc() resides in user-space - * 2. The address of the user space malloc() is provided in user_map.h - * 3. The user-space malloc() is callable from kernel-space. - * - ************************************************************************/ - -FAR void *kmalloc(size_t size) -{ - return KMALLOC(size); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_krealloc.c b/mm/kmm_krealloc.c deleted file mode 100644 index d5bebff38e..0000000000 --- a/mm/kmm_krealloc.c +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************ - * mm/kmm_krealloc.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KREALLOC(p,s) ((krealloc_t)CONFIG_USER_REALLOC)(p,s) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef FAR void *(*krealloc_t)(FAR void*, size_t); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: krealloc - * - * Description: - * This is a simple redirection to the user-space realloc() function. - * - * Parameters: - * oldmem - The old memory allocated - * size - Size (in bytes) of the new memory region to be re-allocated. - * - * Return Value: - * The address of the re-allocated memory (NULL on failure to re-allocate) - * - * Assumptions: - * 1. realloc() resides in user-space - * 2. The address of the user space realloc() is provided in user_map.h - * 3. The user-space realloc() is callable from kernel-space. - * - ************************************************************************/ - -FAR void *krealloc(FAR void *oldmem, size_t size) -{ - return KREALLOC(oldmem, size); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_kzalloc.c b/mm/kmm_kzalloc.c deleted file mode 100644 index 4775312c66..0000000000 --- a/mm/kmm_kzalloc.c +++ /dev/null @@ -1,110 +0,0 @@ -/************************************************************************ - * mm/kmm_kzalloc.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* This value is obtained from user_map.h */ - -#define KZALLOC(s) ((kzalloc_t)CONFIG_USER_ZALLOC)(s) - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef FAR void *(*kzalloc_t)(size_t); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kzalloc - * - * Description: - * This is a simple redirection to the user-space zalloc() function. - * - * Parameters: - * size - Size (in bytes) of the memory region to be allocated. - * - * Return Value: - * The address of the allocated memory (NULL on failure to allocate) - * - * Assumptions: - * 1. zalloc() resides in user-space - * 2. The address of the user space zalloc() is provided in user_map.h - * 3. The user-space zalloc() is callable from kernel-space. - * - ************************************************************************/ - -FAR void *kzalloc(size_t size) -{ - return KZALLOC(size); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/kmm_semaphore.c b/mm/kmm_semaphore.c deleted file mode 100644 index b391e5151d..0000000000 --- a/mm/kmm_semaphore.c +++ /dev/null @@ -1,140 +0,0 @@ -/************************************************************************ - * mm/kmm_semaphore.c - * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) - -/* This logic is all tentatively and, hopefully, will grow in usability. - * For now, the kernel-mode build uses the memory manager that is - * provided in the user-space build. That is awkward but reasonable for - * the current level of support: At present, only memory protection is - * provided. Kernel-mode code may call into user-mode code, but not - * vice-versa. So hosting the memory manager in user-space allows the - * memory manager to be shared in both kernel- and user-mode spaces. - * - * In the longer run, if an MMU is support that can provide virtualized - * memory, then some SLAB memory manager will be required in kernel-space - * with some kind of brk() system call to obtain mapped heap space. - * - * In the current build model, the user-space module is built first. The - * file user_map.h is generated in the first pass and contains the - * addresses of the memory manager needed in this file: - */ - -#include - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/* These values are obtained from user_map.h */ - -#define KTRYSEMAPHORE() ((kmtrysemaphore_t) CONFIG_USER_MMTRYSEM )() -#define KGIVESEMAPHORE() ((kmgivesemaphore_t)CONFIG_USER_MMGIVESEM)() - -/************************************************************************ - * Private Types - ************************************************************************/ - -typedef int (*kmtrysemaphore_t)(void); -typedef void (*kmgivesemaphore_t)(void); - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: kmm_trysemaphore - * - * Description: - * This is a simple redirection to the user-space mm_trysemaphore() - * function. - * - * Parameters: - * None - * - * Return Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * 1. mm_trysemaphore() resides in user-space - * 2. The address of the user space mm_trysemaphore() is provided in - * user_map.h - * 3. The user-space mm_semaphore() is callable from kernel-space. - * - ************************************************************************/ - -int kmm_trysemaphore(void) -{ - return KTRYSEMAPHORE(); -} - -/************************************************************************ - * Name: kmm_givesemaphore - * - * Description: - * This is a simple redirection to the user-space mm_givesemaphore() - * function. - * - * Parameters: - * None - * - * Return Value: - * OK on success; a negated errno on failure - * - * Assumptions: - * 1. mm_givesemaphore() resides in user-space - * 2. The address of the user space mm_givesemaphore() is provided in - * user_map.h - * 3. The user-space mm_semaphore() is callable from kernel-space. - * - ************************************************************************/ - -void kmm_givesemaphore(void) -{ - KGIVESEMAPHORE(); -} - -#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/mm_initialize.c b/mm/mm_initialize.c index 8930f61901..6246cfc4b9 100644 --- a/mm/mm_initialize.c +++ b/mm/mm_initialize.c @@ -53,13 +53,6 @@ * Public Variables ****************************************************************************/ -#if !defined(CONFIG_NUTTX_KERNEL) || !defined(__KERNEL__) -/* This is the user heap */ - -struct mm_heap_s g_mmheap; - -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ diff --git a/mm/mm_kernel.c b/mm/mm_kernel.c new file mode 100644 index 0000000000..207d3e28f5 --- /dev/null +++ b/mm/mm_kernel.c @@ -0,0 +1,282 @@ +/************************************************************************ + * mm/mm_kernel.c + * + * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************/ + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include +#include + +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) && defined(__KERNEL__) + +/************************************************************************ + * Pre-processor definition + ************************************************************************/ + +/************************************************************************ + * Private Types + ************************************************************************/ + +/************************************************************************ + * Public Data + ************************************************************************/ + +/* This is the kernel heap */ + +struct mm_heap_s g_kmmheap; + +/************************************************************************ + * Private Functions + ************************************************************************/ + +/************************************************************************ + * Public Functions + ************************************************************************/ + +/************************************************************************ + * Name: kmm_initialize + * + * Description: + * Initialize the kernel heap data structures, providing the initial + * heap region. + * + * Parameters: + * heap_start - Address of the beginning of the (initial) memory region + * heap_size - The size (in bytes) if the (initial) memory region. + * + * Return Value: + * None + * + ************************************************************************/ + +void kmm_initialize(FAR void *heap_start, size_t heap_size) +{ + return mm_initialize(&g_kmmheap, heap_start, heap_size); +} + +/************************************************************************ + * Name: kmm_addregion + * + * Description: + * This function adds a region of contiguous memory to the kernel heap. + * + * Parameters: + * heap_start - Address of the beginning of the memory region + * heap_size - The size (in bytes) if the memory region. + * + * Return Value: + * None + * + ************************************************************************/ + +void kmm_addregion(FAR void *heap_start, size_t heap_size) +{ + return mm_addregion(&g_kmmheap, heap_start, heap_size); +} + +/************************************************************************ + * Name: kmalloc + * + * Description: + * Allocate memory from the kernel heap. + * + * Parameters: + * size - Size (in bytes) of the memory region to be allocated. + * + * Return Value: + * The address of the allocated memory (NULL on failure to allocate) + * + ************************************************************************/ + +FAR void *kmalloc(size_t size) +{ + return mm_malloc(&g_kmmheap, size); +} + +/************************************************************************ + * Name: kzalloc + * + * Description: + * Allocate and zero memory from the kernel heap. + * + * Parameters: + * size - Size (in bytes) of the memory region to be allocated. + * + * Return Value: + * The address of the allocated memory (NULL on failure to allocate) + * + ************************************************************************/ + +FAR void *kzalloc(size_t size) +{ + return mm_zalloc(&g_kmmheap, size); +} + +/************************************************************************ + * Name: krealloc + * + * Description: + * Re-allocate memory in the kernel heap. + * + * Parameters: + * oldmem - The old memory allocated + * newsize - Size (in bytes) of the new memory region to be re-allocated. + * + * Return Value: + * The address of the re-allocated memory (NULL on failure to re-allocate) + * + ************************************************************************/ + +FAR void *krealloc(FAR void *oldmem, size_t newsize) +{ + return mm_realloc(&g_kmmheap, oldmem, newsize); +} + +/************************************************************************ + * Name: kfree + * + * Description: + * Return allocated memory to the kernel heap. + * + * Parameters: + * None + * + * Return Value: + * None + * + ************************************************************************/ + +void kfree(FAR void *mem) +{ + DEBUGASSERT(kmm_heapmember(mem)); + return mm_free(&g_kmmheap, mem); +} + +/************************************************************************ + * Name: kmm_trysemaphore + * + * Description: + * Try to take the kernel heap semaphore. + * + * Parameters: + * None + * + * Return Value: + * OK on success; a negated errno on failure + * + ************************************************************************/ + +int kmm_trysemaphore(void) +{ + return mm_trysemaphore(&g_kmmheap); +} + +/************************************************************************ + * Name: kmm_givesemaphore + * + * Description: + * Give the kernel heap semaphore. + * + * Parameters: + * None + * + * Return Value: + * OK on success; a negated errno on failure + * + ************************************************************************/ + +void kmm_givesemaphore(void) +{ + return mm_givesemaphore(&g_kmmheap); +} + +/************************************************************************ + * Name: kmm_heapmember + * + * Description: + * Check if an address lies in the kernel heap. + * + * Parameters: + * mem - The address to check + * + * Return Value: + * true if the address is a member of the kernel heap. false if not + * not. If the address is not a member of the kernel heap, then it + * must be a member of the user-space heap (unchecked) + * + ************************************************************************/ + +bool kmm_heapmember(FAR void *mem) +{ +#if CONFIG_MM_REGIONS > 1 + int i; + + /* A valid address from the kernel heap for this region would have to lie + * between the region's two guard nodes. + */ + + for (i = 0; i < g_kmmheap.mm_nregions; i++) + { + if (mem > (FAR void *)g_kmmheap.mm_heapstart[i] && + mem < (FAR void *)g_kmmheap.mm_heapend[i]) + { + return true; + } + } + + /* The address does not like any any region assigned to kernel heap */ + + return false; + +#else + /* A valid address from the kernel heap would have to lie between the + * two guard nodes. + */ + + if (mem > (FAR void *)g_kmmheap.mm_heapstart[0] && + mem < (FAR void *)g_kmmheap.mm_heapend[0]) + { + return true; + } + + /* Otherwise, the address does not lie in the kernel heap */ + + return false; + +#endif +} + +#endif /* CONFIG_NUTTX_KERNEL && CONFIG_MM_KERNEL_HEAP && __KERNEL__ */ diff --git a/mm/mm_kerneluser.c b/mm/mm_kerneluser.c new file mode 100644 index 0000000000..da1f2716ed --- /dev/null +++ b/mm/mm_kerneluser.c @@ -0,0 +1,306 @@ +/************************************************************************ + * mm/mm_kerneluser.c + * + * Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************/ + +/************************************************************************ + * Included Files + ************************************************************************/ + +#include +#include + +#if defined(CONFIG_NUTTX_KERNEL) && defined(__KERNEL__) + +/* This logic is all tentatively and, hopefully, will grow in usability. + * For now, the kernel-mode build uses the memory manager that is + * provided in the user-space build. That is awkward but reasonable for + * the current level of support: At present, only memory protection is + * provided. Kernel-mode code may call into user-mode code, but not + * vice-versa. So hosting the memory manager in user-space allows the + * memory manager to be shared in both kernel- and user-mode spaces. + * + * In the longer run, if an MMU is support that can provide virtualized + * memory, then some SLAB memory manager will be required in kernel-space + * with some kind of brk() system call to obtain mapped heap space. + * + * In the current build model, the user-space module is built first. The + * file user_map.h is generated in the first pass and contains the + * addresses of the memory manager needed in this file: + */ + +#include + +/************************************************************************ + * Pre-processor definition + ************************************************************************/ + +/* These values are obtained from user_map.h */ + +#define KINITIALIZE(h,s) ((kminitialize_t)CONFIG_USER_MMINIT)(h,s) +#define KADDREGION(h,s) ((kmaddregion_t)CONFIG_USER_MMADDREGION)(h,s) +#define KMALLOC(s) ((kmalloc_t)CONFIG_USER_MALLOC)(s) +#define KZALLOC(s) ((kzalloc_t)CONFIG_USER_ZALLOC)(s) +#define KREALLOC(p,s) ((krealloc_t)CONFIG_USER_REALLOC)(p,s) +#define KFREE(p) ((kfree_t)CONFIG_USER_FREE)(p) +#define KTRYSEMAPHORE() ((kmtrysemaphore_t) CONFIG_USER_MMTRYSEM )() +#define KGIVESEMAPHORE() ((kmgivesemaphore_t)CONFIG_USER_MMGIVESEM)() + +/************************************************************************ + * Private Types + ************************************************************************/ + +typedef void (*kminitialize_t)(FAR void*, size_t); +typedef void (*kmaddregion_t)(FAR void*, size_t); +typedef FAR void *(*kmalloc_t)(size_t); +typedef FAR void *(*kzalloc_t)(size_t); +typedef FAR void *(*krealloc_t)(FAR void*, size_t); +typedef void (*kfree_t)(FAR void *); +typedef int (*kmtrysemaphore_t)(void); +typedef void (*kmgivesemaphore_t)(void); + +/************************************************************************ + * Private Functions + ************************************************************************/ + +/************************************************************************ + * Public Functions + ************************************************************************/ + +/************************************************************************ + * Name: kumm_initialize + * + * Description: + * This is a simple redirection to the user-space mm_initialize() + * function. + * + * Parameters: + * heap_start - Address of the beginning of the (initial) memory region + * heap_size - The size (in bytes) if the (initial) memory region. + * + * Return Value: + * None + * + * Assumptions: + * 1. mm_initialize() resides in user-space + * 2. The address of the user space mm_initialize() is provided in + * user_map.h + * 3. The user-space mm_initialize() is callable from kernel-space. + * + ************************************************************************/ + +void kumm_initialize(FAR void *heap_start, size_t heap_size) +{ + return KINITIALIZE(heap_start, heap_size); +} + +/************************************************************************ + * Name: kumm_addregion + * + * Description: + * This is a simple redirection to the user-space mm_addregion() + * function. + * + * Parameters: + * heap_start - Address of the beginning of the memory region + * heap_size - The size (in bytes) if the memory region. + * + * Return Value: + * None + * + * Assumptions: + * 1. mm_addregion() resides in user-space + * 2. The address of the user space mm_addregion() is provided in + * user_map.h + * 3. The user-space mm_addregion() is callable from kernel-space. + * + ************************************************************************/ + +void kumm_addregion(FAR void *heap_start, size_t heap_size) +{ + return KADDREGION(heap_start, heap_size); +} + +/************************************************************************ + * Name: kumalloc + * + * Description: + * This is a simple redirection to the user-space malloc() function. + * + * Parameters: + * size - Size (in bytes) of the memory region to be allocated. + * + * Return Value: + * The address of the allocated memory (NULL on failure to allocate) + * + * Assumptions: + * 1. malloc() resides in user-space + * 2. The address of the user space malloc() is provided in user_map.h + * 3. The user-space malloc() is callable from kernel-space. + * + ************************************************************************/ + +FAR void *kumalloc(size_t size) +{ + return KMALLOC(size); +} + +/************************************************************************ + * Name: kuzalloc + * + * Description: + * This is a simple redirection to the user-space zalloc() function. + * + * Parameters: + * size - Size (in bytes) of the memory region to be allocated. + * + * Return Value: + * The address of the allocated memory (NULL on failure to allocate) + * + * Assumptions: + * 1. zalloc() resides in user-space + * 2. The address of the user space zalloc() is provided in user_map.h + * 3. The user-space zalloc() is callable from kernel-space. + * + ************************************************************************/ + +FAR void *kuzalloc(size_t size) +{ + return KZALLOC(size); +} + +/************************************************************************ + * Name: kurealloc + * + * Description: + * This is a simple redirection to the user-space realloc() function. + * + * Parameters: + * oldmem - The old memory allocated + * newsize - Size (in bytes) of the new memory region to be re-allocated. + * + * Return Value: + * The address of the re-allocated memory (NULL on failure to re-allocate) + * + * Assumptions: + * 1. realloc() resides in user-space + * 2. The address of the user space realloc() is provided in user_map.h + * 3. The user-space realloc() is callable from kernel-space. + * + ************************************************************************/ + +FAR void *kurealloc(FAR void *oldmem, size_t newsize) +{ + return KREALLOC(oldmem, newsize); +} + +/************************************************************************ + * Name: kufree + * + * Description: + * This is a simple redirection to the user-space free() function. + * + * Parameters: + * None + * + * Return Value: + * None + * + * Assumptions: + * 1. free() resides in user-space + * 2. The address of the user space free() is provided in user_map.h + * 3. The user-space free() is callable from kernel-space. + * + ************************************************************************/ + +void kufree(FAR void *mem) +{ +#ifdef CONFIG_MM_KERNEL_HEAP + DEBUGASSERT(!kmm_heapmember(mem)); +#endif + return KFREE(mem); +} + +/************************************************************************ + * Name: kumm_trysemaphore + * + * Description: + * This is a simple redirection to the user-space mm_trysemaphore() + * function. + * + * Parameters: + * None + * + * Return Value: + * OK on success; a negated errno on failure + * + * Assumptions: + * 1. mm_trysemaphore() resides in user-space + * 2. The address of the user space mm_trysemaphore() is provided in + * user_map.h + * 3. The user-space mm_semaphore() is callable from kernel-space. + * + ************************************************************************/ + +int kumm_trysemaphore(void) +{ + return KTRYSEMAPHORE(); +} + +/************************************************************************ + * Name: kumm_givesemaphore + * + * Description: + * This is a simple redirection to the user-space mm_givesemaphore() + * function. + * + * Parameters: + * None + * + * Return Value: + * OK on success; a negated errno on failure + * + * Assumptions: + * 1. mm_givesemaphore() resides in user-space + * 2. The address of the user space mm_givesemaphore() is provided in + * user_map.h + * 3. The user-space mm_semaphore() is callable from kernel-space. + * + ************************************************************************/ + +void kumm_givesemaphore(void) +{ + KGIVESEMAPHORE(); +} + +#endif /* CONFIG_NUTTX_KERNEL && __KERNEL__ */ diff --git a/mm/umm_semaphore.c b/mm/mm_user.c similarity index 64% rename from mm/umm_semaphore.c rename to mm/mm_user.c index d554268abb..ed5ba5eb9f 100644 --- a/mm/umm_semaphore.c +++ b/mm/mm_user.c @@ -1,7 +1,7 @@ /************************************************************************ - * mm/umm_semaphore.c + * mm/mm_user.c * - * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -50,6 +50,14 @@ * Private Types ************************************************************************/ +/************************************************************************ + * Public Data + ************************************************************************/ + +/* This is the user heap */ + +struct mm_heap_s g_mmheap; + /************************************************************************ * Private Functions ************************************************************************/ @@ -58,11 +66,57 @@ * Public Functions ************************************************************************/ +/************************************************************************ + * Name: umm_initialize + * + * Description: + * This is a simple wrapper for the mm_initialize() function. This + * function is exported from the user-space blob so that the kernel + * can initialize the user-mode allocator. + * + * Parameters: + * heap_start - Address of the beginning of the (initial) memory region + * heap_size - The size (in bytes) if the (initial) memory region. + * + * Return Value: + * None + * + ************************************************************************/ + +void umm_initialize(FAR void *heap_start, size_t heap_size) +{ + mm_initialize(&g_mmheap, heap_start, heap_size); +} + +/************************************************************************ + * Name: umm_addregion + * + * Description: + * This is a simple wrapper for the mm_addregion() function. This + * function is exported from the user-space blob so that the kernel + * can initialize the user-mode allocator. + * + * Parameters: + * heap_start - Address of the beginning of the memory region + * heap_size - The size (in bytes) if the memory region. + * + * Return Value: + * None + * + ************************************************************************/ + +void umm_addregion(FAR void *heap_start, size_t heap_size) +{ + mm_addregion(&g_mmheap, heap_start, heap_size); +} + /************************************************************************ * Name: umm_trysemaphore * * Description: - * This is a simple wrapper for the mm_trysemaphore() function. + * This is a simple wrapper for the mm_trysemaphore() function. This + * function is exported from the user-space blob so that the kernel + * can manage the user-mode allocator. * * Parameters: * None @@ -81,7 +135,9 @@ int umm_trysemaphore(void) * Name: umm_givesemaphore * * Description: - * This is a simple wrapper for the mm_givesemaphore() function. + * This is a simple wrapper for the mm_givesemaphore() function. This + * function is exported from the user-space blob so that the kernel + * can manage the user-mode allocator. * * Parameters: * None @@ -96,4 +152,4 @@ void umm_givesemaphore(void) mm_givesemaphore(&g_mmheap); } -#endif /* !CONFIG_NUTTX_KERNEL || __KERNEL__ */ +#endif /* !CONFIG_NUTTX_KERNEL || !__KERNEL__ */ diff --git a/mm/umm_addregion.c b/mm/umm_addregion.c deleted file mode 100644 index 1817231557..0000000000 --- a/mm/umm_addregion.c +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************ - * mm/umm_addregion.c - * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if !defined(CONFIG_NUTTX_KERNEL) || !defined(__KERNEL__) - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/************************************************************************ - * Private Types - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: umm_addregion - * - * Description: - * This is a simple wrapper for the mm_addregion() function. - * - * Parameters: - * heap_start - Address of the beginning of the memory region - * heap_size - The size (in bytes) if the memory region. - * - * Return Value: - * None - * - ************************************************************************/ - -void umm_addregion(FAR void *heap_start, size_t heap_size) -{ - mm_addregion(&g_mmheap, heap_start, heap_size); -} - -#endif /* !CONFIG_NUTTX_KERNEL || !__KERNEL__ */ diff --git a/mm/umm_initialize.c b/mm/umm_initialize.c deleted file mode 100644 index 13a1fe0156..0000000000 --- a/mm/umm_initialize.c +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************ - * mm/umm_initialize.c - * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ************************************************************************/ - -/************************************************************************ - * Included Files - ************************************************************************/ - -#include -#include - -#if !defined(CONFIG_NUTTX_KERNEL) || !defined(__KERNEL__) - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/************************************************************************ - * Private Types - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: umm_initialize - * - * Description: - * This is a simple wrapper for the mm_initialize() function. - * - * Parameters: - * heap_start - Address of the beginning of the (initial) memory region - * heap_size - The size (in bytes) if the (initial) memory region. - * - * Return Value: - * None - * - ************************************************************************/ - -void umm_initialize(FAR void *heap_start, size_t heap_size) -{ - mm_initialize(&g_mmheap, heap_start, heap_size); -} - -#endif /* !CONFIG_NUTTX_KERNEL || !__KERNEL__ */ diff --git a/net/uip/uip_igmpgroup.c b/net/uip/uip_igmpgroup.c index b92db5476c..a530f954ca 100644 --- a/net/uip/uip_igmpgroup.c +++ b/net/uip/uip_igmpgroup.c @@ -2,7 +2,7 @@ * net/uip/uip_igmpgroup.c * IGMP group data structure management logic * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * The NuttX implementation of IGMP was inspired by the IGMP add-on for the @@ -114,7 +114,7 @@ * Private Data ****************************************************************************/ -/* malloc() cannot be called from an interrupt handler. To work around this, +/* kmalloc() cannot be called from an interrupt handler. To work around this, * a small number of IGMP groups are preallocated just for use in interrupt * handling logic. */ @@ -139,13 +139,13 @@ static FAR sq_queue_t g_freelist; * Allocate a new group from heap memory. * * Assumptions: - * Calls malloc and so cannot be called from an interrupt handler. + * Calls kmalloc and so cannot be called from an interrupt handler. * ****************************************************************************/ static inline FAR struct igmp_group_s *uip_grpheapalloc(void) { - return (FAR struct igmp_group_s *)zalloc(sizeof(struct igmp_group_s)); + return (FAR struct igmp_group_s *)kzalloc(sizeof(struct igmp_group_s)); } /**************************************************************************** diff --git a/net/uip/uip_tcpbacklog.c b/net/uip/uip_tcpbacklog.c index 459d543128..068e7a8eb9 100644 --- a/net/uip/uip_tcpbacklog.c +++ b/net/uip/uip_tcpbacklog.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_tcpbacklog.c * - * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2009, 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -113,7 +114,7 @@ int uip_backlogcreate(FAR struct uip_conn *conn, int nblg) /* Then allocate that much */ - bls = (FAR struct uip_backlog_s *)zalloc(size); + bls = (FAR struct uip_backlog_s *)kzalloc(size); if (!bls) { nlldbg("Failed to allocate backlog\n"); @@ -203,7 +204,7 @@ int uip_backlogdestroy(FAR struct uip_conn *conn) /* Then free the entire backlog structure */ - free(blg); + lib_free(blg); } return OK; diff --git a/net/uip/uip_tcpreadahead.c b/net/uip/uip_tcpreadahead.c index a304925a87..dadb809cc8 100644 --- a/net/uip/uip_tcpreadahead.c +++ b/net/uip/uip_tcpreadahead.c @@ -1,7 +1,7 @@ /**************************************************************************** * net/uip/uip_tcpreadahead.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -96,7 +96,7 @@ void uip_tcpreadaheadinit(void) * Allocate a TCP read-ahead buffer by taking a pre-allocated buffer from * the free list. This function is called from TCP logic when new, * incoming TCP data is received but there is no user logic recving the - * the data. Note: malloc() cannot be used because this function is + * the data. Note: kmalloc() cannot be used because this function is * called from interrupt level. * * Assumptions: diff --git a/sched/group_create.c b/sched/group_create.c index 5f3867b72f..f2f6ac179f 100644 --- a/sched/group_create.c +++ b/sched/group_create.c @@ -257,7 +257,7 @@ int group_initialize(FAR struct task_tcb_s *tcb) group->tg_members = (FAR pid_t *)kmalloc(GROUP_INITIAL_MEMBERS*sizeof(pid_t)); if (!group->tg_members) { - free(group); + kfree(group); return -ENOMEM; } diff --git a/sched/os_bringup.c b/sched/os_bringup.c index fbaad1a7ae..97efd9b220 100644 --- a/sched/os_bringup.c +++ b/sched/os_bringup.c @@ -197,10 +197,8 @@ int os_bringup(void) * first user-mode thead. * * In a kernel build (CONFIG_NUTTX_KERNEL), it is expected that this user - * initialization function will: - * - * - Call mm_initialized() to initialize the user memmory manager, and - * - Is so configured, call work_usrstart() to start the user work thread. + * initialization function will call work_usrstart() to start the user + * work thread (if so configured). */ svdbg("Starting init thread\n"); diff --git a/sched/os_start.c b/sched/os_start.c index 2e9991547d..07c5394b47 100644 --- a/sched/os_start.c +++ b/sched/os_start.c @@ -305,16 +305,26 @@ void os_start(void) /* Initialize the memory manager */ -#ifndef CONFIG_HEAP_BASE { FAR void *heap_start; size_t heap_size; + + /* Get the user-mode heap from the platform specific code and configure + * the user-mode memory allocator. + */ + up_allocate_heap(&heap_start, &heap_size); + kumm_initialize(heap_start, heap_size); + +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Get the kernel-mode heap from the platform specific code and configure + * the kernel-mode memory allocator. + */ + + up_allocate_kheap(&heap_start, &heap_size); kmm_initialize(heap_start, heap_size); - } -#else - kmm_initialize((void*)CONFIG_HEAP_BASE, CONFIG_HEAP_SIZE); #endif + } /* Initialize tasking data structures */ diff --git a/sched/sched_garbage.c b/sched/sched_garbage.c index b8bec9399d..0eaa192476 100644 --- a/sched/sched_garbage.c +++ b/sched/sched_garbage.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sched_garbage.c * - * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -90,7 +90,7 @@ void sched_garbagecollection(void) { irqstate_t flags; - void *address; + FAR void *address; /* Test if the delayed deallocation queue is empty. No special protection * is needed because this is an atomic test. @@ -103,14 +103,34 @@ void sched_garbagecollection(void) */ flags = irqsave(); - address = (void*)sq_remfirst((FAR sq_queue_t*)&g_delayeddeallocations); + address = (FAR void*)sq_remfirst((FAR sq_queue_t*)&g_delayeddeallocations); irqrestore(flags); - /* Then deallocate it. */ + /* The address should always be non-NULL since that was checked in the + * 'while' condition above. + */ if (address) { - kfree(address); +#if defined(CONFIG_NUTTX_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) + /* Does the address to be freed lie in the kernel heap? */ + + if (kmm_heapmember(address)) + { + /* Yes.. return the memory to the kernel heap */ + + kfree(address); + } + + /* No.. then the address must lie in the user heap (unchecked) */ + + else +#endif + { + /* Return the memory to the user heap */ + + kufree(address); + } } } }