📄 regioninit.s.svn-base
字号:
;-------------------------------------------------------------------------------;-------------------------------------------------------------------------------;- This confidential and proprietary software may be used only as authorized --;- by a licensing agreement from STMicroelectronics. --;- In the event of publication, the following notice is applicable: --;- --;- (C) COPYRIGHT 2002 STMicroelectronics --;- Innovative Systems Design Group - Central R&D --;- ALL RIGHTS RESERVED --;- --;- The entire notice above must be reproduced on all authorized copies. --;- --;- -- File: regioninit.s --;- -- Author: Francesco Lertora <francesco.lertora@st.com> --;- -- Description: Codice per l'impostazione delle aree di memoria. --;- Versione PRICe --;- --;- -- Modification History: - 1.1 (23/09/2002) --;-------------------------------------------------------------------------------;-------------------------------------------------------------------------------; Warning....some SCoRE steps in the dark.... --;-------------------------------------------------------------------------------; $Id: regioninit.s,v 1.1 2005/05/26 15:51:47 sp_head Exp $; $Log: regioninit.s,v $; Revision 1.1 2005/05/26 15:51:47 sp_head; user NI;; Revision 1.1.1.2 2004/12/03 15:34:24 spear; First import from CRD;; Revision 1.1.1.1 2004/12/02 11:07:22 spear; First import from CRD;; ; Revision: 1.1 Mon Sep 23 21:59:13 2002 lert; First Check-In; This file contains the macro and supporting subroutines to; copy RO code and RW data from ROM to RAM and zero-initialize; the ZI data areas in RAM. AREA Macros, CODE, READONLYDESTINAZIONE EQU 0x44000 ;Base della Cache EXPORT InitRegions ;------------------------------------------------------------------------------;- MACRO macro_RWZI_Init ------------------------------------------------------;------------------------------------------------------------------------------; This macro:; a) copies RO code and/or RW data from ROM at Load$$area$$Base; to RAM at Image$$area$$Base, of length Image$$area$$Length bytes.; b) fills with zero the ZI data in RAM at Image$$area$$ZI$$Base, ; of length Image$$area$$ZI$$Length bytes. MACRO macro_RWZI_Init $areaname LCLS namecp LCLS copyloadsym LCLS copybasesym LCLS copylensym LCLS zibasesym LCLS zilensymnamecp SETS "$areaname"copyloadsym SETS "|Load$$":CC:namecp:CC:"$$Base|"copybasesym SETS "|Image$$":CC:namecp:CC:"$$Base|"copylensym SETS "|Image$$":CC:namecp:CC:"$$Length|"zibasesym SETS "|Image$$":CC:namecp:CC:"$$ZI$$Base|"zilensym SETS "|Image$$":CC:namecp:CC:"$$ZI$$Length|"; The following symbols are generated by the linker. They are imported ; WEAKly because they may not all have defined values. Those which are; undefined will take the value zero. IMPORT $copyloadsym, WEAK IMPORT $copybasesym, WEAK IMPORT $copylensym, WEAK IMPORT $zibasesym, WEAK IMPORT $zilensym, WEAK LDR r0, =$copyloadsym ; load address of region LDR r1, =$copybasesym ; execution address of region MOV r2, r1 ; copy execution address into r2 LDR r4, =$copylensym ADD r2, r2, r4 ; add region length to execution address to... ; ...calculate address of word beyond end... ; ... of execution region BL copy LDR r2, =$zilensym ; get length of ZI region LDR r0, =$zibasesym ; load base address of ZI region MOV r1, r0 ; copy base address of ZI region into r1 ADD r1, r1, r2 ; add region length to base address to... ; ...calculate address of word beyond end... ; ... of ZI region BL zi_init MEND;------------------------------------------------------------------------------;------------------------------------------------------------------------------; This macro:; copies RO code from ROM at Load$$area$$Base; Destination Address in Global Symbol 'DESTINAZIONE';------------------------------------------------------------------------------ MACRO macro_RO_COPY $areaname LCLS namecp LCLS copyloadsym LCLS copybasesym LCLS copylensymnamecp SETS "$areaname"copybasesym SETS "|Image$$":CC:namecp:CC:"$$Base|"copylensym SETS "|Image$$":CC:namecp:CC:"$$Length|" ; The following symbols are generated by the linker. They are imported ; WEAKly because they may not all have defined values. Those which are; undefined will take the value zero. IMPORT $copybasesym, WEAK IMPORT $copylensym, WEAK LDR r0, =$copybasesym ; R0 = INDIRIZZO PARTENZA SORGENTE LDR r1, =DESTINAZIONE ; R1 = INDIRIZZO PARTENZA DESTINAZIONE MOV r2, r1 ; calcolo indirizzo finale LDR r4, =$copylensym ADD r2, r2, r4 ; R2 = INDIRIZZO FINALE SORGENTE BL copy MEND; InitRegions is called from boot.s to initialize the specified execution regions.InitRegions STMFD sp!,{lr} macro_RWZI_Init SRAM LDMFD sp!,{pc}; --- copy and zi_init subroutines; copy is a subroutine which copies a region, from an address given by ; r0 to an address given by r1. The address of the word beyond the end; of this region is held in r2. r3 is used to hold the word being copied. copy CMP r1, r2 ; loop whilst r1 < r2 LDRLO r3, [r0], #4 STRLO r3, [r1], #4 BLO copy MOV pc, lr ; return from subroutine copy; zi_init is a subroutine which zero-initialises a region,; starting at the address in r0. The address of the word; beyond the end of this region is held in r1.zi_init MOV r2, #0 CMP r0, r1 ; loop whilst r0 < r1 STRLO r2, [r0], #4 BLO zi_init MOV pc, lr ; return from subroutine zi_init END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -