📄 start.lst.svn-base
字号:
162 09a0 7C0FF120 mtcr r0
163 09a4 80010018 lwz r0, 24(r1)#restore xer
164 09a8 7C0103A6 mtxer r0
165 09ac 80010014 lwz r0, 20(r1)#restore ctr
166 09b0 7C0903A6 mtspr CTR, r0
167 09b4 80010008 lwz r0, 8(r1)#restore lr
168 09b8 7C0803A6 mtlr r0
169
170 09bc 7C7213A6 mtspr 82,r3 # clear recoverable bit,msr[RI]=0=msr[EE]
171 09c0 80010010 lwz r0,16(r1) #0=memory[1+16]
172 09c4 7C1B03A6 mtsrr1 r0 #s1=0
173 09c8 8001000C lwz r0,12(r1)
174 09cc 7C1A03A6 mtsrr0 r0 #restore s0
175 09d0 80810028 lwz r4,40(r1) #restore working regster
176 09d4 80610024 lwz r3,36(r1)
177 09d8 80010008 lwz r0,8(r1)
GAS LISTING /tmp/cc60KWFF.s page 10 178 09dc 38210050 addi r1,r1,80
179 09e0 4C000064 rfi
180
181 /* System Call
182 * Override the behavior by over-writing the handler code in RAM.
183 */
184 09e4 00000000 .org 0xC00
184 00000000 184 00000000 184 00000000 184 00000000 185 0c00 48000000 b _start
186
187 /* Trace
188 * Override the behavior by over-writing the handler code in RAM.
189 */
190 0c04 00000000 .org 0xD00
190 00000000 190 00000000 190 00000000 190 00000000 191 0d00 48000000 b _start
192
193 /* FP Assist
194 * Override the behavior by over-writing the handler code in RAM.
195 */
196 0d04 00000000 .org 0xE00
196 00000000 196 00000000 196 00000000 196 00000000 197 0e00 48000000 b _start
198
199 /* Performance Monitor
200 * Override the behavior by over-writing the handler code in RAM.
201 */
202 0e04 00000000 .org 0xF00
202 00000000 202 00000000 202 00000000 202 00000000 203 0f00 48000000 b _start
204
205 /* Software Emulation Instruction TLB Miss
206 * Override the behavior by over-writing the handler code in RAM.
207 */
208 0f04 00000000 .org 0x1000
208 00000000 208 00000000 208 00000000 208 00000000 209 1000 48000000 b _start
210
211 /* Instruction TLB Miss Data Load TLB Miss
212 * Override the behavior by over-writing the handler code in RAM.
213 */
214 1004 00000000 .org 0x1100
GAS LISTING /tmp/cc60KWFF.s page 11 214 00000000 214 00000000 214 00000000 214 00000000 215 1100 48000000 b _start
216
217 /* Data TLB Miss Data Store TLB Miss
218 * Override the behavior by over-writing the handler code in RAM.
219 */
220 1104 00000000 .org 0x1200
220 00000000 220 00000000 220 00000000 220 00000000 221 1200 48000000 b _start
222
223 /* Instruction TLB Error Instruction address breakpoint
224 * Override the behavior by over-writing the handler code in RAM.
225 */
226 1204 00000000 .org 0x1300
226 00000000 226 00000000 226 00000000 226 00000000 227 1300 48000000 b _start
228
229 /* Data TLB Error System management
230 * Override the behavior by over-writing the handler code in RAM.
231 */
232 1304 00000000 .org 0x1400
232 00000000 232 00000000 232 00000000 232 00000000 233 1400 48000000 b _start
234
235 /* Data breakpoint
236 * Override the behavior by over-writing the handler code in RAM.
237 */
238 1404 00000000 .org 0x1C00
238 00000000 238 00000000 238 00000000 238 00000000 239 1c00 48000000 b _start
240
241 /* Instruction breakpoint
242 * Override the behavior by over-writing the handler code in RAM.
243 */
244 1c04 00000000 .org 0x1D00
244 00000000 244 00000000 244 00000000 244 00000000 245 1d00 48000000 b _start
246
247
GAS LISTING /tmp/cc60KWFF.s page 12 248 /* Peripheral breakpoint
249 * Override the behavior by over-writing the handler code in RAM.
250 */
251 1d04 00000000 .org 0x1E00
251 00000000 251 00000000 251 00000000 251 00000000 252 1e00 48000000 b _start
253
254 /* Non-maskable development port
255 * Override the behavior by over-writing the handler code in RAM.
256 */
257 1e04 00000000 .org 0x1F00
257 00000000 257 00000000 257 00000000 257 00000000 258 1f00 48000000 b _start
259
260 .globl _end_of_vectors
261 _end_of_vectors:
262 1f04 00000000 .=0x2000 /*Maybe other*/
262 00000000 262 00000000 262 00000000 262 00000000 263
264
/*
265 * void relocate_code (addr_sp, des_addr)
266 *
267 * This "function" does not return, instead it continues in RAM
268 * after relocating the code.
269 *
270 * r3 = dest
271 * r4 = src
272 * r5 = length in bytes
273 */
274 .globl relocate_code
275 relocate_code:
276
277 /*Set new stack pointer in RAM*/
278 mr r1, r3
279
280 2000 7C611B78 /*Save copy of destination address in RAM*/
281 mr r3, r4
282
283 2004 7C832378 /*Source address*/
284 lis r4, CFG_FLASH_BASE@h
285 ori r4, r4, CFG_FLASH_BASE@l
286 2008 3C800000
287 200c 60840000 /*???How can I get the length of code??? Assume that r5 is the length.
288 * Assume that init_end is the end of the code which will be defined in
289 * the linker file.
290 */
291 lis r5, init_end@h
292 ori r5, r5, init_end@l
GAS LISTING /tmp/cc60KWFF.s page 13 293 2010 3CA00000 sub r5, r5, r4
294 2014 60A50000
295 2018 7CA42850 /* Now relocate code */
296 cmplw cr1, r3, r4
297 addi r0, r5, 3 /*Set the immr register, 638 is its number*/
298 201c 7C832040 lis r3, CFG_IMMR_SET@h
299 2020 38050003 ori r3, r3, CFG_IMMR_SET@l
300 2024 3C600000 mtspr IMMR, r3
301 2028 60630800 srwi. r0, r0, 2
302 202c 7C7E9BA6 beq cr1, 4f /* In place copy is not necessary */
303 2030 5400F0BF beq 4f /* Protect against 0 count */
304 2034 41860040 mtctr r0
305 2038 4182003C bge cr1, 2f
306 203c 7C0903A6
307 2040 4084001C la r8, -4(r4)
308 la r7, -4(r3)
309 2044 3904FFFC 1: lwzu r0, 4(r8)
310 2048 38E3FFFC stwu r0, 4(r7)
311 204c 84080004 bdnz 1b
312 2050 94070004 b 4f
313 2054 4200FFF8
314 2058 4800001C 2: slwi r0, r0, 2
315 add r8, r4, r0
316 205c 5400103A add r7, r3, r0
317 2060 7D040214 3: lwzu r0, -4(r8)
318 2064 7CE30214 stwu r0, -4(r7)
319 2068 8408FFFC bdnz 3b
320 206c 9407FFFC
321 2070 4200FFF8 4: sync
322 isync
323 2074 7C0004AC
324 2078 4C00012C /* We are done. Do not return, instead branch to OS initialization, now
325 * running from RAM.
326 */
327 lis r3, jump2OS@h
328 ori r3, r3, jump2OS@l
329 207c 3C600000 mtlr r3
330 2080 60630000 blrl
331 2084 7C6803A6
332 2088 4E800021 /*Interrupt handler, add your code here*/ 333 .globl Interrupt_ESR
334 Interrupt_ESR:
335
336 /*OSTimeTick()*/ 337 .globl OSTimeTick
338 OSTimeTick:
339
340
341 /*jump to entry point of OS*/ 342 .globl jump2OS
343
344 jump2OS: 345
346 lis r3, test@ha
347 addi r3, r3, test@l
348 208c 3C600000 mtlr r3
349 2090 38630000 blrl
GAS LISTING /tmp/cc60KWFF.s page 14 350 2094 7C6803A6
351 2098 4E800021
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -