mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 04:19:21 +08:00
fa4a16a17a
* configure.host: Add support for machine subdirectory of sys subdirectory. * configure.in: Add check for sys machine subdirectory. * Makefile.am: Ditto. * configure: Regenerated. * Makefile.in: Ditto. * libc/sys/linux/crt0.c: Moved to machine/i386 directory. * libc/sys/linux/sys/syscall.h: Ditto. * libc/sys/linux/sleep.c: New file. * libc/sys/linux/socket.c: Ditto. * libc/sys/linux/sockops.h: Ditto. * libc/sys/linux/stack.c: Ditto. * libc/sys/linux/usleep.c: Ditto. * libc/sys/linux/machine/Makefile.am: Ditto. * libc/sys/linux/machine/Makefile.in: Ditto. * libc/sys/linux/machine/aclocal.m4: Ditto. * libc/sys/linux/machine/configure: Ditto. * libc/sys/linux/machine/configure.in: Ditto. * libc/sys/linux/machine/i386/Makefile.am: Ditto. * libc/sys/linux/machine/i386/Makefile.in: Ditto. * libc/sys/linux/machine/i386/aclocal.m4: Ditto. * libc/sys/linux/machine/i386/configure: Ditto. * libc/sys/linux/machine/i386/configure.in: Ditto. * libc/sys/linux/machine/i386/crt0.c: Ditto. * libc/sys/linux/machine/i386/sigset.c: Ditto. * libc/sys/linux/machine/i386/sigstack.h: Ditto. * libc/sys/linux/machine/i386/socketcall.h: Ditto. * libc/sys/linux/machine/i386/syscall.h: Ditto. * libc/sys/linux/sys/select.h: Ditto. * libc/sys/linux/configure.in: Add support for machine directory. * libc/sys/linux/Makefile.am: Ditto plus add new files above. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/configure: Ditto. * libc/sys/linux/brk.c: Use machine/syscall.h instead of sys/syscall.h. * libc/sys/linux/inode.c: Ditto. * libc/sys/linux/linux.c: Ditto. * libc/sys/linux/process.c: Ditto. * libc/sys/linux/systat.c: Ditto. * libc/sys/linux/time.c: Ditto. * libc/sys/linux/wait.c: Ditto. * libc/sys/linux/ids.c: Change header plus add setfsgid/setfsuid. * libc/sys/linux/io.c: Change header plus add readv/writev. * libc/sys/linux/signal.c: Change header plus change sigsuspend to use __sigsuspend syscall. * libc/sys/linux/select.c: Change header plus change select to use _newselect syscall. * libc/sys/linux/sys/cdefs.h: Add a number of standard definitions used by glibc header files. * libc/sys/linux/sys/types.h: Add __socklen_t and __useconds_t types.
109 lines
2.9 KiB
C
109 lines
2.9 KiB
C
/* libc/sys/linux/machine/i386/syscall.h - x86 linux system calls */
|
|
|
|
/* Written 2000 by Werner Almesberger */
|
|
|
|
|
|
#ifndef SYSCALL_H
|
|
|
|
#include <sys/errno.h>
|
|
#include <asm/unistd.h>
|
|
|
|
|
|
/*
|
|
* Note: several system calls are for SysV or BSD compatibility, or are
|
|
* specific Linuxisms. Most of those system calls are not implemented in
|
|
* this library.
|
|
*/
|
|
|
|
|
|
#if defined(__PIC__) && defined(__i386__)
|
|
|
|
/*
|
|
* PIC uses %ebx, so we need to save it during system calls
|
|
*/
|
|
|
|
#undef __inline_syscall1
|
|
#define __inline_syscall1(name,ret,arg1) \
|
|
__asm__ volatile ("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
|
|
: "=a" (ret) \
|
|
: "0" (__NR_##name),"r" ((long)(arg1)));
|
|
|
|
#undef __inline_syscall2
|
|
#define __inline_syscall2(name,ret,arg1,arg2) \
|
|
__asm__ volatile ("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
|
|
: "=a" (ret) \
|
|
: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)));
|
|
|
|
#undef __inline_syscall3
|
|
#define __inline_syscall3(name,ret,arg1,arg2,arg3) \
|
|
__asm__ volatile ("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
|
|
: "=a" (ret) \
|
|
: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)), \
|
|
"d" ((long)(arg3)));
|
|
|
|
#undef __inline_syscall4
|
|
#define __inline_syscall4(name,ret,arg1,arg2,arg3,arg4) \
|
|
__asm__ volatile ("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
|
|
: "=a" (ret) \
|
|
: "0" (__NR_##name),"r" ((long)(arg1)),"c" ((long)(arg2)), \
|
|
"d" ((long)(arg3)),"S" ((long)(arg4)));
|
|
|
|
#undef __inline_syscall5
|
|
#define __inline_syscall5(name,ret,arg1,arg2,arg3,arg4,arg5) \
|
|
__asm__ volatile ("push %%ebx; movl %2,%%ebx; int $0x80; pop %%ebx" \
|
|
: "=a" (ret) \
|
|
: "0" (__NR_##name),"m" ((long)(arg1)),"c" ((long)(arg2)), \
|
|
"d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5)));
|
|
|
|
#undef _syscall1
|
|
#define _syscall1(type,name,type1,arg1) \
|
|
type name(type1 arg1) \
|
|
{ \
|
|
long __res; \
|
|
__inline_syscall1(name,__res,arg1) \
|
|
__syscall_return(type,__res); \
|
|
}
|
|
|
|
#undef _syscall2
|
|
#define _syscall2(type,name,type1,arg1,type2,arg2) \
|
|
type name(type1 arg1,type2 arg2) \
|
|
{ \
|
|
long __res; \
|
|
__inline_syscall2(name,__res,arg1,arg2) \
|
|
__syscall_return(type,__res); \
|
|
}
|
|
|
|
#undef _syscall3
|
|
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
|
|
type name(type1 arg1,type2 arg2,type3 arg3) \
|
|
{ \
|
|
long __res; \
|
|
__inline_syscall3(name,__res,arg1,arg2,arg3) \
|
|
__syscall_return(type,__res); \
|
|
}
|
|
|
|
#undef _syscall4
|
|
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
|
|
type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
|
|
{ \
|
|
long __res; \
|
|
__inline_syscall4(name,__res,arg1,arg2,arg3,arg4) \
|
|
__syscall_return(type,__res); \
|
|
}
|
|
|
|
#undef _syscall5
|
|
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
|
|
type5,arg5) \
|
|
type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
|
|
{ \
|
|
long __res; \
|
|
__inline_syscall5(name,__res,arg1,arg2,arg3,arg4,arg5) \
|
|
__syscall_return(type,__res); \
|
|
}
|
|
|
|
#undef _syscall6
|
|
|
|
#endif /* __PIC__ && __i386__ */
|
|
|
|
#endif /* SYSCALL_H */
|