2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2021-03-08 22:39:04 +01:00
|
|
|
* arch/arm/src/dm320/dm320_allocateheap.c
|
2007-04-28 21:39:18 +02:00
|
|
|
*
|
2021-03-24 09:18:50 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2007-04-28 21:39:18 +02:00
|
|
|
*
|
2021-03-24 09:18:50 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-04-28 21:39:18 +02:00
|
|
|
*
|
2021-03-24 09:18:50 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2007-04-28 21:39:18 +02:00
|
|
|
*
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2007-04-28 21:39:18 +02:00
|
|
|
* Included Files
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <debug.h>
|
2009-12-28 01:49:32 +01:00
|
|
|
|
2007-04-28 21:39:18 +02:00
|
|
|
#include <nuttx/arch.h>
|
2015-02-28 00:19:38 +01:00
|
|
|
#include <nuttx/board.h>
|
2009-12-28 01:49:32 +01:00
|
|
|
#include <arch/board/board.h>
|
|
|
|
|
2009-12-28 23:49:08 +01:00
|
|
|
#include "chip.h"
|
2020-05-01 03:20:29 +02:00
|
|
|
#include "arm_arch.h"
|
|
|
|
#include "arm_internal.h"
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2015-04-08 16:04:12 +02:00
|
|
|
* Pre-processor Definitions
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2007-04-28 21:39:18 +02:00
|
|
|
* Private Data
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2007-04-28 21:39:18 +02:00
|
|
|
* Private Functions
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2007-04-28 21:39:18 +02:00
|
|
|
* Public Functions
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
2015-10-03 01:42:29 +02:00
|
|
|
/****************************************************************************
|
2007-04-28 21:39:18 +02:00
|
|
|
* Name: up_allocate_heap
|
|
|
|
*
|
|
|
|
* Description:
|
2013-03-09 22:12:20 +01:00
|
|
|
* This function will be called to dynamically set aside
|
|
|
|
* the heap region.
|
|
|
|
*
|
2014-08-29 22:47:22 +02:00
|
|
|
* For the kernel build (CONFIG_BUILD_KERNEL=y) with both
|
2013-03-09 22:12:20 +01:00
|
|
|
* 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().
|
2007-04-28 21:39:18 +02:00
|
|
|
*
|
2015-10-03 01:42:29 +02:00
|
|
|
****************************************************************************/
|
2007-04-28 21:39:18 +02:00
|
|
|
|
|
|
|
void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
|
|
|
{
|
2015-11-01 16:07:06 +01:00
|
|
|
board_autoled_on(LED_HEAPALLOCATE);
|
2015-10-07 01:28:32 +02:00
|
|
|
*heap_start = (FAR void *)g_idle_topstack;
|
2013-07-26 18:09:17 +02:00
|
|
|
*heap_size = (DM320_SDRAM_VADDR + CONFIG_RAM_SIZE) - g_idle_topstack;
|
2007-04-28 21:39:18 +02:00
|
|
|
}
|