2007-02-05 23:18:37 +03:00
/ *
* arch/ s39 0 / k e r n e l / b a s e . S
*
* Copyright I B M C o r p . 2 0 0 6 ,2 0 0 7
* 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 12:48:19 +04:00
# include < l i n u x / l i n k a g e . h >
2010-02-27 00:37:43 +03:00
# include < a s m / a s m - o f f s e t s . h >
2007-02-05 23:18:37 +03:00
# include < a s m / p t r a c e . h >
2012-06-04 17:05:43 +04:00
# include < a s m / s i g p . h >
2007-02-05 23:18:37 +03:00
# ifdef C O N F I G _ 6 4 B I T
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ m c c k _ h a n d l e r )
2007-02-05 23:18:37 +03: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 12:48:19 +04:00
.align 8
2007-02-05 23:18:37 +03:00
.globl s390_base_mcck_handler_fn
s390_base_mcck_handler_fn :
.quad 0
.previous
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ e x t _ h a n d l e r )
2011-12-27 14:27:15 +04:00
stmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 23:18:37 +03: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 14:27:15 +04:00
1 : lmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 23:18:37 +03: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 12:48:19 +04:00
.align 8
2007-02-05 23:18:37 +03:00
.globl s390_base_ext_handler_fn
s390_base_ext_handler_fn :
.quad 0
.previous
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ p g m _ h a n d l e r )
2011-12-27 14:27:15 +04:00
stmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 23:18:37 +03: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 14:27:15 +04:00
lmg % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 23:18:37 +03: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 12:48:19 +04:00
.align 8
2007-02-05 23:18:37 +03:00
.globl s390_base_pgm_handler_fn
s390_base_pgm_handler_fn :
.quad 0
.previous
2011-08-03 18:44:22 +04: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
#
# The f o l l o w i n g c o n d i t i o n s m u s t b e e n s u r e d b e f o r e c a l l i n g t h i s f u n c t i o n :
# * Prefix r e g i s t e r = 0
# * Lowcore p r o t e c t i o n i s d i s a b l e d
#
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 )
2011-10-30 18:16:40 +04: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 )
2012-05-21 13:30:30 +04: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 18:44:22 +04: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
diag % r1 ,% r1 ,0 x30 8
.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 17:05:43 +04: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 18:44:22 +04: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 18:16:40 +04: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 )
2012-05-21 13:30:30 +04: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 18:44:22 +04: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 13:30:30 +04:00
.section .data . .nosave , " aw" ,@progbits
.align 8
.Lcontinue_psw :
.quad 0 , .Lcontinue
.previous
2011-08-03 18:44:22 +04:00
.section .bss
.align 8
.Lctlregs :
.rept 16
.quad 0
.endr
2011-10-30 18:16:40 +04:00
.Lfpctl :
.long 0
2011-08-03 18:44:22 +04:00
.previous
2007-02-05 23:18:37 +03:00
# else / * C O N F I G _ 6 4 B I T * /
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ m c c k _ h a n d l e r )
2007-02-05 23:18:37 +03:00
basr % r13 ,0
0 : l % 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
ahi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
l % r1 ,2 f - 0 b ( % r13 )
l % r1 ,0 ( % r1 )
ltr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
1 : lm % r0 ,% r15 ,_ _ L C _ G P R E G S _ S A V E _ A R E A
lpsw _ _ L C _ M C K _ O L D _ P S W
2 : .long s 390 _ base_ m c c k _ h a n d l e r _ f n
.section .bss
2011-07-24 12:48:19 +04:00
.align 4
2007-02-05 23:18:37 +03:00
.globl s390_base_mcck_handler_fn
s390_base_mcck_handler_fn :
.long 0
.previous
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ e x t _ h a n d l e r )
2011-12-27 14:27:15 +04:00
stm % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 23:18:37 +03:00
basr % r13 ,0
0 : ahi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
l % r1 ,2 f - 0 b ( % r13 )
l % r1 ,0 ( % r1 )
ltr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
2011-12-27 14:27:15 +04:00
1 : lm % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ A S Y N C
2007-02-05 23:18:37 +03: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
lpsw _ _ L C _ E X T _ O L D _ P S W
2 : .long s 390 _ base_ e x t _ h a n d l e r _ f n
.section .bss
2011-07-24 12:48:19 +04:00
.align 4
2007-02-05 23:18:37 +03:00
.globl s390_base_ext_handler_fn
s390_base_ext_handler_fn :
.long 0
.previous
2011-07-24 12:48:19 +04:00
ENTRY( s39 0 _ b a s e _ p g m _ h a n d l e r )
2011-12-27 14:27:15 +04:00
stm % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 23:18:37 +03:00
basr % r13 ,0
0 : ahi % r15 ,- S T A C K _ F R A M E _ O V E R H E A D
l % r1 ,2 f - 0 b ( % r13 )
l % r1 ,0 ( % r1 )
ltr % r1 ,% r1
jz 1 f
basr % r14 ,% r1
2011-12-27 14:27:15 +04:00
lm % r0 ,% r15 ,_ _ L C _ S A V E _ A R E A _ S Y N C
2007-02-05 23:18:37 +03:00
lpsw _ _ L C _ P G M _ O L D _ P S W
1 : lpsw d i s a b l e d _ w a i t _ p s w - 0 b ( % r13 )
2 : .long s 390 _ base_ p g m _ h a n d l e r _ f n
disabled_wait_psw :
.align 8
.long 0 x0 0 0 a00 0 0 ,0 x00 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 12:48:19 +04:00
.align 4
2007-02-05 23:18:37 +03:00
.globl s390_base_pgm_handler_fn
s390_base_pgm_handler_fn :
.long 0
.previous
# endif / * C O N F I G _ 6 4 B I T * /