2005-04-17 02:20:36 +04:00
/ *
* arch/ s39 0 / k e r n e l / h e a d . S
*
2006-06-29 16:58:17 +04:00
* Copyright ( C ) I B M C o r p . 1 9 9 9 ,2 0 0 6
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
*
* There a r e 5 d i f f e r e n t I P L m e t h o d s
* 1 ) load t h e i m a g e d i r e c t l y i n t o r a m a t a d d r e s s 0 a n d d o a n P S W r e s t a r t
* 2 ) linload w i l l l o a d t h e i m a g e f r o m a d d r e s s 0 x10 0 0 0 t o m e m o r y 0 x10 0 0 0
* and s t a r t t h e c o d e t h r u L P S W 0 x00 0 8 0 0 0 0 8 0 0 1 0 0 0 0 ( V M o n l y , d e p r e c a t e d )
* 3 ) generate t h e t a p e i p l h e a d e r , s t o r e t h e g e n e r a t e d i m a g e o n a t a p e
* and i p l f r o m i t
* In c a s e o f S L t a p e y o u n e e d t o I P L 5 t i m e s t o g e t p a s t V O L 1 e t c
* 4 ) generate t h e v m r e a d e r i p l h e a d e r , m o v e t h e g e n e r a t e d i m a g e t o t h e
* VM r e a d e r ( u s e o p t i o n N O H ! ) a n d d o a i p l f r o m r e a d e r ( V M o n l y )
* 5 ) direct c a l l o f s t a r t b y t h e S A L I P L l o a d e r
* We u s e t h e c p u i d t o d i s t i n g u i s h b e t w e e n V M a n d n a t i v e i p l
* params f o r k e r n e l a r e p u s h e d t o 0 x10 4 0 0 ( s e e s e t u p . h )
2005-11-07 11:59:12 +03:00
*
2005-04-17 02:20:36 +04:00
* /
# include < a s m / s e t u p . h >
# include < a s m / l o w c o r e . h >
2005-09-09 22:57:26 +04:00
# include < a s m / a s m - o f f s e t s . h >
2005-04-17 02:20:36 +04:00
# 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-01-06 11:19:28 +03:00
# ifdef C O N F I G _ 6 4 B I T
2005-11-07 11:59:12 +03:00
# define A R C H _ O F F S E T 4
# else
# define A R C H _ O F F S E T 0
# endif
2007-07-27 14:29:13 +04:00
.section " .text .head " , " ax"
2005-04-17 02:20:36 +04:00
# ifndef C O N F I G _ I P L
2006-09-28 18:56:37 +04:00
.org 0
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + s t a r t u p # J u s t a r e s t a r t P S W
2005-04-17 02:20:36 +04:00
# else
# ifdef C O N F I G _ I P L _ T A P E
# define I P L _ B S 1 0 2 4
2006-09-28 18:56:37 +04:00
.org 0
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + i p l s t a r t # T h e f i r s t 24 b y t e s a r e l o a d e d
.long 0 x2 7 0 0 0 0 0 0 ,0 x60 0 0 0 0 0 1 # b y i p l t o a d d r e s s e s 0 - 2 3 .
.long 0 x0 2 0 0 0 0 0 0 ,0 x20 0 0 0 0 0 0 + I P L _ B S # ( a P S W a n d t w o C C W s ) .
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 # e x t e r n a l o l d p s w
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 # s v c o l d p s w
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 # p r o g r a m c h e c k o l d p s w
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 # m a c h i n e c h e c k o l d p s w
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 # i o o l d p s w
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0
.long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 5 8 # e x t e r n a l n e w p s w
.long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 6 0 # s v c n e w p s w
.long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 6 8 # p r o g r a m c h e c k n e w p s w
.long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 7 0 # m a c h i n e c h e c k n e w p s w
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t # i o n e w p s w
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.org 0x100
2005-04-17 02:20:36 +04:00
#
# subroutine f o r l o a d i n g f r o m t a p e
2006-09-28 18:56:37 +04:00
# Paramters :
2005-04-17 02:20:36 +04:00
# R1 = d e v i c e n u m b e r
# R2 = l o a d a d d r e s s
2006-09-28 18:56:37 +04:00
.Lloader :
st % r14 ,. L l d r e t
la % r3 ,. L o r b r e a d # r 3 = a d d r e s s o f o r b
la % r5 ,. L i r b # r 5 = a d d r e s s o f i r b
st % r2 ,. L c c w r e a d + 4 # i n i t i a l i z e C C W d a t a a d d r e s s e s
lctl % c6 ,% c6 ,. L c r6
slr % r2 ,% r2
2005-04-17 02:20:36 +04:00
.Lldlp :
2006-09-28 18:56:37 +04:00
la % r6 ,3 # 3 r e t r i e s
2005-04-17 02:20:36 +04:00
.Lssch :
2006-09-28 18:56:37 +04:00
ssch 0 ( % r3 ) # l o a d c h u n k o f I P L _ B S b y t e s
bnz . L l d e r r
2005-04-17 02:20:36 +04:00
.Lw4end :
2006-09-28 18:56:37 +04:00
bas % r14 ,. L w a i t 4 i o
tm 8 ( % r5 ) ,0 x82 # d o w e h a v e a p r o b l e m ?
bnz . L r e c o v
slr % r7 ,% r7
icm % r7 ,3 ,1 0 ( % r5 ) # g e t r e s i d u a l c o u n t
lcr % r7 ,% r7
la % r7 ,I P L _ B S ( % r7 ) # I P L _ B S - r e s i d u a l = # b y t e s r e a d
ar % r2 ,% r7 # a d d t o t o t a l s i z e
tm 8 ( % r5 ) ,0 x01 # f o u n d a t a p e m a r k ?
bnz . L d o n e
l % r0 ,. L c c w r e a d + 4 # u p d a t e C C W d a t a a d d r e s s e s
ar % r0 ,% r7
st % r0 ,. L c c w r e a d + 4
b . L l d l p
2005-04-17 02:20:36 +04:00
.Ldone :
2006-09-28 18:56:37 +04:00
l % r14 ,. L l d r e t
br % r14 # r 2 c o n t a i n s t h e t o t a l s i z e
2005-04-17 02:20:36 +04:00
.Lrecov :
2006-09-28 18:56:37 +04:00
bas % r14 ,. L s e n s e # d o t h e s e n s i n g
bct % r6 ,. L s s c h # d e c . r e t r y c o u n t & b r a n c h
b . L l d e r r
2005-04-17 02:20:36 +04:00
#
# Sense s u b r o u t i n e
#
.Lsense :
2006-09-28 18:56:37 +04:00
st % r14 ,. L s n s r e t
la % r7 ,. L o r b s e n s e
ssch 0 ( % r7 ) # s t a r t s e n s e c o m m a n d
bnz . L l d e r r
bas % r14 ,. L w a i t 4 i o
l % r14 ,. L s n s r e t
tm 8 ( % r5 ) ,0 x82 # d o w e h a v e a p r o b l e m ?
bnz . L l d e r r
br % r14
2005-04-17 02:20:36 +04:00
#
# Wait f o r i n t e r r u p t s u b r o u t i n e
#
.Lwait4io :
2006-09-28 18:56:37 +04:00
lpsw . L w a i t p s w
2005-04-17 02:20:36 +04:00
.Lioint :
2006-09-28 18:56:37 +04:00
c % r1 ,0 x b8 # c o m p a r e s u b c h a n n e l n u m b e r
bne . L w a i t 4 i o
tsch 0 ( % r5 )
slr % r0 ,% r0
tm 8 ( % r5 ) ,0 x82 # d o w e h a v e a p r o b l e m ?
bnz . L w t e x i t
tm 8 ( % r5 ) ,0 x04 # g o t d e v i c e e n d ?
bz . L w a i t 4 i o
2005-04-17 02:20:36 +04:00
.Lwtexit :
2006-09-28 18:56:37 +04:00
br % r14
2005-04-17 02:20:36 +04:00
.Llderr :
2006-09-28 18:56:37 +04:00
lpsw . L c r a s h
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.align 8
2005-04-17 02:20:36 +04:00
.Lorbread :
2006-09-28 18:56:37 +04:00
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 8 0 f f00 ,. L c c w r e a d
.align 8
2005-04-17 02:20:36 +04:00
.Lorbsense :
2006-09-28 18:56:37 +04:00
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 8 0 f f00 ,. L c c w s e n s e
.align 8
2005-04-17 02:20:36 +04:00
.Lccwread :
2006-09-28 18:56:37 +04:00
.long 0 x0 2 2 0 0 0 0 0 + I P L _ B S ,0 x00 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
.Lccwsense :
2006-09-28 18:56:37 +04:00
.long 0 x0 4 2 0 0 0 0 1 ,0 x00 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
.Lwaitpsw :
2006-09-28 18:56:37 +04:00
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.Lirb : .long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
.Lcr6 : .long 0xff000000
.align 8
.Lcrash : .long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 0 0
.Lldret : .long 0
2005-04-17 02:20:36 +04:00
.Lsnsret : .long 0
2006-09-28 18:56:37 +04:00
# endif / * C O N F I G _ I P L _ T A P E * /
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ I P L _ V M
2006-09-28 18:56:37 +04:00
# define I P L _ B S 0 x73 0
.org 0
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + i p l s t a r t # T h e f i r s t 24 b y t e s a r e l o a d e d
.long 0 x0 2 0 0 0 0 1 8 ,0 x60 0 0 0 0 5 0 # b y i p l t o a d d r e s s e s 0 - 2 3 .
.long 0 x0 2 0 0 0 0 6 8 ,0 x60 0 0 0 0 5 0 # ( a P S W a n d t w o C C W s ) .
.fill 8 0 - 2 4 , 1 , 0 x4 0 # b y t e s 24 - 7 9 a r e d i s c a r d e d ! !
.long 0 x0 2 0 0 0 0 f0 ,0 x60 0 0 0 0 5 0 # T h e n e x t 160 b y t e a r e l o a d e d
.long 0 x0 2 0 0 0 1 4 0 ,0 x60 0 0 0 0 5 0 # t o a d d r e s s e s 0x18 - 0 x b7
.long 0 x0 2 0 0 0 1 9 0 ,0 x60 0 0 0 0 5 0 # T h e y f o r m t h e c o n t i n u a t i o n
.long 0 x0 2 0 0 0 1 e 0 ,0 x60 0 0 0 0 5 0 # o f t h e C C W p r o g r a m s t a r t e d
.long 0 x0 2 0 0 0 2 3 0 ,0 x60 0 0 0 0 5 0 # b y i p l a n d l o a d t h e r a n g e
.long 0 x0 2 0 0 0 2 8 0 ,0 x60 0 0 0 0 5 0 # 0x0f0 - 0 x73 0 f r o m t h e i m a g e
.long 0 x0 2 0 0 0 2 d0 ,0 x60 0 0 0 0 5 0 # t o t h e r a n g e 0x0f0 - 0 x73 0
.long 0 x0 2 0 0 0 3 2 0 ,0 x60 0 0 0 0 5 0 # i n m e m o r y . A t t h e e n d o f
.long 0 x0 2 0 0 0 3 7 0 ,0 x60 0 0 0 0 5 0 # t h e c h a n n e l p r o g r a m t h e P S W
.long 0 x0 2 0 0 0 3 c0 ,0 x60 0 0 0 0 5 0 # a t l o c a t i o n 0 i s l o a d e d .
.long 0 x0 2 0 0 0 4 1 0 ,0 x60 0 0 0 0 5 0 # I n i t i a l p r o c e s s i n g s t a r t s
.long 0 x0 2 0 0 0 4 6 0 ,0 x60 0 0 0 0 5 0 # a t 0xf0 = i p l s t a r t .
.long 0 x0 2 0 0 0 4 b0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 0 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 5 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 a0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 5 f0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 4 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 9 0 ,0 x60 0 0 0 0 5 0
.long 0 x0 2 0 0 0 6 e 0 ,0 x20 0 0 0 0 5 0
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.org 0xf0
2005-04-17 02:20:36 +04:00
#
# subroutine f o r l o a d i n g c a r d s f r o m t h e r e a d e r
#
2006-09-28 18:56:37 +04:00
.Lloader :
la % r3 ,. L o r b # r 2 = a d d r e s s o f o r b i n t o r2
la % r5 ,. L i r b # r 4 = a d d r e s s o f i r b
la % r6 ,. L c c w s
la % r7 ,2 0
2005-04-17 02:20:36 +04:00
.Linit :
2006-09-28 18:56:37 +04:00
st % r2 ,4 ( % r6 ) # i n i t i a l i z e C C W d a t a a d d r e s s e s
la % r2 ,0 x50 ( % r2 )
la % r6 ,8 ( % r6 )
bct 7 ,. L i n i t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
lctl % c6 ,% c6 ,. L c r6 # s e t I O s u b c l a s s m a s k
slr % r2 ,% r2
2005-04-17 02:20:36 +04:00
.Lldlp :
2006-09-28 18:56:37 +04:00
ssch 0 ( % r3 ) # l o a d c h u n k o f 1600 b y t e s
bnz . L l d e r r
2005-04-17 02:20:36 +04:00
.Lwait4irq :
2006-09-28 18:56:37 +04:00
mvc 0 x78 ( 8 ) ,. L n e w p s w # s e t u p I O i n t e r r u p t p s w
lpsw . L w a i t p s w
2005-04-17 02:20:36 +04:00
.Lioint :
2006-09-28 18:56:37 +04:00
c % r1 ,0 x b8 # c o m p a r e s u b c h a n n e l n u m b e r
bne . L w a i t 4 i r q
tsch 0 ( % r5 )
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
slr % r0 ,% r0
ic % r0 ,8 ( % r5 ) # g e t d e v i c e s t a t u s
chi % r0 ,8 # c h a n n e l e n d ?
be . L c o n t
chi % r0 ,1 2 # c h a n n e l e n d + d e v i c e e n d ?
be . L c o n t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
l % r0 ,4 ( % r5 )
s % r0 ,8 ( % r3 ) # r 0 / 8 = n u m b e r o f c c w s e x e c u t e d
mhi % r0 ,1 0 # * 10 = n u m b e r o f b y t e s i n c c w s
lh % r3 ,1 0 ( % r5 ) # g e t r e s i d u a l c o u n t
sr % r0 ,% r3 # # c c w s * 80 - r e s i d u a l = #b y t e s r e a d
ar % r2 ,% r0
br % r14 # r 2 c o n t a i n s t h e t o t a l s i z e
2005-04-17 02:20:36 +04:00
.Lcont :
2006-09-28 18:56:37 +04:00
ahi % r2 ,0 x64 0 # a d d 0x640 t o t o t a l s i z e
la % r6 ,. L c c w s
la % r7 ,2 0
2005-04-17 02:20:36 +04:00
.Lincr :
2006-09-28 18:56:37 +04:00
l % r0 ,4 ( % r6 ) # u p d a t e C C W d a t a a d d r e s s e s
ahi % r0 ,0 x64 0
st % r0 ,4 ( % r6 )
ahi % r6 ,8
bct 7 ,. L i n c r
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
b . L l d l p
2005-04-17 02:20:36 +04:00
.Llderr :
2006-09-28 18:56:37 +04:00
lpsw . L c r a s h
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.align 8
.Lorb : .long 0 x0 0 0 0 0 0 0 0 ,0 x00 8 0 f f00 ,. L c c w s
.Lirb : .long 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0
.Lcr6 : .long 0xff000000
.Lloadp : .long 0 , 0
.align 8
.Lcrash : .long 0 x0 0 0 a00 0 0 ,0 x00 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
.Lnewpsw :
2006-09-28 18:56:37 +04:00
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
2005-04-17 02:20:36 +04:00
.Lwaitpsw :
2006-09-28 18:56:37 +04:00
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.align 8
.Lccws : .rept 19
.long 0 x0 2 6 0 0 0 5 0 ,0 x00 0 0 0 0 0 0
.endr
.long 0 x0 2 2 0 0 0 5 0 ,0 x00 0 0 0 0 0 0
# endif / * C O N F I G _ I P L _ V M * /
2005-04-17 02:20:36 +04:00
iplstart :
2006-09-28 18:56:37 +04:00
lh % r1 ,0 x b8 # t e s t i f s u b c h a n n e l n u m b e r
bct % r1 ,. L n o l o a d # i s v a l i d
l % r1 ,0 x b8 # l o a d i p l s u b c h a n n e l n u m b e r
la % r2 ,I P L _ B S # l o a d s t a r t a d d r e s s
bas % r14 ,. L l o a d e r # l o a d r e s t o f i p l i m a g e
l % r12 ,. L p a r m # p o i n t e r t o p a r a m e t e r a r e a
st % r1 ,I P L _ D E V I C E + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # s a v e i p l d e v i c e n u m b e r
2005-04-17 02:20:36 +04:00
#
# load p a r a m e t e r f i l e f r o m i p l d e v i c e
#
.Lagain1 :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d # r a m d i s k l o c . i s t e m p
bas % r14 ,. L l o a d e r # l o a d p a r a m e t e r f i l e
ltr % r2 ,% r2 # g o t a n y t h i n g ?
bz . L n o p f
chi % r2 ,8 9 5
bnh . L n o t r u n c
la % r2 ,8 9 5
2005-04-17 02:20:36 +04:00
.Lnotrunc :
2006-09-28 18:56:37 +04:00
l % r4 ,. L i n i t r d
clc 0 ( 3 ,% r4 ) ,. L _ h d r # i f i t i s H D R x
bz . L a g a i n 1 # s k i p d a t a s e t h e a d e r
clc 0 ( 3 ,% r4 ) ,. L _ e o f # i f i t i s E O F x
bz . L a g a i n 1 # s k i p d a t e s e t t r a i l e r
la % r5 ,0 ( % r4 ,% r2 )
lr % r3 ,% r2
2005-04-17 02:20:36 +04:00
.Lidebc :
2006-09-28 18:56:37 +04:00
tm 0 ( % r5 ) ,0 x80 # h i g h o r d e r b i t s e t ?
bo . L d o c v # y e s - > c o n v e r t f r o m E B C D I C
ahi % r5 ,- 1
bct % r3 ,. L i d e b c
b . L n o c v
2005-04-17 02:20:36 +04:00
.Ldocv :
2006-09-28 18:56:37 +04:00
l % r3 ,. L c v t a b
tr 0 ( 2 5 6 ,% r4 ) ,0 ( % r3 ) # c o n v e r t p a r a m e t e r s t o a s c i i
tr 2 5 6 ( 2 5 6 ,% r4 ) ,0 ( % r3 )
tr 5 1 2 ( 2 5 6 ,% r4 ) ,0 ( % r3 )
tr 7 6 8 ( 1 2 2 ,% r4 ) ,0 ( % r3 )
.Lnocv : la % r3 ,C O M M A N D _ L I N E - P A R M A R E A ( % r12 ) # l o a d a d r . o f c o m m a n d l i n e
mvc 0 ( 2 5 6 ,% r3 ) ,0 ( % r4 )
mvc 2 5 6 ( 2 5 6 ,% r3 ) ,2 5 6 ( % r4 )
mvc 5 1 2 ( 2 5 6 ,% r3 ) ,5 1 2 ( % r4 )
mvc 7 6 8 ( 1 2 2 ,% r3 ) ,7 6 8 ( % r4 )
slr % r0 ,% r0
b . L c n t l p
2005-04-17 02:20:36 +04:00
.Ldelspc :
2006-09-28 18:56:37 +04:00
ic % r0 ,0 ( % r2 ,% r3 )
chi % r0 ,0 x20 # i s i t a s p a c e ?
be . L c n t l p
ahi % r2 ,1
b . L e o l p
2005-04-17 02:20:36 +04:00
.Lcntlp :
2006-09-28 18:56:37 +04:00
brct % r2 ,. L d e l s p c
2005-04-17 02:20:36 +04:00
.Leolp :
2006-09-28 18:56:37 +04:00
slr % r0 ,% r0
stc % r0 ,0 ( % r2 ,% r3 ) # t e r m i n a t e b u f f e r
2005-04-17 02:20:36 +04:00
.Lnopf :
#
# load r a m d i s k f r o m i p l d e v i c e
2006-09-28 18:56:37 +04:00
#
2005-04-17 02:20:36 +04:00
.Lagain2 :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d # a d d r o f r a m d i s k
st % r2 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r12 )
bas % r14 ,. L l o a d e r # l o a d r a m d i s k
st % r2 ,I N I T R D _ S I Z E + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # s t o r e s i z e o f r d
ltr % r2 ,% r2
bnz . L r d c o n t
st % r2 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r12 ) # n o r a m d i s k f o u n d
2005-04-17 02:20:36 +04:00
.Lrdcont :
2006-09-28 18:56:37 +04:00
l % r2 ,. L i n i t r d
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
clc 0 ( 3 ,% r2 ) ,. L _ h d r # s k i p H D R x a n d E O F x
bz . L a g a i n 2
clc 0 ( 3 ,% r2 ) ,. L _ e o f
bz . L a g a i n 2
2005-04-17 02:20:36 +04:00
# ifdef C O N F I G _ I P L _ V M
#
# reset f i l e s i n V M r e a d e r
#
2006-09-28 18:56:37 +04:00
stidp _ _ L C _ C P U I D # s t o r e c p u i d
tm _ _ L C _ C P U I D ,0 x f f # r u n n i n g V M ?
bno . L n o r e s e t
la % r2 ,. L r e s e t
lhi % r3 ,2 6
diag % r2 ,% r3 ,8
la % r5 ,. L i r b
stsch 0 ( % r5 ) # c h e c k i f i r q i s p e n d i n g
tm 3 0 ( % r5 ) ,0 x0 f # b y v e r i f y i n g i f a n y o f t h e
bnz . L w a i t f o r i r q # a c t i v i t y o r s t a t u s c o n t r o l
tm 3 1 ( % r5 ) ,0 x f f # b i t s i s s e t i n t h e s c h i b
bz . L n o r e s e t
2005-07-30 01:03:36 +04:00
.Lwaitforirq :
2006-09-28 18:56:37 +04:00
mvc 0 x78 ( 8 ) ,. L r d r n e w p s w # s e t u p I O i n t e r r u p t p s w
2005-06-22 04:16:31 +04:00
.Lwaitrdrirq :
2006-09-28 18:56:37 +04:00
lpsw . L r d r w a i t p s w
2005-06-22 04:16:31 +04:00
.Lrdrint :
2006-09-28 18:56:37 +04:00
c % r1 ,0 x b8 # c o m p a r e s u b c h a n n e l n u m b e r
bne . L w a i t r d r i r q
la % r5 ,. L i r b
tsch 0 ( % r5 )
2005-04-17 02:20:36 +04:00
.Lnoreset :
2006-09-28 18:56:37 +04:00
b . L n o l o a d
2005-06-22 04:16:31 +04:00
2006-09-28 18:56:37 +04:00
.align 8
2005-06-22 04:16:31 +04:00
.Lrdrnewpsw :
2006-09-28 18:56:37 +04:00
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L r d r i n t
2005-06-22 04:16:31 +04:00
.Lrdrwaitpsw :
2006-09-28 18:56:37 +04:00
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L r d r i n t
2005-04-17 02:20:36 +04:00
# endif
2005-06-22 04:16:31 +04:00
2005-04-17 02:20:36 +04:00
#
# everything l o a d e d , g o f o r i t
#
.Lnoload :
2006-09-28 18:56:37 +04:00
l % r1 ,. L s t a r t u p
br % r1
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
.Linitrd : .long _end + 0 x4 0 0 0 0 0 # d e f a u l t a d d r e s s o f i n i t r d
2005-04-17 02:20:36 +04:00
.Lparm : .long PARMAREA
.Lstartup : .long startup
2006-09-28 18:56:37 +04:00
.Lcvtab : .long _ebcasc # ebcdic t o a s c i i t a b l e
.Lreset : .byte 0 xc3 ,0 x c8 ,0 x c1 ,0 x d5 ,0 x c7 ,0 x c5 ,0 x40 ,0 x d9 ,0 x c4 ,0 x d9 ,0 x40
.byte 0 xc1 ,0 x d3 ,0 x d3 ,0 x40 ,0 x d2 ,0 x c5 ,0 x c5 ,0 x d7 ,0 x40 ,0 x d5 ,0 x d6
.byte 0 xc8 ,0 x d6 ,0 x d3 ,0 x c4 # " change rdr all keep nohold "
.L_eof : .long 0xc5d6c600 /* C'EOF' */
.L_hdr : .long 0xc8c4d900 /* C'HDR' */
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
# endif / * C O N F I G _ I P L * /
2005-04-17 02:20:36 +04:00
#
# SALIPL l o a d e r s u p p o r t . B a s e d o n a p a t c h b y R o b v a n d e r H e i j .
# This e n t r y p o i n t i s c a l l e d d i r e c t l y f r o m t h e S A L I P L l o a d e r a n d
# doesn' t n e e d a b u i l t i n i p l r e c o r d .
#
2006-09-28 18:56:37 +04:00
.org 0x800
.globl start
2005-04-17 02:20:36 +04:00
start :
2006-09-28 18:56:37 +04:00
stm % r0 ,% r15 ,0 x07 b0 # s t o r e r e g i s t e r s
basr % r12 ,% r0
2005-04-17 02:20:36 +04:00
.base :
2006-09-28 18:56:37 +04:00
l % r11 ,. p a r m
l % r8 ,. c m d # p o i n t e r t o c o m m a n d b u f f e r
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
ltr % r9 ,% r9 # d o w e h a v e S A L I P L p a r a m e t e r s ?
bp . s k 8 x8
2005-04-17 02:20:36 +04:00
2006-09-28 18:56:37 +04:00
mvc 0 ( 6 4 ,% r8 ) ,0 x00 b0 # c o p y s a v e d r e g i s t e r s
xc 6 4 ( 2 4 0 - 6 4 ,% r8 ) ,0 ( % r8 ) # r e m a i n d e r o f b u f f e r
tr 0 ( 6 4 ,% r8 ) ,. l o w c a s e
b . g o t r
2005-04-17 02:20:36 +04:00
.sk8x8 :
2006-09-28 18:56:37 +04:00
mvc 0 ( 2 4 0 ,% r8 ) ,0 ( % r9 ) # c o p y i p l p a r m s i n t o b u f f e r
2005-04-17 02:20:36 +04:00
.gotr :
2006-09-28 18:56:37 +04:00
l % r10 ,. t b l # E B C D I C t o A S C I I t a b l e
tr 0 ( 2 4 0 ,% r8 ) ,0 ( % r10 )
slr % r0 ,% r0
st % r0 ,I N I T R D _ S I Z E + A R C H _ O F F S E T - P A R M A R E A ( % r11 )
st % r0 ,I N I T R D _ S T A R T + A R C H _ O F F S E T - P A R M A R E A ( % r11 )
j s t a r t u p # c o n t i n u e w i t h s t a r t u p
.tbl : .long _ebcasc # translate t a b l e
.cmd : .long COMMAND_LINE # address o f c o m m a n d l i n e b u f f e r
.parm : .long PARMAREA
2005-04-17 02:20:36 +04:00
.lowcase :
2006-09-28 18:56:37 +04:00
.byte 0 x0 0 ,0 x01 ,0 x02 ,0 x03 ,0 x04 ,0 x05 ,0 x06 ,0 x07
2005-04-17 02:20:36 +04:00
.byte 0 x0 8 ,0 x09 ,0 x0 a ,0 x0 b ,0 x0 c ,0 x0 d ,0 x0 e ,0 x0 f
2006-09-28 18:56:37 +04:00
.byte 0 x1 0 ,0 x11 ,0 x12 ,0 x13 ,0 x14 ,0 x15 ,0 x16 ,0 x17
2005-04-17 02:20:36 +04:00
.byte 0 x1 8 ,0 x19 ,0 x1 a ,0 x1 b ,0 x1 c ,0 x1 d ,0 x1 e ,0 x1 f
2006-09-28 18:56:37 +04:00
.byte 0 x2 0 ,0 x21 ,0 x22 ,0 x23 ,0 x24 ,0 x25 ,0 x26 ,0 x27
2005-04-17 02:20:36 +04:00
.byte 0 x2 8 ,0 x29 ,0 x2 a ,0 x2 b ,0 x2 c ,0 x2 d ,0 x2 e ,0 x2 f
2006-09-28 18:56:37 +04:00
.byte 0 x3 0 ,0 x31 ,0 x32 ,0 x33 ,0 x34 ,0 x35 ,0 x36 ,0 x37
2005-04-17 02:20:36 +04:00
.byte 0 x3 8 ,0 x39 ,0 x3 a ,0 x3 b ,0 x3 c ,0 x3 d ,0 x3 e ,0 x3 f
2006-09-28 18:56:37 +04:00
.byte 0 x4 0 ,0 x41 ,0 x42 ,0 x43 ,0 x44 ,0 x45 ,0 x46 ,0 x47
2005-04-17 02:20:36 +04:00
.byte 0 x4 8 ,0 x49 ,0 x4 a ,0 x4 b ,0 x4 c ,0 x4 d ,0 x4 e ,0 x4 f
2006-09-28 18:56:37 +04:00
.byte 0 x5 0 ,0 x51 ,0 x52 ,0 x53 ,0 x54 ,0 x55 ,0 x56 ,0 x57
2005-04-17 02:20:36 +04:00
.byte 0 x5 8 ,0 x59 ,0 x5 a ,0 x5 b ,0 x5 c ,0 x5 d ,0 x5 e ,0 x5 f
2006-09-28 18:56:37 +04:00
.byte 0 x6 0 ,0 x61 ,0 x62 ,0 x63 ,0 x64 ,0 x65 ,0 x66 ,0 x67
2005-04-17 02:20:36 +04:00
.byte 0 x6 8 ,0 x69 ,0 x6 a ,0 x6 b ,0 x6 c ,0 x6 d ,0 x6 e ,0 x6 f
2006-09-28 18:56:37 +04:00
.byte 0 x7 0 ,0 x71 ,0 x72 ,0 x73 ,0 x74 ,0 x75 ,0 x76 ,0 x77
2005-04-17 02:20:36 +04:00
.byte 0 x7 8 ,0 x79 ,0 x7 a ,0 x7 b ,0 x7 c ,0 x7 d ,0 x7 e ,0 x7 f
2006-09-28 18:56:37 +04:00
.byte 0 x8 0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87
2005-04-17 02:20:36 +04:00
.byte 0 x8 8 ,0 x89 ,0 x8 a ,0 x8 b ,0 x8 c ,0 x8 d ,0 x8 e ,0 x8 f
2006-09-28 18:56:37 +04:00
.byte 0 x9 0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97
2005-04-17 02:20:36 +04:00
.byte 0 x9 8 ,0 x99 ,0 x9 a ,0 x9 b ,0 x9 c ,0 x9 d ,0 x9 e ,0 x9 f
2006-09-28 18:56:37 +04:00
.byte 0 xa0 ,0 x a1 ,0 x a2 ,0 x a3 ,0 x a4 ,0 x a5 ,0 x a6 ,0 x a7
2005-04-17 02:20:36 +04:00
.byte 0 xa8 ,0 x a9 ,0 x a a ,0 x a b ,0 x a c ,0 x a d ,0 x a e ,0 x a f
2006-09-28 18:56:37 +04:00
.byte 0 xb0 ,0 x b1 ,0 x b2 ,0 x b3 ,0 x b4 ,0 x b5 ,0 x b6 ,0 x b7
2005-04-17 02:20:36 +04:00
.byte 0 xb8 ,0 x b9 ,0 x b a ,0 x b b ,0 x b c ,0 x b d ,0 x b e ,0 x b f
2006-09-28 18:56:37 +04:00
.byte 0 xc0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87 # . a b c d e f g
2005-04-17 02:20:36 +04:00
.byte 0 x8 8 ,0 x89 ,0 x c a ,0 x c b ,0 x c c ,0 x c d ,0 x c e ,0 x c f # h i
2006-09-28 18:56:37 +04:00
.byte 0 xd0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97 # . j k l m n o p
2005-04-17 02:20:36 +04:00
.byte 0 x9 8 ,0 x99 ,0 x d a ,0 x d b ,0 x d c ,0 x d d ,0 x d e ,0 x d f # q r
.byte 0 xe0 ,0 x e 1 ,0 x a2 ,0 x a3 ,0 x a4 ,0 x a5 ,0 x a6 ,0 x a7 # . . s t u v w x
.byte 0 xa8 ,0 x a9 ,0 x e a ,0 x e b ,0 x e c ,0 x e d ,0 x e e ,0 x e f # y z
2006-09-28 18:56:37 +04:00
.byte 0 xf0 ,0 x f1 ,0 x f2 ,0 x f3 ,0 x f4 ,0 x f5 ,0 x f6 ,0 x f7
2005-04-17 02:20:36 +04:00
.byte 0 xf8 ,0 x f9 ,0 x f a ,0 x f b ,0 x f c ,0 x f d ,0 x f e ,0 x f f
2008-12-25 15:39:19 +03:00
#
# startup- c o d e a t 0 x10 0 0 0 , 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
# this i s c a l l e d e i t h e r b y t h e i p l l o a d e r o r d i r e c t l y b y P S W r e s t a r t
# or l i n l o a d o r S A L I P L
#
.org 0x10000
startup : basr % r13 ,0 # g e t b a s e
.LPG0 :
2009-03-26 17:24:44 +03:00
xc 0 x20 0 ( 2 5 6 ) ,0 x20 0 # p a r t i a l l y c l e a r l o w c o r e
xc 0 x30 0 ( 2 5 6 ) ,0 x30 0
2009-04-14 17:36:28 +04:00
l % r1 ,5 f - . L P G 0 ( % r13 )
stck 0 ( % r1 )
2009-04-14 17:36:29 +04:00
spt 6 f - . L P G 0 ( % r13 )
mvc _ _ L C _ L A S T _ U P D A T E _ C L O C K ( 8 ) ,0 ( % r1 )
mvc _ _ L C _ L A S T _ U P D A T E _ T I M E R ( 8 ) ,6 f - . L P G 0 ( % r13 )
mvc _ _ L C _ E X I T _ T I M E R ( 8 ) ,5 f - . L P G 0 ( % r13 )
2008-12-25 15:39:19 +03:00
# ifndef C O N F I G _ M A R C H _ G 5
# check p r o c e s s o r v e r s i o n a g a i n s t M A R C H _ { G 5 ,Z 9 0 0 ,Z 9 9 0 ,Z 9 _ 1 0 9 ,Z 1 0 }
stidp _ _ L C _ C P U I D # s t o r e c p u i d
lhi % r0 ,( 3 f - 2 f ) / 2
la % r1 ,2 f - . L P G 0 ( % r13 )
0 : clc _ _ L C _ C P U I D + 4 ( 2 ) ,0 ( % r1 )
jne 3 f
lpsw 1 f - . L P G 0 ( 1 3 ) # m a c h i n e t y p e n o t g o o d e n o u g h , c r a s h
.align 16
1 : .long 0x000a0000 , 0 x0 0 0 0 0 0 0 0
2 :
# if d e f i n e d ( C O N F I G _ M A R C H _ Z 1 0 )
.short 0 x9 6 7 2 , 0 x20 6 4 , 0 x20 6 6 , 0 x20 8 4 , 0 x20 8 6 , 0 x20 9 4 , 0 x20 9 6
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 _ 1 0 9 )
.short 0 x9 6 7 2 , 0 x20 6 4 , 0 x20 6 6 , 0 x20 8 4 , 0 x20 8 6
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 9 0 )
.short 0 x9 6 7 2 , 0 x20 6 4 , 0 x20 6 6
# elif d e f i n e d ( C O N F I G _ M A R C H _ Z 9 0 0 )
.short 0x9672
# endif
3 : la % r1 ,2 ( % r1 )
brct % r0 ,0 b
# endif
2009-04-14 17:36:28 +04:00
l % r13 ,4 f - . L P G 0 ( % r13 )
2008-12-25 15:39:19 +03:00
b 0 ( % r13 )
2009-04-14 17:36:29 +04:00
.align 4
2009-04-14 17:36:28 +04:00
4 : .long s t a r t u p _ c o n t i n u e
5 : .long s c h e d _ c l o c k _ b a s e _ c c
2009-04-14 17:36:29 +04:00
.align 8
6 : .long 0x7fffffff , 0 xffffffff
2008-12-25 15:39:19 +03:00
#
# params a t 1 0 4 0 0 ( s e t u p . h )
#
.org PARMAREA
.long 0 , 0 # IPL_ D E V I C E
.long 0 , 0 # INITRD_ S T A R T
.long 0 , 0 # INITRD_ S I Z E
.org COMMAND_LINE
.byte " root= / d e v / r a m 0 r o "
.byte 0
2006-01-06 11:19:28 +03:00
# ifdef C O N F I G _ 6 4 B I T
2005-11-07 11:59:12 +03:00
# include " h e a d64 . S "
# else
# include " h e a d31 . S "
2005-04-17 02:20:36 +04:00
# endif