]>
sourceware.org Git - newlib-cygwin.git/blob - libgloss/d30v/syscalls.c
2 * syscalls.c -- provide system call support via trap 31
4 * Copyright (c) 1997 Cygnus Support
6 * The authors hereby grant permission to use, copy, modify, distribute,
7 * and license this software and its documentation for any purpose, provided
8 * that existing copyright notices are retained in all copies and that this
9 * notice is included verbatim in any distributions. No written agreement,
10 * license, or royalty fee is required for any of the authorized uses.
11 * Modifications to this software may be copyrighted by their authors
12 * and need not follow the licensing terms described here, provided that
13 * the new terms are clearly indicated on the first page of each file where
16 * Read bytes, using simulator trap 31.
23 extern int *__errno(), errno
;
26 " .globl __syscall \n\
27 .type __syscall,@function \n\
30 cmpge f0,r2,0 -> jmp/tx link \n\
32 .size __syscall,.-__syscall \n\
36 __set_errno (int new_errno
)
46 __syscall (status
, 0, 0, 0, SYS_exit
);
50 open (const char *filename
, int flags
, int mode
)
52 return __syscall (filename
, flags
, mode
, 0, SYS_open
);
58 return __syscall (filedes
, 0, 0, 0, SYS_close
);
62 read (int filedes
, void *buffer
, size_t length
)
64 return __syscall (filedes
, buffer
, length
, 0, SYS_read
);
68 write (int filedes
, void *buffer
, size_t length
)
70 return __syscall (filedes
, buffer
, length
, 0, SYS_write
);
74 lseek (int filedes
, long offset
, int whence
)
76 return __syscall (filedes
, offset
, whence
, 0, SYS_lseek
);
80 unlink (const char *filename
)
82 return __syscall (filename
, 0, 0, 0, SYS_unlink
);
88 return __syscall (0, 0, 0, 0, SYS_getpid
);
92 kill (int signal
, int pid
)
94 return __syscall (signal
, pid
, 0, 0, SYS_kill
);
98 fstat (int filedes
, void *info
)
100 return __syscall (filedes
, info
, 0, 0, SYS_fstat
);
106 return __syscall (0, 0, 0, 0, SYS_argvlen
);
112 return __syscall (0, 0, 0, 0, SYS_argv
);
118 return __syscall (dir
, 0, 0, 0, SYS_chdir
);
122 stat (const char *__restrict filename
, void *__restrict info
)
124 return __syscall (filename
, info
, 0, 0, SYS_stat
);
128 chmod (const char *filename
, int mode
)
130 return __syscall (filename
, mode
, 0, 0, SYS_chmod
);
134 utime (const char *filename
, void *packet
)
136 return __syscall (filename
, packet
, 0, 0, SYS_utime
);
140 time (time_t *time_ptr
)
143 result
= (time_t) __syscall (time_ptr
, 0, 0, 0, SYS_time
);
144 if (time_ptr
!= NULL
)
This page took 0.041095 seconds and 5 git commands to generate.