From dda5be5c1fc672b5d9cb3a910b5e0cb0a41046c5 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sat, 9 Mar 2013 21:12:20 +0000 Subject: 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 --- nuttx/Documentation/NuttxPortingGuide.html | 15 +- nuttx/arch/8051/src/up_allocateheap.c | 6 +- nuttx/arch/arm/src/common/up_allocateheap.c | 12 +- nuttx/arch/arm/src/dm320/dm320_allocateheap.c | 17 +- nuttx/arch/arm/src/dm320/dm320_framebuffer.c | 21 +- nuttx/arch/arm/src/dm320/dm320_usbdev.c | 11 +- nuttx/arch/arm/src/imx/imx_allocateheap.c | 11 +- nuttx/arch/arm/src/lpc17xx/lpc17_allocateheap.c | 12 +- nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c | 11 +- nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 11 +- nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c | 12 +- nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c | 9 +- nuttx/arch/arm/src/lpc43xx/lpc43_allocateheap.c | 12 +- nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c | 9 +- nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c | 12 +- nuttx/arch/arm/src/stm32/stm32_allocateheap.c | 12 +- nuttx/arch/arm/src/stm32/stm32_otgfsdev.c | 9 +- nuttx/arch/arm/src/stm32/stm32_usbdev.c | 5 +- nuttx/arch/avr/src/at90usb/at90usb_usbdev.c | 11 +- nuttx/arch/avr/src/common/up_allocateheap.c | 13 +- nuttx/arch/hc/src/common/up_allocateheap.c | 14 +- nuttx/arch/mips/src/common/up_allocateheap.c | 14 +- nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c | 7 +- nuttx/arch/rgmp/src/nuttx.c | 2 +- nuttx/arch/sh/src/common/up_allocateheap.c | 14 +- nuttx/arch/sim/src/up_allocateheap.c | 14 +- nuttx/arch/sim/src/up_deviceimage.c | 21 +- nuttx/arch/x86/src/common/up_allocateheap.c | 13 +- nuttx/arch/z16/src/common/up_allocateheap.c | 11 +- nuttx/arch/z80/src/common/up_allocateheap.c | 11 +- nuttx/arch/z80/src/ez80/ez80_i2c.c | 13 +- nuttx/arch/z80/src/z8/z8_i2c.c | 6 +- nuttx/binfmt/binfmt_execmodule.c | 4 +- nuttx/binfmt/binfmt_unloadmodule.c | 5 +- nuttx/binfmt/libelf/libelf_addrenv.c | 6 +- nuttx/binfmt/libelf/libelf_ctors.c | 2 +- nuttx/binfmt/libelf/libelf_dtors.c | 2 +- nuttx/binfmt/libelf/libelf_iobuffer.c | 2 +- nuttx/binfmt/libelf/libelf_unload.c | 4 +- nuttx/binfmt/libnxflat/libnxflat_addrenv.c | 6 +- nuttx/configs/README.txt | 2 - nuttx/configs/amber/hello/defconfig | 2 - nuttx/configs/avr32dev1/nsh/defconfig | 2 - nuttx/configs/avr32dev1/ostest/defconfig | 2 - nuttx/configs/c5471evm/httpd/defconfig | 2 - nuttx/configs/c5471evm/nettest/defconfig | 2 - nuttx/configs/c5471evm/nsh/defconfig | 2 - nuttx/configs/c5471evm/ostest/defconfig | 2 - nuttx/configs/compal_e88/nsh_highram/defconfig | 2 - nuttx/configs/compal_e99/nsh_compalram/defconfig | 2 - nuttx/configs/compal_e99/nsh_highram/defconfig | 2 - nuttx/configs/demo9s12ne64/ostest/defconfig | 2 - nuttx/configs/ea3131/locked/mklocked.sh | 9 +- nuttx/configs/ea3131/src/up_usbmsc.c | 9 +- nuttx/configs/ea3152/src/up_usbmsc.c | 7 +- nuttx/configs/eagle100/httpd/defconfig | 2 - nuttx/configs/eagle100/nettest/defconfig | 2 - nuttx/configs/eagle100/nsh/defconfig | 2 - nuttx/configs/eagle100/nxflat/defconfig | 2 - nuttx/configs/eagle100/ostest/defconfig | 2 - nuttx/configs/eagle100/thttpd/defconfig | 2 - nuttx/configs/ez80f910200zco/dhcpd/defconfig | 2 - nuttx/configs/ez80f910200zco/httpd/defconfig | 2 - nuttx/configs/ez80f910200zco/nettest/defconfig | 2 - nuttx/configs/ez80f910200zco/nsh/defconfig | 2 - nuttx/configs/ez80f910200zco/poll/defconfig | 2 - nuttx/configs/hymini-stm32v/buttons/defconfig | 2 - nuttx/configs/hymini-stm32v/nsh/defconfig | 2 - nuttx/configs/hymini-stm32v/nsh2/defconfig | 2 - nuttx/configs/hymini-stm32v/nx/defconfig | 2 - nuttx/configs/hymini-stm32v/nxlines/defconfig | 2 - nuttx/configs/hymini-stm32v/usbserial/defconfig | 2 - nuttx/configs/hymini-stm32v/usbstorage/defconfig | 2 - nuttx/configs/kwikstik-k40/ostest/defconfig | 2 - nuttx/configs/lincoln60/nsh/defconfig | 2 - nuttx/configs/lincoln60/ostest/defconfig | 2 - nuttx/configs/lm3s6432-s2e/nsh/defconfig | 2 - nuttx/configs/lm3s6432-s2e/ostest/defconfig | 2 - nuttx/configs/lm3s8962-ek/nsh/defconfig | 2 - nuttx/configs/lm3s8962-ek/nx/defconfig | 2 - nuttx/configs/lm3s8962-ek/ostest/defconfig | 2 - nuttx/configs/lpc4330-xplorer/nsh/defconfig | 2 - nuttx/configs/lpc4330-xplorer/ostest/defconfig | 2 - nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig | 2 - nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig | 2 - nuttx/configs/lpcxpresso-lpc1768/nx/defconfig | 2 - nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig | 2 - nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig | 2 - .../lpcxpresso-lpc1768/usbstorage/defconfig | 2 - nuttx/configs/m68332evb/defconfig | 2 - nuttx/configs/mbed/hidkbd/defconfig | 2 - nuttx/configs/mbed/nsh/defconfig | 2 - nuttx/configs/mcu123-lpc214x/composite/defconfig | 2 - nuttx/configs/mcu123-lpc214x/ostest/defconfig | 2 - nuttx/configs/mcu123-lpc214x/usbserial/defconfig | 2 - nuttx/configs/mcu123-lpc214x/usbstorage/defconfig | 2 - nuttx/configs/micropendous3/hello/defconfig | 2 - nuttx/configs/mirtoo/nsh/defconfig | 2 - nuttx/configs/mirtoo/nxffs/defconfig | 2 - nuttx/configs/mirtoo/ostest/defconfig | 2 - nuttx/configs/mx1ads/ostest/defconfig | 2 - nuttx/configs/ne64badge/ostest/defconfig | 2 - nuttx/configs/ntosd-dm320/nettest/defconfig | 2 - nuttx/configs/ntosd-dm320/nsh/defconfig | 2 - nuttx/configs/ntosd-dm320/ostest/defconfig | 2 - nuttx/configs/ntosd-dm320/poll/defconfig | 2 - nuttx/configs/ntosd-dm320/thttpd/defconfig | 2 - nuttx/configs/ntosd-dm320/udp/defconfig | 2 - nuttx/configs/ntosd-dm320/uip/defconfig | 2 - nuttx/configs/nucleus2g/nsh/defconfig | 2 - nuttx/configs/nucleus2g/ostest/defconfig | 2 - nuttx/configs/nucleus2g/usbserial/defconfig | 2 - nuttx/configs/nucleus2g/usbstorage/defconfig | 2 - nuttx/configs/olimex-lpc1766stk/ftpc/defconfig | 2 - nuttx/configs/olimex-lpc1766stk/nx/defconfig | 2 - nuttx/configs/olimex-lpc1766stk/ostest/defconfig | 2 - .../configs/olimex-lpc1766stk/slip-httpd/defconfig | 2 - nuttx/configs/olimex-lpc1766stk/thttpd/defconfig | 2 - .../configs/olimex-lpc1766stk/usbserial/defconfig | 2 - .../configs/olimex-lpc1766stk/usbstorage/defconfig | 2 - nuttx/configs/olimex-lpc2378/nsh/defconfig | 2 - nuttx/configs/olimex-lpc2378/ostest/defconfig | 2 - nuttx/configs/olimex-stm32-p107/nsh/defconfig | 2 - nuttx/configs/olimex-stm32-p107/ostest/defconfig | 2 - nuttx/configs/olimex-strp711/nettest/defconfig | 2 - nuttx/configs/olimex-strp711/nsh/defconfig | 2 - nuttx/configs/olimex-strp711/ostest/defconfig | 2 - nuttx/configs/pcblogic-pic32mx/nsh/defconfig | 2 - nuttx/configs/pcblogic-pic32mx/ostest/defconfig | 2 - nuttx/configs/pic32-starterkit/nsh/defconfig | 2 - nuttx/configs/pic32-starterkit/nsh2/defconfig | 2 - nuttx/configs/pic32-starterkit/ostest/defconfig | 2 - nuttx/configs/pic32mx7mmb/nsh/defconfig | 2 - nuttx/configs/pic32mx7mmb/ostest/defconfig | 2 - nuttx/configs/pjrc-8051/defconfig | 2 - nuttx/configs/qemu-i486/nsh/defconfig | 2 - nuttx/configs/qemu-i486/ostest/defconfig | 2 - nuttx/configs/rgmp/arm/default/defconfig | 2 - nuttx/configs/rgmp/arm/nsh/defconfig | 2 - nuttx/configs/rgmp/x86/cxxtest/defconfig | 4 - nuttx/configs/rgmp/x86/default/defconfig | 2 - nuttx/configs/rgmp/x86/helloxx/defconfig | 4 - nuttx/configs/rgmp/x86/nsh/defconfig | 2 - nuttx/configs/sam3u-ek/knsh/defconfig | 12 +- nuttx/configs/sam3u-ek/nsh/defconfig | 2 - nuttx/configs/sam3u-ek/nx/defconfig | 2 - nuttx/configs/sam3u-ek/ostest/defconfig | 2 - nuttx/configs/sam3u-ek/touchscreen/defconfig | 2 - nuttx/configs/sim/mount/defconfig | 2 - nuttx/configs/sim/nettest/defconfig | 2 - nuttx/configs/sim/nsh2/defconfig | 2 - nuttx/configs/sim/nx/defconfig | 2 - nuttx/configs/sim/nx11/defconfig | 2 - nuttx/configs/sim/nxffs/defconfig | 2 - nuttx/configs/sim/pashello/defconfig | 2 - nuttx/configs/sim/touchscreen/defconfig | 2 - nuttx/configs/skp16c26/ostest/defconfig | 2 - nuttx/configs/stm3210e-eval/RIDE/defconfig | 2 - nuttx/configs/stm3210e-eval/buttons/defconfig | 2 - nuttx/configs/stm3210e-eval/composite/defconfig | 2 - nuttx/configs/stm3210e-eval/nsh/defconfig | 2 - nuttx/configs/stm3210e-eval/nsh2/defconfig | 2 - nuttx/configs/stm3210e-eval/nx/defconfig | 2 - nuttx/configs/stm3210e-eval/nxconsole/defconfig | 2 - nuttx/configs/stm3210e-eval/nxlines/defconfig | 2 - nuttx/configs/stm3210e-eval/nxtext/defconfig | 2 - nuttx/configs/stm3210e-eval/ostest/defconfig | 2 - nuttx/configs/stm3210e-eval/pm/defconfig | 2 - nuttx/configs/stm3210e-eval/usbserial/defconfig | 2 - nuttx/configs/stm3210e-eval/usbstorage/defconfig | 2 - nuttx/configs/stm3220g-eval/dhcpd/defconfig | 2 - nuttx/configs/stm3220g-eval/nettest/defconfig | 2 - nuttx/configs/stm3220g-eval/nsh/defconfig | 2 - nuttx/configs/stm3220g-eval/nsh2/defconfig | 2 - nuttx/configs/stm3220g-eval/ostest/defconfig | 2 - nuttx/configs/stm3220g-eval/telnetd/defconfig | 2 - nuttx/configs/stm3240g-eval/dhcpd/defconfig | 2 - nuttx/configs/stm3240g-eval/nettest/defconfig | 2 - nuttx/configs/stm3240g-eval/nsh/defconfig | 2 - nuttx/configs/stm3240g-eval/nsh2/defconfig | 2 - nuttx/configs/stm3240g-eval/nxconsole/defconfig | 2 - nuttx/configs/stm3240g-eval/nxwm/defconfig | 2 - nuttx/configs/stm3240g-eval/ostest/defconfig | 2 - nuttx/configs/stm3240g-eval/telnetd/defconfig | 2 - nuttx/configs/stm3240g-eval/webserver/defconfig | 2 - nuttx/configs/stm32f4discovery/pm/defconfig | 2 - nuttx/configs/sure-pic32mx/nsh/defconfig | 2 - nuttx/configs/sure-pic32mx/ostest/defconfig | 2 - nuttx/configs/sure-pic32mx/usbnsh/defconfig | 2 - nuttx/configs/teensy/hello/defconfig | 2 - nuttx/configs/teensy/nsh/defconfig | 2 - nuttx/configs/teensy/usbstorage/defconfig | 2 - nuttx/configs/twr-k60n512/nsh/defconfig | 2 - nuttx/configs/twr-k60n512/ostest/defconfig | 2 - nuttx/configs/ubw32/nsh/defconfig | 2 - nuttx/configs/us7032evb1/nsh/defconfig | 2 - nuttx/configs/us7032evb1/ostest/defconfig | 2 - nuttx/configs/vsn/nsh/defconfig | 2 - nuttx/drivers/net/e1000.c | 1 + nuttx/drivers/pwm.c | 7 +- nuttx/drivers/sensors/lm75.c | 8 +- nuttx/drivers/sensors/qencoder.c | 7 +- nuttx/drivers/usbdev/usbmsc.c | 2 +- nuttx/fs/fat/fs_mkfatfs.c | 22 +- nuttx/fs/fs_closedir.c | 6 +- nuttx/fs/fs_fdopen.c | 2 +- nuttx/fs/fs_foreachinode.c | 7 +- nuttx/fs/fs_opendir.c | 6 +- nuttx/fs/mmap/fs_munmap.c | 6 +- nuttx/fs/mmap/fs_rammap.c | 6 +- nuttx/fs/romfs/fs_romfsutil.c | 7 +- nuttx/graphics/nxbe/nxbe_clipper.c | 8 +- nuttx/graphics/nxbe/nxbe_colormap.c | 7 +- nuttx/graphics/nxmu/nx_connect.c | 8 +- nuttx/graphics/nxmu/nx_eventhandler.c | 6 +- nuttx/graphics/nxmu/nx_kbdin.c | 8 +- nuttx/graphics/nxmu/nxfe.h | 4 +- nuttx/graphics/nxmu/nxmu_constructwindow.c | 8 +- nuttx/graphics/nxmu/nxmu_kbdin.c | 6 +- nuttx/graphics/nxsu/nx_close.c | 6 +- nuttx/graphics/nxsu/nx_open.c | 6 +- nuttx/graphics/nxsu/nx_openwindow.c | 6 +- nuttx/graphics/nxsu/nxfe.h | 6 +- nuttx/graphics/nxsu/nxsu_constructwindow.c | 10 +- nuttx/include/nuttx/arch.h | 25 +- nuttx/include/nuttx/kmalloc.h | 61 +++- nuttx/include/stdio.h | 87 +++--- nuttx/libc/lib_internal.h | 16 +- nuttx/libc/misc/lib_sendfile.c | 8 +- nuttx/libc/spawn/lib_psfa_addclose.c | 4 +- nuttx/libc/spawn/lib_psfa_adddup2.c | 4 +- nuttx/libc/spawn/lib_psfa_addopen.c | 5 +- nuttx/libc/spawn/lib_psfa_destroy.c | 4 +- nuttx/libc/stdio/lib_asprintf.c | 2 + nuttx/libc/stdio/lib_libdtoa.c | 4 +- nuttx/libc/string/lib_strdup.c | 3 +- nuttx/libxx/libxx_cxa_atexit.cxx | 5 +- nuttx/libxx/libxx_delete.cxx | 7 +- nuttx/libxx/libxx_deletea.cxx | 7 +- nuttx/libxx/libxx_internal.hxx | 22 +- nuttx/libxx/libxx_new.cxx | 7 +- nuttx/libxx/libxx_newa.cxx | 5 +- nuttx/mm/Kconfig | 6 + nuttx/mm/Makefile | 13 +- nuttx/mm/kmm_addregion.c | 113 -------- nuttx/mm/kmm_initialize.c | 113 -------- nuttx/mm/kmm_kfree.c | 110 -------- nuttx/mm/kmm_kmalloc.c | 110 -------- nuttx/mm/kmm_krealloc.c | 111 -------- nuttx/mm/kmm_kzalloc.c | 110 -------- nuttx/mm/kmm_semaphore.c | 140 ---------- nuttx/mm/mm_initialize.c | 7 - nuttx/mm/mm_kernel.c | 282 +++++++++++++++++++ nuttx/mm/mm_kerneluser.c | 306 +++++++++++++++++++++ nuttx/mm/mm_user.c | 155 +++++++++++ nuttx/mm/umm_addregion.c | 81 ------ nuttx/mm/umm_initialize.c | 81 ------ nuttx/mm/umm_semaphore.c | 99 ------- nuttx/net/uip/uip_igmpgroup.c | 8 +- nuttx/net/uip/uip_tcpbacklog.c | 7 +- nuttx/net/uip/uip_tcpreadahead.c | 4 +- nuttx/sched/group_create.c | 2 +- nuttx/sched/os_bringup.c | 6 +- nuttx/sched/os_start.c | 18 +- nuttx/sched/sched_garbage.c | 30 +- 265 files changed, 1372 insertions(+), 1743 deletions(-) delete mode 100644 nuttx/mm/kmm_addregion.c delete mode 100644 nuttx/mm/kmm_initialize.c delete mode 100644 nuttx/mm/kmm_kfree.c delete mode 100644 nuttx/mm/kmm_kmalloc.c delete mode 100644 nuttx/mm/kmm_krealloc.c delete mode 100644 nuttx/mm/kmm_kzalloc.c delete mode 100644 nuttx/mm/kmm_semaphore.c create mode 100644 nuttx/mm/mm_kernel.c create mode 100644 nuttx/mm/mm_kerneluser.c create mode 100644 nuttx/mm/mm_user.c delete mode 100644 nuttx/mm/umm_addregion.c delete mode 100644 nuttx/mm/umm_initialize.c delete mode 100644 nuttx/mm/umm_semaphore.c (limited to 'nuttx') diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 0670ec11c..3b268c0a5 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/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/nuttx/arch/8051/src/up_allocateheap.c b/nuttx/arch/8051/src/up_allocateheap.c index f2238507a..2f6a89490 100644 --- a/nuttx/arch/8051/src/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/common/up_allocateheap.c b/nuttx/arch/arm/src/common/up_allocateheap.c index d4b763196..12cbfcfa8 100644 --- a/nuttx/arch/arm/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/dm320/dm320_allocateheap.c b/nuttx/arch/arm/src/dm320/dm320_allocateheap.c index 5d4b90093..1383b93da 100644 --- a/nuttx/arch/arm/src/dm320/dm320_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/dm320/dm320_framebuffer.c b/nuttx/arch/arm/src/dm320/dm320_framebuffer.c index 1b1197d53..8b5aec444 100644 --- a/nuttx/arch/arm/src/dm320/dm320_framebuffer.c +++ b/nuttx/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/nuttx/arch/arm/src/dm320/dm320_usbdev.c b/nuttx/arch/arm/src/dm320/dm320_usbdev.c index c924db197..b30aba72c 100644 --- a/nuttx/arch/arm/src/dm320/dm320_usbdev.c +++ b/nuttx/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/nuttx/arch/arm/src/imx/imx_allocateheap.c b/nuttx/arch/arm/src/imx/imx_allocateheap.c index 3279ddbd9..37b05eb7f 100644 --- a/nuttx/arch/arm/src/imx/imx_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc17xx/lpc17_allocateheap.c b/nuttx/arch/arm/src/lpc17xx/lpc17_allocateheap.c index b09220a53..620b46a8e 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c b/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c index 753f82326..938d0c8a7 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_usbdev.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index 78dc86992..da55c67db 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c b/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c index 204fdf6c1..f57c343ef 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c b/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c index ddeb1bf6b..1449d5e5b 100644 --- a/nuttx/arch/arm/src/lpc31xx/lpc31_usbdev.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc43xx/lpc43_allocateheap.c b/nuttx/arch/arm/src/lpc43xx/lpc43_allocateheap.c index ef96bcb0c..c33f9f1ed 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c b/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c index d0af116d6..379dbc435 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_usb0dev.c +++ b/nuttx/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/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c b/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c index a5236e74d..99e2d9e86 100644 --- a/nuttx/arch/arm/src/sam3u/sam3u_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_allocateheap.c b/nuttx/arch/arm/src/stm32/stm32_allocateheap.c index b70a29b44..149de8648 100644 --- a/nuttx/arch/arm/src/stm32/stm32_allocateheap.c +++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c b/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c index ece965b01..3986106d8 100644 --- a/nuttx/arch/arm/src/stm32/stm32_otgfsdev.c +++ b/nuttx/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/nuttx/arch/arm/src/stm32/stm32_usbdev.c b/nuttx/arch/arm/src/stm32/stm32_usbdev.c index 6036eb3d5..ab3967783 100644 --- a/nuttx/arch/arm/src/stm32/stm32_usbdev.c +++ b/nuttx/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/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c b/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c index 0e3ac6487..a5fb64c36 100644 --- a/nuttx/arch/avr/src/at90usb/at90usb_usbdev.c +++ b/nuttx/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/nuttx/arch/avr/src/common/up_allocateheap.c b/nuttx/arch/avr/src/common/up_allocateheap.c index b4a7cde02..3a67ff6a7 100644 --- a/nuttx/arch/avr/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/hc/src/common/up_allocateheap.c b/nuttx/arch/hc/src/common/up_allocateheap.c index fc86faca5..b107baaa5 100644 --- a/nuttx/arch/hc/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/mips/src/common/up_allocateheap.c b/nuttx/arch/mips/src/common/up_allocateheap.c index f29b2685f..b8c449ff1 100644 --- a/nuttx/arch/mips/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c b/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c index 8d9f7c058..5e0f2db3b 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-usbdev.c +++ b/nuttx/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/nuttx/arch/rgmp/src/nuttx.c b/nuttx/arch/rgmp/src/nuttx.c index 6cb300f82..63e925b8c 100644 --- a/nuttx/arch/rgmp/src/nuttx.c +++ b/nuttx/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/nuttx/arch/sh/src/common/up_allocateheap.c b/nuttx/arch/sh/src/common/up_allocateheap.c index e19b2c18e..ad1935d9a 100644 --- a/nuttx/arch/sh/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/sim/src/up_allocateheap.c b/nuttx/arch/sim/src/up_allocateheap.c index 47400ec7c..ffdb69518 100644 --- a/nuttx/arch/sim/src/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/sim/src/up_deviceimage.c b/nuttx/arch/sim/src/up_deviceimage.c index e32f64927..e1f2210f2 100644 --- a/nuttx/arch/sim/src/up_deviceimage.c +++ b/nuttx/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/nuttx/arch/x86/src/common/up_allocateheap.c b/nuttx/arch/x86/src/common/up_allocateheap.c index 74b169df3..b56f9b59a 100644 --- a/nuttx/arch/x86/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/z16/src/common/up_allocateheap.c b/nuttx/arch/z16/src/common/up_allocateheap.c index 62ea870e9..b13740011 100644 --- a/nuttx/arch/z16/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/z80/src/common/up_allocateheap.c b/nuttx/arch/z80/src/common/up_allocateheap.c index 734d678e7..c3e06ef12 100644 --- a/nuttx/arch/z80/src/common/up_allocateheap.c +++ b/nuttx/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/nuttx/arch/z80/src/ez80/ez80_i2c.c b/nuttx/arch/z80/src/ez80/ez80_i2c.c index dbc817442..6668704dc 100644 --- a/nuttx/arch/z80/src/ez80/ez80_i2c.c +++ b/nuttx/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/nuttx/arch/z80/src/z8/z8_i2c.c b/nuttx/arch/z80/src/z8/z8_i2c.c index e90bd4036..59cd2fc2b 100644 --- a/nuttx/arch/z80/src/z8/z8_i2c.c +++ b/nuttx/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/nuttx/binfmt/binfmt_execmodule.c b/nuttx/binfmt/binfmt_execmodule.c index 09ad4ee6c..b56dd470f 100644 --- a/nuttx/binfmt/binfmt_execmodule.c +++ b/nuttx/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/nuttx/binfmt/binfmt_unloadmodule.c b/nuttx/binfmt/binfmt_unloadmodule.c index 365f26a34..50f8dcb43 100644 --- a/nuttx/binfmt/binfmt_unloadmodule.c +++ b/nuttx/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/nuttx/binfmt/libelf/libelf_addrenv.c b/nuttx/binfmt/libelf/libelf_addrenv.c index 193062a54..d2b9870b6 100644 --- a/nuttx/binfmt/libelf/libelf_addrenv.c +++ b/nuttx/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/nuttx/binfmt/libelf/libelf_ctors.c b/nuttx/binfmt/libelf/libelf_ctors.c index 20f1256e2..af9c7bba4 100644 --- a/nuttx/binfmt/libelf/libelf_ctors.c +++ b/nuttx/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/nuttx/binfmt/libelf/libelf_dtors.c b/nuttx/binfmt/libelf/libelf_dtors.c index c0c73a337..638284f0b 100644 --- a/nuttx/binfmt/libelf/libelf_dtors.c +++ b/nuttx/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/nuttx/binfmt/libelf/libelf_iobuffer.c b/nuttx/binfmt/libelf/libelf_iobuffer.c index ead99ca09..b2d54b3ca 100644 --- a/nuttx/binfmt/libelf/libelf_iobuffer.c +++ b/nuttx/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/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c index 539e5faf7..7f7a3cf91 100644 --- a/nuttx/binfmt/libelf/libelf_unload.c +++ b/nuttx/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/nuttx/binfmt/libnxflat/libnxflat_addrenv.c b/nuttx/binfmt/libnxflat/libnxflat_addrenv.c index 2d9255b28..d31e7fda0 100644 --- a/nuttx/binfmt/libnxflat/libnxflat_addrenv.c +++ b/nuttx/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/nuttx/configs/README.txt b/nuttx/configs/README.txt index d4486daaf..726018e67 100644 --- a/nuttx/configs/README.txt +++ b/nuttx/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/nuttx/configs/amber/hello/defconfig b/nuttx/configs/amber/hello/defconfig index 8bdb55db4..9cf1c32da 100644 --- a/nuttx/configs/amber/hello/defconfig +++ b/nuttx/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/nuttx/configs/avr32dev1/nsh/defconfig b/nuttx/configs/avr32dev1/nsh/defconfig index 6c8b5b416..525cf6024 100755 --- a/nuttx/configs/avr32dev1/nsh/defconfig +++ b/nuttx/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/nuttx/configs/avr32dev1/ostest/defconfig b/nuttx/configs/avr32dev1/ostest/defconfig index a48883dda..a88b630f2 100755 --- a/nuttx/configs/avr32dev1/ostest/defconfig +++ b/nuttx/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/nuttx/configs/c5471evm/httpd/defconfig b/nuttx/configs/c5471evm/httpd/defconfig index 88fc0afe2..21dd2a160 100644 --- a/nuttx/configs/c5471evm/httpd/defconfig +++ b/nuttx/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/nuttx/configs/c5471evm/nettest/defconfig b/nuttx/configs/c5471evm/nettest/defconfig index 15258409e..d4a7082bd 100644 --- a/nuttx/configs/c5471evm/nettest/defconfig +++ b/nuttx/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/nuttx/configs/c5471evm/nsh/defconfig b/nuttx/configs/c5471evm/nsh/defconfig index db54c255c..4c94c022b 100644 --- a/nuttx/configs/c5471evm/nsh/defconfig +++ b/nuttx/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/nuttx/configs/c5471evm/ostest/defconfig b/nuttx/configs/c5471evm/ostest/defconfig index f5893d546..d2a470f9e 100644 --- a/nuttx/configs/c5471evm/ostest/defconfig +++ b/nuttx/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/nuttx/configs/compal_e88/nsh_highram/defconfig b/nuttx/configs/compal_e88/nsh_highram/defconfig index 46884c31b..d0eecc7ed 100644 --- a/nuttx/configs/compal_e88/nsh_highram/defconfig +++ b/nuttx/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/nuttx/configs/compal_e99/nsh_compalram/defconfig b/nuttx/configs/compal_e99/nsh_compalram/defconfig index 621f68f1e..e0a1c34ab 100644 --- a/nuttx/configs/compal_e99/nsh_compalram/defconfig +++ b/nuttx/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/nuttx/configs/compal_e99/nsh_highram/defconfig b/nuttx/configs/compal_e99/nsh_highram/defconfig index 52eb1d938..d92810960 100644 --- a/nuttx/configs/compal_e99/nsh_highram/defconfig +++ b/nuttx/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/nuttx/configs/demo9s12ne64/ostest/defconfig b/nuttx/configs/demo9s12ne64/ostest/defconfig index 3222b63ee..f52952232 100755 --- a/nuttx/configs/demo9s12ne64/ostest/defconfig +++ b/nuttx/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/nuttx/configs/ea3131/locked/mklocked.sh b/nuttx/configs/ea3131/locked/mklocked.sh index 731accde3..776247997 100755 --- a/nuttx/configs/ea3131/locked/mklocked.sh +++ b/nuttx/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/nuttx/configs/ea3131/src/up_usbmsc.c b/nuttx/configs/ea3131/src/up_usbmsc.c index e1869af4d..b91bc3598 100644 --- a/nuttx/configs/ea3131/src/up_usbmsc.c +++ b/nuttx/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/nuttx/configs/ea3152/src/up_usbmsc.c b/nuttx/configs/ea3152/src/up_usbmsc.c index ee67f0eed..311ecb741 100644 --- a/nuttx/configs/ea3152/src/up_usbmsc.c +++ b/nuttx/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/nuttx/configs/eagle100/httpd/defconfig b/nuttx/configs/eagle100/httpd/defconfig index bb6636445..91e77446f 100644 --- a/nuttx/configs/eagle100/httpd/defconfig +++ b/nuttx/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/nuttx/configs/eagle100/nettest/defconfig b/nuttx/configs/eagle100/nettest/defconfig index 8f969ee79..136c1d183 100644 --- a/nuttx/configs/eagle100/nettest/defconfig +++ b/nuttx/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/nuttx/configs/eagle100/nsh/defconfig b/nuttx/configs/eagle100/nsh/defconfig index c15c3a7ae..a13167d6b 100644 --- a/nuttx/configs/eagle100/nsh/defconfig +++ b/nuttx/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/nuttx/configs/eagle100/nxflat/defconfig b/nuttx/configs/eagle100/nxflat/defconfig index 3cce495db..738478fe6 100644 --- a/nuttx/configs/eagle100/nxflat/defconfig +++ b/nuttx/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/nuttx/configs/eagle100/ostest/defconfig b/nuttx/configs/eagle100/ostest/defconfig index eb050ac9f..7a2b681be 100644 --- a/nuttx/configs/eagle100/ostest/defconfig +++ b/nuttx/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/nuttx/configs/eagle100/thttpd/defconfig b/nuttx/configs/eagle100/thttpd/defconfig index 7e1282368..ab52ef6dc 100644 --- a/nuttx/configs/eagle100/thttpd/defconfig +++ b/nuttx/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/nuttx/configs/ez80f910200zco/dhcpd/defconfig b/nuttx/configs/ez80f910200zco/dhcpd/defconfig index 043526165..f3c4864f8 100644 --- a/nuttx/configs/ez80f910200zco/dhcpd/defconfig +++ b/nuttx/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/nuttx/configs/ez80f910200zco/httpd/defconfig b/nuttx/configs/ez80f910200zco/httpd/defconfig index 329b97053..f972aacfd 100644 --- a/nuttx/configs/ez80f910200zco/httpd/defconfig +++ b/nuttx/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/nuttx/configs/ez80f910200zco/nettest/defconfig b/nuttx/configs/ez80f910200zco/nettest/defconfig index 94eedae20..345508d9e 100644 --- a/nuttx/configs/ez80f910200zco/nettest/defconfig +++ b/nuttx/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/nuttx/configs/ez80f910200zco/nsh/defconfig b/nuttx/configs/ez80f910200zco/nsh/defconfig index f6e6e9d56..2ce04493d 100644 --- a/nuttx/configs/ez80f910200zco/nsh/defconfig +++ b/nuttx/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/nuttx/configs/ez80f910200zco/poll/defconfig b/nuttx/configs/ez80f910200zco/poll/defconfig index 23c9fe747..141f0a2a7 100644 --- a/nuttx/configs/ez80f910200zco/poll/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/buttons/defconfig b/nuttx/configs/hymini-stm32v/buttons/defconfig index fc258df0c..11f2b4cb3 100644 --- a/nuttx/configs/hymini-stm32v/buttons/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/nsh/defconfig b/nuttx/configs/hymini-stm32v/nsh/defconfig index 146068df4..4a7984863 100755 --- a/nuttx/configs/hymini-stm32v/nsh/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/nsh2/defconfig b/nuttx/configs/hymini-stm32v/nsh2/defconfig index a2cac61fa..b5c8a6a9b 100644 --- a/nuttx/configs/hymini-stm32v/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/nx/defconfig b/nuttx/configs/hymini-stm32v/nx/defconfig index e0bcdfa00..d81a0df57 100644 --- a/nuttx/configs/hymini-stm32v/nx/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/nxlines/defconfig b/nuttx/configs/hymini-stm32v/nxlines/defconfig index 7bfebcf2c..516884b80 100644 --- a/nuttx/configs/hymini-stm32v/nxlines/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/usbserial/defconfig b/nuttx/configs/hymini-stm32v/usbserial/defconfig index a677d2804..ca793bae7 100755 --- a/nuttx/configs/hymini-stm32v/usbserial/defconfig +++ b/nuttx/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/nuttx/configs/hymini-stm32v/usbstorage/defconfig b/nuttx/configs/hymini-stm32v/usbstorage/defconfig index 759e46cf1..1982faaf0 100755 --- a/nuttx/configs/hymini-stm32v/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/kwikstik-k40/ostest/defconfig b/nuttx/configs/kwikstik-k40/ostest/defconfig index 912233ed9..6eca2332a 100755 --- a/nuttx/configs/kwikstik-k40/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lincoln60/nsh/defconfig b/nuttx/configs/lincoln60/nsh/defconfig index 2c28dbf8c..3dee4607a 100644 --- a/nuttx/configs/lincoln60/nsh/defconfig +++ b/nuttx/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/nuttx/configs/lincoln60/ostest/defconfig b/nuttx/configs/lincoln60/ostest/defconfig index f1743b67a..874489c8f 100644 --- a/nuttx/configs/lincoln60/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lm3s6432-s2e/nsh/defconfig b/nuttx/configs/lm3s6432-s2e/nsh/defconfig index b1a0a02c5..d8fb2f600 100644 --- a/nuttx/configs/lm3s6432-s2e/nsh/defconfig +++ b/nuttx/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/nuttx/configs/lm3s6432-s2e/ostest/defconfig b/nuttx/configs/lm3s6432-s2e/ostest/defconfig index 5858bb76d..44d1c46f5 100644 --- a/nuttx/configs/lm3s6432-s2e/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lm3s8962-ek/nsh/defconfig b/nuttx/configs/lm3s8962-ek/nsh/defconfig index 842bc3981..20937822e 100755 --- a/nuttx/configs/lm3s8962-ek/nsh/defconfig +++ b/nuttx/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/nuttx/configs/lm3s8962-ek/nx/defconfig b/nuttx/configs/lm3s8962-ek/nx/defconfig index 329d33de9..c779e71ea 100755 --- a/nuttx/configs/lm3s8962-ek/nx/defconfig +++ b/nuttx/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/nuttx/configs/lm3s8962-ek/ostest/defconfig b/nuttx/configs/lm3s8962-ek/ostest/defconfig index c9b6fa9cf..60a0ed968 100755 --- a/nuttx/configs/lm3s8962-ek/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lpc4330-xplorer/nsh/defconfig b/nuttx/configs/lpc4330-xplorer/nsh/defconfig index 5d75e7222..b2b7befee 100644 --- a/nuttx/configs/lpc4330-xplorer/nsh/defconfig +++ b/nuttx/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/nuttx/configs/lpc4330-xplorer/ostest/defconfig b/nuttx/configs/lpc4330-xplorer/ostest/defconfig index 005ff7174..4318b951f 100644 --- a/nuttx/configs/lpc4330-xplorer/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig index 56c936448..e3cba7b38 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/dhcpd/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig b/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig index 3bece6f21..0c959cd6d 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/nsh/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig b/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig index cd95b4bce..3d1347a28 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/nx/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig b/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig index 8ffed2c25..a6c496313 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/ostest/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig b/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig index b34f64530..a6915762a 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/thttpd/defconfig +++ b/nuttx/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/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig b/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig index f5de5234a..4419dca11 100755 --- a/nuttx/configs/lpcxpresso-lpc1768/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/m68332evb/defconfig b/nuttx/configs/m68332evb/defconfig index 0beaea91e..affc6e1e1 100644 --- a/nuttx/configs/m68332evb/defconfig +++ b/nuttx/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/nuttx/configs/mbed/hidkbd/defconfig b/nuttx/configs/mbed/hidkbd/defconfig index 580921ba9..77f7f19de 100644 --- a/nuttx/configs/mbed/hidkbd/defconfig +++ b/nuttx/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/nuttx/configs/mbed/nsh/defconfig b/nuttx/configs/mbed/nsh/defconfig index 7d5bf4617..89eb1115f 100755 --- a/nuttx/configs/mbed/nsh/defconfig +++ b/nuttx/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/nuttx/configs/mcu123-lpc214x/composite/defconfig b/nuttx/configs/mcu123-lpc214x/composite/defconfig index 2ecfe470f..9c5c72730 100644 --- a/nuttx/configs/mcu123-lpc214x/composite/defconfig +++ b/nuttx/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/nuttx/configs/mcu123-lpc214x/ostest/defconfig b/nuttx/configs/mcu123-lpc214x/ostest/defconfig index 1e505868b..3291fcf17 100644 --- a/nuttx/configs/mcu123-lpc214x/ostest/defconfig +++ b/nuttx/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/nuttx/configs/mcu123-lpc214x/usbserial/defconfig b/nuttx/configs/mcu123-lpc214x/usbserial/defconfig index 127416ad2..14b685d48 100644 --- a/nuttx/configs/mcu123-lpc214x/usbserial/defconfig +++ b/nuttx/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/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig b/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig index 17b99e16e..e60710902 100644 --- a/nuttx/configs/mcu123-lpc214x/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/micropendous3/hello/defconfig b/nuttx/configs/micropendous3/hello/defconfig index 2708c5d52..3bbe436cd 100644 --- a/nuttx/configs/micropendous3/hello/defconfig +++ b/nuttx/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/nuttx/configs/mirtoo/nsh/defconfig b/nuttx/configs/mirtoo/nsh/defconfig index 9beaf6728..bd7cd7deb 100644 --- a/nuttx/configs/mirtoo/nsh/defconfig +++ b/nuttx/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/nuttx/configs/mirtoo/nxffs/defconfig b/nuttx/configs/mirtoo/nxffs/defconfig index 50929eb0e..237165bc7 100644 --- a/nuttx/configs/mirtoo/nxffs/defconfig +++ b/nuttx/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/nuttx/configs/mirtoo/ostest/defconfig b/nuttx/configs/mirtoo/ostest/defconfig index f2d234e37..97793666e 100644 --- a/nuttx/configs/mirtoo/ostest/defconfig +++ b/nuttx/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/nuttx/configs/mx1ads/ostest/defconfig b/nuttx/configs/mx1ads/ostest/defconfig index cc0111f20..b030db568 100644 --- a/nuttx/configs/mx1ads/ostest/defconfig +++ b/nuttx/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/nuttx/configs/ne64badge/ostest/defconfig b/nuttx/configs/ne64badge/ostest/defconfig index a730c93eb..6a0820dc9 100755 --- a/nuttx/configs/ne64badge/ostest/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/nettest/defconfig b/nuttx/configs/ntosd-dm320/nettest/defconfig index 3d2127e90..de3face95 100644 --- a/nuttx/configs/ntosd-dm320/nettest/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/nsh/defconfig b/nuttx/configs/ntosd-dm320/nsh/defconfig index 231108374..aa1514e3d 100644 --- a/nuttx/configs/ntosd-dm320/nsh/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/ostest/defconfig b/nuttx/configs/ntosd-dm320/ostest/defconfig index 0d7333142..5f2dd8b51 100644 --- a/nuttx/configs/ntosd-dm320/ostest/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/poll/defconfig b/nuttx/configs/ntosd-dm320/poll/defconfig index 85ee21df4..6a40da06d 100644 --- a/nuttx/configs/ntosd-dm320/poll/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/thttpd/defconfig b/nuttx/configs/ntosd-dm320/thttpd/defconfig index 593ac48ae..deecffaf4 100644 --- a/nuttx/configs/ntosd-dm320/thttpd/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/udp/defconfig b/nuttx/configs/ntosd-dm320/udp/defconfig index 2282bb8ee..7ee1480b8 100644 --- a/nuttx/configs/ntosd-dm320/udp/defconfig +++ b/nuttx/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/nuttx/configs/ntosd-dm320/uip/defconfig b/nuttx/configs/ntosd-dm320/uip/defconfig index 883c4bf3a..3807959b8 100644 --- a/nuttx/configs/ntosd-dm320/uip/defconfig +++ b/nuttx/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/nuttx/configs/nucleus2g/nsh/defconfig b/nuttx/configs/nucleus2g/nsh/defconfig index a3a88204a..21b8523dd 100755 --- a/nuttx/configs/nucleus2g/nsh/defconfig +++ b/nuttx/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/nuttx/configs/nucleus2g/ostest/defconfig b/nuttx/configs/nucleus2g/ostest/defconfig index 77f7a8a31..146c62284 100755 --- a/nuttx/configs/nucleus2g/ostest/defconfig +++ b/nuttx/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/nuttx/configs/nucleus2g/usbserial/defconfig b/nuttx/configs/nucleus2g/usbserial/defconfig index 64c093b04..5e2332fa0 100755 --- a/nuttx/configs/nucleus2g/usbserial/defconfig +++ b/nuttx/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/nuttx/configs/nucleus2g/usbstorage/defconfig b/nuttx/configs/nucleus2g/usbstorage/defconfig index 133937939..e8cef6869 100755 --- a/nuttx/configs/nucleus2g/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig b/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig index f14885bef..a42addc8b 100755 --- a/nuttx/configs/olimex-lpc1766stk/ftpc/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/nx/defconfig b/nuttx/configs/olimex-lpc1766stk/nx/defconfig index e1aee8047..ef4658776 100755 --- a/nuttx/configs/olimex-lpc1766stk/nx/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/ostest/defconfig b/nuttx/configs/olimex-lpc1766stk/ostest/defconfig index 5dcefc0f4..1ab11500c 100755 --- a/nuttx/configs/olimex-lpc1766stk/ostest/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig b/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig index 33e3d9f41..a83dc8d6a 100755 --- a/nuttx/configs/olimex-lpc1766stk/slip-httpd/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig b/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig index 47efdd95f..048693462 100755 --- a/nuttx/configs/olimex-lpc1766stk/thttpd/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig b/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig index 06d41b6f1..82abd2174 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbserial/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig b/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig index fe39eeb5c..a95c337a0 100755 --- a/nuttx/configs/olimex-lpc1766stk/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc2378/nsh/defconfig b/nuttx/configs/olimex-lpc2378/nsh/defconfig index 6e45f7f46..5ca117490 100755 --- a/nuttx/configs/olimex-lpc2378/nsh/defconfig +++ b/nuttx/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/nuttx/configs/olimex-lpc2378/ostest/defconfig b/nuttx/configs/olimex-lpc2378/ostest/defconfig index dd9d9578d..669c5853c 100755 --- a/nuttx/configs/olimex-lpc2378/ostest/defconfig +++ b/nuttx/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/nuttx/configs/olimex-stm32-p107/nsh/defconfig b/nuttx/configs/olimex-stm32-p107/nsh/defconfig index 1a0eca109..07c84516a 100644 --- a/nuttx/configs/olimex-stm32-p107/nsh/defconfig +++ b/nuttx/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/nuttx/configs/olimex-stm32-p107/ostest/defconfig b/nuttx/configs/olimex-stm32-p107/ostest/defconfig index 6d5901312..ed0440060 100644 --- a/nuttx/configs/olimex-stm32-p107/ostest/defconfig +++ b/nuttx/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/nuttx/configs/olimex-strp711/nettest/defconfig b/nuttx/configs/olimex-strp711/nettest/defconfig index d36b42bb9..2da2a6b5c 100755 --- a/nuttx/configs/olimex-strp711/nettest/defconfig +++ b/nuttx/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/nuttx/configs/olimex-strp711/nsh/defconfig b/nuttx/configs/olimex-strp711/nsh/defconfig index 10b408df6..0e080c7b3 100644 --- a/nuttx/configs/olimex-strp711/nsh/defconfig +++ b/nuttx/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/nuttx/configs/olimex-strp711/ostest/defconfig b/nuttx/configs/olimex-strp711/ostest/defconfig index 47e55c944..0e4e25417 100644 --- a/nuttx/configs/olimex-strp711/ostest/defconfig +++ b/nuttx/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/nuttx/configs/pcblogic-pic32mx/nsh/defconfig b/nuttx/configs/pcblogic-pic32mx/nsh/defconfig index d59e2b7d2..f7f9b951d 100644 --- a/nuttx/configs/pcblogic-pic32mx/nsh/defconfig +++ b/nuttx/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/nuttx/configs/pcblogic-pic32mx/ostest/defconfig b/nuttx/configs/pcblogic-pic32mx/ostest/defconfig index 1cf57ca4c..61976be33 100644 --- a/nuttx/configs/pcblogic-pic32mx/ostest/defconfig +++ b/nuttx/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/nuttx/configs/pic32-starterkit/nsh/defconfig b/nuttx/configs/pic32-starterkit/nsh/defconfig index 16448a95f..2c88881da 100644 --- a/nuttx/configs/pic32-starterkit/nsh/defconfig +++ b/nuttx/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/nuttx/configs/pic32-starterkit/nsh2/defconfig b/nuttx/configs/pic32-starterkit/nsh2/defconfig index a50ac506c..23deb4471 100644 --- a/nuttx/configs/pic32-starterkit/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/pic32-starterkit/ostest/defconfig b/nuttx/configs/pic32-starterkit/ostest/defconfig index 39f7d04af..b1b99e4c6 100644 --- a/nuttx/configs/pic32-starterkit/ostest/defconfig +++ b/nuttx/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/nuttx/configs/pic32mx7mmb/nsh/defconfig b/nuttx/configs/pic32mx7mmb/nsh/defconfig index eb4b64e72..23adc8f5b 100644 --- a/nuttx/configs/pic32mx7mmb/nsh/defconfig +++ b/nuttx/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/nuttx/configs/pic32mx7mmb/ostest/defconfig b/nuttx/configs/pic32mx7mmb/ostest/defconfig index 4595913cd..1148aac37 100644 --- a/nuttx/configs/pic32mx7mmb/ostest/defconfig +++ b/nuttx/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/nuttx/configs/pjrc-8051/defconfig b/nuttx/configs/pjrc-8051/defconfig index 43c2347a9..d2dea8a62 100644 --- a/nuttx/configs/pjrc-8051/defconfig +++ b/nuttx/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/nuttx/configs/qemu-i486/nsh/defconfig b/nuttx/configs/qemu-i486/nsh/defconfig index a482e6fac..44bf3df28 100644 --- a/nuttx/configs/qemu-i486/nsh/defconfig +++ b/nuttx/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/nuttx/configs/qemu-i486/ostest/defconfig b/nuttx/configs/qemu-i486/ostest/defconfig index 4a2331638..1c3e510a4 100644 --- a/nuttx/configs/qemu-i486/ostest/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/arm/default/defconfig b/nuttx/configs/rgmp/arm/default/defconfig index 88843e365..8bff713c8 100644 --- a/nuttx/configs/rgmp/arm/default/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/arm/nsh/defconfig b/nuttx/configs/rgmp/arm/nsh/defconfig index 47c685aae..8c43c376e 100644 --- a/nuttx/configs/rgmp/arm/nsh/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/x86/cxxtest/defconfig b/nuttx/configs/rgmp/x86/cxxtest/defconfig index 2b19192e4..230ed41df 100644 --- a/nuttx/configs/rgmp/x86/cxxtest/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/x86/default/defconfig b/nuttx/configs/rgmp/x86/default/defconfig index 383e0ff5f..5289217a8 100644 --- a/nuttx/configs/rgmp/x86/default/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/x86/helloxx/defconfig b/nuttx/configs/rgmp/x86/helloxx/defconfig index 9266bad81..ca0d17bf4 100644 --- a/nuttx/configs/rgmp/x86/helloxx/defconfig +++ b/nuttx/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/nuttx/configs/rgmp/x86/nsh/defconfig b/nuttx/configs/rgmp/x86/nsh/defconfig index 6f10b234a..b07b7d9a9 100644 --- a/nuttx/configs/rgmp/x86/nsh/defconfig +++ b/nuttx/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/nuttx/configs/sam3u-ek/knsh/defconfig b/nuttx/configs/sam3u-ek/knsh/defconfig index bbd3662c1..1a8db473b 100755 --- a/nuttx/configs/sam3u-ek/knsh/defconfig +++ b/nuttx/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/nuttx/configs/sam3u-ek/nsh/defconfig b/nuttx/configs/sam3u-ek/nsh/defconfig index 034fe37a8..7a6c12eab 100755 --- a/nuttx/configs/sam3u-ek/nsh/defconfig +++ b/nuttx/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/nuttx/configs/sam3u-ek/nx/defconfig b/nuttx/configs/sam3u-ek/nx/defconfig index 29fd3dd6e..e7c85ee93 100755 --- a/nuttx/configs/sam3u-ek/nx/defconfig +++ b/nuttx/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/nuttx/configs/sam3u-ek/ostest/defconfig b/nuttx/configs/sam3u-ek/ostest/defconfig index e8321a896..82510c7d4 100755 --- a/nuttx/configs/sam3u-ek/ostest/defconfig +++ b/nuttx/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/nuttx/configs/sam3u-ek/touchscreen/defconfig b/nuttx/configs/sam3u-ek/touchscreen/defconfig index dc41a75ea..843ba06b4 100755 --- a/nuttx/configs/sam3u-ek/touchscreen/defconfig +++ b/nuttx/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/nuttx/configs/sim/mount/defconfig b/nuttx/configs/sim/mount/defconfig index be62a96de..0d61f7750 100644 --- a/nuttx/configs/sim/mount/defconfig +++ b/nuttx/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/nuttx/configs/sim/nettest/defconfig b/nuttx/configs/sim/nettest/defconfig index 643ee1c9f..bedbbbc23 100644 --- a/nuttx/configs/sim/nettest/defconfig +++ b/nuttx/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/nuttx/configs/sim/nsh2/defconfig b/nuttx/configs/sim/nsh2/defconfig index ce6563fe9..50c7adc5a 100644 --- a/nuttx/configs/sim/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/sim/nx/defconfig b/nuttx/configs/sim/nx/defconfig index de73491ab..ecf3da3b1 100644 --- a/nuttx/configs/sim/nx/defconfig +++ b/nuttx/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/nuttx/configs/sim/nx11/defconfig b/nuttx/configs/sim/nx11/defconfig index 1702045f3..c65fa3d36 100644 --- a/nuttx/configs/sim/nx11/defconfig +++ b/nuttx/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/nuttx/configs/sim/nxffs/defconfig b/nuttx/configs/sim/nxffs/defconfig index 7899f119d..c18a77a62 100644 --- a/nuttx/configs/sim/nxffs/defconfig +++ b/nuttx/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/nuttx/configs/sim/pashello/defconfig b/nuttx/configs/sim/pashello/defconfig index 56f6b8a32..d26e28add 100644 --- a/nuttx/configs/sim/pashello/defconfig +++ b/nuttx/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/nuttx/configs/sim/touchscreen/defconfig b/nuttx/configs/sim/touchscreen/defconfig index 25e047185..bfa9bcbad 100644 --- a/nuttx/configs/sim/touchscreen/defconfig +++ b/nuttx/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/nuttx/configs/skp16c26/ostest/defconfig b/nuttx/configs/skp16c26/ostest/defconfig index 40ff5b3a1..3cc34ca18 100644 --- a/nuttx/configs/skp16c26/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/RIDE/defconfig b/nuttx/configs/stm3210e-eval/RIDE/defconfig index ee2b68793..43b88084f 100755 --- a/nuttx/configs/stm3210e-eval/RIDE/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/buttons/defconfig b/nuttx/configs/stm3210e-eval/buttons/defconfig index 3c8fca222..81a1f3a52 100644 --- a/nuttx/configs/stm3210e-eval/buttons/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/composite/defconfig b/nuttx/configs/stm3210e-eval/composite/defconfig index c9504c516..6ead077f4 100755 --- a/nuttx/configs/stm3210e-eval/composite/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nsh/defconfig b/nuttx/configs/stm3210e-eval/nsh/defconfig index 718dcfa8a..af154810e 100755 --- a/nuttx/configs/stm3210e-eval/nsh/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nsh2/defconfig b/nuttx/configs/stm3210e-eval/nsh2/defconfig index 49d5dbf8c..d5e19733f 100644 --- a/nuttx/configs/stm3210e-eval/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nx/defconfig b/nuttx/configs/stm3210e-eval/nx/defconfig index 788fe7216..f4a3cb4e3 100644 --- a/nuttx/configs/stm3210e-eval/nx/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nxconsole/defconfig b/nuttx/configs/stm3210e-eval/nxconsole/defconfig index 9e7ed363f..ccfea526e 100644 --- a/nuttx/configs/stm3210e-eval/nxconsole/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nxlines/defconfig b/nuttx/configs/stm3210e-eval/nxlines/defconfig index 8832fb0b8..580b28019 100644 --- a/nuttx/configs/stm3210e-eval/nxlines/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/nxtext/defconfig b/nuttx/configs/stm3210e-eval/nxtext/defconfig index aa9284c5f..46a25103e 100644 --- a/nuttx/configs/stm3210e-eval/nxtext/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/ostest/defconfig b/nuttx/configs/stm3210e-eval/ostest/defconfig index 9e9a4e123..5fa10f497 100755 --- a/nuttx/configs/stm3210e-eval/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/pm/defconfig b/nuttx/configs/stm3210e-eval/pm/defconfig index 224953ec2..be0b25194 100644 --- a/nuttx/configs/stm3210e-eval/pm/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/usbserial/defconfig b/nuttx/configs/stm3210e-eval/usbserial/defconfig index 66069d5ad..bb9568ff2 100755 --- a/nuttx/configs/stm3210e-eval/usbserial/defconfig +++ b/nuttx/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/nuttx/configs/stm3210e-eval/usbstorage/defconfig b/nuttx/configs/stm3210e-eval/usbstorage/defconfig index b4d15ae8c..0d3034495 100755 --- a/nuttx/configs/stm3210e-eval/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/dhcpd/defconfig b/nuttx/configs/stm3220g-eval/dhcpd/defconfig index 627136ebb..fecf193d6 100644 --- a/nuttx/configs/stm3220g-eval/dhcpd/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/nettest/defconfig b/nuttx/configs/stm3220g-eval/nettest/defconfig index 39c1bb8ed..7df818c88 100644 --- a/nuttx/configs/stm3220g-eval/nettest/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/nsh/defconfig b/nuttx/configs/stm3220g-eval/nsh/defconfig index 7513abed8..fab3bfd16 100644 --- a/nuttx/configs/stm3220g-eval/nsh/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/nsh2/defconfig b/nuttx/configs/stm3220g-eval/nsh2/defconfig index f1417ef06..d14e7664e 100644 --- a/nuttx/configs/stm3220g-eval/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/ostest/defconfig b/nuttx/configs/stm3220g-eval/ostest/defconfig index fbd7a0c1b..dc23e0ab5 100644 --- a/nuttx/configs/stm3220g-eval/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm3220g-eval/telnetd/defconfig b/nuttx/configs/stm3220g-eval/telnetd/defconfig index 18ed2babb..5a0d96c6b 100644 --- a/nuttx/configs/stm3220g-eval/telnetd/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/dhcpd/defconfig b/nuttx/configs/stm3240g-eval/dhcpd/defconfig index 91682111b..a49e94ea3 100644 --- a/nuttx/configs/stm3240g-eval/dhcpd/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nettest/defconfig b/nuttx/configs/stm3240g-eval/nettest/defconfig index 257a4d252..0fdb75229 100644 --- a/nuttx/configs/stm3240g-eval/nettest/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh/defconfig b/nuttx/configs/stm3240g-eval/nsh/defconfig index 018aafdcf..47f1a4b4c 100644 --- a/nuttx/configs/stm3240g-eval/nsh/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nsh2/defconfig b/nuttx/configs/stm3240g-eval/nsh2/defconfig index 1c59b74a4..d62098eba 100644 --- a/nuttx/configs/stm3240g-eval/nsh2/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nxconsole/defconfig b/nuttx/configs/stm3240g-eval/nxconsole/defconfig index bd8be9f5d..bc9161d30 100644 --- a/nuttx/configs/stm3240g-eval/nxconsole/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/nxwm/defconfig b/nuttx/configs/stm3240g-eval/nxwm/defconfig index 34eaa9ec6..a7ac5e38c 100644 --- a/nuttx/configs/stm3240g-eval/nxwm/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/ostest/defconfig b/nuttx/configs/stm3240g-eval/ostest/defconfig index 87cafe778..7359f210a 100644 --- a/nuttx/configs/stm3240g-eval/ostest/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/telnetd/defconfig b/nuttx/configs/stm3240g-eval/telnetd/defconfig index faab76377..efc548d0b 100644 --- a/nuttx/configs/stm3240g-eval/telnetd/defconfig +++ b/nuttx/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/nuttx/configs/stm3240g-eval/webserver/defconfig b/nuttx/configs/stm3240g-eval/webserver/defconfig index f736a198b..85274ad4f 100644 --- a/nuttx/configs/stm3240g-eval/webserver/defconfig +++ b/nuttx/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/nuttx/configs/stm32f4discovery/pm/defconfig b/nuttx/configs/stm32f4discovery/pm/defconfig index 7a04e6557..5e3904365 100644 --- a/nuttx/configs/stm32f4discovery/pm/defconfig +++ b/nuttx/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/nuttx/configs/sure-pic32mx/nsh/defconfig b/nuttx/configs/sure-pic32mx/nsh/defconfig index a5977733c..c552dec22 100644 --- a/nuttx/configs/sure-pic32mx/nsh/defconfig +++ b/nuttx/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/nuttx/configs/sure-pic32mx/ostest/defconfig b/nuttx/configs/sure-pic32mx/ostest/defconfig index 52562f76a..86c4bbdd9 100644 --- a/nuttx/configs/sure-pic32mx/ostest/defconfig +++ b/nuttx/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/nuttx/configs/sure-pic32mx/usbnsh/defconfig b/nuttx/configs/sure-pic32mx/usbnsh/defconfig index 3ab4563e9..404decf12 100644 --- a/nuttx/configs/sure-pic32mx/usbnsh/defconfig +++ b/nuttx/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/nuttx/configs/teensy/hello/defconfig b/nuttx/configs/teensy/hello/defconfig index cc2b6c9c1..91305456d 100644 --- a/nuttx/configs/teensy/hello/defconfig +++ b/nuttx/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/nuttx/configs/teensy/nsh/defconfig b/nuttx/configs/teensy/nsh/defconfig index 0cc877731..7f332a3b0 100755 --- a/nuttx/configs/teensy/nsh/defconfig +++ b/nuttx/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/nuttx/configs/teensy/usbstorage/defconfig b/nuttx/configs/teensy/usbstorage/defconfig index 590a6f8bb..307c3e888 100755 --- a/nuttx/configs/teensy/usbstorage/defconfig +++ b/nuttx/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/nuttx/configs/twr-k60n512/nsh/defconfig b/nuttx/configs/twr-k60n512/nsh/defconfig index aaa1ea96f..704049400 100644 --- a/nuttx/configs/twr-k60n512/nsh/defconfig +++ b/nuttx/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/nuttx/configs/twr-k60n512/ostest/defconfig b/nuttx/configs/twr-k60n512/ostest/defconfig index 12eb4855d..fecbfd029 100644 --- a/nuttx/configs/twr-k60n512/ostest/defconfig +++ b/nuttx/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/nuttx/configs/ubw32/nsh/defconfig b/nuttx/configs/ubw32/nsh/defconfig index c9718ca8d..bb3babe31 100644 --- a/nuttx/configs/ubw32/nsh/defconfig +++ b/nuttx/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/nuttx/configs/us7032evb1/nsh/defconfig b/nuttx/configs/us7032evb1/nsh/defconfig index 5bf0bd71d..5d4e0632d 100644 --- a/nuttx/configs/us7032evb1/nsh/defconfig +++ b/nuttx/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/nuttx/configs/us7032evb1/ostest/defconfig b/nuttx/configs/us7032evb1/ostest/defconfig index 5b40baf88..2126cc930 100644 --- a/nuttx/configs/us7032evb1/ostest/defconfig +++ b/nuttx/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/nuttx/configs/vsn/nsh/defconfig b/nuttx/configs/vsn/nsh/defconfig index 1a59feb9e..35f787bfc 100755 --- a/nuttx/configs/vsn/nsh/defconfig +++ b/nuttx/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/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c index cae6f39b4..e894a1dd2 100644 --- a/nuttx/drivers/net/e1000.c +++ b/nuttx/drivers/net/e1000.c @@ -52,6 +52,7 @@ #include #include +#include #include #include diff --git a/nuttx/drivers/pwm.c b/nuttx/drivers/pwm.c index 62fb4d2fb..6e33c902b 100644 --- a/nuttx/drivers/pwm.c +++ b/nuttx/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/nuttx/drivers/sensors/lm75.c b/nuttx/drivers/sensors/lm75.c index 2d3346447..2884f29c6 100644 --- a/nuttx/drivers/sensors/lm75.c +++ b/nuttx/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/nuttx/drivers/sensors/qencoder.c b/nuttx/drivers/sensors/qencoder.c index a56adec9a..d9f3d7625 100644 --- a/nuttx/drivers/sensors/qencoder.c +++ b/nuttx/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/nuttx/drivers/usbdev/usbmsc.c b/nuttx/drivers/usbdev/usbmsc.c index 68b61814a..8dafbae5d 100644 --- a/nuttx/drivers/usbdev/usbmsc.c +++ b/nuttx/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/nuttx/fs/fat/fs_mkfatfs.c b/nuttx/fs/fat/fs_mkfatfs.c index 384aa9356..ed7ed2a66 100644 --- a/nuttx/fs/fat/fs_mkfatfs.c +++ b/nuttx/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/nuttx/fs/fs_closedir.c b/nuttx/fs/fs_closedir.c index cd499f539..6aeed03a5 100644 --- a/nuttx/fs/fs_closedir.c +++ b/nuttx/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/nuttx/fs/fs_fdopen.c b/nuttx/fs/fs_fdopen.c index 5d1c67c34..0e43876a1 100644 --- a/nuttx/fs/fs_fdopen.c +++ b/nuttx/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/nuttx/fs/fs_foreachinode.c b/nuttx/fs/fs_foreachinode.c index c5874c669..8d93825fd 100644 --- a/nuttx/fs/fs_foreachinode.c +++ b/nuttx/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/nuttx/fs/fs_opendir.c b/nuttx/fs/fs_opendir.c index 1c87c984d..c1f44a9d1 100644 --- a/nuttx/fs/fs_opendir.c +++ b/nuttx/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/nuttx/fs/mmap/fs_munmap.c b/nuttx/fs/mmap/fs_munmap.c index 5d9416d45..3088ac7d7 100644 --- a/nuttx/fs/mmap/fs_munmap.c +++ b/nuttx/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/nuttx/fs/mmap/fs_rammap.c b/nuttx/fs/mmap/fs_rammap.c index f43541cc9..8a75c3d61 100644 --- a/nuttx/fs/mmap/fs_rammap.c +++ b/nuttx/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/nuttx/fs/romfs/fs_romfsutil.c b/nuttx/fs/romfs/fs_romfsutil.c index 4857fb6d3..5a1d9a900 100644 --- a/nuttx/fs/romfs/fs_romfsutil.c +++ b/nuttx/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/nuttx/graphics/nxbe/nxbe_clipper.c b/nuttx/graphics/nxbe/nxbe_clipper.c index cdbd421c0..1c33dd243 100644 --- a/nuttx/graphics/nxbe/nxbe_clipper.c +++ b/nuttx/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/nuttx/graphics/nxbe/nxbe_colormap.c b/nuttx/graphics/nxbe/nxbe_colormap.c index e33877382..89e6baace 100644 --- a/nuttx/graphics/nxbe/nxbe_colormap.c +++ b/nuttx/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/nuttx/graphics/nxmu/nx_connect.c b/nuttx/graphics/nxmu/nx_connect.c index 4d91b54d5..2c14579ee 100644 --- a/nuttx/graphics/nxmu/nx_connect.c +++ b/nuttx/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/nuttx/graphics/nxmu/nx_eventhandler.c b/nuttx/graphics/nxmu/nx_eventhandler.c index 944bb12d1..815f9f583 100644 --- a/nuttx/graphics/nxmu/nx_eventhandler.c +++ b/nuttx/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/nuttx/graphics/nxmu/nx_kbdin.c b/nuttx/graphics/nxmu/nx_kbdin.c index b4b91298b..69d96ea91 100644 --- a/nuttx/graphics/nxmu/nx_kbdin.c +++ b/nuttx/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/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h index b9e02616c..311cedbc6 100644 --- a/nuttx/graphics/nxmu/nxfe.h +++ b/nuttx/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/nuttx/graphics/nxmu/nxmu_constructwindow.c b/nuttx/graphics/nxmu/nxmu_constructwindow.c index e5f6dcc9a..5392c28b7 100644 --- a/nuttx/graphics/nxmu/nxmu_constructwindow.c +++ b/nuttx/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/nuttx/graphics/nxmu/nxmu_kbdin.c b/nuttx/graphics/nxmu/nxmu_kbdin.c index 0308c2bfa..f156a4151 100644 --- a/nuttx/graphics/nxmu/nxmu_kbdin.c +++ b/nuttx/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/nuttx/graphics/nxsu/nx_close.c b/nuttx/graphics/nxsu/nx_close.c index b48a2fca2..c1b9d1537 100644 --- a/nuttx/graphics/nxsu/nx_close.c +++ b/nuttx/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/nuttx/graphics/nxsu/nx_open.c b/nuttx/graphics/nxsu/nx_open.c index 72a2db058..d8efcee41 100644 --- a/nuttx/graphics/nxsu/nx_open.c +++ b/nuttx/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/nuttx/graphics/nxsu/nx_openwindow.c b/nuttx/graphics/nxsu/nx_openwindow.c index 64f4ed76d..b002f1566 100644 --- a/nuttx/graphics/nxsu/nx_openwindow.c +++ b/nuttx/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/nuttx/graphics/nxsu/nxfe.h b/nuttx/graphics/nxsu/nxfe.h index 528224fc1..40c310d1a 100644 --- a/nuttx/graphics/nxsu/nxfe.h +++ b/nuttx/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/nuttx/graphics/nxsu/nxsu_constructwindow.c b/nuttx/graphics/nxsu/nxsu_constructwindow.c index f812b3f83..194a62106 100644 --- a/nuttx/graphics/nxsu/nxsu_constructwindow.c +++ b/nuttx/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/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index 2afe7166f..8f3a906bb 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/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/nuttx/include/nuttx/kmalloc.h b/nuttx/include/nuttx/kmalloc.h index 95ae33e32..6a9c0da5b 100644 --- a/nuttx/include/nuttx/kmalloc.h +++ b/nuttx/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/nuttx/include/stdio.h b/nuttx/include/stdio.h index 8796861a4..7a1b05270 100644 --- a/nuttx/include/stdio.h +++ b/nuttx/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); - -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 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); + +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/nuttx/libc/lib_internal.h b/nuttx/libc/lib_internal.h index 17adff417..76a37de0d 100644 --- a/nuttx/libc/lib_internal.h +++ b/nuttx/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/nuttx/libc/misc/lib_sendfile.c b/nuttx/libc/misc/lib_sendfile.c index 8a38dc317..f66c30918 100644 --- a/nuttx/libc/misc/lib_sendfile.c +++ b/nuttx/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/nuttx/libc/spawn/lib_psfa_addclose.c b/nuttx/libc/spawn/lib_psfa_addclose.c index 1c72f0f82..4f813f65c 100644 --- a/nuttx/libc/spawn/lib_psfa_addclose.c +++ b/nuttx/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/nuttx/libc/spawn/lib_psfa_adddup2.c b/nuttx/libc/spawn/lib_psfa_adddup2.c index deb3cbdb3..a10f476f1 100644 --- a/nuttx/libc/spawn/lib_psfa_adddup2.c +++ b/nuttx/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/nuttx/libc/spawn/lib_psfa_addopen.c b/nuttx/libc/spawn/lib_psfa_addopen.c index 66bbd813a..d9f5b849f 100644 --- a/nuttx/libc/spawn/lib_psfa_addopen.c +++ b/nuttx/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/nuttx/libc/spawn/lib_psfa_destroy.c b/nuttx/libc/spawn/lib_psfa_destroy.c index a21886645..d80dbd978 100644 --- a/nuttx/libc/spawn/lib_psfa_destroy.c +++ b/nuttx/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/nuttx/libc/stdio/lib_asprintf.c b/nuttx/libc/stdio/lib_asprintf.c index 20ca6de32..c08d7360a 100644 --- a/nuttx/libc/stdio/lib_asprintf.c +++ b/nuttx/libc/stdio/lib_asprintf.c @@ -40,6 +40,8 @@ #include #include +#include "lib_internal.h" + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/nuttx/libc/stdio/lib_libdtoa.c b/nuttx/libc/stdio/lib_libdtoa.c index 29f61fd76..a9a86817c 100644 --- a/nuttx/libc/stdio/lib_libdtoa.c +++ b/nuttx/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/nuttx/libc/string/lib_strdup.c b/nuttx/libc/string/lib_strdup.c index a5b3a1e8c..38eed709c 100644 --- a/nuttx/libc/string/lib_strdup.c +++ b/nuttx/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/nuttx/libxx/libxx_cxa_atexit.cxx b/nuttx/libxx/libxx_cxa_atexit.cxx index cd31f94f6..d7a82fe5b 100644 --- a/nuttx/libxx/libxx_cxa_atexit.cxx +++ b/nuttx/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/nuttx/libxx/libxx_delete.cxx b/nuttx/libxx/libxx_delete.cxx index d9203a228..4de6f338a 100644 --- a/nuttx/libxx/libxx_delete.cxx +++ b/nuttx/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/nuttx/libxx/libxx_deletea.cxx b/nuttx/libxx/libxx_deletea.cxx index e7cfee647..a25a60717 100644 --- a/nuttx/libxx/libxx_deletea.cxx +++ b/nuttx/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/nuttx/libxx/libxx_internal.hxx b/nuttx/libxx/libxx_internal.hxx index fe84c763e..74d5526ce 100644 --- a/nuttx/libxx/libxx_internal.hxx +++ b/nuttx/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/nuttx/libxx/libxx_new.cxx b/nuttx/libxx/libxx_new.cxx index 0563b6580..3158e8605 100644 --- a/nuttx/libxx/libxx_new.cxx +++ b/nuttx/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/nuttx/libxx/libxx_newa.cxx b/nuttx/libxx/libxx_newa.cxx index ad7806865..b5b280356 100644 --- a/nuttx/libxx/libxx_newa.cxx +++ b/nuttx/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/nuttx/mm/Kconfig b/nuttx/mm/Kconfig index 991972f32..57b039fa9 100644 --- a/nuttx/mm/Kconfig +++ b/nuttx/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/nuttx/mm/Makefile b/nuttx/mm/Makefile index 12a237bb7..baae6b4df 100644 --- a/nuttx/mm/Makefile +++ b/nuttx/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 += mm_kerneluser.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_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/nuttx/mm/kmm_addregion.c b/nuttx/mm/kmm_addregion.c deleted file mode 100644 index 979b285ed..000000000 --- a/nuttx/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/nuttx/mm/kmm_initialize.c b/nuttx/mm/kmm_initialize.c deleted file mode 100644 index c5f5df05d..000000000 --- a/nuttx/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/nuttx/mm/kmm_kfree.c b/nuttx/mm/kmm_kfree.c deleted file mode 100644 index c4e31ebfa..000000000 --- a/nuttx/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/nuttx/mm/kmm_kmalloc.c b/nuttx/mm/kmm_kmalloc.c deleted file mode 100644 index e2c347342..000000000 --- a/nuttx/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/nuttx/mm/kmm_krealloc.c b/nuttx/mm/kmm_krealloc.c deleted file mode 100644 index d5bebff38..000000000 --- a/nuttx/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/nuttx/mm/kmm_kzalloc.c b/nuttx/mm/kmm_kzalloc.c deleted file mode 100644 index 4775312c6..000000000 --- a/nuttx/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/nuttx/mm/kmm_semaphore.c b/nuttx/mm/kmm_semaphore.c deleted file mode 100644 index b391e5151..000000000 --- a/nuttx/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/nuttx/mm/mm_initialize.c b/nuttx/mm/mm_initialize.c index 8930f6190..6246cfc4b 100644 --- a/nuttx/mm/mm_initialize.c +++ b/nuttx/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/nuttx/mm/mm_kernel.c b/nuttx/mm/mm_kernel.c new file mode 100644 index 000000000..207d3e28f --- /dev/null +++ b/nuttx/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/nuttx/mm/mm_kerneluser.c b/nuttx/mm/mm_kerneluser.c new file mode 100644 index 000000000..da1f2716e --- /dev/null +++ b/nuttx/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/nuttx/mm/mm_user.c b/nuttx/mm/mm_user.c new file mode 100644 index 000000000..ed5ba5eb9 --- /dev/null +++ b/nuttx/mm/mm_user.c @@ -0,0 +1,155 @@ +/************************************************************************ + * mm/mm_user.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 + ************************************************************************/ + +/************************************************************************ + * Public Data + ************************************************************************/ + +/* This is the user heap */ + +struct mm_heap_s g_mmheap; + +/************************************************************************ + * Private Functions + ************************************************************************/ + +/************************************************************************ + * 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 + * function is exported from the user-space blob so that the kernel + * can manage the user-mode allocator. + * + * Parameters: + * None + * + * Return Value: + * OK on success; a negated errno on failure + * + ************************************************************************/ + +int umm_trysemaphore(void) +{ + return mm_trysemaphore(&g_mmheap); +} + +/************************************************************************ + * Name: umm_givesemaphore + * + * Description: + * 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 + * + * Return Value: + * OK on success; a negated errno on failure + * + ************************************************************************/ + +void umm_givesemaphore(void) +{ + mm_givesemaphore(&g_mmheap); +} + +#endif /* !CONFIG_NUTTX_KERNEL || !__KERNEL__ */ diff --git a/nuttx/mm/umm_addregion.c b/nuttx/mm/umm_addregion.c deleted file mode 100644 index 181723155..000000000 --- a/nuttx/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/nuttx/mm/umm_initialize.c b/nuttx/mm/umm_initialize.c deleted file mode 100644 index 13a1fe015..000000000 --- a/nuttx/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/nuttx/mm/umm_semaphore.c b/nuttx/mm/umm_semaphore.c deleted file mode 100644 index d554268ab..000000000 --- a/nuttx/mm/umm_semaphore.c +++ /dev/null @@ -1,99 +0,0 @@ -/************************************************************************ - * mm/umm_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__) - -/************************************************************************ - * Pre-processor definition - ************************************************************************/ - -/************************************************************************ - * Private Types - ************************************************************************/ - -/************************************************************************ - * Private Functions - ************************************************************************/ - -/************************************************************************ - * Public Functions - ************************************************************************/ - -/************************************************************************ - * Name: umm_trysemaphore - * - * Description: - * This is a simple wrapper for the mm_trysemaphore() function. - * - * Parameters: - * None - * - * Return Value: - * OK on success; a negated errno on failure - * - ************************************************************************/ - -int umm_trysemaphore(void) -{ - return mm_trysemaphore(&g_mmheap); -} - -/************************************************************************ - * Name: umm_givesemaphore - * - * Description: - * This is a simple wrapper for the mm_givesemaphore() function. - * - * Parameters: - * None - * - * Return Value: - * OK on success; a negated errno on failure - * - ************************************************************************/ - -void umm_givesemaphore(void) -{ - mm_givesemaphore(&g_mmheap); -} - -#endif /* !CONFIG_NUTTX_KERNEL || __KERNEL__ */ diff --git a/nuttx/net/uip/uip_igmpgroup.c b/nuttx/net/uip/uip_igmpgroup.c index b92db5476..a530f954c 100644 --- a/nuttx/net/uip/uip_igmpgroup.c +++ b/nuttx/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/nuttx/net/uip/uip_tcpbacklog.c b/nuttx/net/uip/uip_tcpbacklog.c index 459d54312..068e7a8eb 100644 --- a/nuttx/net/uip/uip_tcpbacklog.c +++ b/nuttx/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/nuttx/net/uip/uip_tcpreadahead.c b/nuttx/net/uip/uip_tcpreadahead.c index a304925a8..dadb809cc 100644 --- a/nuttx/net/uip/uip_tcpreadahead.c +++ b/nuttx/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/nuttx/sched/group_create.c b/nuttx/sched/group_create.c index 5f3867b72..f2f6ac179 100644 --- a/nuttx/sched/group_create.c +++ b/nuttx/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/nuttx/sched/os_bringup.c b/nuttx/sched/os_bringup.c index fbaad1a7a..97efd9b22 100644 --- a/nuttx/sched/os_bringup.c +++ b/nuttx/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/nuttx/sched/os_start.c b/nuttx/sched/os_start.c index 2e9991547..07c5394b4 100644 --- a/nuttx/sched/os_start.c +++ b/nuttx/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/nuttx/sched/sched_garbage.c b/nuttx/sched/sched_garbage.c index b8bec9399..0eaa19247 100644 --- a/nuttx/sched/sched_garbage.c +++ b/nuttx/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); + } } } } -- cgit v1.2.3