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/config.h>
15 #include <linux/sys.h>
16 #include <asm/unistd.h>
17 #include <asm/errno.h>
18 #include <asm/processor.h>
20 #include <asm/cache.h>
24 * hcall interface to pSeries LPAR
26 #define HVSC .long 0x44000022
28 /* long plpar_hcall(unsigned long opcode, R3
29 unsigned long arg1, R4
30 unsigned long arg2, R5
31 unsigned long arg3, R6
32 unsigned long arg4, R7
33 unsigned long *out1, R8
34 unsigned long *out2, R9
35 unsigned long *out3); R10
44 std r8,-8(r1) /* Save out ptrs. */
48 HVSC /* invoke the hypervisor */
50 ld r10,-8(r1) /* Fetch r4-r7 ret args. */
60 blr /* return r3 = status */
63 /* long plpar_hcall_4out(unsigned long opcode, R3
64 unsigned long arg1, R4
65 unsigned long arg2, R5
66 unsigned long arg3, R6
67 unsigned long arg4, R7
68 unsigned long *out1, (r4) R8
69 unsigned long *out2, (r5) R9
70 unsigned long *out3, (r6) R10
71 unsigned long *out4); (r7) 112(R1). From Parameter save area.
73 _GLOBAL(plpar_hcall_4out)
79 std r8,32(r1) /* Save out ptrs. */
84 HVSC /* invoke the hypervisor */
86 ld r14,32(r1) /* Fetch r4-r7 ret args. */
98 blr /* return r3 = status */
101 /* Simple interface with no output values (other than status) */
102 _GLOBAL(plpar_hcall_norets)
105 HVSC /* invoke the hypervisor */
108 blr /* return r3 = status */
111 /* long plpar_hcall_8arg_2ret(unsigned long opcode, R3
112 unsigned long arg1, R4
113 unsigned long arg2, R5
114 unsigned long arg3, R6
115 unsigned long arg4, R7
116 unsigned long arg5, R8
117 unsigned long arg6, R9
118 unsigned long arg7, R10
119 unsigned long arg8, 112(R1)
120 unsigned long *out1); 120(R1)
125 _GLOBAL(plpar_hcall_8arg_2ret)
128 ld r11, 112(r1) /* put arg8 and out1 in R11 and R12 */
134 std r12,-8(r1) /* Save out ptr */
136 HVSC /* invoke the hypervisor */
138 ld r10,-8(r1) /* Fetch r4 ret arg */
144 blr /* return r3 = status */