aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sh
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2006-12-06 23:37:29 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:37 -0500
commitf5738ceed46782aea7663d62cb6398eb05fc4ce0 (patch)
tree156ebf498bc1d892d6f9e33d2751869417e30eb4 /include/asm-sh
parent28ec24e23229ae3d333f8d7f0e6b31fa8ea7bf46 (diff)
[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: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh')
-rw-r--r--include/asm-sh/unistd.h137
1 files changed, 0 insertions, 137 deletions
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index 0cae1d248761..f982073dc6c6 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -332,143 +332,6 @@
332 332
333#ifdef __KERNEL__ 333#ifdef __KERNEL__
334 334
335#include <linux/err.h>
336
337/* user-visible error numbers are in the range -1 - -MAX_ERRNO:
338 * see <asm-sh/errno.h> */
339
340#define __syscall_return(type, res) \
341do { \
342 if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \
343 /* Avoid using "res" which is declared to be in register r0; \
344 errno might expand to a function call and clobber it. */ \
345 int __err = -(res); \
346 errno = __err; \
347 res = -1; \
348 } \
349 return (type) (res); \
350} while (0)
351
352#if defined(__sh2__) || defined(__SH2E__) || defined(__SH2A__)
353#define SYSCALL_ARG0 "trapa #0x20"
354#define SYSCALL_ARG1 "trapa #0x21"
355#define SYSCALL_ARG2 "trapa #0x22"
356#define SYSCALL_ARG3 "trapa #0x23"
357#define SYSCALL_ARG4 "trapa #0x24"
358#define SYSCALL_ARG5 "trapa #0x25"
359#define SYSCALL_ARG6 "trapa #0x26"
360#else
361#define SYSCALL_ARG0 "trapa #0x10"
362#define SYSCALL_ARG1 "trapa #0x11"
363#define SYSCALL_ARG2 "trapa #0x12"
364#define SYSCALL_ARG3 "trapa #0x13"
365#define SYSCALL_ARG4 "trapa #0x14"
366#define SYSCALL_ARG5 "trapa #0x15"
367#define SYSCALL_ARG6 "trapa #0x16"
368#endif
369
370/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
371#define _syscall0(type,name) \
372type name(void) \
373{ \
374register long __sc0 __asm__ ("r3") = __NR_##name; \
375__asm__ __volatile__ (SYSCALL_ARG0 \
376 : "=z" (__sc0) \
377 : "0" (__sc0) \
378 : "memory" ); \
379__syscall_return(type,__sc0); \
380}
381
382#define _syscall1(type,name,type1,arg1) \
383type name(type1 arg1) \
384{ \
385register long __sc0 __asm__ ("r3") = __NR_##name; \
386register long __sc4 __asm__ ("r4") = (long) arg1; \
387__asm__ __volatile__ (SYSCALL_ARG1 \
388 : "=z" (__sc0) \
389 : "0" (__sc0), "r" (__sc4) \
390 : "memory"); \
391__syscall_return(type,__sc0); \
392}
393
394#define _syscall2(type,name,type1,arg1,type2,arg2) \
395type name(type1 arg1,type2 arg2) \
396{ \
397register long __sc0 __asm__ ("r3") = __NR_##name; \
398register long __sc4 __asm__ ("r4") = (long) arg1; \
399register long __sc5 __asm__ ("r5") = (long) arg2; \
400__asm__ __volatile__ (SYSCALL_ARG2 \
401 : "=z" (__sc0) \
402 : "0" (__sc0), "r" (__sc4), "r" (__sc5) \
403 : "memory"); \
404__syscall_return(type,__sc0); \
405}
406
407#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
408type name(type1 arg1,type2 arg2,type3 arg3) \
409{ \
410register long __sc0 __asm__ ("r3") = __NR_##name; \
411register long __sc4 __asm__ ("r4") = (long) arg1; \
412register long __sc5 __asm__ ("r5") = (long) arg2; \
413register long __sc6 __asm__ ("r6") = (long) arg3; \
414__asm__ __volatile__ (SYSCALL_ARG3 \
415 : "=z" (__sc0) \
416 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \
417 : "memory"); \
418__syscall_return(type,__sc0); \
419}
420
421#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
422type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
423{ \
424register long __sc0 __asm__ ("r3") = __NR_##name; \
425register long __sc4 __asm__ ("r4") = (long) arg1; \
426register long __sc5 __asm__ ("r5") = (long) arg2; \
427register long __sc6 __asm__ ("r6") = (long) arg3; \
428register long __sc7 __asm__ ("r7") = (long) arg4; \
429__asm__ __volatile__ (SYSCALL_ARG4 \
430 : "=z" (__sc0) \
431 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \
432 "r" (__sc7) \
433 : "memory" ); \
434__syscall_return(type,__sc0); \
435}
436
437#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
438type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
439{ \
440register long __sc3 __asm__ ("r3") = __NR_##name; \
441register long __sc4 __asm__ ("r4") = (long) arg1; \
442register long __sc5 __asm__ ("r5") = (long) arg2; \
443register long __sc6 __asm__ ("r6") = (long) arg3; \
444register long __sc7 __asm__ ("r7") = (long) arg4; \
445register long __sc0 __asm__ ("r0") = (long) arg5; \
446__asm__ __volatile__ (SYSCALL_ARG5 \
447 : "=z" (__sc0) \
448 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
449 "r" (__sc3) \
450 : "memory" ); \
451__syscall_return(type,__sc0); \
452}
453
454#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \
455type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
456{ \
457register long __sc3 __asm__ ("r3") = __NR_##name; \
458register long __sc4 __asm__ ("r4") = (long) arg1; \
459register long __sc5 __asm__ ("r5") = (long) arg2; \
460register long __sc6 __asm__ ("r6") = (long) arg3; \
461register long __sc7 __asm__ ("r7") = (long) arg4; \
462register long __sc0 __asm__ ("r0") = (long) arg5; \
463register long __sc1 __asm__ ("r1") = (long) arg6; \
464__asm__ __volatile__ (SYSCALL_ARG6 \
465 : "=z" (__sc0) \
466 : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \
467 "r" (__sc3), "r" (__sc1) \
468 : "memory" ); \
469__syscall_return(type,__sc0); \
470}
471
472#define __ARCH_WANT_IPC_PARSE_VERSION 335#define __ARCH_WANT_IPC_PARSE_VERSION
473#define __ARCH_WANT_OLD_READDIR 336#define __ARCH_WANT_OLD_READDIR
474#define __ARCH_WANT_OLD_STAT 337#define __ARCH_WANT_OLD_STAT