arch/risc-v: Don't declare riscv_addregion if CONFIG_MM_REGIONS is < 1.

Don't declare riscv_addregion if CONFIG_MM_REGIONS is < 1, so we won't
have to provide a dummy stub for every chip.
Also rename the function from up_addregion to riscv_addregion since it's
not exported outside the arch directory.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche
2021-02-01 19:03:49 +01:00
committed by Xiang Xiao
parent 778c805357
commit 37b93bd498
8 changed files with 61 additions and 20 deletions
+16 -8
View File
@@ -37,14 +37,6 @@ extern uint8_t _heap_size;
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_addregion
****************************************************************************/
void up_addregion(void)
{
}
/****************************************************************************
* Name: up_allocate_heap
*
@@ -65,3 +57,19 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
*heap_start = (FAR void *)&_heap_start;
*heap_size = (size_t)&_heap_size;
}
/****************************************************************************
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
* that may be used for heap.
*
****************************************************************************/
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
}
#endif
+1 -1
View File
@@ -114,7 +114,7 @@ void up_initialize(void)
/* Add any extra memory fragments to the memory manager */
up_addregion();
riscv_addregion();
#ifdef CONFIG_PM
/* Initialize the power management subsystem. This MCU-specific function
+6 -1
View File
@@ -172,7 +172,12 @@ void up_boot(void);
/* Memory allocation ********************************************************/
void up_addregion(void);
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void);
#else
# define riscv_addregion()
#endif
void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
/* IRQ initialization *******************************************************/
+9 -2
View File
@@ -45,9 +45,16 @@
****************************************************************************/
/****************************************************************************
* Name: up_addregion
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
* that may be used for heap.
*
****************************************************************************/
void up_addregion(void)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
}
#endif
+4 -2
View File
@@ -82,7 +82,7 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
}
/****************************************************************************
* Name: up_addregion
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
@@ -90,7 +90,9 @@ void up_allocate_heap(FAR void **heap_start, size_t *heap_size)
*
****************************************************************************/
void up_addregion(void)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
/* TODO: add L1 memorie */
}
#endif
+10 -2
View File
@@ -94,9 +94,17 @@ void up_allocate_kheap(FAR void **heap_start, size_t *heap_size)
#endif
/****************************************************************************
* Name: up_addregion
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
* that may be used for heap.
*
****************************************************************************/
void up_addregion(void)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
}
#endif
+10 -2
View File
@@ -33,9 +33,17 @@
****************************************************************************/
/****************************************************************************
* Name: up_addregion
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
* that may be used for heap.
*
****************************************************************************/
void up_addregion(void)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
}
#endif
+5 -2
View File
@@ -49,7 +49,7 @@
************************************************************************************/
/************************************************************************************
* Name: up_addregion
* Name: riscv_addregion
*
* Description:
* RAM may be added in non-contiguous chunks. This routine adds all chunks
@@ -57,6 +57,9 @@
*
************************************************************************************/
void up_addregion(void)
#if CONFIG_MM_REGIONS > 1
void riscv_addregion(void)
{
}
#endif