2005-04-16 22:20:36 +00:00
|
|
|
/*
|
2012-07-20 09:15:04 +00:00
|
|
|
* Copyright IBM Corp 2000, 2011
|
2009-03-26 14:24:57 +00:00
|
|
|
* Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
|
|
|
|
* Denis Joseph Barrow,
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
|
2011-07-24 08:48:19 +00:00
|
|
|
#include <linux/linkage.h>
|
2010-02-26 21:37:43 +00:00
|
|
|
#include <asm/asm-offsets.h>
|
2012-06-04 13:05:43 +00:00
|
|
|
#include <asm/sigp.h>
|
2007-03-05 22:35:43 +00:00
|
|
|
|
2011-08-03 14:44:21 +00:00
|
|
|
#
|
2015-10-29 09:28:26 +00:00
|
|
|
# Issue "store status" for the current CPU to its prefix page
|
|
|
|
# and call passed function afterwards
|
2011-08-03 14:44:21 +00:00
|
|
|
#
|
2015-10-29 09:28:26 +00:00
|
|
|
# r2 = Function to be called after store status
|
|
|
|
# r3 = Parameter for function
|
2011-08-03 14:44:21 +00:00
|
|
|
#
|
|
|
|
ENTRY(store_status)
|
|
|
|
/* Save register one and load save area base */
|
2011-12-27 10:27:15 +00:00
|
|
|
stg %r1,__LC_SAVE_AREA_RESTART
|
2011-08-03 14:44:21 +00:00
|
|
|
/* General purpose registers */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_GPREGS_SAVE_AREA
|
|
|
|
stmg %r0,%r15,0(%r1)
|
|
|
|
mvc 8(8,%r1),__LC_SAVE_AREA_RESTART
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Control registers */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_CREGS_SAVE_AREA
|
|
|
|
stctg %c0,%c15,0(%r1)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Access registers */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_AREGS_SAVE_AREA
|
|
|
|
stam %a0,%a15,0(%r1)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Floating point registers */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_FPREGS_SAVE_AREA
|
|
|
|
std %f0, 0x00(%r1)
|
|
|
|
std %f1, 0x08(%r1)
|
|
|
|
std %f2, 0x10(%r1)
|
|
|
|
std %f3, 0x18(%r1)
|
|
|
|
std %f4, 0x20(%r1)
|
|
|
|
std %f5, 0x28(%r1)
|
|
|
|
std %f6, 0x30(%r1)
|
|
|
|
std %f7, 0x38(%r1)
|
|
|
|
std %f8, 0x40(%r1)
|
|
|
|
std %f9, 0x48(%r1)
|
|
|
|
std %f10,0x50(%r1)
|
|
|
|
std %f11,0x58(%r1)
|
|
|
|
std %f12,0x60(%r1)
|
|
|
|
std %f13,0x68(%r1)
|
|
|
|
std %f14,0x70(%r1)
|
|
|
|
std %f15,0x78(%r1)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Floating point control register */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_FP_CREG_SAVE_AREA
|
|
|
|
stfpc 0(%r1)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* CPU timer */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_CPU_TIMER_SAVE_AREA
|
|
|
|
stpt 0(%r1)
|
2015-10-29 09:28:26 +00:00
|
|
|
/* Store prefix register */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_PREFIX_SAVE_AREA
|
2015-10-29 09:28:26 +00:00
|
|
|
stpx 0(%r1)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Clock comparator - seven bytes */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_CLOCK_COMP_SAVE_AREA
|
2015-10-29 09:28:26 +00:00
|
|
|
larl %r4,.Lclkcmp
|
|
|
|
stckc 0(%r4)
|
|
|
|
mvc 1(7,%r1),1(%r4)
|
2011-08-03 14:44:21 +00:00
|
|
|
/* Program status word */
|
2015-10-23 07:05:38 +00:00
|
|
|
lghi %r1,__LC_PSW_SAVE_AREA
|
2015-10-29 09:28:26 +00:00
|
|
|
epsw %r4,%r5
|
|
|
|
st %r4,0(%r1)
|
|
|
|
st %r5,4(%r1)
|
2015-10-23 07:05:38 +00:00
|
|
|
stg %r2,8(%r1)
|
2015-10-29 09:28:26 +00:00
|
|
|
lgr %r1,%r2
|
|
|
|
lgr %r2,%r3
|
|
|
|
br %r1
|
2011-10-30 14:16:40 +00:00
|
|
|
|
|
|
|
.section .bss
|
|
|
|
.align 8
|
2011-08-03 14:44:21 +00:00
|
|
|
.Lclkcmp: .quad 0x0000000000000000
|
2011-10-30 14:16:40 +00:00
|
|
|
.previous
|
2011-08-03 14:44:21 +00:00
|
|
|
|
2007-03-05 22:35:43 +00:00
|
|
|
#
|
|
|
|
# do_reipl_asm
|
|
|
|
# Parameter: r2 = schid of reipl device
|
|
|
|
#
|
|
|
|
|
2011-07-24 08:48:19 +00:00
|
|
|
ENTRY(do_reipl_asm)
|
|
|
|
basr %r13,0
|
2006-12-04 14:40:26 +00:00
|
|
|
.Lpg0: lpswe .Lnewpsw-.Lpg0(%r13)
|
2015-10-29 09:28:26 +00:00
|
|
|
.Lpg1: lgr %r3,%r2
|
|
|
|
larl %r2,.Lstatus
|
|
|
|
brasl %r14,store_status
|
2006-09-20 13:58:49 +00:00
|
|
|
|
2015-10-29 09:28:26 +00:00
|
|
|
.Lstatus: lctlg %c6,%c6,.Lall-.Lpg0(%r13)
|
2006-09-28 14:56:37 +00:00
|
|
|
lgr %r1,%r2
|
|
|
|
mvc __LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13)
|
|
|
|
stsch .Lschib-.Lpg0(%r13)
|
|
|
|
oi .Lschib+5-.Lpg0(%r13),0x84
|
2015-02-13 12:04:39 +00:00
|
|
|
.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
|
2006-09-28 14:56:37 +00:00
|
|
|
msch .Lschib-.Lpg0(%r13)
|
|
|
|
lghi %r0,5
|
|
|
|
.Lssch: ssch .Liplorb-.Lpg0(%r13)
|
2005-04-16 22:20:36 +00:00
|
|
|
jz .L001
|
2006-09-28 14:56:37 +00:00
|
|
|
brct %r0,.Lssch
|
2005-04-16 22:20:36 +00:00
|
|
|
bas %r14,.Ldisab-.Lpg0(%r13)
|
2006-09-28 14:56:37 +00:00
|
|
|
.L001: mvc __LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13)
|
|
|
|
.Ltpi: lpswe .Lwaitpsw-.Lpg0(%r13)
|
2005-04-16 22:20:36 +00:00
|
|
|
.Lcont: c %r1,__LC_SUBCHANNEL_ID
|
|
|
|
jnz .Ltpi
|
|
|
|
clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
|
|
|
|
jnz .Ltpi
|
2006-09-28 14:56:37 +00:00
|
|
|
tsch .Liplirb-.Lpg0(%r13)
|
2005-04-16 22:20:36 +00:00
|
|
|
tm .Liplirb+9-.Lpg0(%r13),0xbf
|
2006-09-28 14:56:37 +00:00
|
|
|
jz .L002
|
|
|
|
bas %r14,.Ldisab-.Lpg0(%r13)
|
|
|
|
.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
|
|
|
|
jz .L003
|
|
|
|
bas %r14,.Ldisab-.Lpg0(%r13)
|
2006-12-04 14:40:26 +00:00
|
|
|
.L003: st %r1,__LC_SUBCHANNEL_ID
|
2006-09-28 14:56:37 +00:00
|
|
|
lhi %r1,0 # mode 0 = esa
|
2015-02-13 12:04:39 +00:00
|
|
|
slr %r0,%r0 # set cpuid to zero
|
2012-06-04 13:05:43 +00:00
|
|
|
sigp %r1,%r0,SIGP_SET_ARCHITECTURE # switch to esa mode
|
2006-09-28 14:56:37 +00:00
|
|
|
lpsw 0
|
|
|
|
.Ldisab: sll %r14,1
|
|
|
|
srl %r14,1 # need to kill hi bit to avoid specification exceptions.
|
|
|
|
st %r14,.Ldispsw+12-.Lpg0(%r13)
|
2005-04-16 22:20:36 +00:00
|
|
|
lpswe .Ldispsw-.Lpg0(%r13)
|
2006-09-28 14:56:37 +00:00
|
|
|
.align 8
|
2005-04-16 22:20:36 +00:00
|
|
|
.Lall: .quad 0x00000000ff000000
|
2006-09-28 14:56:37 +00:00
|
|
|
.align 16
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* These addresses have to be 31 bit otherwise
|
|
|
|
* the sigp will throw a specifcation exception
|
|
|
|
* when switching to ESA mode as bit 31 be set
|
|
|
|
* in the ESA psw.
|
|
|
|
* Bit 31 of the addresses has to be 0 for the
|
|
|
|
* 31bit lpswe instruction a fact they appear to have
|
2011-03-31 01:57:33 +00:00
|
|
|
* omitted from the pop.
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
2006-09-28 14:56:37 +00:00
|
|
|
.Lnewpsw: .quad 0x0000000080000000
|
|
|
|
.quad .Lpg1
|
|
|
|
.Lpcnew: .quad 0x0000000080000000
|
|
|
|
.quad .Lecs
|
|
|
|
.Lionew: .quad 0x0000000080000000
|
|
|
|
.quad .Lcont
|
2005-04-16 22:20:36 +00:00
|
|
|
.Lwaitpsw: .quad 0x0202000080000000
|
2006-09-28 14:56:37 +00:00
|
|
|
.quad .Ltpi
|
|
|
|
.Ldispsw: .quad 0x0002000080000000
|
|
|
|
.quad 0x0000000000000000
|
|
|
|
.Liplccws: .long 0x02000000,0x60000018
|
|
|
|
.long 0x08000008,0x20000001
|
2005-04-16 22:20:36 +00:00
|
|
|
.Liplorb: .long 0x0049504c,0x0040ff80
|
|
|
|
.long 0x00000000+.Liplccws
|
2006-09-28 14:56:37 +00:00
|
|
|
.Lschib: .long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
2005-04-16 22:20:36 +00:00
|
|
|
.Liplirb: .long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|
|
|
|
.long 0x00000000,0x00000000
|