aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-frv/unistd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-frv/unistd.h')
-rw-r--r--include/asm-frv/unistd.h119
1 files changed, 0 insertions, 119 deletions
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h
index 725e854928cf..584c0417ae4d 100644
--- a/include/asm-frv/unistd.h
+++ b/include/asm-frv/unistd.h
@@ -320,125 +320,6 @@
320#ifdef __KERNEL__ 320#ifdef __KERNEL__
321 321
322#define NR_syscalls 310 322#define NR_syscalls 310
323#include <linux/err.h>
324
325/*
326 * process the return value of a syscall, consigning it to one of two possible fates
327 * - user-visible error numbers are in the range -1 - -4095: see <asm-frv/errno.h>
328 */
329#undef __syscall_return
330#define __syscall_return(type, res) \
331do { \
332 unsigned long __sr2 = (res); \
333 if (__builtin_expect(__sr2 >= (unsigned long)(-MAX_ERRNO), 0)) { \
334 errno = (-__sr2); \
335 __sr2 = ~0UL; \
336 } \
337 return (type) __sr2; \
338} while (0)
339
340/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
341
342#undef _syscall0
343#define _syscall0(type,name) \
344type name(void) \
345{ \
346 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
347 register unsigned long __sc0 __asm__ ("gr8"); \
348 __asm__ __volatile__ ("tira gr0,#0" \
349 : "=r" (__sc0) \
350 : "r" (__scnum)); \
351 __syscall_return(type, __sc0); \
352}
353
354#undef _syscall1
355#define _syscall1(type,name,type1,arg1) \
356type name(type1 arg1) \
357{ \
358 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
359 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
360 __asm__ __volatile__ ("tira gr0,#0" \
361 : "+r" (__sc0) \
362 : "r" (__scnum)); \
363 __syscall_return(type, __sc0); \
364}
365
366#undef _syscall2
367#define _syscall2(type,name,type1,arg1,type2,arg2) \
368type name(type1 arg1,type2 arg2) \
369{ \
370 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
371 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
372 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
373 __asm__ __volatile__ ("tira gr0,#0" \
374 : "+r" (__sc0) \
375 : "r" (__scnum), "r" (__sc1)); \
376 __syscall_return(type, __sc0); \
377}
378
379#undef _syscall3
380#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
381type name(type1 arg1,type2 arg2,type3 arg3) \
382{ \
383 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
384 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
385 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
386 register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
387 __asm__ __volatile__ ("tira gr0,#0" \
388 : "+r" (__sc0) \
389 : "r" (__scnum), "r" (__sc1), "r" (__sc2)); \
390 __syscall_return(type, __sc0); \
391}
392
393#undef _syscall4
394#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
395type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
396{ \
397 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
398 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
399 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
400 register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
401 register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
402 __asm__ __volatile__ ("tira gr0,#0" \
403 : "+r" (__sc0) \
404 : "r" (__scnum), "r" (__sc1), "r" (__sc2), "r" (__sc3)); \
405 __syscall_return(type, __sc0); \
406}
407
408#undef _syscall5
409#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
410type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
411{ \
412 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
413 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
414 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
415 register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
416 register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
417 register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
418 __asm__ __volatile__ ("tira gr0,#0" \
419 : "+r" (__sc0) \
420 : "r" (__scnum), "r" (__sc1), "r" (__sc2), \
421 "r" (__sc3), "r" (__sc4)); \
422 __syscall_return(type, __sc0); \
423}
424
425#undef _syscall6
426#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
427type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
428{ \
429 register unsigned long __scnum __asm__ ("gr7") = (__NR_##name); \
430 register unsigned long __sc0 __asm__ ("gr8") = (unsigned long) arg1; \
431 register unsigned long __sc1 __asm__ ("gr9") = (unsigned long) arg2; \
432 register unsigned long __sc2 __asm__ ("gr10") = (unsigned long) arg3; \
433 register unsigned long __sc3 __asm__ ("gr11") = (unsigned long) arg4; \
434 register unsigned long __sc4 __asm__ ("gr12") = (unsigned long) arg5; \
435 register unsigned long __sc5 __asm__ ("gr13") = (unsigned long) arg6; \
436 __asm__ __volatile__ ("tira gr0,#0" \
437 : "+r" (__sc0) \
438 : "r" (__scnum), "r" (__sc1), "r" (__sc2), \
439 "r" (__sc3), "r" (__sc4), "r" (__sc5)); \
440 __syscall_return(type, __sc0); \
441}
442 323
443#define __ARCH_WANT_IPC_PARSE_VERSION 324#define __ARCH_WANT_IPC_PARSE_VERSION
444/* #define __ARCH_WANT_OLD_READDIR */ 325/* #define __ARCH_WANT_OLD_READDIR */