arch: cxd56xx: Introduce cxd56_modtext.c

Summary:
- This commit introduces cxd56_modtext.c to allocate a separate
  text memory for ELF

Impact:
- None

Testing:
- Tested with spresense:elf

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2021-06-03 06:25:30 +09:00 committed by Xiang Xiao
parent 588deffb6c
commit 8c97db37e0
2 changed files with 75 additions and 0 deletions

View File

@ -97,6 +97,10 @@ CHIP_CSRCS += cxd56_testset.c
endif endif
endif endif
ifeq ($(CONFIG_ARCH_USE_MODULE_TEXT), y)
CHIP_CSRCS += cxd56_modtext.c
endif
ifeq ($(CONFIG_CXD56_UART0),y) ifeq ($(CONFIG_CXD56_UART0),y)
CHIP_CSRCS += cxd56_uart0.c CHIP_CSRCS += cxd56_uart0.c
endif endif

View File

@ -0,0 +1,71 @@
/****************************************************************************
* arch/arm/src/cxd56xx/cxd56_modtext.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>
/****************************************************************************
* Public Functions
****************************************************************************/
/****************************************************************************
* Name: up_module_text_init()
****************************************************************************/
void up_module_text_init()
{
}
/****************************************************************************
* Name: up_module_text_memalign()
****************************************************************************/
FAR void *up_module_text_memalign(size_t align, size_t size)
{
FAR void *ret;
ret = (FAR void *)kmm_malloc(size);
#ifdef CONFIG_CXD56_USE_SYSBUS
ret -= 0x20000000;
#endif
return ret;
}
/****************************************************************************
* Name: up_module_text_free()
****************************************************************************/
void up_module_text_free(FAR void *p)
{
kmm_free(p);
}