2 * Standard x86 syscalls for user programs running under Cygmon
4 * Copyright (c) 1998 Cygnus Support
6 * The authors hereby grant permission to use, copy, modify, distribute,
7 * and license this software and its documentation for any purpose, provided
8 * that existing copyright notices are retained in all copies and that this
9 * notice is included verbatim in any distributions. No written agreement,
10 * license, or royalty fee is required for any of the authorized uses.
11 * Modifications to this software may be copyrighted by their authors
12 * and need not follow the licensing terms described here, provided that
13 * the new terms are clearly indicated on the first page of each file where
17 #ifndef CYGMON_SYSCALL_H
18 #define CYGMON_SYSCALL_H
20 #define __MAX_ERRNO 4096
22 #define _syscall0(type,name) \
26 __asm__ __volatile__ ("int $0x80" \
28 : "0" (SYS_##name)); \
29 return (type) __res; \
32 #define _syscall1(type,name,atype,a) \
36 __asm__ __volatile__ ("int $0x80" \
37 : "=a" (__res), "=&b" (dummy) \
38 : "0" (SYS_##name),"1" ((long)(a))); \
39 return (type) __res; \
42 #define _syscall2(type,name,atype,a,btype,b) \
43 type name(atype a,btype b) \
46 __asm__ __volatile__ ("int $0x80" \
47 : "=a" (__res), "=&b" (dummy) \
48 : "0" (SYS_##name),"1" ((long)(a)),"c" ((long)(b))); \
49 return (type) __res; \
52 #define _syscall3(type,name,atype,a,btype,b,ctype,c) \
53 type name(atype a,btype b,ctype c) \
56 __asm__ __volatile__ ("int $0x80" \
57 : "=a" (__res), "=&b" (dummy) \
58 : "0" (SYS_##name),"1" ((long)(a)),"c" ((long)(b)),"d" ((long)(c))); \
59 return (type) __res; \
62 #define _syscall4(type,name,atype,a,btype,b,ctype,c,dtype,d) \
63 type name (atype a, btype b, ctype c, dtype d) \
66 __asm__ __volatile__ ("int $0x80" \
68 : "0" (SYS_##name),"b" ((long)(a)),"c" ((long)(b)), \
69 "d" ((long)(c)),"S" ((long)(d))); \
70 return (type) __res; \
73 #define _syscall5(type,name,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
74 type name (atype a,btype b,ctype c,dtype d,etype e) \
77 __asm__ __volatile__ ("int $0x80" \
79 : "0" (SYS_##name),"b" ((long)(a)),"c" ((long)(b)), \
80 "d" ((long)(c)),"S" ((long)(d)),"D" ((long)(e))); \
81 return (type) __res; \
84 #define SYS_putTtyChar 2
85 #define SYS___sys_exit 1
92 #define SYS_gettimeofday 156
93 #define SYS___install_signal_handler 48
95 #define SYS___get_program_arguments 184
96 #endif /* SYSCALL_H */