diff options
Diffstat (limited to 'include/asm-sh/unistd.h')
-rw-r--r-- | include/asm-sh/unistd.h | 124 |
1 files changed, 4 insertions, 120 deletions
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index f1a0cbc966be..f982073dc6c6 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -324,130 +324,14 @@ | |||
324 | #define __NR_sync_file_range 314 | 324 | #define __NR_sync_file_range 314 |
325 | #define __NR_tee 315 | 325 | #define __NR_tee 315 |
326 | #define __NR_vmsplice 316 | 326 | #define __NR_vmsplice 316 |
327 | #define __NR_move_pages 317 | ||
328 | #define __NR_getcpu 318 | ||
329 | #define __NR_epoll_pwait 319 | ||
327 | 330 | ||
328 | #define NR_syscalls 317 | 331 | #define NR_syscalls 320 |
329 | 332 | ||
330 | #ifdef __KERNEL__ | 333 | #ifdef __KERNEL__ |
331 | 334 | ||
332 | #include <linux/err.h> | ||
333 | |||
334 | /* user-visible error numbers are in the range -1 - -MAX_ERRNO: | ||
335 | * see <asm-sh/errno.h> */ | ||
336 | |||
337 | #define __syscall_return(type, res) \ | ||
338 | do { \ | ||
339 | if ((unsigned long)(res) >= (unsigned long)(-MAX_ERRNO)) { \ | ||
340 | /* Avoid using "res" which is declared to be in register r0; \ | ||
341 | errno might expand to a function call and clobber it. */ \ | ||
342 | int __err = -(res); \ | ||
343 | errno = __err; \ | ||
344 | res = -1; \ | ||
345 | } \ | ||
346 | return (type) (res); \ | ||
347 | } while (0) | ||
348 | |||
349 | /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */ | ||
350 | #define _syscall0(type,name) \ | ||
351 | type name(void) \ | ||
352 | { \ | ||
353 | register long __sc0 __asm__ ("r3") = __NR_##name; \ | ||
354 | __asm__ __volatile__ ("trapa #0x10" \ | ||
355 | : "=z" (__sc0) \ | ||
356 | : "0" (__sc0) \ | ||
357 | : "memory" ); \ | ||
358 | __syscall_return(type,__sc0); \ | ||
359 | } | ||
360 | |||
361 | #define _syscall1(type,name,type1,arg1) \ | ||
362 | type name(type1 arg1) \ | ||
363 | { \ | ||
364 | register long __sc0 __asm__ ("r3") = __NR_##name; \ | ||
365 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
366 | __asm__ __volatile__ ("trapa #0x11" \ | ||
367 | : "=z" (__sc0) \ | ||
368 | : "0" (__sc0), "r" (__sc4) \ | ||
369 | : "memory"); \ | ||
370 | __syscall_return(type,__sc0); \ | ||
371 | } | ||
372 | |||
373 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
374 | type name(type1 arg1,type2 arg2) \ | ||
375 | { \ | ||
376 | register long __sc0 __asm__ ("r3") = __NR_##name; \ | ||
377 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
378 | register long __sc5 __asm__ ("r5") = (long) arg2; \ | ||
379 | __asm__ __volatile__ ("trapa #0x12" \ | ||
380 | : "=z" (__sc0) \ | ||
381 | : "0" (__sc0), "r" (__sc4), "r" (__sc5) \ | ||
382 | : "memory"); \ | ||
383 | __syscall_return(type,__sc0); \ | ||
384 | } | ||
385 | |||
386 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
387 | type name(type1 arg1,type2 arg2,type3 arg3) \ | ||
388 | { \ | ||
389 | register long __sc0 __asm__ ("r3") = __NR_##name; \ | ||
390 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
391 | register long __sc5 __asm__ ("r5") = (long) arg2; \ | ||
392 | register long __sc6 __asm__ ("r6") = (long) arg3; \ | ||
393 | __asm__ __volatile__ ("trapa #0x13" \ | ||
394 | : "=z" (__sc0) \ | ||
395 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6) \ | ||
396 | : "memory"); \ | ||
397 | __syscall_return(type,__sc0); \ | ||
398 | } | ||
399 | |||
400 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
401 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ | ||
402 | { \ | ||
403 | register long __sc0 __asm__ ("r3") = __NR_##name; \ | ||
404 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
405 | register long __sc5 __asm__ ("r5") = (long) arg2; \ | ||
406 | register long __sc6 __asm__ ("r6") = (long) arg3; \ | ||
407 | register long __sc7 __asm__ ("r7") = (long) arg4; \ | ||
408 | __asm__ __volatile__ ("trapa #0x14" \ | ||
409 | : "=z" (__sc0) \ | ||
410 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), \ | ||
411 | "r" (__sc7) \ | ||
412 | : "memory" ); \ | ||
413 | __syscall_return(type,__sc0); \ | ||
414 | } | ||
415 | |||
416 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ | ||
417 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \ | ||
418 | { \ | ||
419 | register long __sc3 __asm__ ("r3") = __NR_##name; \ | ||
420 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
421 | register long __sc5 __asm__ ("r5") = (long) arg2; \ | ||
422 | register long __sc6 __asm__ ("r6") = (long) arg3; \ | ||
423 | register long __sc7 __asm__ ("r7") = (long) arg4; \ | ||
424 | register long __sc0 __asm__ ("r0") = (long) arg5; \ | ||
425 | __asm__ __volatile__ ("trapa #0x15" \ | ||
426 | : "=z" (__sc0) \ | ||
427 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ | ||
428 | "r" (__sc3) \ | ||
429 | : "memory" ); \ | ||
430 | __syscall_return(type,__sc0); \ | ||
431 | } | ||
432 | |||
433 | #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ | ||
434 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \ | ||
435 | { \ | ||
436 | register long __sc3 __asm__ ("r3") = __NR_##name; \ | ||
437 | register long __sc4 __asm__ ("r4") = (long) arg1; \ | ||
438 | register long __sc5 __asm__ ("r5") = (long) arg2; \ | ||
439 | register long __sc6 __asm__ ("r6") = (long) arg3; \ | ||
440 | register long __sc7 __asm__ ("r7") = (long) arg4; \ | ||
441 | register long __sc0 __asm__ ("r0") = (long) arg5; \ | ||
442 | register long __sc1 __asm__ ("r1") = (long) arg6; \ | ||
443 | __asm__ __volatile__ ("trapa #0x16" \ | ||
444 | : "=z" (__sc0) \ | ||
445 | : "0" (__sc0), "r" (__sc4), "r" (__sc5), "r" (__sc6), "r" (__sc7), \ | ||
446 | "r" (__sc3), "r" (__sc1) \ | ||
447 | : "memory" ); \ | ||
448 | __syscall_return(type,__sc0); \ | ||
449 | } | ||
450 | |||
451 | #define __ARCH_WANT_IPC_PARSE_VERSION | 335 | #define __ARCH_WANT_IPC_PARSE_VERSION |
452 | #define __ARCH_WANT_OLD_READDIR | 336 | #define __ARCH_WANT_OLD_READDIR |
453 | #define __ARCH_WANT_OLD_STAT | 337 | #define __ARCH_WANT_OLD_STAT |