Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/xstormy16/syscalls.m4')
-rw-r--r--libgloss/xstormy16/syscalls.m440
1 files changed, 40 insertions, 0 deletions
diff --git a/libgloss/xstormy16/syscalls.m4 b/libgloss/xstormy16/syscalls.m4
new file mode 100644
index 000000000..ab71fc6d5
--- /dev/null
+++ b/libgloss/xstormy16/syscalls.m4
@@ -0,0 +1,40 @@
+# xstormy16 system calls for the simulator
+
+#include <syscall.h>
+
+ .text
+
+define(`syscall',`.globl _`'$1
+_`'$1`':
+ mov r1,#SYS_$1
+ .hword 0x0001
+ bnz r1,#0,syscall_error
+ ret
+0: .size $1,0b-_$1
+')dnl
+ syscall(exit)
+ syscall(open)
+ syscall(close)
+ syscall(read)
+ syscall(write)
+ syscall(lseek)
+ syscall(unlink)
+ syscall(getpid)
+ syscall(kill)
+ syscall(fstat)
+ syscall(chdir)
+ syscall(stat)
+ syscall(chmod)
+ syscall(utime)
+ syscall(time)
+ syscall(gettimeofday)
+ syscall(times)
+ syscall(link)
+dnl
+syscall_error:
+ push r0
+ callf __errno
+ pop r0
+ mov.w (r2),r0
+ ret
+0: .size syscall_error,0b-syscall_error