repo.or.cz
/
zpugcc
/
jano.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fixed more binutils issues (newer gcc/libc)
[zpugcc/jano.git]
/
toolchain
/
gcc
/
libgloss
/
xstormy16
/
syscalls.m4
blob
ab71fc6d5ccd1c467467a036f266686787bcafe9
1
# xstormy16 system calls for the simulator
2
3
#include <syscall.h>
4
5
.text
6
7
define(`syscall',`.globl _`'$1
8
_`'$1`':
9
mov r1,#SYS_$1
10
.hword 0x0001
11
bnz r1,#0,syscall_error
12
ret
13
0: .size $1,0b-_$1
14
')dnl
15
syscall(exit)
16
syscall(open)
17
syscall(close)
18
syscall(read)
19
syscall(write)
20
syscall(lseek)
21
syscall(unlink)
22
syscall(getpid)
23
syscall(kill)
24
syscall(fstat)
25
syscall(chdir)
26
syscall(stat)
27
syscall(chmod)
28
syscall(utime)
29
syscall(time)
30
syscall(gettimeofday)
31
syscall(times)
32
syscall(link)
33
dnl
34
syscall_error:
35
push r0
36
callf __errno
37
pop r0
38
mov.w (r2),r0
39
ret
40
0: .size syscall_error,0b-syscall_error