2005-04-17 02:20:36 +04:00
/ *
* arch/ s39 0 / k e r n e l / h e a d . S
*
2005-11-07 11:59:12 +03:00
* ( C) C o p y r i g h t I B M C o r p . 1 9 9 9 , 2 0 0 5
*
* 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 < l i n u x / c o n f i g . h >
# 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
2005-04-17 02:20:36 +04:00
# ifndef C O N F I G _ I P L
.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
# 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
.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
.org 0x100
#
# subroutine f o r l o a d i n g f r o m t a p e
# Paramters :
# 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
.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
.Lldlp :
la % r6 ,3 # 3 r e t r i e s
.Lssch :
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
.Lw4end :
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
.Ldone :
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
.Lrecov :
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
#
# Sense s u b r o u t i n e
#
.Lsense :
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
#
# Wait f o r i n t e r r u p t s u b r o u t i n e
#
.Lwait4io :
lpsw . L w a i t p s w
.Lioint :
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
.Lwtexit :
br % r14
.Llderr :
lpsw . L c r a s h
.align 8
.Lorbread :
.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
.Lorbsense :
.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
.Lccwread :
.long 0 x0 2 2 0 0 0 0 0 + I P L _ B S ,0 x00 0 0 0 0 0 0
.Lccwsense :
.long 0 x0 4 2 0 0 0 0 1 ,0 x00 0 0 0 0 0 0
.Lwaitpsw :
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
.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
.Lsnsret : .long 0
# endif / * C O N F I G _ I P L _ T A P E * /
# ifdef C O N F I G _ I P L _ V M
# 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
.org 0xf0
#
# 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
#
.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
.Linit :
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
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
.Lldlp :
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
.Lwait4irq :
2005-11-07 11:59:12 +03: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
2005-04-17 02:20:36 +04:00
lpsw . L w a i t p s w
.Lioint :
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 )
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
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
.Lcont :
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
.Lincr :
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
b . L l d l p
.Llderr :
lpsw . L c r a s h
.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
.Lnewpsw :
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
.Lwaitpsw :
.long 0 x0 2 0 a00 0 0 ,0 x80 0 0 0 0 0 0 + . L i o i n t
.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 * /
iplstart :
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
2005-11-07 11:59:12 +03:00
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 :
2005-11-07 11:59:12 +03:00
l % 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 ) # r a m d i s k l o c . i s t e m p
2005-04-17 02:20:36 +04:00
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
.Lnotrunc :
2005-11-07 11:59:12 +03:00
l % r4 ,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 )
2005-04-17 02:20:36 +04:00
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
.Lidebc :
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
.Ldocv :
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
.Ldelspc :
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
.Lcntlp :
brct % r2 ,. L d e l s p c
.Leolp :
slr % r0 ,% r0
stc % r0 ,0 ( % r2 ,% r3 ) # t e r m i n a t e b u f f e r
.Lnopf :
#
# load r a m d i s k f r o m i p l d e v i c e
#
.Lagain2 :
2005-11-07 11:59:12 +03:00
l % 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 ) # a d d r o f r a m d i s k
2005-04-17 02:20:36 +04:00
bas % r14 ,. L l o a d e r # l o a d r a m d i s k
2005-11-07 11:59:12 +03:00
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 a m d i s k
2005-04-17 02:20:36 +04:00
ltr % r2 ,% r2
bnz . L r d c o n t
2005-11-07 11:59:12 +03:00
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 :
2005-11-07 11:59:12 +03:00
l % 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 )
2005-04-17 02:20:36 +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
# 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
#
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
2005-06-22 04:16:31 +04:00
diag % r2 ,% r3 ,8
2005-07-30 01:03:36 +04:00
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
.Lwaitforirq :
2005-06-22 04:16:31 +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
.Lwaitrdrirq :
lpsw . L r d r w a i t p s w
.Lrdrint :
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 :
2005-06-22 04:16:31 +04:00
b . L n o l o a d
.align 8
.Lrdrnewpsw :
.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
.Lrdrwaitpsw :
.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 :
l % r1 ,. L s t a r t u p
br % r1
.Lparm : .long PARMAREA
.Lstartup : .long startup
.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' */
# endif / * C O N F I G _ I P L * /
#
# 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 .
#
.org 0x800
.globl start
start :
stm % r0 ,% r15 ,0 x07 b0 # s t o r e r e g i s t e r s
basr % r12 ,% r0
.base :
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
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
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
.sk8x8 :
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
.gotr :
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 )
stidp _ _ L C _ C P U I D # A r e w e r u n n i n g o n V M m a y b e
cli _ _ L C _ C P U I D ,0 x f f
bnz . t e s t
.long 0x83300060 # diag 3 ,0 ,x ' 0 0 6 0 ' - s t o r a g e s i z e
b . d o n e
.test :
mvc 0 x68 ( 8 ) ,. p g m n w # s e t u p p g m c h e c k h a n d l e r
l % r2 ,. f o u r m e g
lr % r3 ,% r2
bctr % r3 ,% r0 # 4 M - 1
.loop : iske % r0 ,% r3
ar % r3 ,% r2
.pgmx :
sr % r3 ,% r2
la % r3 ,1 ( % r3 )
.done :
l % r1 ,. m e m s i z e
2005-11-07 11:59:12 +03:00
st % r3 ,A R C H _ O F F S E T ( % r1 )
2005-04-17 02:20:36 +04:00
slr % r0 ,% r0
2005-11-07 11:59:12 +03:00
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 )
2005-04-17 02:20:36 +04:00
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
.memsize : .long memory_size
.fourmeg : .long 0x00400000 # 4 M
.pgmnw : .long 0 x0 0 0 8 0 0 0 0 ,. p g m x
.lowcase :
.byte 0 x0 0 ,0 x01 ,0 x02 ,0 x03 ,0 x04 ,0 x05 ,0 x06 ,0 x07
.byte 0 x0 8 ,0 x09 ,0 x0 a ,0 x0 b ,0 x0 c ,0 x0 d ,0 x0 e ,0 x0 f
.byte 0 x1 0 ,0 x11 ,0 x12 ,0 x13 ,0 x14 ,0 x15 ,0 x16 ,0 x17
.byte 0 x1 8 ,0 x19 ,0 x1 a ,0 x1 b ,0 x1 c ,0 x1 d ,0 x1 e ,0 x1 f
.byte 0 x2 0 ,0 x21 ,0 x22 ,0 x23 ,0 x24 ,0 x25 ,0 x26 ,0 x27
.byte 0 x2 8 ,0 x29 ,0 x2 a ,0 x2 b ,0 x2 c ,0 x2 d ,0 x2 e ,0 x2 f
.byte 0 x3 0 ,0 x31 ,0 x32 ,0 x33 ,0 x34 ,0 x35 ,0 x36 ,0 x37
.byte 0 x3 8 ,0 x39 ,0 x3 a ,0 x3 b ,0 x3 c ,0 x3 d ,0 x3 e ,0 x3 f
.byte 0 x4 0 ,0 x41 ,0 x42 ,0 x43 ,0 x44 ,0 x45 ,0 x46 ,0 x47
.byte 0 x4 8 ,0 x49 ,0 x4 a ,0 x4 b ,0 x4 c ,0 x4 d ,0 x4 e ,0 x4 f
.byte 0 x5 0 ,0 x51 ,0 x52 ,0 x53 ,0 x54 ,0 x55 ,0 x56 ,0 x57
.byte 0 x5 8 ,0 x59 ,0 x5 a ,0 x5 b ,0 x5 c ,0 x5 d ,0 x5 e ,0 x5 f
.byte 0 x6 0 ,0 x61 ,0 x62 ,0 x63 ,0 x64 ,0 x65 ,0 x66 ,0 x67
.byte 0 x6 8 ,0 x69 ,0 x6 a ,0 x6 b ,0 x6 c ,0 x6 d ,0 x6 e ,0 x6 f
.byte 0 x7 0 ,0 x71 ,0 x72 ,0 x73 ,0 x74 ,0 x75 ,0 x76 ,0 x77
.byte 0 x7 8 ,0 x79 ,0 x7 a ,0 x7 b ,0 x7 c ,0 x7 d ,0 x7 e ,0 x7 f
.byte 0 x8 0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87
.byte 0 x8 8 ,0 x89 ,0 x8 a ,0 x8 b ,0 x8 c ,0 x8 d ,0 x8 e ,0 x8 f
.byte 0 x9 0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97
.byte 0 x9 8 ,0 x99 ,0 x9 a ,0 x9 b ,0 x9 c ,0 x9 d ,0 x9 e ,0 x9 f
.byte 0 xa0 ,0 x a1 ,0 x a2 ,0 x a3 ,0 x a4 ,0 x a5 ,0 x a6 ,0 x a7
.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
.byte 0 xb0 ,0 x b1 ,0 x b2 ,0 x b3 ,0 x b4 ,0 x b5 ,0 x b6 ,0 x b7
.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
.byte 0 xc0 ,0 x81 ,0 x82 ,0 x83 ,0 x84 ,0 x85 ,0 x86 ,0 x87 # . a b c d e f g
.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
.byte 0 xd0 ,0 x91 ,0 x92 ,0 x93 ,0 x94 ,0 x95 ,0 x96 ,0 x97 # . j k l m n o p
.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
.byte 0 xf0 ,0 x f1 ,0 x f2 ,0 x f3 ,0 x f4 ,0 x f5 ,0 x f6 ,0 x f7
.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
2005-11-07 11:59:12 +03:00
.macro GET_IPL_DEVICE
2005-10-31 02:00:11 +03:00
.Lget_ipl_device :
basr % r12 ,0
2005-11-07 11:59:12 +03:00
.LGID : l % r1 ,0 x b8 # g e t s i d
2005-10-31 02:00:11 +03:00
sll % r1 ,1 5 # t e s t i f s u b c h a n n e l i s e n a b l e d
srl % r1 ,3 1
ltr % r1 ,% r1
bz 0 ( % r14 ) # s u b c h a n n e l d i s a b l e d
l % r1 ,0 x b8
2005-11-07 11:59:12 +03:00
la % r5 ,. L i p l _ s c h i b - . L G I D ( % r12 )
2005-10-31 02:00:11 +03:00
stsch 0 ( % r5 ) # g e t s c h i b o f s u b c h a n n e l
bnz 0 ( % r14 ) # s c h i b n o t a v a i l a b l e
tm 5 ( % r5 ) ,0 x01 # d e v n o v a l i d ?
bno 0 ( % r14 )
2005-11-07 11:59:12 +03:00
la % r6 ,i p l _ p a r a m e t e r _ f l a g s - . L G I D ( % r12 )
2005-10-31 02:00:11 +03:00
oi 3 ( % r6 ) ,0 x01 # s e t f l a g
2005-11-07 11:59:12 +03:00
la % r2 ,i p l _ d e v n o - . L G I D ( % r12 )
2005-10-31 02:00:11 +03:00
mvc 0 ( 2 ,% r2 ) ,6 ( % r5 ) # s t o r e d e v n o
tm 4 ( % r5 ) ,0 x80 # q d i o c a p a b l e d e v i c e ?
bno 0 ( % r14 )
oi 3 ( % r6 ) ,0 x02 # s e t f l a g
# copy i p l p a r a m e t e r s
lhi % r0 ,4 0 9 6
l % r2 ,2 0 ( % r0 ) # g e t a d d r e s s o f p a r a m e t e r l i s t
lhi % r3 ,I P L _ P A R M B L O C K _ O R I G I N
st % r3 ,2 0 ( % r0 )
lhi % r4 ,1
cr % r2 ,% r3 # s t a r t p a r a m e t e r s < d e s t i n a t i o n ?
jl 0 f
lhi % r1 ,1 # c o p y d i r e c t i o n i s u p w a r d s
j 1 f
0 : lhi % r1 ,- 1 # c o p y d i r e c t i o n i s d o w n w a r d s
ar % r2 ,% r0
ar % r3 ,% r0
ar % r2 ,% r1
ar % r3 ,% r1
1 : mvc 0 ( 1 ,% r3 ) ,0 ( % r2 ) # f i n a l l y c o p y i p l p a r a m e t e r s
ar % r3 ,% r1
ar % r2 ,% r1
sr % r0 ,% r4
jne 1 b
b 0 ( % r14 )
.align 4
.Lipl_schib :
.rept 13
.long 0
.endr
.globl ipl_parameter_flags
ipl_parameter_flags :
.long 0
.globl ipl_devno
ipl_devno :
.word 0
2005-11-07 11:59:12 +03:00
.endm
2005-10-31 02:00:11 +03:00
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