summaryrefslogtreecommitdiff
path: root/nuttx/sched/os_start.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched/os_start.c')
-rw-r--r--nuttx/sched/os_start.c18
1 files changed, 14 insertions, 4 deletions
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 */