stdlib: fix the return value of exit()
[neatlibc.git] / syscall.s
blob4e6d5ca5c9f4d660540f43a1751a11d1c1e3df8b
1 format ELF
3 __syscall:
4 push ebp
5 mov ebp, esp
7 push ebx
8 push edi
9 push esi
11 mov ebx, [ebp+8]
12 mov ecx, [ebp+12]
13 mov edx, [ebp+16]
14 mov esi, [ebp+20]
15 mov edi, [ebp+24]
16 mov ebp, [ebp+28]
18 int 0x80
20 cmp eax, -125
21 jb done
22 neg eax
23 mov [errno], eax
24 mov eax, -1
25 done:
26 pop esi
27 pop edi
28 pop ebx
29 pop ebp
30 ret
32 errno dd 0
33 public errno
35 public _exit
36 _exit:
37 mov eax, 1
38 jmp __syscall
40 public fork
41 fork:
42 mov eax, 2
43 jmp __syscall
45 public read
46 read:
47 mov eax, 3
48 jmp __syscall
50 public write
51 write:
52 mov eax, 4
53 jmp __syscall
55 public open
56 open:
57 mov eax, 5
58 jmp __syscall
60 public close
61 close:
62 mov eax, 6
63 jmp __syscall
65 public waitpid
66 waitpid:
67 mov eax, 7
68 jmp __syscall
70 public creat
71 creat:
72 mov eax, 8
73 jmp __syscall
75 public link
76 link:
77 mov eax, 9
78 jmp __syscall
80 public unlink
81 unlink:
82 mov eax, 10
83 jmp __syscall
85 public execve
86 execve:
87 mov eax, 11
88 jmp __syscall
90 public chdir
91 chdir:
92 mov eax, 12
93 jmp __syscall
95 public time
96 time:
97 mov eax, 13
98 jmp __syscall
100 public mknod
101 mknod:
102 mov eax, 14
103 jmp __syscall
105 public chmod
106 chmod:
107 mov eax, 15
108 jmp __syscall
110 public lseek
111 lseek:
112 mov eax, 19
113 jmp __syscall
115 public getpid
116 getpid:
117 mov eax, 20
118 jmp __syscall
120 public mount
121 mount:
122 mov eax, 21
123 jmp __syscall
125 public umount
126 umount:
127 mov eax, 22
128 jmp __syscall
130 public setuid
131 setuid:
132 mov eax, 23
133 jmp __syscall
135 public getuid
136 getuid:
137 mov eax, 24
138 jmp __syscall
140 public utime
141 utime:
142 mov eax, 30
143 jmp __syscall
145 public access
146 access:
147 mov eax, 33
148 jmp __syscall
150 public sync
151 sync:
152 mov eax, 36
153 jmp __syscall
155 public kill
156 kill:
157 mov eax, 37
158 jmp __syscall
160 public mkdir
161 mkdir:
162 mov eax, 39
163 jmp __syscall
165 public rmdir
166 rmdir:
167 mov eax, 40
168 jmp __syscall
170 public __dup as 'dup'
171 __dup:
172 mov eax, 41
173 jmp __syscall
175 public pipe
176 pipe:
177 mov eax, 42
178 jmp __syscall
180 public brk
181 brk:
182 mov eax, 45
183 jmp __syscall
185 public setgid
186 setgid:
187 mov eax, 46
188 jmp __syscall
190 public getgid
191 getgid:
192 mov eax, 47
193 jmp __syscall
195 public signal
196 signal:
197 mov eax, 48
198 jmp __syscall
200 public geteuid
201 geteuid:
202 mov eax, 49
203 jmp __syscall
205 public getegid
206 getegid:
207 mov eax, 50
208 jmp __syscall
210 public ioctl
211 ioctl:
212 mov eax, 54
213 jmp __syscall
215 public fcntl
216 fcntl:
217 mov eax, 55
218 jmp __syscall
220 public dup2
221 dup2:
222 mov eax, 63
223 jmp __syscall
225 public getppid
226 getppid:
227 mov eax, 64
228 jmp __syscall
230 public setsid
231 setsid:
232 mov eax, 66
233 jmp __syscall
235 public gettimeofday
236 gettimeofday:
237 mov eax, 78
238 jmp __syscall
240 public settimeofday
241 settimeofday:
242 mov eax, 79
243 jmp __syscall
245 public mmap
246 mmap:
247 mov eax, 192
248 jmp __syscall
250 public munmap
251 munmap:
252 mov eax, 91
253 jmp __syscall
255 public stat
256 stat:
257 mov eax, 106
258 jmp __syscall
260 public lstat
261 lstat:
262 mov eax, 107
263 jmp __syscall
265 public fstat
266 fstat:
267 mov eax, 108
268 jmp __syscall
270 public clone
271 clone:
272 mov eax, 120
273 jmp __syscall
275 public uname
276 uname:
277 mov eax, 122
278 jmp __syscall
280 public fchdir
281 fchdir:
282 mov eax, 133
283 jmp __syscall
285 public nanosleep
286 nanosleep:
287 mov eax, 162
288 jmp __syscall
290 public poll
291 poll:
292 mov eax, 168
293 jmp __syscall
295 public chown
296 chown:
297 mov eax, 182
298 jmp __syscall
300 public getcwd
301 getcwd:
302 mov eax, 183
303 jmp __syscall