summaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/sie64a.S
blob: 934fd6a885f69724a00440a714b4fb9498a64c8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * sie64a.S - low level sie call
 *
 * Copyright IBM Corp. 2008
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License (version 2 only)
 * as published by the Free Software Foundation.
 *
 *    Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
 */

#include <linux/errno.h>
#include <asm/asm-offsets.h>

SP_R5 =	5 * 8	# offset into stackframe
SP_R6 =	6 * 8

/*
 * sie64a calling convention:
 * %r2 pointer to sie control block
 * %r3 guest register save area
 */
	.globl	sie64a
sie64a:
	lgr	%r5,%r3
	stmg	%r5,%r14,SP_R5(%r15)	# save register on entry
	lgr	%r14,%r2		# pointer to sie control block
	lmg	%r0,%r13,0(%r3)		# load guest gprs 0-13
sie_inst:
	sie	0(%r14)
	lg	%r14,SP_R5(%r15)
	stmg	%r0,%r13,0(%r14)	# save guest gprs 0-13
	lghi	%r2,0
	lmg	%r6,%r14,SP_R6(%r15)
	br	%r14

sie_err:
	lg	%r14,SP_R5(%r15)
	stmg	%r0,%r13,0(%r14)	# save guest gprs 0-13
	lghi	%r2,-EFAULT
	lmg	%r6,%r14,SP_R6(%r15)
	br	%r14

	.section __ex_table,"a"
	.quad	sie_inst,sie_err
	.previous