Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright IBM Corp 2000, 2011
4 * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
5 * Denis Joseph Barrow,
6 */
7
8#include <linux/linkage.h>
9#include <asm/asm-offsets.h>
10#include <asm/nospec-insn.h>
11#include <asm/sigp.h>
12
13 GEN_BR_THUNK %r9
14
15#
16# Issue "store status" for the current CPU to its prefix page
17# and call passed function afterwards
18#
19# r2 = Function to be called after store status
20# r3 = Parameter for function
21#
22ENTRY(store_status)
23 /* Save register one and load save area base */
24 stg %r1,__LC_SAVE_AREA_RESTART
25 /* General purpose registers */
26 lghi %r1,__LC_GPREGS_SAVE_AREA
27 stmg %r0,%r15,0(%r1)
28 mvc 8(8,%r1),__LC_SAVE_AREA_RESTART
29 /* Control registers */
30 lghi %r1,__LC_CREGS_SAVE_AREA
31 stctg %c0,%c15,0(%r1)
32 /* Access registers */
33 lghi %r1,__LC_AREGS_SAVE_AREA
34 stam %a0,%a15,0(%r1)
35 /* Floating point registers */
36 lghi %r1,__LC_FPREGS_SAVE_AREA
37 std %f0, 0x00(%r1)
38 std %f1, 0x08(%r1)
39 std %f2, 0x10(%r1)
40 std %f3, 0x18(%r1)
41 std %f4, 0x20(%r1)
42 std %f5, 0x28(%r1)
43 std %f6, 0x30(%r1)
44 std %f7, 0x38(%r1)
45 std %f8, 0x40(%r1)
46 std %f9, 0x48(%r1)
47 std %f10,0x50(%r1)
48 std %f11,0x58(%r1)
49 std %f12,0x60(%r1)
50 std %f13,0x68(%r1)
51 std %f14,0x70(%r1)
52 std %f15,0x78(%r1)
53 /* Floating point control register */
54 lghi %r1,__LC_FP_CREG_SAVE_AREA
55 stfpc 0(%r1)
56 /* CPU timer */
57 lghi %r1,__LC_CPU_TIMER_SAVE_AREA
58 stpt 0(%r1)
59 /* Store prefix register */
60 lghi %r1,__LC_PREFIX_SAVE_AREA
61 stpx 0(%r1)
62 /* Clock comparator - seven bytes */
63 lghi %r1,__LC_CLOCK_COMP_SAVE_AREA
64 larl %r4,.Lclkcmp
65 stckc 0(%r4)
66 mvc 1(7,%r1),1(%r4)
67 /* Program status word */
68 lghi %r1,__LC_PSW_SAVE_AREA
69 epsw %r4,%r5
70 st %r4,0(%r1)
71 st %r5,4(%r1)
72 stg %r2,8(%r1)
73 lgr %r9,%r2
74 lgr %r2,%r3
75 BR_EX %r9
76ENDPROC(store_status)
77
78 .section .bss
79 .align 8
80.Lclkcmp: .quad 0x0000000000000000
81 .previous
1/*
2 * S390 version
3 * Copyright IBM Corp. 2000
4 * Author(s): Holger Smolinski (Holger.Smolinski@de.ibm.com)
5 */
6
7#include <linux/linkage.h>
8#include <asm/asm-offsets.h>
9#include <asm/sigp.h>
10
11#
12# store_status: Empty implementation until kdump is supported on 31 bit
13#
14ENTRY(store_status)
15 br %r14
16
17#
18# do_reipl_asm
19# Parameter: r2 = schid of reipl device
20#
21ENTRY(do_reipl_asm)
22 basr %r13,0
23.Lpg0: lpsw .Lnewpsw-.Lpg0(%r13)
24.Lpg1: # do store status of all registers
25
26 stm %r0,%r15,__LC_GPREGS_SAVE_AREA
27 stctl %c0,%c15,__LC_CREGS_SAVE_AREA
28 stam %a0,%a15,__LC_AREGS_SAVE_AREA
29 l %r10,.Ldump_pfx-.Lpg0(%r13)
30 mvc __LC_PREFIX_SAVE_AREA(4),0(%r10)
31 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
35 lctl %c6,%c6,.Lall-.Lpg0(%r13)
36 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)
44 jz .L001
45 brct %r0,.Lssch
46 bas %r14,.Ldisab-.Lpg0(%r13)
47.L001: mvc __LC_IO_NEW_PSW(8),.Lionew-.Lpg0(%r13)
48.Ltpi: lpsw .Lwaitpsw-.Lpg0(%r13)
49.Lcont: c %r1,__LC_SUBCHANNEL_ID
50 jnz .Ltpi
51 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
52 jnz .Ltpi
53 tsch .Liplirb-.Lpg0(%r13)
54 tm .Liplirb+9-.Lpg0(%r13),0xbf
55 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)
60.L003: st %r1,__LC_SUBCHANNEL_ID
61 lpsw 0
62 sigp 0,0,SIGP_RESTART
63.Ldisab: st %r14,.Ldispsw+4-.Lpg0(%r13)
64 lpsw .Ldispsw-.Lpg0(%r13)
65 .align 8
66.Lclkcmp: .quad 0x0000000000000000
67.Lall: .long 0xff000000
68.Ldump_pfx: .long dump_prefix_page
69 .align 8
70.Lnewpsw: .long 0x00080000,0x80000000+.Lpg1
71.Lpcnew: .long 0x00080000,0x80000000+.Lecs
72.Lionew: .long 0x00080000,0x80000000+.Lcont
73.Lwaitpsw: .long 0x020a0000,0x00000000+.Ltpi
74.Ldispsw: .long 0x000a0000,0x00000000
75.Liplccws: .long 0x02000000,0x60000018
76 .long 0x08000008,0x20000001
77.Liplorb: .long 0x0049504c,0x0040ff80
78 .long 0x00000000+.Liplccws
79.Lschib: .long 0x00000000,0x00000000
80 .long 0x00000000,0x00000000
81 .long 0x00000000,0x00000000
82 .long 0x00000000,0x00000000
83 .long 0x00000000,0x00000000
84 .long 0x00000000,0x00000000
85.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