chiark / gitweb /
[PATCH] volume-id build fix and update
[elogind.git] / klibc / klibc / arch / s390x / include / klibc / archsys.h
1 /*
2  * arch/s390x/include/klibc/archsys.h
3  *
4  * Architecture-specific syscall definitions
5  */
6
7 #ifndef _KLIBC_ARCHSYS_H
8 #define _KLIBC_ARCHSYS_H
9
10 /* S/390X only has five syscall parameters, and uses a structure for
11    6-argument syscalls. */
12
13 #ifndef _syscall6
14
15 #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,\
16                   type4,arg4,type5,arg5,type6,arg6)          \
17 type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4,    \
18           type5 arg5, type6 arg6) {                          \
19         unsigned long  __arg[6] = {                          \
20                 (unsigned long) arg1,                        \
21                 (unsigned long) arg2,                        \
22                 (unsigned long) arg3,                        \
23                 (unsigned long) arg4,                        \
24                 (unsigned long) arg5,                        \
25                 (unsigned long) arg6                         \
26         };                                                   \
27         register void *__argp asm("2") = &__arg;             \
28         long __res;                                          \
29         __asm__ __volatile__ (                               \
30                 "    svc %b1\n"                              \
31                 "    lgr  %0,2"                              \
32                 : "=d" (__res)                               \
33                 : "i" (__NR_##name),                         \
34                   "d" (__argp)                               \
35                 : _svc_clobber);                             \
36         __syscall_return(type, __res);                       \
37 }
38
39 #endif /* _syscall6() missing */
40
41 #endif /* _KLIBC_ARCHSYS_H */