diff options
Diffstat (limited to 'include/asm-sparc64/unistd.h')
-rw-r--r-- | include/asm-sparc64/unistd.h | 128 |
1 files changed, 7 insertions, 121 deletions
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 124cf076717f..47047536f261 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -320,132 +320,18 @@ | |||
320 | #define __NR_unshare 299 | 320 | #define __NR_unshare 299 |
321 | #define __NR_set_robust_list 300 | 321 | #define __NR_set_robust_list 300 |
322 | #define __NR_get_robust_list 301 | 322 | #define __NR_get_robust_list 301 |
323 | #define __NR_migrate_pages 302 | ||
324 | |||
325 | #define NR_SYSCALLS 303 | ||
323 | 326 | ||
324 | #ifdef __KERNEL__ | 327 | #ifdef __KERNEL__ |
325 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since | 328 | |
329 | /* WARNING: You MAY NOT add syscall numbers larger than 302, since | ||
326 | * all of the syscall tables in the Sparc kernel are | 330 | * all of the syscall tables in the Sparc kernel are |
327 | * sized to have 301 entries (starting at zero). Therefore | 331 | * sized to have 302 entries (starting at zero). Therefore |
328 | * find a free slot in the 0-301 range. | 332 | * find a free slot in the 0-302 range. |
329 | */ | 333 | */ |
330 | 334 | ||
331 | #define _syscall0(type,name) \ | ||
332 | type name(void) \ | ||
333 | { \ | ||
334 | long __res; \ | ||
335 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
336 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
337 | "sub %%g0, %%o0, %0\n\t" \ | ||
338 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
339 | : "=r" (__res)\ | ||
340 | : "r" (__g1) \ | ||
341 | : "o0", "cc"); \ | ||
342 | if (__res >= 0) \ | ||
343 | return (type) __res; \ | ||
344 | errno = -__res; \ | ||
345 | return -1; \ | ||
346 | } | ||
347 | |||
348 | #define _syscall1(type,name,type1,arg1) \ | ||
349 | type name(type1 arg1) \ | ||
350 | { \ | ||
351 | long __res; \ | ||
352 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
353 | register long __o0 __asm__ ("o0") = (long)(arg1); \ | ||
354 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
355 | "sub %%g0, %%o0, %0\n\t" \ | ||
356 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
357 | : "=r" (__res), "=&r" (__o0) \ | ||
358 | : "1" (__o0), "r" (__g1) \ | ||
359 | : "cc"); \ | ||
360 | if (__res >= 0) \ | ||
361 | return (type) __res; \ | ||
362 | errno = -__res; \ | ||
363 | return -1; \ | ||
364 | } | ||
365 | |||
366 | #define _syscall2(type,name,type1,arg1,type2,arg2) \ | ||
367 | type name(type1 arg1,type2 arg2) \ | ||
368 | { \ | ||
369 | long __res; \ | ||
370 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
371 | register long __o0 __asm__ ("o0") = (long)(arg1); \ | ||
372 | register long __o1 __asm__ ("o1") = (long)(arg2); \ | ||
373 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
374 | "sub %%g0, %%o0, %0\n\t" \ | ||
375 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
376 | : "=r" (__res), "=&r" (__o0) \ | ||
377 | : "1" (__o0), "r" (__o1), "r" (__g1) \ | ||
378 | : "cc"); \ | ||
379 | if (__res >= 0) \ | ||
380 | return (type) __res; \ | ||
381 | errno = -__res; \ | ||
382 | return -1; \ | ||
383 | } | ||
384 | |||
385 | #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ | ||
386 | type name(type1 arg1,type2 arg2,type3 arg3) \ | ||
387 | { \ | ||
388 | long __res; \ | ||
389 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
390 | register long __o0 __asm__ ("o0") = (long)(arg1); \ | ||
391 | register long __o1 __asm__ ("o1") = (long)(arg2); \ | ||
392 | register long __o2 __asm__ ("o2") = (long)(arg3); \ | ||
393 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
394 | "sub %%g0, %%o0, %0\n\t" \ | ||
395 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
396 | : "=r" (__res), "=&r" (__o0) \ | ||
397 | : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__g1) \ | ||
398 | : "cc"); \ | ||
399 | if (__res>=0) \ | ||
400 | return (type) __res; \ | ||
401 | errno = -__res; \ | ||
402 | return -1; \ | ||
403 | } | ||
404 | |||
405 | #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ | ||
406 | type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ | ||
407 | { \ | ||
408 | long __res; \ | ||
409 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
410 | register long __o0 __asm__ ("o0") = (long)(arg1); \ | ||
411 | register long __o1 __asm__ ("o1") = (long)(arg2); \ | ||
412 | register long __o2 __asm__ ("o2") = (long)(arg3); \ | ||
413 | register long __o3 __asm__ ("o3") = (long)(arg4); \ | ||
414 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
415 | "sub %%g0, %%o0, %0\n\t" \ | ||
416 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
417 | : "=r" (__res), "=&r" (__o0) \ | ||
418 | : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__g1) \ | ||
419 | : "cc"); \ | ||
420 | if (__res>=0) \ | ||
421 | return (type) __res; \ | ||
422 | errno = -__res; \ | ||
423 | return -1; \ | ||
424 | } | ||
425 | |||
426 | #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ | ||
427 | type5,arg5) \ | ||
428 | type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ | ||
429 | { \ | ||
430 | long __res; \ | ||
431 | register long __g1 __asm__ ("g1") = __NR_##name; \ | ||
432 | register long __o0 __asm__ ("o0") = (long)(arg1); \ | ||
433 | register long __o1 __asm__ ("o1") = (long)(arg2); \ | ||
434 | register long __o2 __asm__ ("o2") = (long)(arg3); \ | ||
435 | register long __o3 __asm__ ("o3") = (long)(arg4); \ | ||
436 | register long __o4 __asm__ ("o4") = (long)(arg5); \ | ||
437 | __asm__ __volatile__ ("t 0x6d\n\t" \ | ||
438 | "sub %%g0, %%o0, %0\n\t" \ | ||
439 | "movcc %%xcc, %%o0, %0\n\t" \ | ||
440 | : "=r" (__res), "=&r" (__o0) \ | ||
441 | : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \ | ||
442 | : "cc"); \ | ||
443 | if (__res>=0) \ | ||
444 | return (type) __res; \ | ||
445 | errno = -__res; \ | ||
446 | return -1; \ | ||
447 | } | ||
448 | |||
449 | /* sysconf options, for SunOS compatibility */ | 335 | /* sysconf options, for SunOS compatibility */ |
450 | #define _SC_ARG_MAX 1 | 336 | #define _SC_ARG_MAX 1 |
451 | #define _SC_CHILD_MAX 2 | 337 | #define _SC_CHILD_MAX 2 |