2007-02-05 21:18:37 +01:00
/ *
* arch/ s39 0 / k e r n e l / b a s e . S
*
2012-07-20 11:15:04 +02:00
* Copyright I B M C o r p . 2 0 0 6 , 2 0 0 7
2007-02-05 21:18:37 +01:00
* Author( s ) : H e i k o C a r s t e n s < h e i k o . c a r s t e n s @de.ibm.com>
* Michael H o l z h e u < h o l z h e u @de.ibm.com>
* /
2011-07-24 10:48:19 +02:00
# include < l i n u x / l i n k a g e . h >
2010-02-26 22:37:43 +01:00
# include < a s m / a s m - o f f s e t s . h >
2007-02-05 21:18:37 +01:00
# include < a s m / p t r a c e . h >
2012-06-04 15:05:43 +02:00
# include < a s m / s i g p . h >
2007-02-05 21:18:37 +01:00
2011-07-24 10:48:19 +02:00
ENTRY( s39 0 _ b a s e _ m c c k _ h a n d l e r )
2007-02-05 21:18:37 +01:00
basr % r13 ,0
0 : lg % r15 ,_ _ L C _ P A N I C _ S T A C K # l o a d p a n i c s t a c k
aghi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
larl % r1 ,s39 0 _ b a s e _ m c c k _ h a n d l e r _ f n
lg % r1 ,0 ( % r1 )
ltgr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
1 : la % r1 ,4 0 9 5
lmg % r0 ,% r15 ,_ _ L C _ G P R E G S _ S A V E _ A R E A - 4 0 9 5 ( % r1 )
lpswe _ _ L C _ M C K _ O L D _ P S W
.section .bss
2011-07-24 10:48:19 +02:00
.align 8
2007-02-05 21:18:37 +01:00
.globl s390_base_mcck_handler_fn
s390_base_mcck_handler_fn :
.quad 0
.previous
2011-07-24 10:48:19 +02:00
ENTRY( s39 0 _ b a s e _ e x t _ h a n d l e r )
2011-12-27 11:27:15 +01:00
stmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 21:18:37 +01:00
basr % r13 ,0
0 : aghi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
larl % r1 ,s39 0 _ b a s e _ e x t _ h a n d l e r _ f n
lg % r1 ,0 ( % r1 )
ltgr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
2011-12-27 11:27:15 +01:00
1 : lmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 21:18:37 +01:00
ni _ _ L C _ E X T _ O L D _ P S W + 1 ,0 x f d # c l e a r w a i t s t a t e b i t
lpswe _ _ L C _ E X T _ O L D _ P S W
.section .bss
2011-07-24 10:48:19 +02:00
.align 8
2007-02-05 21:18:37 +01:00
.globl s390_base_ext_handler_fn
s390_base_ext_handler_fn :
.quad 0
.previous
2011-07-24 10:48:19 +02:00
ENTRY( s39 0 _ b a s e _ p g m _ h a n d l e r )
2011-12-27 11:27:15 +01:00
stmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 21:18:37 +01:00
basr % r13 ,0
0 : aghi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
larl % r1 ,s39 0 _ b a s e _ p g m _ h a n d l e r _ f n
lg % r1 ,0 ( % r1 )
ltgr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
2011-12-27 11:27:15 +01:00
lmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 21:18:37 +01:00
lpswe _ _ L C _ P G M _ O L D _ P S W
1 : lpswe d i s a b l e d _ w a i t _ p s w - 0 b ( % r13 )
.align 8
disabled_wait_psw :
.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 + s39 0 _ b a s e _ p g m _ h a n d l e r
.section .bss
2011-07-24 10:48:19 +02:00
.align 8
2007-02-05 21:18:37 +01:00
.globl s390_base_pgm_handler_fn
s390_base_pgm_handler_fn :
.quad 0
.previous
2011-08-03 16:44:22 +02:00
#
# Calls d i a g 3 0 8 s u b c o d e 1 a n d c o n t i n u e s e x e c u t i o n
#
ENTRY( d i a g 3 0 8 _ r e s e t )
larl % r4 ,. L c t l r e g s # S a v e c o n t r o l r e g i s t e r s
stctg % c0 ,% c15 ,0 ( % r4 )
2015-05-26 19:05:23 +02:00
lg % r2 ,0 ( % r4 ) # D i s a b l e l o w c o r e p r o t e c t i o n
nilh % r2 ,0 x e f f f
larl % r4 ,. L c t l r e g 0
stg % r2 ,0 ( % r4 )
lctlg % c0 ,% c0 ,0 ( % r4 )
2011-10-30 15:16:40 +01:00
larl % r4 ,. L f p c t l # F l o a t i n g p o i n t c o n t r o l r e g i s t e r
stfpc 0 ( % r4 )
2015-05-26 19:05:23 +02:00
larl % r4 ,. L p r e f i x # S a v e p r e f i x r e g i s t e r
stpx 0 ( % r4 )
larl % r4 ,. L p r e f i x _ z e r o # S e t p r e f i x r e g i s t e r t o 0
spx 0 ( % r4 )
2012-05-21 11:30:30 +02:00
larl % r4 ,. L c o n t i n u e _ p s w # S a v e P S W f l a g s
epsw % r2 ,% r3
stm % r2 ,% r3 ,0 ( % r4 )
2011-08-03 16:44:22 +02:00
larl % r4 ,. L r e s t a r t _ p s w # S e t u p r e s t a r t P S W a t a b s o l u t e 0
lghi % r3 ,0
lg % r4 ,0 ( % r4 ) # S a v e P S W
sturg % r4 ,% r3 # U s e s t u r g , b e c a u s e o f l a r g e p a g e s
lghi % r1 ,1
2015-01-14 17:52:10 +01:00
lghi % r0 ,0
diag % r0 ,% r1 ,0 x30 8
2011-08-03 16:44:22 +02:00
.Lrestart_part2 :
lhi % r0 ,0 # L o a d r 0 w i t h z e r o
lhi % r1 ,2 # U s e m o d e 2 = E S A M E ( d u m p )
2012-06-04 15:05:43 +02:00
sigp % r1 ,% r0 ,S I G P _ S E T _ A R C H I T E C T U R E # S w i t c h t o E S A M E m o d e
2011-08-03 16:44:22 +02:00
sam6 4 # S w i t c h t o 64 b i t a d d r e s s i n g m o d e
larl % r4 ,. L c t l r e g s # R e s t o r e c o n t r o l r e g i s t e r s
lctlg % c0 ,% c15 ,0 ( % r4 )
2011-10-30 15:16:40 +01:00
larl % r4 ,. L f p c t l # R e s t o r e f l o a t i n g p o i n t c t l r e g i s t e r
lfpc 0 ( % r4 )
2015-05-26 19:05:23 +02:00
larl % r4 ,. L p r e f i x # R e s t o r e p r e f i x r e g i s t e r
spx 0 ( % r4 )
2012-05-21 11:30:30 +02:00
larl % r4 ,. L c o n t i n u e _ p s w # R e s t o r e P S W f l a g s
lpswe 0 ( % r4 )
.Lcontinue :
2011-08-03 16:44:22 +02:00
br % r14
.align 16
.Lrestart_psw :
.long 0 x0 0 0 8 0 0 0 0 ,0 x80 0 0 0 0 0 0 + . L r e s t a r t _ p a r t 2
2012-05-21 11:30:30 +02:00
.section .data . .nosave , " aw" ,@progbits
.align 8
.Lcontinue_psw :
.quad 0 , .Lcontinue
.previous
2011-08-03 16:44:22 +02:00
.section .bss
.align 8
2015-05-26 19:05:23 +02:00
.Lctlreg0 :
.quad 0
2011-08-03 16:44:22 +02:00
.Lctlregs :
.rept 16
.quad 0
.endr
2011-10-30 15:16:40 +01:00
.Lfpctl :
.long 0
2015-05-26 19:05:23 +02:00
.Lprefix :
.long 0
.Lprefix_zero :
.long 0
2011-08-03 16:44:22 +02:00
.previous