📄 kev75401_relocate_init.c
字号:
/***********************************************************************
* $Workfile: board_relocate_init.c $
* $Revision: 1.0 $
* $Author: AnvikE $
* $Date: Jul 03 2003 17:32:14 $
*
* Project: kev75401 BSP (board support package)
*
* Description:
*
*
* Revision History:
* $Log:
***********************************************************************
*
* Copyright (c) 2002 Sharp Microelectronics of the Americas
*
* All rights reserved
*
* SHARP MICROELECTRONICS OF THE AMERICAS MAKES NO REPRESENTATION
* OR WARRANTIES WITH RESPECT TO THE PERFORMANCE OF THIS SOFTWARE,
* AND SPECIFICALLY DISCLAIMS ANY RESPONSIBILITY FOR ANY DAMAGES,
* SPECIAL OR CONSEQUENTIAL, CONNECTED WITH THE USE OF THIS SOFTWARE.
*
* SHARP MICROELECTRONICS OF THE AMERICAS PROVIDES THIS SOFTWARE SOLELY
* FOR THE PURPOSE OF SOFTWARE DEVELOPMENT INCORPORATING THE USE OF A
* SHARP MICROCONTROLLER OR SYSTEM-ON-CHIP PRODUCT. USE OF THIS SOURCE
* FILE IMPLIES ACCEPTANCE OF THESE CONDITIONS.
*
**********************************************************************/
#include "kev75401_relocate.h"
/* external linker symbols - see crt0 for details */
/* first load region */
extern int load_sram_base;
/* first text section */
extern int text_sram_start;
extern int text_sram_end;
/* first data section */
extern int data_sram_start;
extern int data_sram_end;
/* first bss section */
extern int bss_sram_start;
extern int bss_sram_end;
/* second load region */
extern int load_fram_base;
/* second text section */
extern int text_fram_start;
extern int text_fram_end;
/* second data section */
extern int data_fram_start;
extern int data_fram_end;
/* second bss section */
extern int bss_fram_start;
extern int bss_fram_end;
/************************************************************************
*
* Function: relocate_init
*
* Purpose:
* Sets up the segment table - note this is defined by the user.
*
* Processing:
*
* Parameters:
* None
*
* Outputs:
* None
*
* Returns:
* None
*
* Notes:
* see the linker script for section details.
*
************************************************************************/
void relocate_init (void)
{
SECTIONS_T sections;
int* dst = (int*)TBUF_ADDR;
int* end = (int*)(TBUF_ADDR+sizeof(sections));
int* src = (int*)§ions;
/* Set up the section for the first text region */
sections.text[0].load_baddr = load_sram_base;
sections.text[0].exec_baddr = text_sram_start;
sections.text[0].exec_eaddr = text_sram_end;
/* Set up the section for the first data region */
sections.data[0].load_baddr = load_sram_base+
(data_sram_start-text_sram_start);
sections.data[0].exec_baddr = data_sram_start;
sections.data[0].exec_eaddr = data_sram_end;
/* Set up the section for the first bss region */
sections.bss[0].exec_baddr = bss_sram_start;
sections.bss[0].exec_eaddr = bss_sram_end;
/* Set up the section for the second text region */
sections.text[1].load_baddr = load_fram_base;
sections.text[1].exec_baddr = text_fram_start;
sections.text[1].exec_eaddr = text_fram_end;
/* Set up the section for the second data region */
sections.data[1].load_baddr = load_fram_base+
(data_fram_start-text_fram_start);
sections.data[1].exec_baddr = data_fram_start;
sections.data[1].exec_eaddr = data_fram_end;
/* Set up the section for the second bss region */
sections.bss[1].exec_baddr = bss_fram_start;
sections.bss[1].exec_eaddr = bss_fram_end;
/* copy the config structure to a temporary memory location */
mmove (dst, end, src);
}
/* EOF */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -