From: keie Date: Tue, 1 Jan 1985 22:27:02 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release-5-5~5817 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c235c1a93d7781347cc633209b2d7394d471d45f;p=ack.git *** empty log message *** --- diff --git a/lang/cem/libcc/mon/_exit.e b/lang/cem/libcc/mon/_exit.e new file mode 100644 index 000000000..a88f9b5f6 --- /dev/null +++ b/lang/cem/libcc/mon/_exit.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $_exit + pro $_exit,0 + lol 0 + loc 1 + mon + end diff --git a/lang/cem/libcc/mon/access.e b/lang/cem/libcc/mon/access.e new file mode 100644 index 000000000..681f59783 --- /dev/null +++ b/lang/cem/libcc/mon/access.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $access + pro $access,0 + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 33 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/acct.e b/lang/cem/libcc/mon/acct.e new file mode 100644 index 000000000..8ac3415a0 --- /dev/null +++ b/lang/cem/libcc/mon/acct.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $acct + pro $acct,0 + lal 0 + loi EM_PSIZE + loc 51 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/alarm.e b/lang/cem/libcc/mon/alarm.e new file mode 100644 index 000000000..228147ef3 --- /dev/null +++ b/lang/cem/libcc/mon/alarm.e @@ -0,0 +1,9 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $alarm + pro $alarm,0 + lol 0 + loc 27 + mon + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/brk.e b/lang/cem/libcc/mon/brk.e new file mode 100644 index 000000000..1c2b1303a --- /dev/null +++ b/lang/cem/libcc/mon/brk.e @@ -0,0 +1,10 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $brk + pro $brk,0 + lal 0 + loi EM_PSIZE + str 2 ; The - possibly - occurring traps should be caught + loc 0 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/chdir.e b/lang/cem/libcc/mon/chdir.e new file mode 100644 index 000000000..089da818d --- /dev/null +++ b/lang/cem/libcc/mon/chdir.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $chdir + pro $chdir,0 + lal 0 + loi EM_PSIZE + loc 12 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/chmod.e b/lang/cem/libcc/mon/chmod.e new file mode 100644 index 000000000..fa278b7b7 --- /dev/null +++ b/lang/cem/libcc/mon/chmod.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $chmod + pro $chmod,0 + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 15 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/chown.e b/lang/cem/libcc/mon/chown.e new file mode 100644 index 000000000..f6f0ffbb6 --- /dev/null +++ b/lang/cem/libcc/mon/chown.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $chown + pro $chown,0 + lal 0 + loi EM_PSIZE+2*EM_WSIZE + loc 16 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/chroot.e b/lang/cem/libcc/mon/chroot.e new file mode 100644 index 000000000..f448be0f6 --- /dev/null +++ b/lang/cem/libcc/mon/chroot.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $chroot + pro $chroot,0 + lal 0 + loi EM_PSIZE + loc 61 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/cleanup.c b/lang/cem/libcc/mon/cleanup.c new file mode 100644 index 000000000..88849f148 --- /dev/null +++ b/lang/cem/libcc/mon/cleanup.c @@ -0,0 +1 @@ +_cleanup(){} diff --git a/lang/cem/libcc/mon/close.e b/lang/cem/libcc/mon/close.e new file mode 100644 index 000000000..77c3dd5c6 --- /dev/null +++ b/lang/cem/libcc/mon/close.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $close + pro $close,0 + lol 0 + loc 6 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/creat.e b/lang/cem/libcc/mon/creat.e new file mode 100644 index 000000000..6832be089 --- /dev/null +++ b/lang/cem/libcc/mon/creat.e @@ -0,0 +1,14 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $creat + pro $creat,0 + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 8 + mon + zeq *1 + ste errno ; since e==r0 + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/dup.e b/lang/cem/libcc/mon/dup.e new file mode 100644 index 000000000..e9c77d8bc --- /dev/null +++ b/lang/cem/libcc/mon/dup.e @@ -0,0 +1,14 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $dup + pro $dup,0 + lol 0 + dup EM_WSIZE + loc 41 + mon + zeq *1 + ste errno + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/dup2.e b/lang/cem/libcc/mon/dup2.e new file mode 100644 index 000000000..67bda6fec --- /dev/null +++ b/lang/cem/libcc/mon/dup2.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $dup2 + pro $dup2,0 + lal 0 + loi 2*EM_WSIZE + loc 64 + ior EM_WSIZE + loc 41 + mon + zeq *1 + ste errno + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/errno.e b/lang/cem/libcc/mon/errno.e new file mode 100644 index 000000000..18df9017a --- /dev/null +++ b/lang/cem/libcc/mon/errno.e @@ -0,0 +1,6 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + + exa errno +errno + bss EM_WSIZE,0,0 diff --git a/lang/cem/libcc/mon/execl.e b/lang/cem/libcc/mon/execl.e new file mode 100644 index 000000000..e958d65ae --- /dev/null +++ b/lang/cem/libcc/mon/execl.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $execl + pro $execl,0 + lae _penvp + loi EM_PSIZE + lal EM_PSIZE + lal 0 + loi EM_PSIZE + loc 59 + mon + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/execle.e b/lang/cem/libcc/mon/execle.e new file mode 100644 index 000000000..3f529ea1a --- /dev/null +++ b/lang/cem/libcc/mon/execle.e @@ -0,0 +1,25 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $execle + pro $execle,0 + lal EM_PSIZE +1 + dup EM_PSIZE + loi EM_PSIZE + zer EM_PSIZE + cmp + zeq *2 + adp EM_PSIZE + bra *1 +2 + adp EM_PSIZE + loi EM_PSIZE + lal EM_PSIZE + lal 0 + loi EM_PSIZE + loc 59 + mon + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/execv.e b/lang/cem/libcc/mon/execv.e new file mode 100644 index 000000000..5cbaa3444 --- /dev/null +++ b/lang/cem/libcc/mon/execv.e @@ -0,0 +1,14 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $execv + pro $execv,0 + lae _penvp + loi EM_PSIZE + lal 0 + loi 2*EM_PSIZE + loc 59 + mon + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/execve.e b/lang/cem/libcc/mon/execve.e new file mode 100644 index 000000000..33769b4d7 --- /dev/null +++ b/lang/cem/libcc/mon/execve.e @@ -0,0 +1,12 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $execve + pro $execve,0 + lal 0 + loi 3*EM_PSIZE + loc 59 + mon + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/exit.c b/lang/cem/libcc/mon/exit.c new file mode 100644 index 000000000..f57bd3a03 --- /dev/null +++ b/lang/cem/libcc/mon/exit.c @@ -0,0 +1,24 @@ +/* + * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands. + * + * This product is part of the Amsterdam Compiler Kit + * developed by Andrew S. Tanenbaum, Johan W. Stevenson, + * Ed Keizer and Hans van Staveren of the Vrije Universiteit. + * + * Permission to use, sell, duplicate or disclose this software must be + * obtained in writing. Requests for such permissions may be sent to + * + * Dr. Andrew S. Tanenbaum + * Wiskundig Seminarium + * Vrije Universiteit + * Postbox 7161 + * 1007 MC Amsterdam + * The Netherlands + * + */ + +exit(code) +{ + _cleanup() ; + _exit(code) ; +} diff --git a/lang/cem/libcc/mon/fork.e b/lang/cem/libcc/mon/fork.e new file mode 100644 index 000000000..e2c27b9f4 --- /dev/null +++ b/lang/cem/libcc/mon/fork.e @@ -0,0 +1,21 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exa par_uid +par_uid + bss EM_WSIZE,0,0 + + exp $fork + pro $fork,0 + loc 2 + mon + zeq *1 + ste errno + loc -1 + ret EM_WSIZE +1 + zeq *2 + ste par_uid + loc 0 +2 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/fstat.e b/lang/cem/libcc/mon/fstat.e new file mode 100644 index 000000000..97b841057 --- /dev/null +++ b/lang/cem/libcc/mon/fstat.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $fstat + pro $fstat,0 + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 28 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/ftime.e b/lang/cem/libcc/mon/ftime.e new file mode 100644 index 000000000..614533ab4 --- /dev/null +++ b/lang/cem/libcc/mon/ftime.e @@ -0,0 +1,10 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $ftime + pro $ftime,0 + lal 0 + loi EM_PSIZE + loc 35 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/getegid.e b/lang/cem/libcc/mon/getegid.e new file mode 100644 index 000000000..3e0c4dd2b --- /dev/null +++ b/lang/cem/libcc/mon/getegid.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $getegid + pro $getegid,0 + loc 47 + mon + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/geteuid.e b/lang/cem/libcc/mon/geteuid.e new file mode 100644 index 000000000..78b046071 --- /dev/null +++ b/lang/cem/libcc/mon/geteuid.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $geteuid + pro $geteuid,0 + loc 24 + mon + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/getgid.e b/lang/cem/libcc/mon/getgid.e new file mode 100644 index 000000000..c52a8c765 --- /dev/null +++ b/lang/cem/libcc/mon/getgid.e @@ -0,0 +1,9 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $getgid + pro $getgid,0 + loc 47 + mon + asp EM_WSIZE + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/getpid.e b/lang/cem/libcc/mon/getpid.e new file mode 100644 index 000000000..f98e72023 --- /dev/null +++ b/lang/cem/libcc/mon/getpid.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $getpid + pro $getpid,0 + loc 20 + mon + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/getuid.e b/lang/cem/libcc/mon/getuid.e new file mode 100644 index 000000000..7367cd2ab --- /dev/null +++ b/lang/cem/libcc/mon/getuid.e @@ -0,0 +1,9 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $getuid + pro $getuid,0 + loc 24 + mon + asp EM_WSIZE + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/gtty.c b/lang/cem/libcc/mon/gtty.c new file mode 100644 index 000000000..cf2c769b7 --- /dev/null +++ b/lang/cem/libcc/mon/gtty.c @@ -0,0 +1,4 @@ +#include +int gtty(fildes,argp) int fildes ; struct sgttyb *argp ; { + return ioctl(fildes,TIOCGETP,argp) ; +} diff --git a/lang/cem/libcc/mon/ioctl.e b/lang/cem/libcc/mon/ioctl.e new file mode 100644 index 000000000..337aab952 --- /dev/null +++ b/lang/cem/libcc/mon/ioctl.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $ioctl + pro $ioctl,0 + lal 0 + loi EM_PSIZE+2*EM_WSIZE + loc 54 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/kill.e b/lang/cem/libcc/mon/kill.e new file mode 100644 index 000000000..49df6c034 --- /dev/null +++ b/lang/cem/libcc/mon/kill.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $kill + pro $kill,0 + ldl 0 + loc 37 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/link.e b/lang/cem/libcc/mon/link.e new file mode 100644 index 000000000..50a1e87aa --- /dev/null +++ b/lang/cem/libcc/mon/link.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $link + pro $link,0 + lal 0 + loi 2*EM_PSIZE + loc 9 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/lock.e b/lang/cem/libcc/mon/lock.e new file mode 100644 index 000000000..09faeed60 --- /dev/null +++ b/lang/cem/libcc/mon/lock.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $lock + pro $lock,0 + lol 0 + loc 53 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/lseek.e b/lang/cem/libcc/mon/lseek.e new file mode 100644 index 000000000..282a959b9 --- /dev/null +++ b/lang/cem/libcc/mon/lseek.e @@ -0,0 +1,25 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $lseek + pro $lseek,0 + lal 0 + loi 4*EM_WSIZE + loc 19 + mon + zeq *1 + ste errno +#if EM_WSIZE==1 + ldc -1 + loc 2 + loc 4 + cii +#endif +#if EM_WSIZE==2 + ldc -1 +#endif +#if EM_WSIZE==4 + loc -1 +#endif +1 + ret 2*EM_WSIZE + end diff --git a/lang/cem/libcc/mon/mknod.e b/lang/cem/libcc/mon/mknod.e new file mode 100644 index 000000000..073298382 --- /dev/null +++ b/lang/cem/libcc/mon/mknod.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $mknod + pro $mknod,0 + lal 0 + loi EM_PSIZE+2*EM_WSIZE + loc 14 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/mount.e b/lang/cem/libcc/mon/mount.e new file mode 100644 index 000000000..8bdfddfde --- /dev/null +++ b/lang/cem/libcc/mon/mount.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $mount + pro $mount,0 + lal 0 + loi EM_WSIZE+2*EM_PSIZE + loc 21 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/mpxcall.e b/lang/cem/libcc/mon/mpxcall.e new file mode 100644 index 000000000..8782b11d5 --- /dev/null +++ b/lang/cem/libcc/mon/mpxcall.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $mpxcall + pro $mpxcall,0 + lal 0 + loi EM_PSIZE+EM_WSIZE + loc 56 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/nice.e b/lang/cem/libcc/mon/nice.e new file mode 100644 index 000000000..60bda54a7 --- /dev/null +++ b/lang/cem/libcc/mon/nice.e @@ -0,0 +1,9 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $nice + pro $nice,0 + lol 0 + loc 34 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/open.e b/lang/cem/libcc/mon/open.e new file mode 100644 index 000000000..e6da95e9c --- /dev/null +++ b/lang/cem/libcc/mon/open.e @@ -0,0 +1,14 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $open + pro $open,0 + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 5 + mon + zeq *1 + ste errno + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/pause.e b/lang/cem/libcc/mon/pause.e new file mode 100644 index 000000000..43927720b --- /dev/null +++ b/lang/cem/libcc/mon/pause.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $pause + pro $pause,0 + loc 29 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/pipe.e b/lang/cem/libcc/mon/pipe.e new file mode 100644 index 000000000..133ada6f6 --- /dev/null +++ b/lang/cem/libcc/mon/pipe.e @@ -0,0 +1,18 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $pipe + pro $pipe,0 + loc 42 + mon + zeq *1 + ste errno + loc -1 + ret EM_WSIZE +1 + lal 0 + loi EM_PSIZE + stf EM_WSIZE + sil 0 + loc 0 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/prof.e b/lang/cem/libcc/mon/prof.e new file mode 100644 index 000000000..53617e4a4 --- /dev/null +++ b/lang/cem/libcc/mon/prof.e @@ -0,0 +1,10 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $profil + pro $profil,0 + lal 0 + loi 4*EM_PSIZE + loc 44 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/ptrace.e b/lang/cem/libcc/mon/ptrace.e new file mode 100644 index 000000000..2fd4b97e4 --- /dev/null +++ b/lang/cem/libcc/mon/ptrace.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $ptrace + pro $ptrace,0 + zre errno + lal 0 + loi EM_PSIZE+3*EM_WSIZE + loc 26 + mon + zeq *1 + ste errno + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/read.e b/lang/cem/libcc/mon/read.e new file mode 100644 index 000000000..82e0dd317 --- /dev/null +++ b/lang/cem/libcc/mon/read.e @@ -0,0 +1,23 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $read + pro $read,0 + lol EM_WSIZE+EM_PSIZE + loc EM_WSIZE + loc EM_PSIZE + ciu + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 3 + mon + zne *1 + loc EM_PSIZE + loc EM_WSIZE + cui + bra *2 +1 + ste errno + loc -1 +2 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/sbrk.e b/lang/cem/libcc/mon/sbrk.e new file mode 100644 index 000000000..bed013837 --- /dev/null +++ b/lang/cem/libcc/mon/sbrk.e @@ -0,0 +1,11 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $sbrk + pro $sbrk,0 + lor 2 + lor 2 + lol 0 + ads EM_WSIZE + str 2 ; The - possibly - occurring traps should be caught + ret EM_PSIZE + end diff --git a/lang/cem/libcc/mon/setgid.e b/lang/cem/libcc/mon/setgid.e new file mode 100644 index 000000000..1e9093afb --- /dev/null +++ b/lang/cem/libcc/mon/setgid.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $setgid + pro $setgid,0 + lol 0 + loc 46 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/setsig.e b/lang/cem/libcc/mon/setsig.e new file mode 100644 index 000000000..d0a41810d --- /dev/null +++ b/lang/cem/libcc/mon/setsig.e @@ -0,0 +1,45 @@ +# + mes 2,EM_WSIZE,EM_PSIZE +save + bss EM_PSIZE,0,0 +trf + bss EM_PSIZE,0,0 + + exp $_setsig + pro $_setsig,0 + lal 0 + loi EM_PSIZE + lae trf + sti EM_PSIZE + inp $catchit + lpi $catchit ; trap to catchit + sig + lae save ; remember higher level trap + sti EM_PSIZE + ret 0 + end + + pro $catchit,0 + lpi $catchit + sig + asp EM_PSIZE + lol 0 ; fetch trapno + lae trf + loi EM_PSIZE ; fetch procedure identifier + cai + lfr EM_WSIZE + zne *1 + ; trap not handled by trf function, trap through; trapno still on stack + lae save + loi EM_PSIZE + sig + asp EM_PSIZE + trp + lpi $catchit ; trap ignored, further traps to catchit + sig + asp EM_PSIZE + lae save ; remember higher level trap + sti EM_PSIZE +1 + rtt + end diff --git a/lang/cem/libcc/mon/setuid.e b/lang/cem/libcc/mon/setuid.e new file mode 100644 index 000000000..656f5b890 --- /dev/null +++ b/lang/cem/libcc/mon/setuid.e @@ -0,0 +1,15 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $setuid + pro $setuid,0 + lol 0 + loc 23 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/signal.c b/lang/cem/libcc/mon/signal.c new file mode 100644 index 000000000..92884796b --- /dev/null +++ b/lang/cem/libcc/mon/signal.c @@ -0,0 +1,99 @@ +#include + +typedef int (*callvec)() ; + +static callvec vector[16] = { + SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, + SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL, SIG_DFL +} ; + +static char mapvec[] = { + 0, /* EARRAY */ + 0, /* ERANGE */ + 0, /* ESET */ + 0, /* EIOVFL */ + SIGFPE, /* EFOVFL */ + SIGFPE, /* EFUNDFL */ + 0, /* EIDIVZ */ + SIGFPE, /* EFDIVZ */ + 0, /* EIUND, already ignored */ + SIGFPE, /* EFUND */ + 0, /* ECONV */ + 0, /* 11 */ + 0, /* 12 */ + 0, /* 13 */ + 0, /* 14 */ + 0, /* 15 */ + SIGSEGV, /* ESTACK */ + SIGSEGV, /* EHEAP */ + 0, /* EILLINS */ + 0, /* EODDZ */ + 0, /* ECASE */ + SIGSEGV, /* EBADMEM */ + SIGBUS, /* EBADPTR */ + 0, /* EBADPC */ + 0, /* EBADLAE */ + SIGSYS, /* EBADMON */ + 0, /* EBADLIN */ + 0, /* EBADGTO */ +} ; + +#define VECBASE 128 + +static firsttime = 1 ; +static int catchtrp() ; +static int procesig() ; + +callvec signal(sig,func) int sig ; callvec func ; { + register index, i ; + callvec prev ; + + index= sig-1 ; + if ( index<0 || index>=(sizeof vector/sizeof vector[0]) ) { + return (callvec) -1 ; + } + if ( firsttime ) { + firsttime= 0 ; + _setsig(catchtrp) ; + } + prev= vector[index] ; + if ( prev!=func ) { + register int mapval ; + vector[index]= func ; + if ( func==SIG_IGN ) { + mapval= -3; + } else if ( func==SIG_DFL ) { + mapval= -2; + } else { + mapval=VECBASE+sig; + } + if ( sigtrp(mapval,sig)== -1 ) return (callvec) -1; + + } + return prev ; +} + +static int catchtrp(trapno) int trapno ; { + if ( trapno>VECBASE && + trapno<=VECBASE + (sizeof vector/sizeof vector[0]) ) { + return procesig(trapno-VECBASE) ; + } + if ( trapno>=0 && trapno< (sizeof mapvec/sizeof mapvec[0]) && + mapvec[trapno] ) { + return procesig(mapvec[trapno]) ; + } + return 0 ; /* Failed to handle the trap */ +} + +static int procesig(sig) int sig ; { + register index ; + callvec trf ; + + index= sig-1 ; + trf= vector[index] ; + if ( trf==SIG_IGN ) return 1 ; + if ( sig!=SIGILL && sig!=SIGTRAP ) vector[index]= SIG_IGN ; + if ( trf==SIG_DFL ) return 0 ; + (*trf)(sig) ; + return 1 ; +} diff --git a/lang/cem/libcc/mon/sigtrp.e b/lang/cem/libcc/mon/sigtrp.e new file mode 100644 index 000000000..ffaa23185 --- /dev/null +++ b/lang/cem/libcc/mon/sigtrp.e @@ -0,0 +1,13 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $sigtrp + pro $sigtrp,0 + ldl 0 + loc 48 + mon + zeq *1 + ste errno + loc -1 +1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/stat.e b/lang/cem/libcc/mon/stat.e new file mode 100644 index 000000000..d5be7a37a --- /dev/null +++ b/lang/cem/libcc/mon/stat.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $stat + pro $stat,0 + lal 0 + loi 2*EM_PSIZE + loc 18 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/stime.e b/lang/cem/libcc/mon/stime.e new file mode 100644 index 000000000..79a8946ea --- /dev/null +++ b/lang/cem/libcc/mon/stime.e @@ -0,0 +1,20 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $stime + pro $stime,0 +#if EM_WSIZE<4 + lol 0 + loi 4 +#else + lil 0 +#endif + loc 25 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/stty.c b/lang/cem/libcc/mon/stty.c new file mode 100644 index 000000000..778b9aecf --- /dev/null +++ b/lang/cem/libcc/mon/stty.c @@ -0,0 +1,4 @@ +#include +int stty(fildes,argp) int fildes ; struct sgttyb *argp ; { + return ioctl(fildes,TIOCSETP,argp) ; +} diff --git a/lang/cem/libcc/mon/sync.e b/lang/cem/libcc/mon/sync.e new file mode 100644 index 000000000..476b45de9 --- /dev/null +++ b/lang/cem/libcc/mon/sync.e @@ -0,0 +1,8 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $sync + pro $sync,0 + loc 36 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/tell.c b/lang/cem/libcc/mon/tell.c new file mode 100644 index 000000000..12e6bf23a --- /dev/null +++ b/lang/cem/libcc/mon/tell.c @@ -0,0 +1,10 @@ +/* + * return offset in file. + */ + +long lseek(); + +long tell(f) +{ + return(lseek(f, 0L, 1)); +} diff --git a/lang/cem/libcc/mon/time.c b/lang/cem/libcc/mon/time.c new file mode 100644 index 000000000..29979d0c8 --- /dev/null +++ b/lang/cem/libcc/mon/time.c @@ -0,0 +1,9 @@ +#include +#include +time_t time(timpt) time_t *timpt ; { + struct timeb buf ; + + ftime(&buf) ; + if ( timpt ) *timpt= buf.time ; + return buf.time ; +} diff --git a/lang/cem/libcc/mon/times.e b/lang/cem/libcc/mon/times.e new file mode 100644 index 000000000..d347ffcbc --- /dev/null +++ b/lang/cem/libcc/mon/times.e @@ -0,0 +1,10 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $times + pro $times,0 + lal 0 + loi EM_PSIZE + loc 43 + mon + ret 0 + end diff --git a/lang/cem/libcc/mon/umask.e b/lang/cem/libcc/mon/umask.e new file mode 100644 index 000000000..8bcf4fea6 --- /dev/null +++ b/lang/cem/libcc/mon/umask.e @@ -0,0 +1,9 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $umask + pro $umask,0 + lol 0 + loc 60 + mon + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/umount.e b/lang/cem/libcc/mon/umount.e new file mode 100644 index 000000000..f92b87e89 --- /dev/null +++ b/lang/cem/libcc/mon/umount.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $umount + pro $umount,0 + lal 0 + loi EM_PSIZE + loc 22 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/unlink.e b/lang/cem/libcc/mon/unlink.e new file mode 100644 index 000000000..3313d8adc --- /dev/null +++ b/lang/cem/libcc/mon/unlink.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $unlink + pro $unlink,0 + lal 0 + loi EM_PSIZE + loc 10 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/utime.e b/lang/cem/libcc/mon/utime.e new file mode 100644 index 000000000..50df2364a --- /dev/null +++ b/lang/cem/libcc/mon/utime.e @@ -0,0 +1,16 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $utime + pro $utime,0 + lal 0 + loi 2*EM_PSIZE + loc 30 + mon + zne *1 + loc 0 + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/wait.e b/lang/cem/libcc/mon/wait.e new file mode 100644 index 000000000..a000ce8c5 --- /dev/null +++ b/lang/cem/libcc/mon/wait.e @@ -0,0 +1,33 @@ +# + mes 2,EM_WSIZE,EM_PSIZE +#if EM_WSIZE<4 +#define STATUS_SIZE 2 +#else +#define STATUS_SIZE EM_WSIZE +#endif + exp $wait + pro $wait,0 + loc 7 + mon + zne *1 + lal 0 + loi EM_PSIZE + zer EM_PSIZE + cms EM_PSIZE + zeq *2 +#if EM_WSIZE==1 + lal 0 + loi EM_PSIZE + sti 2 ; 2 bytes, not one int! +#else + sil 0 +#endif + ret EM_WSIZE +2 + asp STATUS_SIZE + ret EM_WSIZE +1 + ste errno + loc -1 + ret EM_WSIZE + end diff --git a/lang/cem/libcc/mon/write.e b/lang/cem/libcc/mon/write.e new file mode 100644 index 000000000..2e91b5aab --- /dev/null +++ b/lang/cem/libcc/mon/write.e @@ -0,0 +1,23 @@ +# + mes 2,EM_WSIZE,EM_PSIZE + exp $write + pro $write,0 + lol EM_WSIZE+EM_PSIZE + loc EM_WSIZE + loc EM_PSIZE + ciu + lal 0 + loi EM_WSIZE+EM_PSIZE + loc 4 + mon + zne *1 + loc EM_PSIZE + loc EM_WSIZE + cui + bra *2 +1 + ste errno + loc -1 +2 + ret EM_WSIZE + end