2005-04-17 02:20:36 +04:00
/ *
2012-07-20 13:15:04 +04:00
* Copyright I B M C o r p . 1 9 9 9 , 2 0 1 0
2005-11-07 11:59:12 +03: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>
2005-04-17 02:20:36 +04:00
*
* /
2010-02-27 00:37:53 +03:00
# include < l i n u x / i n i t . h >
2011-07-24 12:48:19 +04:00
# include < l i n u x / l i n k a g e . h >
2010-02-27 00:37:53 +03:00
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / t h r e a d _ i n f o . h >
# include < a s m / p a g e . h >
2006-06-29 16:58:17 +04:00
2010-02-27 00:37:53 +03:00
_ _ HEAD
2011-07-24 12:48:19 +04:00
ENTRY( s t a r t u p _ c o n t i n u e )
2015-11-24 14:33:07 +03:00
tm _ _ L C _ S T F L E _ F A C _ L I S T + 6 ,0 x80 # L P P a v a i l a b l e ?
2015-10-06 19:06:15 +03:00
jz 0 f
xc _ _ L C _ L P P + 1 ( 7 ,0 ) ,_ _ L C _ L P P + 1 # c l e a r l p p a n d c u r r e n t _ p i d
mvi _ _ L C _ L P P ,0 x80 # a n d s e t L P P _ M A G I C
.insn s,0 x b28 0 0 0 0 0 ,_ _ L C _ L P P # l o a d p r o g r a m p a r a m e t e r
0 : larl % r1 ,s c h e d _ c l o c k _ b a s e _ c c
2010-02-27 00:37:53 +03:00
mvc 0 ( 8 ,% r1 ) ,_ _ L C _ L A S T _ U P D A T E _ C L O C K
larl % r13 ,. L P G 1 # g e t b a s e
2006-09-28 18:56:37 +04:00
lctlg % 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
lg % 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
2008-12-31 17:11:42 +03:00
lghi % r0 ,_ _ L C _ P A S T E
stg % r0 ,_ _ L C _ V D S O _ P E R _ C P U
2006-09-20 17:59:15 +04:00
#
# Setup s t a c k
#
2006-09-28 18:56:37 +04:00
larl % r15 ,i n i t _ t h r e a d _ u n i o n
2009-09-11 12:28:58 +04:00
stg % 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-28 18:56:37 +04:00
lg % r14 ,_ _ T I _ t a s k ( % r15 ) # c a c h e c u r r e n t i n l o w c o r e
stg % r14 ,_ _ L C _ C U R R E N T
aghi % 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
stg % 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
aghi % r15 ,- 1 6 0
2005-04-17 02:20:36 +04:00
#
2007-02-05 23:18:24 +03: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-04-17 02:20:36 +04:00
#
2007-02-05 23:18:24 +03:00
brasl % r14 ,s t a r t u p _ i n i t
2006-09-28 18:56:37 +04:00
lpswe . 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 16
2010-02-27 00:37:53 +03:00
.LPG1 :
2006-09-28 18:56:37 +04:00
.Lentry : .quad 0 x0 0 0 0 0 0 0 1 8 0 0 0 0 0 0 0 ,_ s t e x t
2011-07-24 12:48:29 +04:00
.Lctl : .quad 0x04040000 # cr0 : AFP r e g i s t e r s & s e c o n d a r y s p a c e
2006-09-28 18:56:37 +04:00
.quad 0 # cr1 : primary s p a c e s e g m e n t t a b l e
.quad .Lduct # cr2 : dispatchable u n i t c o n t r o l t a b l e
.quad 0 # cr3 : instruction a u t h o r i z a t i o n
.quad 0 # cr4 : instruction a u t h o r i z a t i o n
2007-03-06 01:35:54 +03:00
.quad .Lduct # cr5 : primary- a s t e o r i g i n
2006-09-28 18:56:37 +04:00
.quad 0 # cr6 : I/ O i n t e r r u p t s
.quad 0 # cr7 : secondary s p a c e s e g m e n t t a b l e
.quad 0 # cr8 : access r e g i s t e r s t r a n s l a t i o n
.quad 0 # cr9 : tracing o f f
.quad 0 # cr10 : tracing o f f
.quad 0 # cr11 : tracing o f f
.quad 0 # cr12 : tracing o f f
.quad 0 # cr13 : home s p a c e s e g m e n t t a b l e
.quad 0xc0000000 # cr14 : machine c h e c k h a n d l i n g o f f
2014-02-03 20:37:15 +04:00
.quad .Llinkage_stack # cr15 : linkage s t a c k o p e r a t i o n s
2006-09-28 18:56:37 +04:00
.Lpcmsk : .quad 0x0000000180000000
2005-04-17 02:20:36 +04:00
.L4malign : .quad 0xffffffffffc00000
2006-09-28 18:56:37 +04:00
.Lscan2g : .quad 0x80000000 + 0 x2 0 0 0 0 - 8 # 2 G B + 1 2 8 K - 8
.Lnop : .long 0x07000700
2006-06-29 16:58:17 +04:00
.Lparmaddr :
.quad PARMAREA
2007-03-06 01:35:54 +03:00
.align 64
2014-02-03 20:37:15 +04:00
.Lduct : .long 0 , .Laste , .Laste , 0 , .Lduald , 0 , 0 , 0
2007-03-06 01:35:54 +03:00
.long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
2014-02-03 20:37:15 +04:00
.Laste : .quad 0 , 0 xffffffffffffffff,0 ,0 ,0 ,0 ,0 ,0
2007-03-06 01:35:54 +03:00
.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
2014-02-03 20:37:15 +04:00
.Llinkage_stack :
.long 0 , 0 , 0 x8 9 0 0 0 0 0 0 ,0 ,0 ,0 ,0 x8 a00 0 0 0 0 ,0
2005-04-17 02:20:36 +04:00
2011-07-24 12:48:19 +04:00
ENTRY( _ e h e a d )
2010-02-27 00:37:53 +03:00
2010-05-12 11:32:13 +04:00
.org 0x100000 - 0 x1 1 0 0 0 # h e a d . o e n d s a t 0x11000
2005-04-17 02:20:36 +04:00
#
2006-06-29 16:58:17 +04: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-04-17 02:20:36 +04:00
#
2011-07-24 12:48:19 +04:00
ENTRY( _ s t e x t )
basr % r13 ,0 # g e t b a s e
2005-10-31 02:00:11 +03:00
.LPG3 :
2005-04-17 02:20:36 +04:00
# check c o n t r o l r e g i s t e r s
2006-09-28 18:56:37 +04:00
stctg % c0 ,% c15 ,0 ( % r15 )
2011-10-30 18:16:58 +04:00
oi 6 ( % r15 ) ,0 x60 # e n a b l e s i g p e m e r g e n c y & e x t e r n a l c a l l
2006-09-28 18:56:37 +04:00
oi 4 ( % r15 ) ,0 x10 # s w i t c h o n l o w a d d r e s s p r o c t e c t i o n
lctlg % c0 ,% c15 ,0 ( % r15 )
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
lam 0 ,1 5 ,. L a r e g s - . L P G 3 ( % r13 ) # l o a d a c r s n e e d e d b y u a c c e s s
brasl % r14 ,s t a r t _ k e r n e l # g o t o C c o d e
2005-04-17 02:20:36 +04:00
#
# 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
#
2006-09-28 18:56:37 +04:00
basr % r13 ,0
lpswe . L d w - . ( % r13 ) # l o a d d i s a b l e d w a i t p s w
2006-09-20 17:59:15 +04:00
2006-09-28 18:56:37 +04:00
.align 8
.Ldw : .quad 0 x0 0 0 2 0 0 0 1 8 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 0 0 0 0 0 0 0 0
.Laregs : .long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0