source: trunk/libs/newlib/src/libgloss/xstormy16/syscalls.m4 @ 546

Last change on this file since 546 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 601 bytes
Line 
1# xstormy16 system calls for the simulator
2
3#include <syscall.h>
4
5        .text
6
7define(`syscall',`.globl _`'$1
8_`'$1`':
9        mov r1,#SYS_$1
10        .hword 0x0001
11        bnz r1,#0,syscall_error
12        ret
130:      .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)
33dnl
34syscall_error:
35        push r0
36        callf __errno
37        pop r0
38        mov.w (r2),r0
39        ret
400:      .size syscall_error,0b-syscall_error
Note: See TracBrowser for help on using the repository browser.