[POWERPC] clean up pseries hcall interfaces
[deliverable/linux.git] / arch / powerpc / platforms / pseries / hvCall.S
CommitLineData
1da177e4 1/*
1da177e4
LT
2 * This file contains the generic code to perform a call to the
3 * pSeries LPAR hypervisor.
1da177e4
LT
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10#include <asm/hvcall.h>
11#include <asm/processor.h>
12#include <asm/ppc_asm.h>
13
14#define STK_PARM(i) (48 + ((i)-3)*8)
15
16 .text
17
1da177e4 18_GLOBAL(plpar_hcall_norets)
eeb24de4
AB
19 HMT_MEDIUM
20
1da177e4
LT
21 mfcr r0
22 stw r0,8(r1)
23
24 HVSC /* invoke the hypervisor */
25
26 lwz r0,8(r1)
27 mtcrf 0xff,r0
28 blr /* return r3 = status */
29
b9377ffc 30_GLOBAL(plpar_hcall)
eeb24de4
AB
31 HMT_MEDIUM
32
1da177e4 33 mfcr r0
1da177e4
LT
34 stw r0,8(r1)
35
b9377ffc 36 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
1da177e4 37
b9377ffc
AB
38 mr r4,r5
39 mr r5,r6
40 mr r6,r7
41 mr r7,r8
42 mr r8,r9
43 mr r9,r10
1da177e4
LT
44
45 HVSC /* invoke the hypervisor */
46
b9377ffc
AB
47 ld r12,STK_PARM(r4)(r1)
48 std r4, 0(r12)
49 std r5, 8(r12)
50 std r6, 16(r12)
51 std r7, 24(r12)
b13a96cf
HS
52
53 lwz r0,8(r1)
b13a96cf
HS
54 mtcrf 0xff,r0
55
56 blr /* return r3 = status */
57
b9377ffc 58_GLOBAL(plpar_hcall9)
b13a96cf
HS
59 HMT_MEDIUM
60
61 mfcr r0
62 stw r0,8(r1)
63
b9377ffc
AB
64 std r4,STK_PARM(r4)(r1) /* Save ret buffer */
65
66 mr r4,r5
67 mr r5,r6
68 mr r6,r7
69 mr r7,r8
70 mr r8,r9
71 mr r9,r10
72 ld r10,STK_PARM(r11)(r1) /* put arg7 in R10 */
73 ld r11,STK_PARM(r12)(r1) /* put arg8 in R11 */
74 ld r12,STK_PARM(r13)(r1) /* put arg9 in R12 */
b13a96cf
HS
75
76 HVSC /* invoke the hypervisor */
77
b9377ffc
AB
78 ld r12,STK_PARM(r4)(r1)
79 std r4, 0(r12)
80 std r5, 8(r12)
81 std r6, 16(r12)
82 std r7, 24(r12)
83 std r8, 32(r12)
84 std r9, 40(r12)
85 std r10,48(r12)
86 std r11,56(r12)
87 std r12,64(r12)
b13a96cf
HS
88
89 lwz r0,8(r1)
90 mtcrf 0xff,r0
91
92 blr /* return r3 = status */
This page took 0.126969 seconds and 5 git commands to generate.