malloc: mset->size may not be equal to MSETLEN
[neatlibc.git] / x86 / syscall.s
blob58d554db4dad5ee1b54eda06295f1d15657663ec
2 extern errno
4 __syscall:
5 push ebp
6 mov ebp, esp
8 push ebx
9 push edi
10 push esi
12 mov ebx, [ebp+8]
13 mov ecx, [ebp+12]
14 mov edx, [ebp+16]
15 mov esi, [ebp+20]
16 mov edi, [ebp+24]
17 mov ebp, [ebp+28]
19 int 0x80
21 cmp eax, -125
22 jb done
23 neg eax
24 mov [errno], eax
25 mov eax, -1
26 done:
27 pop esi
28 pop edi
29 pop ebx
30 pop ebp
31 ret
33 global _exit
34 _exit:
35 mov eax, 1
36 jmp __syscall
38 global fork
39 fork:
40 mov eax, 2
41 jmp __syscall
43 global read
44 read:
45 mov eax, 3
46 jmp __syscall
48 global write
49 write:
50 mov eax, 4
51 jmp __syscall
53 global open
54 open:
55 mov eax, 5
56 jmp __syscall
58 global close
59 close:
60 mov eax, 6
61 jmp __syscall
63 global waitpid
64 waitpid:
65 mov eax, 7
66 jmp __syscall
68 global creat
69 creat:
70 mov eax, 8
71 jmp __syscall
73 global link
74 link:
75 mov eax, 9
76 jmp __syscall
78 global unlink
79 unlink:
80 mov eax, 10
81 jmp __syscall
83 global execve
84 execve:
85 mov eax, 11
86 jmp __syscall
88 global chdir
89 chdir:
90 mov eax, 12
91 jmp __syscall
93 global time
94 time:
95 mov eax, 13
96 jmp __syscall
98 global mknod
99 mknod:
100 mov eax, 14
101 jmp __syscall
103 global chmod
104 chmod:
105 mov eax, 15
106 jmp __syscall
108 global lseek
109 lseek:
110 mov eax, 19
111 jmp __syscall
113 global getpid
114 getpid:
115 mov eax, 20
116 jmp __syscall
118 global mount
119 mount:
120 mov eax, 21
121 jmp __syscall
123 global umount
124 umount:
125 mov eax, 22
126 jmp __syscall
128 global setuid
129 setuid:
130 mov eax, 23
131 jmp __syscall
133 global getuid
134 getuid:
135 mov eax, 24
136 jmp __syscall
138 global utime
139 utime:
140 mov eax, 30
141 jmp __syscall
143 global access
144 access:
145 mov eax, 33
146 jmp __syscall
148 global sync
149 sync:
150 mov eax, 36
151 jmp __syscall
153 global kill
154 kill:
155 mov eax, 37
156 jmp __syscall
158 global mkdir
159 mkdir:
160 mov eax, 39
161 jmp __syscall
163 global rmdir
164 rmdir:
165 mov eax, 40
166 jmp __syscall
168 global __dup
169 global dup
170 dup:
171 __dup:
172 mov eax, 41
173 jmp __syscall
175 global pipe
176 pipe:
177 mov eax, 42
178 jmp __syscall
180 global brk
181 brk:
182 mov eax, 45
183 jmp __syscall
185 global setgid
186 setgid:
187 mov eax, 46
188 jmp __syscall
190 global getgid
191 getgid:
192 mov eax, 47
193 jmp __syscall
195 global geteuid
196 geteuid:
197 mov eax, 49
198 jmp __syscall
200 global getegid
201 getegid:
202 mov eax, 50
203 jmp __syscall
205 global ioctl
206 ioctl:
207 mov eax, 54
208 jmp __syscall
210 global fcntl
211 fcntl:
212 mov eax, 55
213 jmp __syscall
215 global dup2
216 dup2:
217 mov eax, 63
218 jmp __syscall
220 global getppid
221 getppid:
222 mov eax, 64
223 jmp __syscall
225 global setsid
226 setsid:
227 mov eax, 66
228 jmp __syscall
230 global gettimeofday
231 gettimeofday:
232 mov eax, 78
233 jmp __syscall
235 global settimeofday
236 settimeofday:
237 mov eax, 79
238 jmp __syscall
240 global mmap
241 mmap:
242 mov eax, 192
243 jmp __syscall
245 global munmap
246 munmap:
247 mov eax, 91
248 jmp __syscall
250 global stat
251 stat:
252 mov eax, 106
253 jmp __syscall
255 global lstat
256 lstat:
257 mov eax, 107
258 jmp __syscall
260 global fstat
261 fstat:
262 mov eax, 108
263 jmp __syscall
265 global clone
266 clone:
267 mov eax, 120
268 jmp __syscall
270 global uname
271 uname:
272 mov eax, 122
273 jmp __syscall
275 global fchdir
276 fchdir:
277 mov eax, 133
278 jmp __syscall
280 global getdents
281 getdents:
282 mov eax, 141
283 jmp __syscall
285 global nanosleep
286 nanosleep:
287 mov eax, 162
288 jmp __syscall
290 global poll
291 poll:
292 mov eax, 168
293 jmp __syscall
295 global chown
296 chown:
297 mov eax, 182
298 jmp __syscall
300 global getcwd
301 getcwd:
302 mov eax, 183
303 jmp __syscall
305 global sigaction
306 sigaction:
307 mov eax, 67
308 jmp __syscall
310 global sigreturn
311 sigreturn:
312 mov eax, 119
313 jmp __syscall
315 global fsync
316 fsync:
317 mov eax, 118
318 jmp __syscall
320 global fdatasync
321 fdatasync:
322 mov eax, 148
323 jmp __syscall
325 global truncate
326 truncate:
327 mov eax, 92
328 jmp __syscall
330 global ftruncate
331 ftruncate:
332 mov eax, 93
333 jmp __syscall