2 * arch/ppc64/kernel/pSeries_hvCall.S
5 * This file contains the generic code to perform a call to the
6 * pSeries LPAR hypervisor.
7 * NOTE: this file will go away when we move to inline this work.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
14 #include <linux/sys.h>
15 #include <asm/unistd.h>
16 #include <asm/errno.h>
17 #include <asm/processor.h>
19 #include <asm/cache.h>
20 #include <asm/ppc_asm.h>
23 * hcall interface to pSeries LPAR
25 #define HVSC .long 0x44000022
27 /* long plpar_hcall(unsigned long opcode, R3
28 unsigned long arg1, R4
29 unsigned long arg2, R5
30 unsigned long arg3, R6
31 unsigned long arg4, R7
32 unsigned long *out1, R8
33 unsigned long *out2, R9
34 unsigned long *out3); R10
43 std r8,-8(r1) /* Save out ptrs. */
47 HVSC /* invoke the hypervisor */
49 ld r10,-8(r1) /* Fetch r4-r7 ret args. */
59 blr /* return r3 = status */
62 /* Simple interface with no output values (other than status) */
63 _GLOBAL(plpar_hcall_norets)
66 HVSC /* invoke the hypervisor */
69 blr /* return r3 = status */
72 /* long plpar_hcall_8arg_2ret(unsigned long opcode, R3
73 unsigned long arg1, R4
74 unsigned long arg2, R5
75 unsigned long arg3, R6
76 unsigned long arg4, R7
77 unsigned long arg5, R8
78 unsigned long arg6, R9
79 unsigned long arg7, R10
80 unsigned long arg8, 112(R1)
81 unsigned long *out1); 120(R1)
86 _GLOBAL(plpar_hcall_8arg_2ret)
89 ld r11, 112(r1) /* put arg8 and out1 in R11 and R12 */
95 std r12,-8(r1) /* Save out ptr */
97 HVSC /* invoke the hypervisor */
99 ld r10,-8(r1) /* Fetch r4 ret arg */
105 blr /* return r3 = status */
108 /* long plpar_hcall_4out(unsigned long opcode, R3
109 unsigned long arg1, R4
110 unsigned long arg2, R5
111 unsigned long arg3, R6
112 unsigned long arg4, R7
113 unsigned long *out1, (r4) R8
114 unsigned long *out2, (r5) R9
115 unsigned long *out3, (r6) R10
116 unsigned long *out4); (r7) 112(R1). From Parameter save area.
118 _GLOBAL(plpar_hcall_4out)
124 std r8,32(r1) /* Save out ptrs. */
129 HVSC /* invoke the hypervisor */
131 ld r14,32(r1) /* Fetch r4-r7 ret args. */
143 blr /* return r3 = status */