2 * This file contains the generic code to perform a call to the
3 * pSeries LPAR hypervisor.
4 * NOTE: this file will go away when we move to inline this work.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
11 #include <asm/hvcall.h>
12 #include <asm/processor.h>
13 #include <asm/ppc_asm.h>
15 #define STK_PARM(i) (48 + ((i)-3)*8)
19 /* long plpar_hcall(unsigned long opcode, R3
20 unsigned long arg1, R4
21 unsigned long arg2, R5
22 unsigned long arg3, R6
23 unsigned long arg4, R7
24 unsigned long *out1, R8
25 unsigned long *out2, R9
26 unsigned long *out3); R10
33 std r8,STK_PARM(r8)(r1) /* Save out ptrs */
34 std r9,STK_PARM(r9)(r1)
35 std r10,STK_PARM(r10)(r1)
39 HVSC /* invoke the hypervisor */
43 ld r8,STK_PARM(r8)(r1) /* Fetch r4-r6 ret args */
44 ld r9,STK_PARM(r9)(r1)
45 ld r10,STK_PARM(r10)(r1)
51 blr /* return r3 = status */
54 /* Simple interface with no output values (other than status) */
55 _GLOBAL(plpar_hcall_norets)
61 HVSC /* invoke the hypervisor */
65 blr /* return r3 = status */
68 /* long plpar_hcall_8arg_2ret(unsigned long opcode, R3
69 unsigned long arg1, R4
70 unsigned long arg2, R5
71 unsigned long arg3, R6
72 unsigned long arg4, R7
73 unsigned long arg5, R8
74 unsigned long arg6, R9
75 unsigned long arg7, R10
76 unsigned long arg8, 112(R1)
77 unsigned long *out1); 120(R1)
79 _GLOBAL(plpar_hcall_8arg_2ret)
83 ld r11,STK_PARM(r11)(r1) /* put arg8 in R11 */
86 HVSC /* invoke the hypervisor */
89 ld r10,STK_PARM(r12)(r1) /* Fetch r4 ret arg */
92 blr /* return r3 = status */
95 /* long plpar_hcall_4out(unsigned long opcode, R3
96 unsigned long arg1, R4
97 unsigned long arg2, R5
98 unsigned long arg3, R6
99 unsigned long arg4, R7
100 unsigned long *out1, R8
101 unsigned long *out2, R9
102 unsigned long *out3, R10
103 unsigned long *out4); 112(R1)
105 _GLOBAL(plpar_hcall_4out)
111 std r8,STK_PARM(r8)(r1) /* Save out ptrs */
112 std r9,STK_PARM(r9)(r1)
113 std r10,STK_PARM(r10)(r1)
115 HVSC /* invoke the hypervisor */
119 ld r8,STK_PARM(r8)(r1) /* Fetch r4-r7 ret args */
120 ld r9,STK_PARM(r9)(r1)
121 ld r10,STK_PARM(r10)(r1)
122 ld r11,STK_PARM(r11)(r1)
129 blr /* return r3 = status */