arch/risc-v/esp32c3: Remove the up_textheap_init function since it's not
needed anymore. Implement the up_extraheaps_init function to initialize all separate heaps. Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
parent
fc9c320bd8
commit
add18b9592
@ -159,6 +159,7 @@ config ESP32C3_DISABLE_STDC_ATOMIC
|
|||||||
|
|
||||||
config ESP32C3_RTC_HEAP
|
config ESP32C3_RTC_HEAP
|
||||||
bool "Use the RTC memory as a separate heap"
|
bool "Use the RTC memory as a separate heap"
|
||||||
|
select ARCH_HAVE_EXTRA_HEAPS
|
||||||
default n
|
default n
|
||||||
|
|
||||||
menu "ESP32-C3 Peripheral Support"
|
menu "ESP32-C3 Peripheral Support"
|
||||||
|
@ -160,6 +160,10 @@ CHIP_CSRCS += esp32c3_efuse_table.c
|
|||||||
CHIP_CSRCS += esp32c3_efuse_lowerhalf.c
|
CHIP_CSRCS += esp32c3_efuse_lowerhalf.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CONFIG_ARCH_HAVE_EXTRA_HEAPS),y)
|
||||||
|
CHIP_CSRCS += esp32c3_extraheaps.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP),y)
|
ifeq ($(CONFIG_ARCH_USE_TEXT_HEAP),y)
|
||||||
CHIP_CSRCS += esp32c3_textheap.c
|
CHIP_CSRCS += esp32c3_textheap.c
|
||||||
endif
|
endif
|
||||||
|
62
arch/risc-v/src/esp32c3/esp32c3_extraheaps.c
Normal file
62
arch/risc-v/src/esp32c3/esp32c3_extraheaps.c
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* arch/risc-v/src/esp32c3/esp32c3_extraheaps.c
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <debug.h>
|
||||||
|
|
||||||
|
#include <nuttx/arch.h>
|
||||||
|
#include <nuttx/kmalloc.h>
|
||||||
|
|
||||||
|
#include "hardware/esp32c3_soc.h"
|
||||||
|
|
||||||
|
#ifdef CONFIG_ESP32C3_RTC_HEAP
|
||||||
|
#include "esp32c3_rtcheap.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_extraheaps_init
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Initialize any extra heap.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void up_extraheaps_init()
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_ESP32C3_RTC_HEAP
|
||||||
|
/* Initialize the RTC heap */
|
||||||
|
|
||||||
|
esp32c3_rtcheap_initialize();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
@ -49,19 +49,6 @@
|
|||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: up_textheap_init()
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
void up_textheap_init()
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_ESP32C3_RTC_HEAP
|
|
||||||
/* Initialize the RTC heap */
|
|
||||||
|
|
||||||
esp32c3_rtcheap_initialize();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_textheap_memalign()
|
* Name: up_textheap_memalign()
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user