xref: /qemu/linux-user/mips/target_syscall.h (revision 460c579f3ddc71bcf34128d4b3d1e1debdd93f73)
1*460c579fSLluís Vilanova #ifndef TARGET_SYSCALL_H
2*460c579fSLluís Vilanova #define TARGET_SYSCALL_H
3048f6b4dSbellard 
4048f6b4dSbellard /* this struct defines the way the registers are stored on the
5048f6b4dSbellard    stack during a system call. */
6048f6b4dSbellard 
7048f6b4dSbellard struct target_pt_regs {
8048f6b4dSbellard 	/* Pad bytes for argument save space on the stack. */
9992f48a0Sblueswir1 	abi_ulong pad0[6];
10048f6b4dSbellard 
11048f6b4dSbellard 	/* Saved main processor registers. */
12992f48a0Sblueswir1 	abi_ulong regs[32];
13048f6b4dSbellard 
14048f6b4dSbellard 	/* Saved special registers. */
15992f48a0Sblueswir1 	abi_ulong cp0_status;
16992f48a0Sblueswir1 	abi_ulong lo;
17992f48a0Sblueswir1 	abi_ulong hi;
18992f48a0Sblueswir1 	abi_ulong cp0_badvaddr;
19992f48a0Sblueswir1 	abi_ulong cp0_cause;
20992f48a0Sblueswir1 	abi_ulong cp0_epc;
21048f6b4dSbellard };
22048f6b4dSbellard 
23637947f1Sths /* Target errno definitions taken from asm-mips/errno.h */
24637947f1Sths #undef TARGET_ENOMSG
25637947f1Sths #define TARGET_ENOMSG          35      /* Identifier removed */
26637947f1Sths #undef TARGET_EIDRM
27637947f1Sths #define TARGET_EIDRM           36      /* Identifier removed */
28637947f1Sths #undef TARGET_ECHRNG
29637947f1Sths #define TARGET_ECHRNG          37      /* Channel number out of range */
30637947f1Sths #undef TARGET_EL2NSYNC
31637947f1Sths #define TARGET_EL2NSYNC        38      /* Level 2 not synchronized */
32637947f1Sths #undef TARGET_EL3HLT
33637947f1Sths #define TARGET_EL3HLT          39      /* Level 3 halted */
34637947f1Sths #undef TARGET_EL3RST
35637947f1Sths #define TARGET_EL3RST          40      /* Level 3 reset */
36637947f1Sths #undef TARGET_ELNRNG
37637947f1Sths #define TARGET_ELNRNG          41      /* Link number out of range */
38637947f1Sths #undef TARGET_EUNATCH
39637947f1Sths #define TARGET_EUNATCH         42      /* Protocol driver not attached */
40637947f1Sths #undef TARGET_ENOCSI
41637947f1Sths #define TARGET_ENOCSI          43      /* No CSI structure available */
42637947f1Sths #undef TARGET_EL2HLT
43637947f1Sths #define TARGET_EL2HLT          44      /* Level 2 halted */
44637947f1Sths #undef TARGET_EDEADLK
45637947f1Sths #define TARGET_EDEADLK         45      /* Resource deadlock would occur */
46637947f1Sths #undef TARGET_ENOLCK
47637947f1Sths #define TARGET_ENOLCK          46      /* No record locks available */
48637947f1Sths #undef TARGET_EBADE
49637947f1Sths #define TARGET_EBADE           50      /* Invalid exchange */
50637947f1Sths #undef TARGET_EBADR
51637947f1Sths #define TARGET_EBADR           51      /* Invalid request descriptor */
52637947f1Sths #undef TARGET_EXFULL
53637947f1Sths #define TARGET_EXFULL          52      /* TARGET_Exchange full */
54637947f1Sths #undef TARGET_ENOANO
55637947f1Sths #define TARGET_ENOANO          53      /* No anode */
56637947f1Sths #undef TARGET_EBADRQC
57637947f1Sths #define TARGET_EBADRQC         54      /* Invalid request code */
58637947f1Sths #undef TARGET_EBADSLT
59637947f1Sths #define TARGET_EBADSLT         55      /* Invalid slot */
60637947f1Sths #undef TARGET_EDEADLOCK
61637947f1Sths #define TARGET_EDEADLOCK       56      /* File locking deadlock error */
62637947f1Sths #undef TARGET_EBFONT
63637947f1Sths #define TARGET_EBFONT          59      /* Bad font file format */
64637947f1Sths #undef TARGET_ENOSTR
65637947f1Sths #define TARGET_ENOSTR          60      /* Device not a stream */
66637947f1Sths #undef TARGET_ENODATA
67637947f1Sths #define TARGET_ENODATA         61      /* No data available */
68637947f1Sths #undef TARGET_ETIME
69637947f1Sths #define TARGET_ETIME           62      /* Timer expired */
70637947f1Sths #undef TARGET_ENOSR
71637947f1Sths #define TARGET_ENOSR           63      /* Out of streams resources */
72637947f1Sths #undef TARGET_ENONET
73637947f1Sths #define TARGET_ENONET          64      /* Machine is not on the network */
74637947f1Sths #undef TARGET_ENOPKG
75637947f1Sths #define TARGET_ENOPKG          65      /* Package not installed */
76637947f1Sths #undef TARGET_EREMOTE
77637947f1Sths #define TARGET_EREMOTE         66      /* Object is remote */
78637947f1Sths #undef TARGET_ENOLINK
79637947f1Sths #define TARGET_ENOLINK         67      /* Link has been severed */
80637947f1Sths #undef TARGET_EADV
81637947f1Sths #define TARGET_EADV            68      /* Advertise error */
82637947f1Sths #undef TARGET_ESRMNT
83637947f1Sths #define TARGET_ESRMNT          69      /* Srmount error */
84637947f1Sths #undef TARGET_ECOMM
85637947f1Sths #define TARGET_ECOMM           70      /* Communication error on send */
86637947f1Sths #undef TARGET_EPROTO
87637947f1Sths #define TARGET_EPROTO          71      /* Protocol error */
88637947f1Sths #undef TARGET_EDOTDOT
89637947f1Sths #define TARGET_EDOTDOT         73      /* RFS specific error */
90637947f1Sths #undef TARGET_EMULTIHOP
91637947f1Sths #define TARGET_EMULTIHOP       74      /* Multihop attempted */
92637947f1Sths #undef TARGET_EBADMSG
93637947f1Sths #define TARGET_EBADMSG         77      /* Not a data message */
94637947f1Sths #undef TARGET_ENAMETOOLONG
95637947f1Sths #define TARGET_ENAMETOOLONG    78      /* File name too long */
96637947f1Sths #undef TARGET_EOVERFLOW
97637947f1Sths #define TARGET_EOVERFLOW       79      /* Value too large for defined data type */
98637947f1Sths #undef TARGET_ENOTUNIQ
99637947f1Sths #define TARGET_ENOTUNIQ        80      /* Name not unique on network */
100637947f1Sths #undef TARGET_EBADFD
101637947f1Sths #define TARGET_EBADFD          81      /* File descriptor in bad state */
102637947f1Sths #undef TARGET_EREMCHG
103637947f1Sths #define TARGET_EREMCHG         82      /* Remote address changed */
104637947f1Sths #undef TARGET_ELIBACC
105637947f1Sths #define TARGET_ELIBACC         83      /* Can not access a needed shared library */
106637947f1Sths #undef TARGET_ELIBBAD
107637947f1Sths #define TARGET_ELIBBAD         84      /* Accessing a corrupted shared library */
108637947f1Sths #undef TARGET_ELIBSCN
109637947f1Sths #define TARGET_ELIBSCN         85      /* .lib section in a.out corrupted */
110637947f1Sths #undef TARGET_ELIBMAX
111637947f1Sths #define TARGET_ELIBMAX         86      /* Attempting to link in too many shared libraries */
112637947f1Sths #undef TARGET_ELIBEXEC
113637947f1Sths #define TARGET_ELIBEXEC        87      /* Cannot exec a shared library directly */
114637947f1Sths #undef TARGET_EILSEQ
115637947f1Sths #define TARGET_EILSEQ          88      /* Illegal byte sequence */
116637947f1Sths #undef TARGET_ENOSYS
117637947f1Sths #define TARGET_ENOSYS          89      /* Function not implemented */
118637947f1Sths #undef TARGET_ELOOP
119637947f1Sths #define TARGET_ELOOP           90      /* Too many symbolic links encountered */
120637947f1Sths #undef TARGET_ERESTART
121637947f1Sths #define TARGET_ERESTART        91      /* Interrupted system call should be restarted */
122637947f1Sths #undef TARGET_ESTRPIPE
123637947f1Sths #define TARGET_ESTRPIPE        92      /* Streams pipe error */
124637947f1Sths #undef TARGET_ENOTEMPTY
125637947f1Sths #define TARGET_ENOTEMPTY       93      /* Directory not empty */
126637947f1Sths #undef TARGET_EUSERS
127637947f1Sths #define TARGET_EUSERS          94      /* Too many users */
128637947f1Sths #undef TARGET_ENOTSOCK
129637947f1Sths #define TARGET_ENOTSOCK        95      /* Socket operation on non-socket */
130637947f1Sths #undef TARGET_EDESTADDRREQ
131637947f1Sths #define TARGET_EDESTADDRREQ    96      /* Destination address required */
132637947f1Sths #undef TARGET_EMSGSIZE
133637947f1Sths #define TARGET_EMSGSIZE        97      /* Message too long */
134637947f1Sths #undef TARGET_EPROTOTYPE
135637947f1Sths #define TARGET_EPROTOTYPE      98      /* Protocol wrong type for socket */
136637947f1Sths #undef TARGET_ENOPROTOOPT
137637947f1Sths #define TARGET_ENOPROTOOPT     99      /* Protocol not available */
138637947f1Sths #undef TARGET_EPROTONOSUPPORT
139637947f1Sths #define TARGET_EPROTONOSUPPORT 120     /* Protocol not supported */
140637947f1Sths #undef TARGET_ESOCKTNOSUPPORT
141637947f1Sths #define TARGET_ESOCKTNOSUPPORT 121     /* Socket type not supported */
142637947f1Sths #undef TARGET_EOPNOTSUPP
143637947f1Sths #define TARGET_EOPNOTSUPP      122     /* Operation not supported on transport endpoint */
144637947f1Sths #undef TARGET_EPFNOSUPPORT
145637947f1Sths #define TARGET_EPFNOSUPPORT    123     /* Protocol family not supported */
146637947f1Sths #undef TARGET_EAFNOSUPPORT
147637947f1Sths #define TARGET_EAFNOSUPPORT    124     /* Address family not supported by protocol */
148637947f1Sths #undef TARGET_EADDRINUSE
149637947f1Sths #define TARGET_EADDRINUSE      125     /* Address already in use */
150637947f1Sths #undef TARGET_EADDRNOTAVAIL
151637947f1Sths #define TARGET_EADDRNOTAVAIL   126     /* Cannot assign requested address */
152637947f1Sths #undef TARGET_ENETDOWN
153637947f1Sths #define TARGET_ENETDOWN        127     /* Network is down */
154637947f1Sths #undef TARGET_ENETUNREACH
155637947f1Sths #define TARGET_ENETUNREACH     128     /* Network is unreachable */
156637947f1Sths #undef TARGET_ENETRESET
157637947f1Sths #define TARGET_ENETRESET       129     /* Network dropped connection because of reset */
158637947f1Sths #undef TARGET_ECONNABORTED
159637947f1Sths #define TARGET_ECONNABORTED    130     /* Software caused connection abort */
160637947f1Sths #undef TARGET_ECONNRESET
161637947f1Sths #define TARGET_ECONNRESET      131     /* Connection reset by peer */
162637947f1Sths #undef TARGET_ENOBUFS
163637947f1Sths #define TARGET_ENOBUFS         132     /* No buffer space available */
164637947f1Sths #undef TARGET_EISCONN
165637947f1Sths #define TARGET_EISCONN         133     /* Transport endpoint is already connected */
166637947f1Sths #undef TARGET_ENOTCONN
167637947f1Sths #define TARGET_ENOTCONN        134     /* Transport endpoint is not connected */
168637947f1Sths #undef TARGET_EUCLEAN
169637947f1Sths #define TARGET_EUCLEAN         135     /* Structure needs cleaning */
170637947f1Sths #undef TARGET_ENOTNAM
171637947f1Sths #define TARGET_ENOTNAM         137     /* Not a XENIX named type file */
172637947f1Sths #undef TARGET_ENAVAIL
173637947f1Sths #define TARGET_ENAVAIL         138     /* No XENIX semaphores available */
174637947f1Sths #undef TARGET_EISNAM
175637947f1Sths #define TARGET_EISNAM          139     /* Is a named type file */
176637947f1Sths #undef TARGET_EREMOTEIO
177637947f1Sths #define TARGET_EREMOTEIO       140     /* Remote I/O error */
178637947f1Sths #undef TARGET_EINIT
179637947f1Sths #define TARGET_EINIT           141     /* Reserved */
180637947f1Sths #undef TARGET_EREMDEV
181637947f1Sths #define TARGET_EREMDEV         142     /* TARGET_Error 142 */
182637947f1Sths #undef TARGET_ESHUTDOWN
183637947f1Sths #define TARGET_ESHUTDOWN       143     /* Cannot send after transport endpoint shutdown */
184637947f1Sths #undef TARGET_ETOOMANYREFS
185637947f1Sths #define TARGET_ETOOMANYREFS    144     /* Too many references: cannot splice */
186637947f1Sths #undef TARGET_ETIMEDOUT
187637947f1Sths #define TARGET_ETIMEDOUT       145     /* Connection timed out */
188637947f1Sths #undef TARGET_ECONNREFUSED
189637947f1Sths #define TARGET_ECONNREFUSED    146     /* Connection refused */
190637947f1Sths #undef TARGET_EHOSTDOWN
191637947f1Sths #define TARGET_EHOSTDOWN       147     /* Host is down */
192637947f1Sths #undef TARGET_EHOSTUNREACH
193637947f1Sths #define TARGET_EHOSTUNREACH    148     /* No route to host */
194637947f1Sths #undef TARGET_EALREADY
195637947f1Sths #define TARGET_EALREADY        149     /* Operation already in progress */
196637947f1Sths #undef TARGET_EINPROGRESS
197637947f1Sths #define TARGET_EINPROGRESS     150     /* Operation now in progress */
198637947f1Sths #undef TARGET_ESTALE
199637947f1Sths #define TARGET_ESTALE          151     /* Stale NFS file handle */
200637947f1Sths #undef TARGET_ECANCELED
201637947f1Sths #define TARGET_ECANCELED       158     /* AIO operation canceled */
202637947f1Sths /*
203637947f1Sths  * These error are Linux extensions.
204637947f1Sths  */
205637947f1Sths #undef TARGET_ENOMEDIUM
206637947f1Sths #define TARGET_ENOMEDIUM       159     /* No medium found */
207637947f1Sths #undef TARGET_EMEDIUMTYPE
208637947f1Sths #define TARGET_EMEDIUMTYPE     160     /* Wrong medium type */
209637947f1Sths #undef TARGET_ENOKEY
210637947f1Sths #define TARGET_ENOKEY          161     /* Required key not available */
211637947f1Sths #undef TARGET_EKEYEXPIRED
212637947f1Sths #define TARGET_EKEYEXPIRED     162     /* Key has expired */
213637947f1Sths #undef TARGET_EKEYREVOKED
214637947f1Sths #define TARGET_EKEYREVOKED     163     /* Key has been revoked */
215637947f1Sths #undef TARGET_EKEYREJECTED
216637947f1Sths #define TARGET_EKEYREJECTED    164     /* Key was rejected by service */
217637947f1Sths 
218637947f1Sths /* for robust mutexes */
219637947f1Sths #undef TARGET_EOWNERDEAD
220637947f1Sths #define TARGET_EOWNERDEAD      165     /* Owner died */
221637947f1Sths #undef TARGET_ENOTRECOVERABLE
222637947f1Sths #define TARGET_ENOTRECOVERABLE 166     /* State not recoverable */
223637947f1Sths 
224637947f1Sths 
225637947f1Sths 
2260b1bcb00Spbrook /* Nasty hack: define a fake errno value for use by sigreturn.  */
2270b1bcb00Spbrook #define TARGET_QEMU_ESIGRETURN 255
2280b1bcb00Spbrook 
229048f6b4dSbellard #define UNAME_MACHINE "mips"
230cbc14e6fSRiku Voipio #define UNAME_MINIMUM_RELEASE "2.6.32"
2314ce6243dSPeter Maydell 
2324ce6243dSPeter Maydell #define TARGET_CLONE_BACKWARDS
2330903c8beSTom Musta #define TARGET_MINSIGSTKSZ 2048
2346f6a4032STom Musta #define TARGET_MLOCKALL_MCL_CURRENT 1
2356f6a4032STom Musta #define TARGET_MLOCKALL_MCL_FUTURE  2
236*460c579fSLluís Vilanova 
237*460c579fSLluís Vilanova #endif  /* TARGET_SYSCALL_H */
238