2011-10-30 15:16:40 +01:00
/ *
* S3 9 0 k d u m p l o w l e v e l f u n c t i o n s ( n e w k e r n e l )
*
* Copyright I B M C o r p . 2 0 1 1
* Author( s ) : M i c h a e l H o l z h e u < h o l z h e u @linux.vnet.ibm.com>
* /
2012-06-04 15:05:43 +02:00
# include < a s m / s i g p . h >
2011-10-30 15:16:40 +01:00
# define D A T A M O V E R _ A D D R 0 x40 0 0
# define C O P Y _ P A G E _ A D D R 0 x60 0 0
# ifdef C O N F I G _ C R A S H _ D U M P
#
# kdump e n t r y ( n e w k e r n e l - n o t y e t r e l o c a t e d )
#
# Note : This c o d e h a s t o b e p o s i t i o n i n d e p e n d e n t
#
.align 2
.Lep_startup_kdump :
lhi % r1 ,2 # 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-10-30 15:16:40 +01: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
basr % r13 ,0
.Lbase :
larl % r2 ,. L b a s e _ a d d r # C h e c k , i f w e h a v e b e e n
lg % r2 ,0 ( % r2 ) # a l r e a d y r e l o c a t e d :
clgr % r2 ,% r13 #
jne . L r e l o c a t e # N o : S t a r t d a t a m o v e r
lghi % r2 ,0 # Y e s : S t a r t k d u m p k e r n e l
brasl % r14 ,s t a r t u p _ k d u m p _ r e l o c a t e d
.Lrelocate :
larl % r4 ,s t a r t u p
lg % r2 ,0 x41 8 ( % r4 ) # G e t k d u m p b a s e
lg % r3 ,0 x42 0 ( % r4 ) # G e t k d u m p s i z e
larl % r10 ,. L c o p y _ s t a r t # S o u r c e o f d a t a m o v e r
lghi % r8 ,D A T A M O V E R _ A D D R # T a r g e t o f d a t a m o v e r
mvc 0 ( 2 5 6 ,% r8 ) ,0 ( % r10 ) # C o p y d a t a m o v e r c o d e
agr % r8 ,% r2 # C o p y d a t a m o v e r t o
mvc 0 ( 2 5 6 ,% r8 ) ,0 ( % r10 ) # r e s e r v e d m e m
lghi % r14 ,D A T A M O V E R _ A D D R # J u m p t o c o p i e d d a t a m o v e r
basr % r14 ,% r14
.Lbase_addr :
.quad .Lbase
#
# kdump d a t a m o v e r c o d e ( r u n s a t a d d r e s s D A T A M O V E R _ A D D R )
#
# r2 : kdump b a s e a d d r e s s
# r3 : kdump s i z e
#
.Lcopy_start :
basr % r13 ,0 # B a s e
0 :
lgr % r11 ,% r2 # S a v e k d u m p b a s e a d d r e s s
lgr % r12 ,% r2
agr % r12 ,% r3 # C o m p u t e k d u m p e n d a d d r e s s
lghi % r5 ,0
lghi % r10 ,C O P Y _ P A G E _ A D D R # L o a d c o p y p a g e a d d r e s s
1 :
mvc 0 ( 2 5 6 ,% r10 ) ,0 ( % r5 ) # C o p y o l d k e r n e l t o t m p
mvc 0 ( 2 5 6 ,% r5 ) ,0 ( % r11 ) # C o p y n e w k e r n e l t o o l d
mvc 0 ( 2 5 6 ,% r11 ) ,0 ( % r10 ) # C o p y t m p t o n e w
aghi % r11 ,2 5 6
aghi % r5 ,2 5 6
clgr % r11 ,% r12
jl 1 b
lg % r14 ,. L s t a r t u p _ k d u m p - 0 b ( % r13 )
basr % r14 ,% r14 # S t a r t r e l o c a t e d k e r n e l
.Lstartup_kdump :
.long 0 x0 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 + s t a r t u p _ k d u m p _ r e l o c a t e d
.Lcopy_end :
#
# Startup o f k d u m p ( r e l o c a t e d n e w k e r n e l )
#
.align 2
startup_kdump_relocated :
basr % r13 ,0
2012-10-15 15:09:08 +02:00
0 : lpswe . L r e s t a r t _ p s w - 0 b ( % r13 ) # S t a r t n e w k e r n e l . . .
2011-10-30 15:16:40 +01:00
.align 8
.Lrestart_psw :
2012-10-15 15:09:08 +02:00
.quad 0 x0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + s t a r t u p
2011-10-30 15:16:40 +01:00
# else
.align 2
.Lep_startup_kdump :
larl % r13 ,s t a r t u p _ k d u m p _ c r a s h
lpswe 0 ( % r13 )
.align 8
startup_kdump_crash :
.quad 0 x0 0 0 2 0 0 0 0 8 0 0 0 0 0 0 0 ,0 x00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + s t a r t u p _ k d u m p _ c r a s h
# endif / * C O N F I G _ C R A S H _ D U M P * /