Commit f5738cee authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

[PATCH] remove kernel syscalls

The last thing we agreed on was to remove the macros entirely for 2.6.19,
on all architectures. Unfortunately, I think nobody actually _did_ that,
so they are still there.

[akpm@osdl.org: x86_64 fix]
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Greg Schafer <gschafer@zip.com.au>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 28ec24e2
......@@ -42,6 +42,7 @@
#include <asm/topology.h>
#define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr)))
#define __syscall_clobber "r11","rcx","memory"
int __sysctl_vsyscall __section_sysctl_vsyscall = 1;
seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED;
......
......@@ -387,188 +387,6 @@
#define NR_SYSCALLS 447
#if defined(__GNUC__)
#define _syscall_return(type) \
return (_sc_err ? errno = _sc_ret, _sc_ret = -1L : 0), (type) _sc_ret
#define _syscall_clobbers \
"$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \
"$22", "$23", "$24", "$25", "$27", "$28" \
#define _syscall0(type, name) \
type name(void) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = __NR_##name; \
__asm__("callsys # %0 %1 %2" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
__asm__("callsys # %0 %1 %2 %3" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
_sc_17 = (long) (arg2); \
__asm__("callsys # %0 %1 %2 %3 %4" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
_sc_17 = (long) (arg2); \
_sc_18 = (long) (arg3); \
__asm__("callsys # %0 %1 %2 %3 %4 %5" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
"r"(_sc_18) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
register long _sc_19 __asm__("$19"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
_sc_17 = (long) (arg2); \
_sc_18 = (long) (arg3); \
_sc_19 = (long) (arg4); \
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
"r"(_sc_18), "1"(_sc_19) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
register long _sc_19 __asm__("$19"); \
register long _sc_20 __asm__("$20"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
_sc_17 = (long) (arg2); \
_sc_18 = (long) (arg3); \
_sc_19 = (long) (arg4); \
_sc_20 = (long) (arg5); \
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6 %7" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
"r"(_sc_18), "1"(_sc_19), "r"(_sc_20) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
type5,arg5,type6,arg6) \
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, type6 arg6)\
{ \
long _sc_ret, _sc_err; \
{ \
register long _sc_0 __asm__("$0"); \
register long _sc_16 __asm__("$16"); \
register long _sc_17 __asm__("$17"); \
register long _sc_18 __asm__("$18"); \
register long _sc_19 __asm__("$19"); \
register long _sc_20 __asm__("$20"); \
register long _sc_21 __asm__("$21"); \
\
_sc_0 = __NR_##name; \
_sc_16 = (long) (arg1); \
_sc_17 = (long) (arg2); \
_sc_18 = (long) (arg3); \
_sc_19 = (long) (arg4); \
_sc_20 = (long) (arg5); \
_sc_21 = (long) (arg6); \
__asm__("callsys # %0 %1 %2 %3 %4 %5 %6 %7 %8" \
: "=r"(_sc_0), "=r"(_sc_19) \
: "0"(_sc_0), "r"(_sc_16), "r"(_sc_17), \
"r"(_sc_18), "1"(_sc_19), "r"(_sc_20), "r"(_sc_21) \
: _syscall_clobbers); \
_sc_ret = _sc_0, _sc_err = _sc_19; \
} \
_syscall_return(type); \
}
#endif /* __GNUC__ */
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_STAT64
......
......@@ -377,156 +377,6 @@
#endif
#ifdef __KERNEL__
#include <linux/err.h>
#include <linux/linkage.h>
#define __sys2(x) #x
#define __sys1(x) __sys2(x)
#ifndef __syscall
#if defined(__thumb__) || defined(__ARM_EABI__)
#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name;
#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs
#define __syscall(name) "swi\t0"
#else
#define __SYS_REG(name)
#define __SYS_REG_LIST(regs...) regs
#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
#endif
#endif
#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \
errno = -(res); \
res = -1; \
} \
return (type) (res); \
} while (0)
#define _syscall0(type,name) \
type name(void) { \
__SYS_REG(name) \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST() \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0), "r" (__r1) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __r4 __asm__("r4") = (long)arg5; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
"r" (__r3), "r" (__r4) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
__SYS_REG(name) \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __r4 __asm__("r4") = (long)arg5; \
register long __r5 __asm__("r5") = (long)arg6; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), \
"r" (__r3), "r" (__r4), "r" (__r5) ) \
: "memory" ); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_STAT64
......
......@@ -311,139 +311,6 @@
#define __ARM_NR_usr26 (__ARM_NR_BASE+3)
#ifdef __KERNEL__
#include <linux/err.h>
#include <linux/linkage.h>
#define __sys2(x) #x
#define __sys1(x) __sys2(x)
#ifndef __syscall
#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
#endif
#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)-MAX_ERRNO) { \
errno = -(res); \
res = -1; \
} \
return (type) (res); \
} while (0)
#define _syscall0(type,name) \
type name(void) { \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0),"r" (__r1) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0),"r" (__r1),"r" (__r2) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __r4 __asm__("r4") = (long)arg5; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3),"r" (__r4) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) { \
register long __r0 __asm__("r0") = (long)arg1; \
register long __r1 __asm__("r1") = (long)arg2; \
register long __r2 __asm__("r2") = (long)arg3; \
register long __r3 __asm__("r3") = (long)arg4; \
register long __r4 __asm__("r4") = (long)arg5; \
register long __r5 __asm__("r5") = (long)arg6; \
register long __res_r0 __asm__("r0"); \
long __res; \
__asm__ __volatile__ ( \
__syscall(name) \
: "=r" (__res_r0) \
: "r" (__r0),"r" (__r1),"r" (__r2),"r" (__r3), "r" (__r4),"r" (__r5) \
: "lr"); \
__res = __res_r0; \
__syscall_return(type,__res); \
}
#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
......
......@@ -320,125 +320,6 @@
#ifdef __KERNEL__
#define NR_syscalls 310
#include <linux/err.h>
/*
* process the return value of a syscall, consigning it to one of two possible fates
* - user-visible error numbers are in the range -1 - -4095: see <asm-frv/errno.h>
*/
#undef __syscall_return
#define __syscall_return(type, res) \
do { \
unsigned long __sr2 = (res); \
if (__builtin_expect(__sr2 >= (unsigned long)(-MAX_ERRNO), 0)) { \
errno = (-__sr2); \
__sr2 = ~0UL; \
} \
return (type) __sr2; \
} while (0)
/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
#undef _syscall0
#define _syscall0(type,name) \
type name(void) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8"); \
__asm__ __volatile__ ("tira gr0,#0" \
: "=r" (__sc0) \
: "r" (__scnum)); \
__syscall_return(type, __sc0); \
}
#undef _syscall1
#define _syscall1(type,name,type1,arg1) \
type name(type1 arg1) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum)); \
__syscall_return(type, __sc0); \
}
#undef _syscall2
#define _syscall2(type,name,type1,arg1,type2,arg2) \
type name(type1 arg1,type2 arg2) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum), "r" (__sc1)); \
__syscall_return(type, __sc0); \
}
#undef _syscall3
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
type name(type1 arg1,type2 arg2,type3 arg3) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum), "r" (__sc1), "r" (__sc2)); \
__syscall_return(type, __sc0); \
}
#undef _syscall4
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum), "r" (__sc1), "r" (__sc2), "r" (__sc3)); \
__syscall_return(type, __sc0); \
}
#undef _syscall5
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum), "r" (__sc1), "r" (__sc2), \
"r" (__sc3), "r" (__sc4)); \
__syscall_return(type, __sc0); \
}
#undef _syscall6
#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
{ \
register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) arg6; \
__asm__ __volatile__ ("tira gr0,#0" \
: "+r" (__sc0) \
: "r" (__scnum), "r" (__sc1), "r" (__sc2), \
"r" (__sc3), "r" (__sc4), "r" (__sc5)); \
__syscall_return(type, __sc0); \
}
#define __ARCH_WANT_IPC_PARSE_VERSION
/* #define __ARCH_WANT_OLD_READDIR */
......
......@@ -295,172 +295,6 @@
#ifdef __KERNEL__
#define NR_syscalls 289
#include <linux/err.h>
/* user-visible error numbers are in the range -1 - -MAX_ERRNO: see
<asm-m68k/errno.h> */
#define __syscall_return(type, res) \
do { \
if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \
/* avoid using res which is declared to be in register d0; \
errno might expand to a function call and clobber it. */ \
int __err = -(res); \
errno = __err; \
res = -1; \
} \
return (type) (res); \
} while (0)
#define _syscall0(type, name) \
type name(void) \
{ \
register long __res __asm__("er0"); \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}
#define _syscall1(type, name, atype, a) \
type name(atype a) \
{ \
register long __res __asm__("er0"); \
register long _a __asm__("er1"); \
_a = (long)a; \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name), \
"g" (_a) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}
#define _syscall2(type, name, atype, a, btype, b) \
type name(atype a, btype b) \
{ \
register long __res __asm__("er0"); \
register long _a __asm__("er1"); \
register long _b __asm__("er2"); \
_a = (long)a; \
_b = (long)b; \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name), \
"g" (_a), \
"g" (_b) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}
#define _syscall3(type, name, atype, a, btype, b, ctype, c) \
type name(atype a, btype b, ctype c) \
{ \
register long __res __asm__("er0"); \
register long _a __asm__("er1"); \
register long _b __asm__("er2"); \
register long _c __asm__("er3"); \
_a = (long)a; \
_b = (long)b; \
_c = (long)c; \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name), \
"g" (_a), \
"g" (_b), \
"g" (_c) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}
#define _syscall4(type, name, atype, a, btype, b, \
ctype, c, dtype, d) \
type name(atype a, btype b, ctype c, dtype d) \
{ \
register long __res __asm__("er0"); \
register long _a __asm__("er1"); \
register long _b __asm__("er2"); \
register long _c __asm__("er3"); \
register long _d __asm__("er4"); \
_a = (long)a; \
_b = (long)b; \
_c = (long)c; \
_d = (long)d; \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name), \
"g" (_a), \
"g" (_b), \
"g" (_c), \
"g" (_d) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}
#define _syscall5(type, name, atype, a, btype, b, \
ctype, c, dtype, d, etype, e) \
type name(atype a, btype b, ctype c, dtype d, etype e) \
{ \
register long __res __asm__("er0"); \
register long _a __asm__("er1"); \
register long _b __asm__("er2"); \
register long _c __asm__("er3"); \
register long _d __asm__("er4"); \
register long _e __asm__("er5"); \
_a = (long)a; \
_b = (long)b; \
_c = (long)c; \
_d = (long)d; \
_e = (long)e; \
__asm__ __volatile__ ("mov.l %1,er0\n\t" \
"trapa #0\n\t" \
: "=r" (__res) \
: "g" (__NR_##name), \
"g" (_a), \
"g" (_b), \
"g" (_c), \
"g" (_d), \
"g" (_e) \
: "cc", "memory"); \
__syscall_return(type, __res); \
}