chiark / gitweb /
volume_id: provide libvolume_id.a file
[elogind.git] / klibc / klibc / arch / parisc / syscall.c
1 /*
2  * arch/parisc/syscall.c
3  *
4  * This function is called from a stub with %r20 already set up.
5  * Compile this function with -ffixed-r20 so that it doesn't clobber
6  * this register by mistake.
7  */
8
9 #include <klibc/compiler.h>
10 #include <errno.h>
11
12 long __syscall_common(long a0, long a1, long a2, long a3, long a4, long a5)
13 {
14   register unsigned long rv asm ("r28");
15
16   asm volatile("\tble 0x100(%%sr2, %%r0)\n"
17                : "=r" (rv)
18                : "r" (a0), "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5)
19                : "%r1", "%r2", "%r29", "%r31");
20
21   if ( __unlikely(rv >= -4095UL) ) {
22     errno = -rv;
23     return -1L;
24   } else {
25     return (long)rv;
26   }
27 }
28
29