@ -252,39 +252,36 @@ l2_disabled:
lis r1 ,C O N F I G _ S Y S _ M O N I T O R _ B A S E @h
mtspr I V P R ,r1
lis r3 ,( C O N F I G _ S Y S _ M O N I T O R _ B A S E & 0 x f f f f ) @h
ori r3 ,r3 ,( C O N F I G _ S Y S _ M O N I T O R _ B A S E & 0 x f f f f ) @l
addi r4 ,r3 ,C r i t i c a l I n p u t - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,C r i t i c a l I n p u t @l
mtspr I V O R 0 ,r4 / * 0 : C r i t i c a l i n p u t * /
addi r4 ,r3 ,M a c h i n e C h e c k - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,M a c h i n e C h e c k @l
mtspr I V O R 1 ,r4 / * 1 : M a c h i n e c h e c k * /
addi r4 ,r3 ,D a t a S t o r a g e - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,D a t a S t o r a g e @l
mtspr I V O R 2 ,r4 / * 2 : D a t a s t o r a g e * /
addi r4 ,r3 ,I n s t S t o r a g e - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,I n s t S t o r a g e @l
mtspr I V O R 3 ,r4 / * 3 : I n s t r u c t i o n s t o r a g e * /
addi r4 ,r3 ,E x t I n t e r r u p t - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,E x t I n t e r r u p t @l
mtspr I V O R 4 ,r4 / * 4 : E x t e r n a l i n t e r r u p t * /
addi r4 ,r3 ,A l i g n m e n t - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,A l i g n m e n t @l
mtspr I V O R 5 ,r4 / * 5 : A l i g n m e n t * /
addi r4 ,r3 ,P r o g r a m C h e c k - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,P r o g r a m C h e c k @l
mtspr I V O R 6 ,r4 / * 6 : P r o g r a m c h e c k * /
addi r4 ,r3 ,F P U n a v a i l a b l e - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,F P U n a v a i l a b l e @l
mtspr I V O R 7 ,r4 / * 7 : f l o a t i n g p o i n t u n a v a i l a b l e * /
addi r4 ,r3 ,S y s t e m C a l l - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,S y s t e m C a l l @l
mtspr I V O R 8 ,r4 / * 8 : S y s t e m c a l l * /
/* 9: Auxiliary processor unavailable(unsupported) */
addi r4 ,r3 ,D e c r e m e n t e r - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,D e c r e m e n t e r @l
mtspr I V O R 1 0 ,r4 / * 1 0 : D e c r e m e n t e r * /
addi r4 ,r3 ,I n t e r v a l T i m e r - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,I n t e r v a l T i m e r @l
mtspr I V O R 1 1 ,r4 / * 1 1 : I n t e r v a l t i m e r * /
addi r4 ,r3 ,W a t c h d o g T i m e r - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,W a t c h d o g T i m e r @l
mtspr I V O R 1 2 ,r4 / * 1 2 : W a t c h d o g t i m e r * /
addi r4 ,r3 ,D a t a T L B E r r o r - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,D a t a T L B E r r o r @l
mtspr I V O R 1 3 ,r4 / * 1 3 : D a t a T L B e r r o r * /
addi r4 ,r3 ,I n s t r u c t i o n T L B E r r o r - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,I n s t r u c t i o n T L B E r r o r @l
mtspr I V O R 1 4 ,r4 / * 1 4 : I n s t r u c t i o n T L B e r r o r * /
addi r4 ,r3 ,D e b u g B r e a k p o i n t - _ s t a r t + _ S T A R T _ O F F S E T
li r4 ,D e b u g B r e a k p o i n t @l
mtspr I V O R 1 5 ,r4 / * 1 5 : D e b u g * /
# endif
@ -1121,7 +1118,7 @@ switch_as:
/*--------------------------------------------------------------*/
lis r3 ,C O N F I G _ S Y S _ M O N I T O R _ B A S E @h
ori r3 ,r3 ,C O N F I G _ S Y S _ M O N I T O R _ B A S E @l
addi r3 ,r3 ,_ s t a r t _ c o n t - _ s t a r t + _ S T A R T _ O F F S E T
addi r3 ,r3 ,_ s t a r t _ c o n t - _ s t a r t
mtlr r3
blr
# endif
@ -1165,7 +1162,6 @@ _start_cont:
/* NOTREACHED - board_init_f() does not return */
# ifndef M I N I M A L _ S P L
. = EXC_ O F F _ S Y S _ R E S E T
.globl _start_of_vectors
_start_of_vectors :
@ -1185,7 +1181,6 @@ _start_of_vectors:
STD_ E X C E P T I O N ( 0 x05 0 0 , E x t I n t e r r u p t , E x t I n t E x c e p t i o n )
/* Alignment exception. */
. = 0 x0 6 0 0
Alignment :
EXCEPTION_ P R O L O G ( S R R 0 , S R R 1 )
mfspr r4 ,D A R
@ -1193,21 +1188,20 @@ Alignment:
mfspr r5 ,D S I S R
stw r5 ,_ D S I S R ( r21 )
addi r3 ,r1 ,S T A C K _ F R A M E _ O V E R H E A D
EXC_ X F E R _ T E M P L A T E ( A l i g n m e n t , A l i g n m e n t E x c e p t i o n , M S R _ K E R N E L , C O P Y _ E E )
EXC_ X F E R _ T E M P L A T E ( 0 x60 0 , A l i g n m e n t , A l i g n m e n t E x c e p t i o n ,
MSR_ K E R N E L , C O P Y _ E E )
/* Program check exception */
. = 0 x0 7 0 0
ProgramCheck :
EXCEPTION_ P R O L O G ( S R R 0 , S R R 1 )
addi r3 ,r1 ,S T A C K _ F R A M E _ O V E R H E A D
EXC_ X F E R _ T E M P L A T E ( P r o g r a m C h e c k , P r o g r a m C h e c k E x c e p t i o n ,
EXC_ X F E R _ T E M P L A T E ( 0 x70 0 , P r o g r a m C h e c k , P r o g r a m C h e c k E x c e p t i o n ,
MSR_ K E R N E L , C O P Y _ E E )
/ * No F P U o n M P C 8 5 x x . T h i s e x c e p t i o n i s n o t s u p p o s e d t o h a p p e n .
* /
STD_ E X C E P T I O N ( 0 x08 0 0 , F P U n a v a i l a b l e , U n k n o w n E x c e p t i o n )
. = 0 x0 9 0 0
/ *
* r0 - S Y S C A L L n u m b e r
* r3 - . . . a r g u m e n t s
@ -1293,32 +1287,22 @@ _end_of_vectors:
* This c o d e f i n i s h e s s a v i n g t h e r e g i s t e r s t o t h e e x c e p t i o n f r a m e
* and j u m p s t o t h e a p p r o p r i a t e h a n d l e r f o r t h e e x c e p t i o n .
* Register r21 i s p o i n t e r i n t o t r a p f r a m e , r1 h a s n e w s t a c k p o i n t e r .
* r2 3 i s t h e a d d r e s s o f t h e h a n d l e r .
* /
.globl transfer_to_handler
transfer_to_handler :
stw r22 ,_ N I P ( r21 )
lis r22 ,M S R _ P O W @h
andc r23 ,r23 ,r22
stw r23 ,_ M S R ( r21 )
SAVE_ G P R ( 7 , r21 )
SAVE_ 4 G P R S ( 8 , r21 )
SAVE_ 8 G P R S ( 1 2 , r21 )
SAVE_ 8 G P R S ( 2 4 , r21 )
mflr r23
andi. r24 ,r23 ,0 x3 f00 / * g e t v e c t o r o f f s e t * /
stw r24 ,T R A P ( r21 )
li r22 ,0
stw r22 ,R E S U L T ( r21 )
mtspr S P R G 2 ,r22 / * r1 i s n o w k e r n e l s p * /
lwz r24 ,0 ( r23 ) / * v i r t u a l a d d r e s s o f h a n d l e r * /
lwz r23 ,4 ( r23 ) / * w h e r e t o g o w h e n d o n e * /
mtspr S R R 0 ,r24
mtspr S R R 1 ,r20
mtlr r23
SYNC
rfi / * j u m p t o h a n d l e r , e n a b l e M M U * /
mtctr r23 / * v i r t u a l a d d r e s s o f h a n d l e r * /
mtmsr r20
bctrl
int_return :
mfmsr r28 / * D i s a b l e i n t e r r u p t s * /
@ -1728,7 +1712,7 @@ relocate_code:
* initialization, n o w r u n n i n g f r o m R A M .
* /
addi r0 ,r10 ,i n _ r a m - _ s t a r t + _ S T A R T _ O F F S E T
addi r0 ,r10 ,i n _ r a m - _ s t a r t
/ *
* As I V P R i s g o i n g t o p o i n t R A M a d d r e s s ,
@ -1816,89 +1800,41 @@ 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 _ o f _ v e c t o r s )
lwz r8 ,G O T ( _ e n d _ o f _ v e c t o r s )
li r9 ,0 x10 0 / * r e s e t v e c t o r a l w a y s a t 0 x10 0 * /
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 * /
1 :
lwz r0 ,0 ( r7 )
stw r0 ,0 ( r9 )
addi r7 ,r7 ,4
addi r9 ,r9 ,4
cmplw 0 ,r7 ,r8
bne 1 b
/* Update IVORs as per relocation */
mtspr I V P R ,r3
/ *
* relocate ` h d l r ' a n d ` i n t _ r e t u r n ' e n t r i e s
* /
li r7 ,. L _ C r i t i c a l I n p u t - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ M a c h i n e C h e c k - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ D a t a S t o r a g e - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ I n s t S t o r a g e - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ E x t I n t e r r u p t - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ A l i g n m e n t - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ P r o g r a m C h e c k - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ F P U n a v a i l a b l e - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ D e c r e m e n t e r - _ s t a r t + _ S T A R T _ O F F S E T
bl t r a p _ r e l o c
li r7 ,. L _ I n t e r v a l T i m e r - _ s t a r t + _ S T A R T _ O F F S E T
li r8 ,_ e n d _ o f _ v e c t o r s - _ s t a r t + _ S T A R T _ O F F S E T
2 :
bl t r a p _ r e l o c
addi r7 ,r7 ,0 x10 0 / * n e x t e x c e p t i o n v e c t o r * /
cmplw 0 ,r7 ,r8
blt 2 b
/* Update IVORs as per relocated vector table address */
li r7 ,0 x01 0 0
mtspr I V O R 0 ,r7 / * 0 : C r i t i c a l i n p u t * /
li r7 ,0 x02 0 0
mtspr I V O R 1 ,r7 / * 1 : M a c h i n e c h e c k * /
li r7 ,0 x03 0 0
mtspr I V O R 2 ,r7 / * 2 : D a t a s t o r a g e * /
li r7 ,0 x04 0 0
mtspr I V O R 3 ,r7 / * 3 : I n s t r u c t i o n s t o r a g e * /
li r7 ,0 x05 0 0
mtspr I V O R 4 ,r7 / * 4 : E x t e r n a l i n t e r r u p t * /
li r7 ,0 x06 0 0
mtspr I V O R 5 ,r7 / * 5 : A l i g n m e n t * /
li r7 ,0 x07 0 0
mtspr I V O R 6 ,r7 / * 6 : P r o g r a m c h e c k * /
li r7 ,0 x08 0 0
mtspr I V O R 7 ,r7 / * 7 : f l o a t i n g p o i n t u n a v a i l a b l e * /
li r7 ,0 x09 0 0
mtspr I V O R 8 ,r7 / * 8 : S y s t e m c a l l * /
li r4 ,C r i t i c a l I n p u t @l
mtspr I V O R 0 ,r4 / * 0 : C r i t i c a l i n p u t * /
li r4 ,M a c h i n e C h e c k @l
mtspr I V O R 1 ,r4 / * 1 : M a c h i n e c h e c k * /
li r4 ,D a t a S t o r a g e @l
mtspr I V O R 2 ,r4 / * 2 : D a t a s t o r a g e * /
li r4 ,I n s t S t o r a g e @l
mtspr I V O R 3 ,r4 / * 3 : I n s t r u c t i o n s t o r a g e * /
li r4 ,E x t I n t e r r u p t @l
mtspr I V O R 4 ,r4 / * 4 : E x t e r n a l i n t e r r u p t * /
li r4 ,A l i g n m e n t @l
mtspr I V O R 5 ,r4 / * 5 : A l i g n m e n t * /
li r4 ,P r o g r a m C h e c k @l
mtspr I V O R 6 ,r4 / * 6 : P r o g r a m c h e c k * /
li r4 ,F P U n a v a i l a b l e @l
mtspr I V O R 7 ,r4 / * 7 : f l o a t i n g p o i n t u n a v a i l a b l e * /
li r4 ,S y s t e m C a l l @l
mtspr I V O R 8 ,r4 / * 8 : S y s t e m c a l l * /
/* 9: Auxiliary processor unavailable(unsupported) */
li r7 ,0 x0 a00
mtspr I V O R 1 0 ,r7 / * 1 0 : D e c r e m e n t e r * /
li r7 ,0 x0 b00
mtspr I V O R 1 1 ,r7 / * 1 1 : I n t e r v a l t i m e r * /
li r7 ,0 x0 c00
mtspr I V O R 1 2 ,r7 / * 1 2 : W a t c h d o g t i m e r * /
li r7 ,0 x0 d00
mtspr I V O R 1 3 ,r7 / * 1 3 : D a t a T L B e r r o r * /
li r7 ,0 x0 e 0 0
mtspr I V O R 1 4 ,r7 / * 1 4 : I n s t r u c t i o n T L B e r r o r * /
li r7 ,0 x0 f00
mtspr I V O R 1 5 ,r7 / * 1 5 : D e b u g * /
lis r7 ,0 x0
mtspr I V P R ,r7
mtlr r4 / * r e s t o r e l i n k r e g i s t e r * /
li r4 ,D e c r e m e n t e r @l
mtspr I V O R 1 0 ,r4 / * 1 0 : D e c r e m e n t e r * /
li r4 ,I n t e r v a l T i m e r @l
mtspr I V O R 1 1 ,r4 / * 1 1 : I n t e r v a l t i m e r * /
li r4 ,W a t c h d o g T i m e r @l
mtspr I V O R 1 2 ,r4 / * 1 2 : W a t c h d o g t i m e r * /
li r4 ,D a t a T L B E r r o r @l
mtspr I V O R 1 3 ,r4 / * 1 3 : D a t a T L B e r r o r * /
li r4 ,I n s t r u c t i o n T L B E r r o r @l
mtspr I V O R 1 4 ,r4 / * 1 4 : I n s t r u c t i o n T L B e r r o r * /
li r4 ,D e b u g B r e a k p o i n t @l
mtspr I V O R 1 5 ,r4 / * 1 5 : D e b u g * /
blr
.globl unlock_ram_in_cache