2005-11-07 00:59:12 -08:00
/ *
* arch/ s39 0 / k e r n e l / h e a d31 . S
*
2006-06-29 14:58:17 +02:00
* Copyright ( C ) I B M C o r p . 2 0 0 5 ,2 0 0 6
2005-11-07 00:59:12 -08:00
*
* Author( s ) : H a r t m u t P e n n e r < h p @de.ibm.com>
* Martin S c h w i d e f s k y < s c h w i d e f s k y @de.ibm.com>
* Rob v a n d e r H e i j < r v d h e i @iae.nl>
* Heiko C a r s t e n s < h e i k o . c a r s t e n s @de.ibm.com>
*
* /
2006-06-29 14:58:17 +02:00
.org 0x11000
startup_continue :
basr % r13 ,0 # g e t b a s e
2008-12-25 13:39:19 +01:00
.LPG1 :
mvi _ _ L C _ A R _ M O D E _ I D ,0 # s e t E S A f l a g ( m o d e 0 )
2005-11-07 00:59:12 -08:00
lctl % c0 ,% c15 ,. L c t l - . L P G 1 ( % r13 ) # l o a d c o n t r o l r e g i s t e r s
2006-06-29 14:58:17 +02:00
l % r12 ,. L p a r m a d d r - . L P G 1 ( % r13 ) # p o i n t e r t o p a r a m e t e r a r e a
# move I P L d e v i c e t o l o w c o r e
2006-09-20 15:59:15 +02:00
#
# Setup s t a c k
#
l % r15 ,. L i n i t t u - . L P G 1 ( % r13 )
2009-09-11 10:28:58 +02:00
st % r15 ,_ _ L C _ T H R E A D _ I N F O # c a c h e t h r e a d i n f o i n l o w c o r e
2006-09-20 15:59:15 +02:00
mvc _ _ L C _ C U R R E N T ( 4 ) ,_ _ T I _ t a s k ( % r15 )
ahi % r15 ,1 < < ( P A G E _ S H I F T + T H R E A D _ O R D E R ) # i n i t _ t a s k _ u n i o n + T H R E A D _ S I Z E
st % r15 ,_ _ L C _ K E R N E L _ S T A C K # s e t e n d o f k e r n e l s t a c k
ahi % r15 ,- 9 6
2005-11-07 00:59:12 -08:00
#
2007-02-05 21:18:24 +01:00
# Save i p l p a r a m e t e r s , c l e a r b s s m e m o r y , i n i t i a l i z e s t o r a g e k e y f o r k e r n e l p a g e s ,
# and c r e a t e a k e r n e l N S S i f t h e S A V E S Y S = p a r m i s d e f i n e d
2005-11-07 00:59:12 -08:00
#
2007-02-05 21:18:24 +01:00
l % r14 ,. L s t a r t u p _ i n i t - . L P G 1 ( % r13 )
basr % r14 ,% r14
2005-11-07 00:59:12 -08:00
lpsw . L e n t r y - . L P G 1 ( 1 3 ) # j u m p t o _ s t e x t i n p r i m a r y - s p a c e ,
# virtual a n d n e v e r r e t u r n . . .
.align 8
.Lentry : .long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + _ s t e x t
.Lctl : .long 0x04b50002 # cr0 : various t h i n g s
.long 0 # cr1 : primary s p a c e s e g m e n t t a b l e
.long .Lduct # cr2 : dispatchable u n i t c o n t r o l t a b l e
.long 0 # cr3 : instruction a u t h o r i z a t i o n
.long 0 # cr4 : instruction a u t h o r i z a t i o n
2007-03-05 23:35:54 +01:00
.long .Lduct # cr5 : primary- a s t e o r i g i n
2005-11-07 00:59:12 -08:00
.long 0 # cr6 : I/ O i n t e r r u p t s
.long 0 # cr7 : secondary s p a c e s e g m e n t t a b l e
.long 0 # cr8 : access r e g i s t e r s t r a n s l a t i o n
.long 0 # cr9 : tracing o f f
.long 0 # cr10 : tracing o f f
.long 0 # cr11 : tracing o f f
.long 0 # cr12 : tracing o f f
.long 0 # cr13 : home s p a c e s e g m e n t t a b l e
.long 0xc0000000 # cr14 : machine c h e c k h a n d l i n g o f f
.long 0 # cr15 : linkage s t a c k o p e r a t i o n s
.Lmchunk : .long memory_chunk
.Lbss_bgn : .long __bss_start
.Lbss_end : .long _end
2006-06-29 14:58:17 +02:00
.Lparmaddr : .long PARMAREA
2007-02-05 21:18:37 +01:00
.Linittu : .long init_thread_union
.Lstartup_init :
.long startup_init
2007-03-05 23:35:54 +01:00
.align 64
.Lduct : .long 0 , 0 , 0 , 0 , .Lduald , 0 , 0 , 0
.long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
.align 128
.Lduald : .rept 8
.long 0 x8 0 0 0 0 0 0 0 ,0 ,0 ,0 # i n v a l i d a c c e s s - l i s t e n t r i e s
.endr
2006-09-20 15:59:15 +02:00
2006-07-18 13:44:57 +02:00
.org 0x12000
2007-02-21 10:55:37 +01:00
.globl _ehead
_ehead :
2005-11-07 00:59:12 -08:00
# ifdef C O N F I G _ S H A R E D _ K E R N E L
.org 0x100000
# endif
#
2006-06-29 14:58:17 +02:00
# startup- c o d e , r u n n i n g i n a b s o l u t e a d d r e s s i n g m o d e
2005-11-07 00:59:12 -08:00
#
.globl _stext
_stext : basr % r13 ,0 # g e t b a s e
.LPG3 :
# check c o n t r o l r e g i s t e r s
stctl % c0 ,% c15 ,0 ( % r15 )
oi 2 ( % r15 ) ,0 x40 # e n a b l e s i g p e m e r g e n c y s i g n a l
oi 0 ( % r15 ) ,0 x10 # s w i t c h o n l o w a d d r e s s p r o t e c t i o n
lctl % c0 ,% c15 ,0 ( % r15 )
#
lam 0 ,1 5 ,. L a r e g s - . L P G 3 ( % r13 ) # l o a d a c c e s s r e g s n e e d e d b y u a c c e s s
l % r14 ,. L s t a r t - . L P G 3 ( % r13 )
basr % r14 ,% r14 # c a l l s t a r t _ k e r n e l
#
# We r e t u r n e d f r o m s t a r t _ k e r n e l ? ! ? P A N I K
#
basr % r13 ,0
lpsw . L d w - . ( % r13 ) # l o a d d i s a b l e d w a i t p s w
#
.align 8
.Ldw : .long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 0 0
.Lstart : .long start_kernel
.Laregs : .long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0