up_addregion should use kmm_addregion; move garbage kmm*.c file to mm/. for now
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5721 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
9402f13edc
commit
81353c7a76
@ -1,7 +1,7 @@
|
||||
/************************************************************
|
||||
* up_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -38,11 +38,14 @@
|
||||
************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sched.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "os_internal.h"
|
||||
#include "up_internal.h"
|
||||
#include "up_mem.h"
|
||||
@ -84,6 +87,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
void up_addregion(void)
|
||||
{
|
||||
mm_addregion((FAR void*)UP_HEAP2_BASE, UP_HEAP2_END - UP_HEAP2_BASE);
|
||||
kmm_addregion((FAR void*)UP_HEAP2_BASE, UP_HEAP2_END - UP_HEAP2_BASE);
|
||||
}
|
||||
#endif
|
||||
|
@ -42,7 +42,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
@ -96,7 +96,6 @@ void up_addregion(void)
|
||||
/* Configure the RHEA bridge with some sane default values */
|
||||
calypso_rhea_cfg(0, 0, 0xff, 0, 1, 0, 0);
|
||||
|
||||
mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
|
||||
kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
@ -2,7 +2,7 @@
|
||||
* arch/arm/src/imx/imx_allocateheap.c
|
||||
* arch/arm/src/chip/imx_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -44,7 +44,7 @@
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
@ -105,14 +105,14 @@ void up_addregion(void)
|
||||
# if (CONFIG_DRAM_NUTTXENTRY & 0xffff0000) != CONFIG_DRAM_VSTART
|
||||
uint32_t start = CONFIG_DRAM_VSTART + 0x1000;
|
||||
uint32_t end = (CONFIG_DRAM_NUTTXENTRY & 0xffff0000);
|
||||
mm_addregion((FAR void*)start, end - start);
|
||||
kmm_addregion((FAR void*)start, end - start);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Check for any additional memory regions */
|
||||
|
||||
#if defined(CONFIG_HEAP2_BASE) && defined(CONFIG_HEAP2_SIZE)
|
||||
mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc17xx/lpc17_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2010-2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010-2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -224,7 +224,7 @@ void up_addregion(void)
|
||||
|
||||
/* Yes... Add the AHB SRAM heap region. */
|
||||
|
||||
mm_addregion((FAR void*)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE);
|
||||
kmm_addregion((FAR void*)LPC17_AHB_HEAPBASE, LPC17_AHB_HEAPSIZE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/************************************************************************
|
||||
* arch/arm/src/lpc31xx/lpc31_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2010, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -43,6 +43,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "arm.h"
|
||||
@ -192,15 +193,15 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
void up_addregion(void)
|
||||
{
|
||||
#if defined(CONFIG_ARCH_EXTSRAM0) && defined(CONFIG_ARCH_EXTSRAM0HEAP)
|
||||
mm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_ARCH_EXTSRAM0SIZE);
|
||||
kmm_addregion((FAR void*)LPC31_EXTSRAM0_VSECTION, CONFIG_ARCH_EXTSRAM0SIZE);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_EXTSRAM1) && defined(CONFIG_ARCH_EXTSRAM1HEAP)
|
||||
mm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_ARCH_EXTSRAM1SIZE);
|
||||
kmm_addregion((FAR void*)LPC31_EXTSRAM1_VSECTION, CONFIG_ARCH_EXTSRAM1SIZE);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_EXTDRAM) && defined(CONFIG_ARCH_EXTDRAMHEAP)
|
||||
mm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_ARCH_EXTDRAMSIZE);
|
||||
kmm_addregion((FAR void*)LPC31_EXTSDRAM_VSECTION, CONFIG_ARCH_EXTDRAMSIZE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/lpc43xx/lpc43_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -43,7 +43,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
@ -259,7 +259,7 @@ void up_addregion(void)
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
/* Add the next SRAM region (which should exist) */
|
||||
|
||||
mm_addregion((FAR void*)MM_REGION2_BASE, MM_REGION2_SIZE);
|
||||
kmm_addregion((FAR void*)MM_REGION2_BASE, MM_REGION2_SIZE);
|
||||
|
||||
#ifdef MM_REGION3_BASE
|
||||
/* Add the third SRAM region (which will not exist in configuration B) */
|
||||
@ -267,12 +267,12 @@ void up_addregion(void)
|
||||
#if CONFIG_MM_REGIONS > 2
|
||||
/* Add the third SRAM region (which may not exist) */
|
||||
|
||||
mm_addregion((FAR void*)MM_REGION3_BASE, MM_REGION3_SIZE);
|
||||
kmm_addregion((FAR void*)MM_REGION3_BASE, MM_REGION3_SIZE);
|
||||
|
||||
#if CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE)
|
||||
/* Add the DMA region (which may not be available) */
|
||||
|
||||
mm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
|
||||
kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
|
||||
|
||||
#endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */
|
||||
#endif /* CONFIG_MM_REGIONS > 2 */
|
||||
@ -281,7 +281,7 @@ void up_addregion(void)
|
||||
#if CONFIG_MM_REGIONS > 2 && defined(MM_DMAHEAP_BASE)
|
||||
/* Add the DMA region (which may not be available) */
|
||||
|
||||
mm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
|
||||
kmm_addregion((FAR void*)MM_DMAHEAP_BASE, MM_DMAHEAP_SIZE);
|
||||
|
||||
#endif /* CONFIG_MM_REGIONS > 3 && defined(MM_DMAHEAP_BASE) */
|
||||
#endif /* MM_REGION3_BASE */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/common/sam3u_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32/up_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -43,7 +43,7 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
@ -385,13 +385,13 @@ void up_addregion(void)
|
||||
/* Add the STM32F20xxx/STM32F40xxx CCM SRAM heap region. */
|
||||
|
||||
#ifndef CONFIG_STM32_CCMEXCLUDE
|
||||
mm_addregion((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START);
|
||||
kmm_addregion((FAR void*)SRAM2_START, SRAM2_END-SRAM2_START);
|
||||
#endif
|
||||
|
||||
/* Add the external FSMC SRAM heap region. */
|
||||
|
||||
#ifdef CONFIG_STM32_FSMC_SRAM
|
||||
mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* common/up_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,8 +41,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip/chip.h"
|
||||
@ -107,6 +108,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
void up_addregion(void)
|
||||
{
|
||||
mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* common/up_allocateheap.c
|
||||
*
|
||||
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@ -41,8 +41,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/mm.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
@ -109,6 +110,6 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
|
||||
#if CONFIG_MM_REGIONS > 1
|
||||
void up_addregion(void)
|
||||
{
|
||||
mm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
kmm_addregion((FAR void*)CONFIG_HEAP2_BASE, CONFIG_HEAP2_SIZE);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user