@ -56,7 +56,7 @@
/ *
* Set u p G O T : G l o b a l O f f s e t T a b l e
*
* Use r14 t o a c c e s s t h e G O T
* Use r12 t o a c c e s s t h e G O T
* /
START_ G O T
GOT_ E N T R Y ( _ G O T 2 _ T A B L E _ )
@ -650,7 +650,9 @@ init_debug:
/* RAM should now be operational */
# define V E C _ W R D _ C N T ( ( _ e n d _ o f _ v e c t o r s - _ s t a r t + E X C _ O F F _ S Y S _ R E S E T ) / 4 )
mflr r3
GET_ G O T
mtlr r3
lwz r3 , G O T ( _ e n d _ o f _ v e c t o r s )
rlwinm r4 , r3 , 0 , 1 8 , 3 1 / * _ e n d _ o f _ v e c t o r s & 0 x3 F F F * /
lis r5 , V E C _ W R D _ C N T @h
@ -792,6 +794,7 @@ relocate_code:
mr r9 , r4 / * S a v e c o p y o f G l o b a l D a t a p o i n t e r * /
mr r10 , r5 / * S a v e c o p y o f D e s t i n a t i o n A d d r e s s * /
GET_ G O T
mr r3 , r5 / * D e s t i n a t i o n A d d r e s s * /
lis r4 , C O N F I G _ S Y S _ M O N I T O R _ B A S E @h /* Source Address */
ori r4 , r4 , C O N F I G _ S Y S _ M O N I T O R _ B A S E @l
@ -809,7 +812,7 @@ relocate_code:
sub r15 , r10 , r4
/* First our own GOT */
add r14 , r14 , r15
add r12 , r12 , r15
/* then the one used by the C code */
add r30 , r30 , r15
@ -882,7 +885,7 @@ relocate_code:
in_ram :
/ *
* Relocation F u n c t i o n , r14 p o i n t t o g o t 2 + 0 x80 0 0
* Relocation F u n c t i o n , r12 p o i n t t o g o t 2 + 0 x80 0 0
*
* Adjust g o t 2 p o i n t e r s , n o n e e d t o c h e c k f o r 0 , t h i s c o d e
* already p u t s a f e w e n t r i e s i n t h e t a b l e .
@ -958,6 +961,8 @@ clear_bss:
* /
.globl trap_init
trap_init :
mflr r4 / * s a v e l i n k r e g i s t e r * /
GET_ G O T
lwz r7 , G O T ( _ s t a r t )
lwz r8 , G O T ( _ e n d _ o f _ v e c t o r s )
@ -965,8 +970,6 @@ trap_init:
cmplw 0 , r7 , r8
bgelr / * r e t u r n i f r7 > =r8 - j u s t i n c a s e * /
mflr r4 / * s a v e l i n k r e g i s t e r * /
1 :
lwz r0 , 0 ( r7 )
stw r0 , 0 ( r9 )