blob: dd8016b0477eae6117c8cae5917e8c59d1fe65d5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * S390 version
Heiko Carstensa53c8fa2012-07-20 11:15:04 +02003 * Copyright IBM Corp. 2000
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com)
5 */
6
Jan Glauber144d6342011-07-24 10:48:19 +02007#include <linux/linkage.h>
Heiko Carstenscbb870c2010-02-26 22:37:43 +01008#include <asm/asm-offsets.h>
Heiko Carstenseb546192012-06-04 15:05:43 +02009#include <asm/sigp.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Heiko Carstensc5dd8582007-03-05 23:35:43 +010011#
Michael Holzheu60a0c682011-10-30 15:16:40 +010012# store_status: Empty implementation until kdump is supported on 31 bit
13#
14ENTRY(store_status)
15 br %r14
16
17#
Heiko Carstensc5dd8582007-03-05 23:35:43 +010018# do_reipl_asm
19# Parameter: r2 = schid of reipl device
20#
Jan Glauber144d6342011-07-24 10:48:19 +020021ENTRY(do_reipl_asm)
22 basr %r13,0
Linus Torvalds1da177e2005-04-16 15:20:36 -070023.Lpg0: lpsw .Lnewpsw-.Lpg0(%r13)
Heiko Carstens15e9b582006-12-04 15:40:26 +010024.Lpg1: # do store status of all registers
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020025
26 stm %r0,%r15,__LC_GPREGS_SAVE_AREA
27 stctl %c0,%c15,__LC_CREGS_SAVE_AREA
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020028 stam %a0,%a15,__LC_AREGS_SAVE_AREA
Heiko Carstensc5dd8582007-03-05 23:35:43 +010029 l %r10,.Ldump_pfx-.Lpg0(%r13)
30 mvc __LC_PREFIX_SAVE_AREA(4),0(%r10)
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020031 stckc .Lclkcmp-.Lpg0(%r13)
32 mvc __LC_CLOCK_COMP_SAVE_AREA(8),.Lclkcmp-.Lpg0(%r13)
33 stpt __LC_CPU_TIMER_SAVE_AREA
34 st %r13, __LC_PSW_SAVE_AREA+4
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020035 lctl %c6,%c6,.Lall-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020036 lr %r1,%r2
37 mvc __LC_PGM_NEW_PSW(8),.Lpcnew-.Lpg0(%r13)
38 stsch .Lschib-.Lpg0(%r13)
39 oi .Lschib+5-.Lpg0(%r13),0x84
40.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
41 msch .Lschib-.Lpg0(%r13)
42 lhi %r0,5
43.Lssch: ssch .Liplorb-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 jz .L001
Heiko Carstens25d83cb2006-09-28 16:56:37 +020045 brct %r0,.Lssch
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 bas %r14,.Ldisab-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020047.L001: mvc __LC_IO_NEW_PSW(8),.Lionew-.Lpg0(%r13)
48.Ltpi: lpsw .Lwaitpsw-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049.Lcont: c %r1,__LC_SUBCHANNEL_ID
50 jnz .Ltpi
51 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
52 jnz .Ltpi
Heiko Carstens25d83cb2006-09-28 16:56:37 +020053 tsch .Liplirb-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 tm .Liplirb+9-.Lpg0(%r13),0xbf
Heiko Carstens25d83cb2006-09-28 16:56:37 +020055 jz .L002
56 bas %r14,.Ldisab-.Lpg0(%r13)
57.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
58 jz .L003
59 bas %r14,.Ldisab-.Lpg0(%r13)
Heiko Carstens15e9b582006-12-04 15:40:26 +010060.L003: st %r1,__LC_SUBCHANNEL_ID
Heiko Carstens25d83cb2006-09-28 16:56:37 +020061 lpsw 0
Heiko Carstenseb546192012-06-04 15:05:43 +020062 sigp 0,0,SIGP_RESTART
Heiko Carstens25d83cb2006-09-28 16:56:37 +020063.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 lpsw .Ldispsw-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020065 .align 8
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020066.Lclkcmp: .quad 0x0000000000000000
Linus Torvalds1da177e2005-04-16 15:20:36 -070067.Lall: .long 0xff000000
Heiko Carstensc5dd8582007-03-05 23:35:43 +010068.Ldump_pfx: .long dump_prefix_page
Heiko Carstens25d83cb2006-09-28 16:56:37 +020069 .align 8
70.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1
71.Lpcnew: .long 0x00080000,0x80000000+.Lecs
72.Lionew: .long 0x00080000,0x80000000+.Lcont
Linus Torvalds1da177e2005-04-16 15:20:36 -070073.Lwaitpsw: .long 0x020a0000,0x00000000+.Ltpi
Heiko Carstens25d83cb2006-09-28 16:56:37 +020074.Ldispsw: .long 0x000a0000,0x00000000
75.Liplccws: .long 0x02000000,0x60000018
76 .long 0x08000008,0x20000001
Linus Torvalds1da177e2005-04-16 15:20:36 -070077.Liplorb: .long 0x0049504c,0x0040ff80
78 .long 0x00000000+.Liplccws
Heiko Carstens25d83cb2006-09-28 16:56:37 +020079.Lschib: .long 0x00000000,0x00000000
80 .long 0x00000000,0x00000000
81 .long 0x00000000,0x00000000
82 .long 0x00000000,0x00000000
83 .long 0x00000000,0x00000000
84 .long 0x00000000,0x00000000
Linus Torvalds1da177e2005-04-16 15:20:36 -070085.Liplirb: .long 0x00000000,0x00000000
86 .long 0x00000000,0x00000000
87 .long 0x00000000,0x00000000
88 .long 0x00000000,0x00000000
89 .long 0x00000000,0x00000000
90 .long 0x00000000,0x00000000
91 .long 0x00000000,0x00000000
92 .long 0x00000000,0x00000000