Heiko Carstens | b0c632d | 2008-03-25 18:47:20 +0100 | [diff] [blame] | 1 | /* |
| 2 | * sie64a.S - low level sie call |
| 3 | * |
| 4 | * Copyright IBM Corp. 2008 |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License (version 2 only) |
| 8 | * as published by the Free Software Foundation. |
| 9 | * |
| 10 | * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com> |
| 11 | */ |
| 12 | |
| 13 | #include <linux/errno.h> |
| 14 | #include <asm/asm-offsets.h> |
| 15 | |
| 16 | SP_R5 = 5 * 8 # offset into stackframe |
| 17 | SP_R6 = 6 * 8 |
| 18 | |
| 19 | /* |
| 20 | * sie64a calling convention: |
| 21 | * %r2 pointer to sie control block |
| 22 | * %r3 guest register save area |
| 23 | */ |
| 24 | .globl sie64a |
| 25 | sie64a: |
| 26 | lgr %r5,%r3 |
| 27 | stmg %r5,%r14,SP_R5(%r15) # save register on entry |
| 28 | lgr %r14,%r2 # pointer to sie control block |
| 29 | lmg %r0,%r13,0(%r3) # load guest gprs 0-13 |
| 30 | sie_inst: |
| 31 | sie 0(%r14) |
| 32 | lg %r14,SP_R5(%r15) |
| 33 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
| 34 | lghi %r2,0 |
| 35 | lmg %r6,%r14,SP_R6(%r15) |
| 36 | br %r14 |
| 37 | |
| 38 | sie_err: |
| 39 | lg %r14,SP_R5(%r15) |
| 40 | stmg %r0,%r13,0(%r14) # save guest gprs 0-13 |
| 41 | lghi %r2,-EFAULT |
| 42 | lmg %r6,%r14,SP_R6(%r15) |
| 43 | br %r14 |
| 44 | |
| 45 | .section __ex_table,"a" |
| 46 | .quad sie_inst,sie_err |
| 47 | .previous |