diff options
author | Anton Blanchard <anton@samba.org> | 2006-07-18 18:01:28 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-08-01 02:19:15 -0400 |
commit | b9377ffc3a03cde558d76349a262a1adbb6d3112 (patch) | |
tree | c61fcdb732d06c64b9c5634953e46cefdf6af846 /include/asm-powerpc/hvcall.h | |
parent | 57cad8084e0837e0f2c97da789ec9b3f36809be9 (diff) |
[POWERPC] clean up pseries hcall interfaces
Our pseries hcall interfaces are out of control:
plpar_hcall_norets
plpar_hcall
plpar_hcall_8arg_2ret
plpar_hcall_4out
plpar_hcall_7arg_7ret
plpar_hcall_9arg_9ret
Create 3 interfaces to cover all cases:
plpar_hcall_norets: 7 arguments no returns
plpar_hcall: 6 arguments 4 returns
plpar_hcall9: 9 arguments 9 returns
There are only 2 cases in the kernel that need plpar_hcall9, hopefully
we can keep it that way.
Pass in a buffer to stash return parameters so we avoid the &dummy1,
&dummy2 madness.
Signed-off-by: Anton Blanchard <anton@samba.org>
--
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/hvcall.h')
-rw-r--r-- | include/asm-powerpc/hvcall.h | 105 |
1 files changed, 25 insertions, 80 deletions
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h index f07ae50cbc2c..63ce1ac8c1f4 100644 --- a/include/asm-powerpc/hvcall.h +++ b/include/asm-powerpc/hvcall.h | |||
@@ -212,94 +212,39 @@ | |||
212 | 212 | ||
213 | #ifndef __ASSEMBLY__ | 213 | #ifndef __ASSEMBLY__ |
214 | 214 | ||
215 | /* plpar_hcall() -- Generic call interface using above opcodes | 215 | /** |
216 | * plpar_hcall_norets: - Make a pseries hypervisor call with no return arguments | ||
217 | * @opcode: The hypervisor call to make. | ||
216 | * | 218 | * |
217 | * The actual call interface is a hypervisor call instruction with | 219 | * This call supports up to 7 arguments and only returns the status of |
218 | * the opcode in R3 and input args in R4-R7. | 220 | * the hcall. Use this version where possible, its slightly faster than |
219 | * Status is returned in R3 with variable output values in R4-R11. | 221 | * the other plpar_hcalls. |
220 | * Only H_PTE_READ with H_READ_4 uses R6-R11 so we ignore it for now | ||
221 | * and return only two out args which MUST ALWAYS BE PROVIDED. | ||
222 | */ | ||
223 | long plpar_hcall(unsigned long opcode, | ||
224 | unsigned long arg1, | ||
225 | unsigned long arg2, | ||
226 | unsigned long arg3, | ||
227 | unsigned long arg4, | ||
228 | unsigned long *out1, | ||
229 | unsigned long *out2, | ||
230 | unsigned long *out3); | ||
231 | |||
232 | /* Same as plpar_hcall but for those opcodes that return no values | ||
233 | * other than status. Slightly more efficient. | ||
234 | */ | 222 | */ |
235 | long plpar_hcall_norets(unsigned long opcode, ...); | 223 | long plpar_hcall_norets(unsigned long opcode, ...); |
236 | 224 | ||
237 | /* | 225 | /** |
238 | * Special hcall interface for ibmveth support. | 226 | * plpar_hcall: - Make a pseries hypervisor call |
239 | * Takes 8 input parms. Returns a rc and stores the | 227 | * @opcode: The hypervisor call to make. |
240 | * R4 return value in *out1. | 228 | * @retbuf: Buffer to store up to 4 return arguments in. |
241 | */ | ||
242 | long plpar_hcall_8arg_2ret(unsigned long opcode, | ||
243 | unsigned long arg1, | ||
244 | unsigned long arg2, | ||
245 | unsigned long arg3, | ||
246 | unsigned long arg4, | ||
247 | unsigned long arg5, | ||
248 | unsigned long arg6, | ||
249 | unsigned long arg7, | ||
250 | unsigned long arg8, | ||
251 | unsigned long *out1); | ||
252 | |||
253 | /* plpar_hcall_4out() | ||
254 | * | 229 | * |
255 | * same as plpar_hcall except with 4 output arguments. | 230 | * This call supports up to 6 arguments and 4 return arguments. Use |
231 | * PLPAR_HCALL_BUFSIZE to size the return argument buffer. | ||
256 | * | 232 | * |
233 | * Used for all but the craziest of phyp interfaces (see plpar_hcall9) | ||
257 | */ | 234 | */ |
258 | long plpar_hcall_4out(unsigned long opcode, | 235 | #define PLPAR_HCALL_BUFSIZE 4 |
259 | unsigned long arg1, | 236 | long plpar_hcall(unsigned long opcode, unsigned long *retbuf, ...); |
260 | unsigned long arg2, | ||
261 | unsigned long arg3, | ||
262 | unsigned long arg4, | ||
263 | unsigned long *out1, | ||
264 | unsigned long *out2, | ||
265 | unsigned long *out3, | ||
266 | unsigned long *out4); | ||
267 | 237 | ||
268 | long plpar_hcall_7arg_7ret(unsigned long opcode, | 238 | /** |
269 | unsigned long arg1, | 239 | * plpar_hcall9: - Make a pseries hypervisor call with up to 9 return arguments |
270 | unsigned long arg2, | 240 | * @opcode: The hypervisor call to make. |
271 | unsigned long arg3, | 241 | * @retbuf: Buffer to store up to 9 return arguments in. |
272 | unsigned long arg4, | 242 | * |
273 | unsigned long arg5, | 243 | * This call supports up to 9 arguments and 9 return arguments. Use |
274 | unsigned long arg6, | 244 | * PLPAR_HCALL9_BUFSIZE to size the return argument buffer. |
275 | unsigned long arg7, | 245 | */ |
276 | unsigned long *out1, | 246 | #define PLPAR_HCALL9_BUFSIZE 9 |
277 | unsigned long *out2, | 247 | long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...); |
278 | unsigned long *out3, | ||
279 | unsigned long *out4, | ||
280 | unsigned long *out5, | ||
281 | unsigned long *out6, | ||
282 | unsigned long *out7); | ||
283 | |||
284 | long plpar_hcall_9arg_9ret(unsigned long opcode, | ||
285 | unsigned long arg1, | ||
286 | unsigned long arg2, | ||
287 | unsigned long arg3, | ||
288 | unsigned long arg4, | ||
289 | unsigned long arg5, | ||
290 | unsigned long arg6, | ||
291 | unsigned long arg7, | ||
292 | unsigned long arg8, | ||
293 | unsigned long arg9, | ||
294 | unsigned long *out1, | ||
295 | unsigned long *out2, | ||
296 | unsigned long *out3, | ||
297 | unsigned long *out4, | ||
298 | unsigned long *out5, | ||
299 | unsigned long *out6, | ||
300 | unsigned long *out7, | ||
301 | unsigned long *out8, | ||
302 | unsigned long *out9); | ||
303 | 248 | ||
304 | #endif /* __ASSEMBLY__ */ | 249 | #endif /* __ASSEMBLY__ */ |
305 | #endif /* __KERNEL__ */ | 250 | #endif /* __KERNEL__ */ |