~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/cris/include/arch-v10/arch/unistd.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef _ASM_CRIS_ARCH_UNISTD_H_
  2 #define _ASM_CRIS_ARCH_UNISTD_H_
  3 
  4 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
  5 /*
  6  * Don't remove the .ifnc tests; they are an insurance against
  7  * any hard-to-spot gcc register allocation bugs.
  8  */
  9 #define _syscall0(type,name) \
 10 type name(void) \
 11 { \
 12   register long __a __asm__ ("r10"); \
 13   register long __n_ __asm__ ("r9") = (__NR_##name); \
 14   __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
 15                         ".err\n\t" \
 16                         ".endif\n\t" \
 17                         "break 13" \
 18                         : "=r" (__a) \
 19                         : "r" (__n_)); \
 20   if (__a >= 0) \
 21      return (type) __a; \
 22   errno = -__a; \
 23   return (type) -1; \
 24 }
 25 
 26 #define _syscall1(type,name,type1,arg1) \
 27 type name(type1 arg1) \
 28 { \
 29   register long __a __asm__ ("r10") = (long) arg1; \
 30   register long __n_ __asm__ ("r9") = (__NR_##name); \
 31   __asm__ __volatile__ (".ifnc %0%1,$r10$r9\n\t" \
 32                         ".err\n\t" \
 33                         ".endif\n\t" \
 34                         "break 13" \
 35                         : "=r" (__a) \
 36                         : "r" (__n_), "" (__a)); \
 37   if (__a >= 0) \
 38      return (type) __a; \
 39   errno = -__a; \
 40   return (type) -1; \
 41 }
 42 
 43 #define _syscall2(type,name,type1,arg1,type2,arg2) \
 44 type name(type1 arg1,type2 arg2) \
 45 { \
 46   register long __a __asm__ ("r10") = (long) arg1; \
 47   register long __b __asm__ ("r11") = (long) arg2; \
 48   register long __n_ __asm__ ("r9") = (__NR_##name); \
 49   __asm__ __volatile__ (".ifnc %0%1%3,$r10$r9$r11\n\t" \
 50                         ".err\n\t" \
 51                         ".endif\n\t" \
 52                         "break 13" \
 53                         : "=r" (__a) \
 54                         : "r" (__n_), "" (__a), "r" (__b)); \
 55   if (__a >= 0) \
 56      return (type) __a; \
 57   errno = -__a; \
 58   return (type) -1; \
 59 }
 60 
 61 #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
 62 type name(type1 arg1,type2 arg2,type3 arg3) \
 63 { \
 64   register long __a __asm__ ("r10") = (long) arg1; \
 65   register long __b __asm__ ("r11") = (long) arg2; \
 66   register long __c __asm__ ("r12") = (long) arg3; \
 67   register long __n_ __asm__ ("r9") = (__NR_##name); \
 68   __asm__ __volatile__ (".ifnc %0%1%3%4,$r10$r9$r11$r12\n\t" \
 69                         ".err\n\t" \
 70                         ".endif\n\t" \
 71                         "break 13" \
 72                         : "=r" (__a) \
 73                         : "r" (__n_), "" (__a), "r" (__b), "r" (__c)); \
 74   if (__a >= 0) \
 75      return (type) __a; \
 76   errno = -__a; \
 77   return (type) -1; \
 78 }
 79 
 80 #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
 81 type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
 82 { \
 83   register long __a __asm__ ("r10") = (long) arg1; \
 84   register long __b __asm__ ("r11") = (long) arg2; \
 85   register long __c __asm__ ("r12") = (long) arg3; \
 86   register long __d __asm__ ("r13") = (long) arg4; \
 87   register long __n_ __asm__ ("r9") = (__NR_##name); \
 88   __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
 89                         ".err\n\t" \
 90                         ".endif\n\t" \
 91                         "break 13" \
 92                         : "=r" (__a) \
 93                         : "r" (__n_), "" (__a), "r" (__b), \
 94                           "r" (__c), "r" (__d)); \
 95   if (__a >= 0) \
 96      return (type) __a; \
 97   errno = -__a; \
 98   return (type) -1; \
 99 } 
100 
101 #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
102           type5,arg5) \
103 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
104 { \
105   register long __a __asm__ ("r10") = (long) arg1; \
106   register long __b __asm__ ("r11") = (long) arg2; \
107   register long __c __asm__ ("r12") = (long) arg3; \
108   register long __d __asm__ ("r13") = (long) arg4; \
109   register long __n_ __asm__ ("r9") = (__NR_##name); \
110   __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
111                         ".err\n\t" \
112                         ".endif\n\t" \
113                         "move %6,$mof\n\t" \
114                         "break 13" \
115                         : "=r" (__a) \
116                         : "r" (__n_), "" (__a), "r" (__b), \
117                           "r" (__c), "r" (__d), "g" (arg5)); \
118   if (__a >= 0) \
119      return (type) __a; \
120   errno = -__a; \
121   return (type) -1; \
122 }
123 
124 #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
125           type5,arg5,type6,arg6) \
126 type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
127 { \
128   register long __a __asm__ ("r10") = (long) arg1; \
129   register long __b __asm__ ("r11") = (long) arg2; \
130   register long __c __asm__ ("r12") = (long) arg3; \
131   register long __d __asm__ ("r13") = (long) arg4; \
132   register long __n_ __asm__ ("r9") = (__NR_##name); \
133   __asm__ __volatile__ (".ifnc %0%1%3%4%5,$r10$r9$r11$r12$r13\n\t" \
134                         ".err\n\t" \
135                         ".endif\n\t" \
136                         "move %6,$mof\n\tmove %7,$srp\n\t" \
137                         "break 13" \
138                         : "=r" (__a) \
139                         : "r" (__n_), "" (__a), "r" (__b), \
140                           "r" (__c), "r" (__d), "g" (arg5), "g" (arg6)\
141                         : "srp"); \
142   if (__a >= 0) \
143      return (type) __a; \
144   errno = -__a; \
145   return (type) -1; \
146 }
147 
148 #endif
149 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp