📄 regioninit.s.lst
字号:
ARM Macro Assembler Page 1
1 00000000 ;/******************************************************
*******************/
2 00000000 ;/* Copyright (c) 2001 Embedded Web Co., Lt
d. */
3 00000000 ;/*
*/
4 00000000 ;/* PROPRIETARY RIGHTS of Embedded Web are involved in t
he */
5 00000000 ;/* subject matter of this material. All manufacturing,
reproduction, */
6 00000000 ;/* use, and sales rights pertaining to this subject mat
ter are governed */
7 00000000 ;/* by the license agreement. The recipient of this sof
tware implicitly */
8 00000000 ;/* accepts the terms of the license.
*/
9 00000000 ;/*
*/
10 00000000 ;/******************************************************
*******************/
11 00000000 ;
12 00000000 ;/******************************************************
*******************/
13 00000000 ;/*
*/
14 00000000 ;/* FILE NAME
VERSION */
15 00000000 ;/*
*/
16 00000000 ;/* regioninit.s 1.
00.0 */
17 00000000 ;/*
*/
18 00000000 ;/* COMPONENT
*/
19 00000000 ;/*
*/
20 00000000 ;/*
*/
21 00000000 ;/* DESCRIPTION
*/
22 00000000 ;/*
*/
23 00000000 ;/* This file contains the macro and supporting subrout
ines to */
24 00000000 ;/* copy RO code and RW data from ROM to RAM and zero-i
nitialize */
25 00000000 ;/* the ZI data areas in RAM
*/
26 00000000 ;/*
*/
27 00000000 ;/* AUTHOR
*/
28 00000000 ;/*
*/
29 00000000 ;/* Cadmus Kim Embedded Web Co., Ltd.
*/
30 00000000 ;/*
*/
ARM Macro Assembler Page 2
31 00000000 ;/* DATA STRUCTURES
*/
32 00000000 ;/*
*/
33 00000000 ;/*
*/
34 00000000 ;/* FUNCTIONS
*/
35 00000000 ;/*
*/
36 00000000 ;/* macro_RWZI_Init
*/
37 00000000 ;/*
*/
38 00000000 ;/* DEPENDENCIES
*/
39 00000000 ;/*
*/
40 00000000 ;/*
*/
41 00000000 ;/* HISTORY
*/
42 00000000 ;/*
*/
43 00000000 ;/* NAME DATE REMA
RKS */
44 00000000 ;/*
*/
45 00000000 ;/* Cadmus Kim 08-16-2001 Created initial version 1.0
*/
46 00000000 ;/*
*/
47 00000000 ;/******************************************************
*******************/
48 00000000 ;
49 00000000 AREA Macros, CODE, READONLY
50 00000000
51 00000000 EXPORT InitRegions
52 00000000
53 00000000 ; This macro:
54 00000000 ; a) copies RO code and/or RW data from ROM at Load$$are
a$$Base
55 00000000 ; to RAM at Image$$area$$Base, of length Image$$area$$Le
ngth bytes.
56 00000000 ; b) fills with zero the ZI data in RAM at Image$$area$$
ZI$$Base,
57 00000000 ; of length Image$$area$$ZI$$Length bytes.
58 00000000
59 00000000 MACRO
60 00000000 macro_RWZI_Init
$areaname
61 00000000
62 00000000 LCLS namecp
63 00000000 LCLS copyloadsym
64 00000000 LCLS copybasesym
65 00000000 LCLS copylensym
66 00000000 LCLS zibasesym
67 00000000 LCLS zilensym
68 00000000
ARM Macro Assembler Page 3
69 00000000 namecp SETS "$areaname"
70 00000000
71 00000000 copyloadsym
SETS "|Load$$":CC:namecp:CC:"$$Base|"
72 00000000 copybasesym
SETS "|Image$$":CC:namecp:CC:"$$Base|"
73 00000000 copylensym
SETS "|Image$$":CC:namecp:CC:"$$Length|"
74 00000000 zibasesym
SETS "|Image$$":CC:namecp:CC:"$$ZI$$Base|"
75 00000000 zilensym
SETS "|Image$$":CC:namecp:CC:"$$ZI$$Length|"
76 00000000
77 00000000 ; The following symbols are generated by the linker. Th
ey are imported
78 00000000 ; WEAKly because they may not all have defined values. T
hose which are
79 00000000 ; undefined will take the value zero.
80 00000000
81 00000000 IMPORT $copyloadsym, WEAK
82 00000000 IMPORT $copybasesym, WEAK
83 00000000 IMPORT $copylensym, WEAK
84 00000000 IMPORT $zibasesym, WEAK
85 00000000 IMPORT $zilensym, WEAK
86 00000000
87 00000000
88 00000000 LDR r0, =$copyloadsym
; load address of region
89 00000000 LDR r1, =$copybasesym ; execution address of
region
90 00000000 MOV r2, r1 ; copy execution address int
o r2
91 00000000 LDR r4, =$copylensym
92 00000000 ADD r2, r2, r4 ; add region length to execu
tion
93 00000000 ; address to calculate address
94 00000000 ; of word beyond end of execution
95 00000000 ; region
96 00000000 BL copy
97 00000000
98 00000000 LDR r2, =$zilensym ; get length of ZI region
99 00000000 LDR r0, =$zibasesym ; load base address of Z
I region
100 00000000 MOV r1, r0 ; copy base address of ZI re
gion
101 00000000 ADD r1, r1, r2 ; into r1 add region length
to
102 00000000 ; base address to calculate
103 00000000 ; address of word beyond end of
104 00000000 ; ZI region
105 00000000 BL zi_init
106 00000000
107 00000000 MEND
108 00000000
109 00000000 ; InitRegions is called from boot.s to initialize the sp
ecified execution regions.
110 00000000 ; In this example, the regions are called SSRAM and SRAM
, to match the PID board.
ARM Macro Assembler Page 4
111 00000000 ; These execution region names should match those given
in the scatter description file.
112 00000000
113 00000000 InitRegions
114 00000000 E92D4000 STMFD sp!,{lr}
115 00000004 macro_RWZI_Init
SRAM
61 00000004
62 00000004 LCLS namecp
63 00000004 LCLS copyloadsym
64 00000004 LCLS copybasesym
65 00000004 LCLS copylensym
66 00000004 LCLS zibasesym
67 00000004 LCLS zilensym
68 00000004
69 00000004 SRAM namecp SETS "SRAM"
70 00000004
71 00000004 |Load$SRAM$Base|
copyloadsym
SETS "|Load$":CC:namecp:CC:"$Base|"
72 00000004 |Image$SRAM$Base|
copybasesym
SETS "|Image$":CC:namecp:CC:"$Base|"
73 00000004 |Image$SRAM$Length|
copylensym
SETS "|Image$":CC:namecp:CC:"$Length|"
74 00000004 |Image$SRAM$ZI$Base|
zibasesym
SETS "|Image$":CC:namecp:CC:"$ZI$Base|"
75 00000004 |Image$SRAM$ZI$Length|
zilensym
SETS "|Image$":CC:namecp:CC:"$ZI$Length|"
76 00000004
77 00000004 ; The following symbols are generated by the linker. Th
ey are imported
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -