x64: rename() system call
[neatlibc.git] / x86 / syscall.s
blob8736119d70e427807ed0ca45e855c3ebdf416dda
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 rename
159 rename:
160 mov eax, 38
161 jmp __syscall
163 global mkdir
164 mkdir:
165 mov eax, 39
166 jmp __syscall
168 global rmdir
169 rmdir:
170 mov eax, 40
171 jmp __syscall
173 global __dup
174 global dup
175 dup:
176 __dup:
177 mov eax, 41
178 jmp __syscall
180 global pipe
181 pipe:
182 mov eax, 42
183 jmp __syscall
185 global brk
186 brk:
187 mov eax, 45
188 jmp __syscall
190 global setgid
191 setgid:
192 mov eax, 46
193 jmp __syscall
195 global getgid
196 getgid:
197 mov eax, 47
198 jmp __syscall
200 global geteuid
201 geteuid:
202 mov eax, 49
203 jmp __syscall
205 global getegid
206 getegid:
207 mov eax, 50
208 jmp __syscall
210 global ioctl
211 ioctl:
212 mov eax, 54
213 jmp __syscall
215 global fcntl
216 fcntl:
217 mov eax, 55
218 jmp __syscall
220 global dup2
221 dup2:
222 mov eax, 63
223 jmp __syscall
225 global getppid
226 getppid:
227 mov eax, 64
228 jmp __syscall
230 global setsid
231 setsid:
232 mov eax, 66
233 jmp __syscall
235 global gettimeofday
236 gettimeofday:
237 mov eax, 78
238 jmp __syscall
240 global settimeofday
241 settimeofday:
242 mov eax, 79
243 jmp __syscall
245 global mmap
246 mmap:
247 mov eax, 192
248 jmp __syscall
250 global munmap
251 munmap:
252 mov eax, 91
253 jmp __syscall
255 global stat
256 stat:
257 mov eax, 106
258 jmp __syscall
260 global lstat
261 lstat:
262 mov eax, 107
263 jmp __syscall
265 global fstat
266 fstat:
267 mov eax, 108
268 jmp __syscall
270 global clone
271 clone:
272 mov eax, 120
273 jmp __syscall
275 global uname
276 uname:
277 mov eax, 122
278 jmp __syscall
280 global fchdir
281 fchdir:
282 mov eax, 133
283 jmp __syscall
285 global getdents
286 getdents:
287 mov eax, 141
288 jmp __syscall
290 global nanosleep
291 nanosleep:
292 mov eax, 162
293 jmp __syscall
295 global poll
296 poll:
297 mov eax, 168
298 jmp __syscall
300 global chown
301 chown:
302 mov eax, 182
303 jmp __syscall
305 global getcwd
306 getcwd:
307 mov eax, 183
308 jmp __syscall
310 global sigaction
311 sigaction:
312 mov eax, 67
313 jmp __syscall
315 global sigreturn
316 sigreturn:
317 mov eax, 119
318 jmp __syscall
320 global fsync
321 fsync:
322 mov eax, 118
323 jmp __syscall
325 global fdatasync
326 fdatasync:
327 mov eax, 148
328 jmp __syscall
330 global truncate
331 truncate:
332 mov eax, 92
333 jmp __syscall
335 global ftruncate
336 ftruncate:
337 mov eax, 93
338 jmp __syscall