diff options
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/unistd.h | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 04b6c17cc59b..0ae954e3d258 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -334,115 +334,6 @@ | |||
334 | 334 | ||
335 | #ifndef __ASSEMBLY__ | 335 | #ifndef __ASSEMBLY__ |
336 | 336 | ||
337 | /* On powerpc a system call basically clobbers the same registers like a | ||
338 | * function call, with the exception of LR (which is needed for the | ||
339 | * "sc; bnslr" sequence) and CR (where only CR0.SO is clobbered to signal | ||
340 | * an error return status). | ||
341 | */ | ||
342 | |||
343 | #define __syscall_nr(nr, type, name, args...) \ | ||
344 | unsigned long __sc_ret, __sc_err; \ | ||
345 | { \ | ||
346 | register unsigned long __sc_0 __asm__ ("r0"); \ | ||
347 | register unsigned long __sc_3 __asm__ ("r3"); \ | ||
348 | register unsigned long __sc_4 __asm__ ("r4"); \ | ||
349 | register unsigned long __sc_5 __asm__ ("r5"); \ | ||
350 | register unsigned long __sc_6 __asm__ ("r6"); \ | ||
351 | register unsigned long __sc_7 __asm__ ("r7"); \ | ||
352 | register unsigned long __sc_8 __asm__ ("r8"); \ | ||
353 | \ | ||
354 | __sc_loadargs_##nr(name, args); \ | ||
355 | __asm__ __volatile__ \ | ||
356 | ("sc \n\t" \ | ||
357 | "mfcr %0 " \ | ||
358 | : "=&r" (__sc_0), \ | ||
359 | "=&r" (__sc_3), "=&r" (__sc_4), \ | ||
360 | "=&r" (__sc_5), "=&r" (__sc_6), \ | ||
361 | "=&r" (__sc_7), "=&r" (__sc_8) \ | ||
362 | : __sc_asm_input_##nr \ | ||
363 | : "cr0", "ctr", "memory", \ | ||
364 | "r9", "r10","r11", "r12"); \ | ||
365 | __sc_ret = __sc_3; \ | ||
366 | __sc_err = __sc_0; \ | ||
367 | } \ | ||
368 | if (__sc_err & 0x10000000) \ | ||
369 | { \ | ||
370 | errno = __sc_ret; \ | ||
371 | __sc_ret = -1; \ | ||
372 | } \ | ||
373 | return (type) __sc_ret | ||
374 | |||
375 | #define __sc_loadargs_0(name, dummy...) \ | ||
376 | __sc_0 = __NR_##name | ||
377 | #define __sc_loadargs_1(name, arg1) \ | ||
378 | __sc_loadargs_0(name); \ | ||
379 | __sc_3 = (unsigned long) (arg1) | ||
380 | #define __sc_loadargs_2(name, arg1, arg2) \ | ||
381 | __sc_loadargs_1(name, arg1); \ | ||
382 | __sc_4 = (unsigned long) (arg2) | ||
383 | #define __sc_loadargs_3(name, arg1, arg2, arg3) \ | ||
384 | __sc_loadargs_2(name, arg1, arg2); \ | ||
385 | __sc_5 = (unsigned long) (arg3) | ||
386 | #define __sc_loadargs_4(name, arg1, arg2, arg3, arg4) \ | ||
387 | __sc_loadargs_3(name, arg1, arg2, arg3); \ | ||
388 | __sc_6 = (unsigned long) (arg4) | ||
389 | #define __sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5) \ | ||
390 | __sc_loadargs_4(name, arg1, arg2, arg3, arg4); \ | ||
391 | __sc_7 = (unsigned long) (arg5) | ||
392 | #define __sc_loadargs_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \ | ||
393 | __sc_loadargs_5(name, arg1, arg2, arg3, arg4, arg5); \ | ||
394 | __sc_8 = (unsigned long) (arg6) | ||
395 | |||
396 | #define __sc_asm_input_0 "0" (__sc_0) | ||
397 | #define __sc_asm_input_1 __sc_asm_input_0, "1" (__sc_3) | ||
398 | #define __sc_asm_input_2 __sc_asm_input_1, "2" (__sc_4) | ||
399 | #define __sc_asm_input_3 __sc_asm_input_2, "3" (__sc_5) | ||
400 | #define __sc_asm_input_4 __sc_asm_input_3, "4" (__sc_6) | ||
401 | #define __sc_asm_input_5 __sc_asm_input_4, "5" (__sc_7) | ||
402 | #define __sc_asm_input_6 __sc_asm_input_5, "6" (__sc_8) | ||
403 | |||
404 | #define _syscall0(type,name) \ | ||
405 | type name(void) \ | ||
406 | { \ | ||
407 | __syscall_nr(0, type, name); \ | ||
408 | } | ||
409 | |||
410 | #define _syscall1(type,name,type1,arg1) \ | ||
411 | type name(type1 arg1) \ | ||
412 | { \ | ||
413 | __syscall_nr(1, type, name, arg1); \ | ||
414 | } | ||
415 | |||
416 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
417 | type name(type1 arg1, type2 arg2) \ | ||
418 | { \ | ||
419 | __syscall_nr(2, type, name, arg1, arg2); \ | ||
420 | } | ||
421 | |||
422 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
423 | type name(type1 arg1, type2 arg2, type3 arg3) \ | ||
424 | { \ | ||
425 | __syscall_nr(3, type, name, arg1, arg2, arg3); \ | ||
426 | } | ||
427 | |||
428 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
429 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ | ||
430 | { \ | ||
431 | __syscall_nr(4, type, name, arg1, arg2, arg3, arg4); \ | ||
432 | } | ||
433 | |||
434 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ | ||
435 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | ||
436 | { \ | ||
437 | __syscall_nr(5, type, name, arg1, arg2, arg3, arg4, arg5); \ | ||
438 | } | ||
439 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ | ||
440 | type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | ||
441 | { \ | ||
442 | __syscall_nr(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6); \ | ||
443 | } | ||
444 | |||
445 | |||
446 | #include <linux/types.h> | 337 | #include <linux/types.h> |
447 | #include <linux/compiler.h> | 338 | #include <linux/compiler.h> |
448 | #include <linux/linkage.h> | 339 | #include <linux/linkage.h> |