xref: /openbmc/linux/arch/s390/kernel/reipl.S (revision bdeeed09)
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/sigp.h>
11
12#
13# Issue "store status" for the current CPU to its prefix page
14# and call passed function afterwards
15#
16# r2 = Function to be called after store status
17# r3 = Parameter for function
18#
19ENTRY(store_status)
20	/* Save register one and load save area base */
21	stg	%r1,__LC_SAVE_AREA_RESTART
22	/* General purpose registers */
23	lghi	%r1,__LC_GPREGS_SAVE_AREA
24	stmg	%r0,%r15,0(%r1)
25	mvc	8(8,%r1),__LC_SAVE_AREA_RESTART
26	/* Control registers */
27	lghi	%r1,__LC_CREGS_SAVE_AREA
28	stctg	%c0,%c15,0(%r1)
29	/* Access registers */
30	lghi	%r1,__LC_AREGS_SAVE_AREA
31	stam	%a0,%a15,0(%r1)
32	/* Floating point registers */
33	lghi	%r1,__LC_FPREGS_SAVE_AREA
34	std	%f0, 0x00(%r1)
35	std	%f1, 0x08(%r1)
36	std	%f2, 0x10(%r1)
37	std	%f3, 0x18(%r1)
38	std	%f4, 0x20(%r1)
39	std	%f5, 0x28(%r1)
40	std	%f6, 0x30(%r1)
41	std	%f7, 0x38(%r1)
42	std	%f8, 0x40(%r1)
43	std	%f9, 0x48(%r1)
44	std	%f10,0x50(%r1)
45	std	%f11,0x58(%r1)
46	std	%f12,0x60(%r1)
47	std	%f13,0x68(%r1)
48	std	%f14,0x70(%r1)
49	std	%f15,0x78(%r1)
50	/* Floating point control register */
51	lghi	%r1,__LC_FP_CREG_SAVE_AREA
52	stfpc	0(%r1)
53	/* CPU timer */
54	lghi	%r1,__LC_CPU_TIMER_SAVE_AREA
55	stpt	0(%r1)
56	/* Store prefix register */
57	lghi	%r1,__LC_PREFIX_SAVE_AREA
58	stpx	0(%r1)
59	/* Clock comparator - seven bytes */
60	lghi	%r1,__LC_CLOCK_COMP_SAVE_AREA
61	larl	%r4,.Lclkcmp
62	stckc	0(%r4)
63	mvc	1(7,%r1),1(%r4)
64	/* Program status word */
65	lghi	%r1,__LC_PSW_SAVE_AREA
66	epsw	%r4,%r5
67	st	%r4,0(%r1)
68	st	%r5,4(%r1)
69	stg	%r2,8(%r1)
70	lgr	%r1,%r2
71	lgr	%r2,%r3
72	br	%r1
73
74	.section .bss
75	.align	8
76.Lclkcmp:	.quad	0x0000000000000000
77	.previous
78