diff --git a/arch/risc-v/src/bl602/bl602_allocateheap.c b/arch/risc-v/src/bl602/bl602_allocateheap.c index 065c30cd9c1..4d41404c7de 100644 --- a/arch/risc-v/src/bl602/bl602_allocateheap.c +++ b/arch/risc-v/src/bl602/bl602_allocateheap.c @@ -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 + diff --git a/arch/risc-v/src/common/riscv_initialize.c b/arch/risc-v/src/common/riscv_initialize.c index 1fb5bc1c7d2..be180ba9912 100644 --- a/arch/risc-v/src/common/riscv_initialize.c +++ b/arch/risc-v/src/common/riscv_initialize.c @@ -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 diff --git a/arch/risc-v/src/common/riscv_internal.h b/arch/risc-v/src/common/riscv_internal.h index 34b850cec91..46c6d0b77fc 100644 --- a/arch/risc-v/src/common/riscv_internal.h +++ b/arch/risc-v/src/common/riscv_internal.h @@ -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 *******************************************************/ diff --git a/arch/risc-v/src/fe310/fe310_allocateheap.c b/arch/risc-v/src/fe310/fe310_allocateheap.c index a7ed59a75ad..9e7212a5280 100644 --- a/arch/risc-v/src/fe310/fe310_allocateheap.c +++ b/arch/risc-v/src/fe310/fe310_allocateheap.c @@ -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 diff --git a/arch/risc-v/src/gap8/gap8_allocateheap.c b/arch/risc-v/src/gap8/gap8_allocateheap.c index 687cbdbf798..5eb590926fa 100644 --- a/arch/risc-v/src/gap8/gap8_allocateheap.c +++ b/arch/risc-v/src/gap8/gap8_allocateheap.c @@ -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 diff --git a/arch/risc-v/src/k210/k210_allocateheap.c b/arch/risc-v/src/k210/k210_allocateheap.c index e2f420e9bc7..a88ee4c1348 100644 --- a/arch/risc-v/src/k210/k210_allocateheap.c +++ b/arch/risc-v/src/k210/k210_allocateheap.c @@ -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 + diff --git a/arch/risc-v/src/litex/litex_allocateheap.c b/arch/risc-v/src/litex/litex_allocateheap.c index 2edc5bab0c5..7349cc7e804 100644 --- a/arch/risc-v/src/litex/litex_allocateheap.c +++ b/arch/risc-v/src/litex/litex_allocateheap.c @@ -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 + diff --git a/arch/risc-v/src/nr5m100/nr5_allocateheap.c b/arch/risc-v/src/nr5m100/nr5_allocateheap.c index dc1fcbc974c..2cba18a8c5d 100644 --- a/arch/risc-v/src/nr5m100/nr5_allocateheap.c +++ b/arch/risc-v/src/nr5m100/nr5_allocateheap.c @@ -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 +