OSDN Git Service

Initial revision
[pf3gnuchains/pf3gnuchains4x.git] / newlib / libc / sys / h8300hms / misc.c
1 /* Misc. operating system stubs.  */
2
3 #include <_ansi.h>
4 #include <sys/types.h>
5 #include <sys/stat.h>
6
7 /* _raise(), getpid(), and kill() are required by abort().
8    getpid/kill are prefixed with '_' because of MISSING_SYSCALL_NAMES.  */
9
10 int _DEFUN(_raise,(sig),
11            int sig)
12 {
13   return 0;
14 }
15
16 int _DEFUN(_getpid,(),)
17 {
18   return 0;
19 }
20
21 int _DEFUN(_kill,(pid, sig),
22            int pid _AND
23            int sig)
24 {
25   if (pid == 0)
26     {
27       /* Narrow SIG down to a short, in case we're compiled with -mint32.  */
28       short sig2 = sig;
29       /* This causes the simulator to indicate abort() was called.
30          The format of r0 is defined by devo/include/wait.h.  */
31       asm ("mov.w %0,r0\n\tsleep" : : "r" (sig2) : "r0");
32     }
33   return 0;
34 }