1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 *  arch/s390/kernel/base.S
4 *
5 *    Copyright IBM Corp. 2006, 2007
6 *    Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
7 *		 Michael Holzheu <holzheu@de.ibm.com>
8 */
9
10#include <linux/linkage.h>
11#include <asm/asm-offsets.h>
12#include <asm/nospec-insn.h>
13#include <asm/ptrace.h>
14#include <asm/sigp.h>
15
16	GEN_BR_THUNK %r9
17	GEN_BR_THUNK %r14
18
19ENTRY(s390_base_ext_handler)
20	stmg	%r0,%r15,__LC_SAVE_AREA_ASYNC
21	basr	%r13,0
220:	aghi	%r15,-STACK_FRAME_OVERHEAD
23	larl	%r1,s390_base_ext_handler_fn
24	lg	%r9,0(%r1)
25	ltgr	%r9,%r9
26	jz	1f
27	BASR_EX	%r14,%r9
281:	lmg	%r0,%r15,__LC_SAVE_AREA_ASYNC
29	ni	__LC_EXT_OLD_PSW+1,0xfd	# clear wait state bit
30	lpswe	__LC_EXT_OLD_PSW
31ENDPROC(s390_base_ext_handler)
32
33	.section .bss
34	.align 8
35	.globl s390_base_ext_handler_fn
36s390_base_ext_handler_fn:
37	.quad	0
38	.previous
39
40ENTRY(s390_base_pgm_handler)
41	stmg	%r0,%r15,__LC_SAVE_AREA_SYNC
42	basr	%r13,0
430:	aghi	%r15,-STACK_FRAME_OVERHEAD
44	larl	%r1,s390_base_pgm_handler_fn
45	lg	%r9,0(%r1)
46	ltgr	%r9,%r9
47	jz	1f
48	BASR_EX	%r14,%r9
49	lmg	%r0,%r15,__LC_SAVE_AREA_SYNC
50	lpswe	__LC_PGM_OLD_PSW
511:	lpswe	disabled_wait_psw-0b(%r13)
52ENDPROC(s390_base_pgm_handler)
53
54	.align	8
55disabled_wait_psw:
56	.quad	0x0002000180000000,0x0000000000000000 + s390_base_pgm_handler
57
58	.section .bss
59	.align 8
60	.globl s390_base_pgm_handler_fn
61s390_base_pgm_handler_fn:
62	.quad	0
63	.previous
64