Skip to content

Commit

Permalink
[PATCH] remove kernel syscalls
Browse files Browse the repository at this point in the history
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: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Arnd Bergmann authored and Linus Torvalds committed Dec 7, 2006
1 parent 28ec24e commit f5738ce
Show file tree
Hide file tree
Showing 20 changed files with 1 addition and 2,701 deletions.
1 change: 1 addition & 0 deletions arch/x86_64/kernel/vsyscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
182 changes: 0 additions & 182 deletions include/asm-alpha/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
150 changes: 0 additions & 150 deletions include/asm-arm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit f5738ce

Please sign in to comment.