Initial revision

This commit is contained in:
ceriel 1987-01-07 17:13:41 +00:00
parent be68581019
commit 18376b38cf
84 changed files with 1511 additions and 0 deletions

81
mach/pdp/libsys/LIST Normal file
View file

@ -0,0 +1,81 @@
tail_mon.a
exit.c
cleanup.c
stty.c
gtty.c
_exit.s
access.s
acct.s
alarm.s
chdir.s
chmod.s
chown.s
chroot.s
close.s
creat.s
dup.s
execl.s
execle.s
execv.s
execve.s
fetchi.s
fork.s
fperr.s
fstat.s
ftime.s
getgid.s
getgrp.s
getpid.s
getppid.s
getuid.s
gldav.s
ioctl.s
kill.s
killbkg.s
killpg.s
link.s
lock.s
login.s
lseek.s
lstat.s
mknod.s
mount.s
mpxcall.s
nice.s
nostk.s
open.s
pause.s
phys.s
pipe.s
profil.s
ptrace.s
qfstat.s
qstat.s
quota.s
read.s
readlink.s
reboot.s
renice.s
rtp.s
sbrk.s
setgid.s
setgrp.s
setuid.s
signal.s
stat.s
stime.s
submit.s
symlink.s
sync.s
time.s
times.s
ucall.s
umask.s
umount.s
unlink.s
utime.s
vfork.s
vhangup.s
wait.s
write.s
errno.s

25
mach/pdp/libsys/Makefile Normal file
View file

@ -0,0 +1,25 @@
# $Header$
install: cp
cp: all
../../install tail_mon
rm -f head_em tail_mon
cmp: all
-../../compare tail_mon
rm -f head_em tail_mon
all: tail_mon
tail_mon:
ASAR=ar ; export ASAR ;\
RANLIB=ranlib ; export RANLIB ;\
march . tail_mon
clean:
rm -f *.o
opr:
make pr | opr
pr:
@pr `pwd`/Makefile `pwd`/head_em.s
@pr -l33 `tail +1 LIST|sort`

6
mach/pdp/libsys/_exit.s Normal file
View file

@ -0,0 +1,6 @@
#include "sys.h"
.globl __exit
__exit:
mov 2(sp),r0
sys exit

17
mach/pdp/libsys/access.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _access
.globl _errno
_access:
mov 2(sp),0f+2
mov 4(sp),0f+4
clr r0
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys access; ..; ..

17
mach/pdp/libsys/acct.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _acct
.globl _errno
_acct:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0, _errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys acct; ..

12
mach/pdp/libsys/alarm.s Normal file
View file

@ -0,0 +1,12 @@
#include "sys.h"
.globl _alarm
.globl _errno
_alarm:
mov 2(sp),r0
sys alarm
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc

17
mach/pdp/libsys/chdir.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _chdir
.globl _errno
_chdir:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys chdir; ..

18
mach/pdp/libsys/chmod.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _chmod
.globl _errno
_chmod:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys chmod; ..; ..

19
mach/pdp/libsys/chown.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _chown
.globl _errno
_chown:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys chown; ..; ..; ..

17
mach/pdp/libsys/chroot.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _chroot
.globl _errno
_chroot:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys chroot; ..

View file

@ -0,0 +1,3 @@
_cleanup()
{
}

14
mach/pdp/libsys/close.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _close
.globl _errno
_close:
mov 2(sp),r0
sys close
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

4
mach/pdp/libsys/compmodule Executable file
View file

@ -0,0 +1,4 @@
if pdp -O -c -I../../../h -I. $1 1>&2
then echo `basename $1 $2`.o
else exit 1
fi

16
mach/pdp/libsys/creat.s Normal file
View file

@ -0,0 +1,16 @@
#include "sys.h"
.globl _creat
.globl _errno
_creat:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys creat; ..; ..

20
mach/pdp/libsys/dup.s Normal file
View file

@ -0,0 +1,20 @@
#include "sys.h"
.globl _dup
.globl _dup2
.globl _errno
_dup2:
mov 2(sp),r0
bis $100,r0
br 1f
_dup:
mov 2(sp),r0
1:
mov 4(sp),r1
sys dup
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc

3
mach/pdp/libsys/errno.s Normal file
View file

@ -0,0 +1,3 @@
.globl _errno
.bss
_errno: .=.+2

18
mach/pdp/libsys/execl.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _execl
.globl _environ
.globl _errno
_execl:
mov 2(sp),0f+2
mov sp,r0
add $4,r0
mov r0,0f+4
mov _environ,0f+6
sys indir; 0f
mov r0,_errno
mov $-1,r0
rts pc
.data
0:
sys exece; ..; ..; ..

20
mach/pdp/libsys/execle.s Normal file
View file

@ -0,0 +1,20 @@
#include "sys.h"
.globl _execle
.globl _errno
_execle:
mov 2(sp),0f+2
mov sp,r0
add $4,r0
mov r0,0f+4
1:
tst (r0)+
bne 1b
mov (r0),0f+6
sys indir; 0f
mov r0,_errno
mov $-1,r0
rts pc
.data
0:
sys exece; ..; ..; ..

16
mach/pdp/libsys/execv.s Normal file
View file

@ -0,0 +1,16 @@
#include "sys.h"
.globl _execv,
.globl _environ
.globl _errno
_execv:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov _environ,0f+6
sys indir; 0f
mov r0,_errno
mov $-1,r0
rts pc
.data
0:
sys exece; ..; ..; ..

15
mach/pdp/libsys/execve.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _execve
.globl _errno
_execve:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
mov r0,_errno
mov $-1,r0
rts pc
.data
0:
sys exece; ..; ..; ..

5
mach/pdp/libsys/exit.c Normal file
View file

@ -0,0 +1,5 @@
exit(n)
{
_cleanup();
_exit(n);
}

15
mach/pdp/libsys/fetchi.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _fetchi
.globl _errno
_fetchi:
mov 2(sp),r0
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys fetchi

15
mach/pdp/libsys/fork.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _fork
.globl _errno
_fork:
sys fork
br 1f
bec 2f
mov r0,_errno
mov $-1,r0
2:
rts pc
1:
clr r0
rts pc

20
mach/pdp/libsys/fperr.s Normal file
View file

@ -0,0 +1,20 @@
#include "sys.h"
.globl _fperr
.globl _errno
_fperr:
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
mov r5,-(sp)
mov 4(sp),r5
mov r0,(r5)+
mov r1,(r5)
mov (sp)+,r5
rts pc
.data
0:
sys fperr

18
mach/pdp/libsys/fstat.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _fstat
.globl _errno
_fstat:
mov 2(sp),r0
mov 4(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys fstat; ..

11
mach/pdp/libsys/ftime.s Normal file
View file

@ -0,0 +1,11 @@
#include "sys.h"
.globl _ftime
_ftime:
mov 2(sp),0f+2
sys indir; 0f
rts pc
.data
0:
sys ftime; ..

12
mach/pdp/libsys/getgid.s Normal file
View file

@ -0,0 +1,12 @@
#include "sys.h"
.globl _getgid
.globl _getegid
_getgid:
sys getgid
rts pc
_getegid:
sys getgid
mov r1,r0
rts pc

17
mach/pdp/libsys/getgrp.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _getgrp
.globl _errno
_getgrp:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys getgrp; ..

6
mach/pdp/libsys/getpid.s Normal file
View file

@ -0,0 +1,6 @@
#include "sys.h"
.globl _getpid
_getpid:
sys getpid
rts pc

View file

@ -0,0 +1,7 @@
#include "sys.h"
.globl _getppid
_getppid:
sys getpid
mov r1,r0
rts pc

12
mach/pdp/libsys/getuid.s Normal file
View file

@ -0,0 +1,12 @@
#include "sys.h"
.globl _getuid
.globl _geteuid
_getuid:
sys getuid
rts pc
_geteuid:
sys getuid
mov r1,r0
rts pc

17
mach/pdp/libsys/gldav.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _gldav
.globl _errno
_gldav:
mov 2(sp),r0
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys gldav

7
mach/pdp/libsys/gtty.c Normal file
View file

@ -0,0 +1,7 @@
#include <sgtty.h>
int gtty(fildes,argp)
int fildes ;
struct sgttyb *argp ;
{
return ioctl(fildes,TIOCGETP,argp) ;
}

19
mach/pdp/libsys/ioctl.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _ioctl
.globl _errno
_ioctl:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys ioctl; ..; ..; ..

19
mach/pdp/libsys/kill.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _kill
.globl _errno
_kill:
mov 2(sp),r0
mov 4(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys kill; ..

18
mach/pdp/libsys/killbkg.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _killbkg
.globl _errno
_killbkg:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys killbkg; ..; ..

19
mach/pdp/libsys/killpg.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _killpg
.globl _errno
_killpg:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys killpg; ..; ..

18
mach/pdp/libsys/link.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _link
.globl _errno
_link:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys link; ..; ..

15
mach/pdp/libsys/lock.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _lock
.globl _errno
_lock:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys lock; ..

19
mach/pdp/libsys/login.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _login
.globl _errno
_login:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys login; ..; ..; ..;

19
mach/pdp/libsys/lseek.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _lseek
.globl _errno
_lseek:
mov 2(sp),r0
mov 4(sp),0f+2
mov 6(sp),0f+4
mov 10(sp),0f+6
sys indir; 0f
bec 1f
mov $-1,r1
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys lseek; ..; ..; ..

18
mach/pdp/libsys/lstat.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _lstat
.globl _errno
_lstat:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys lstat; ..; ..

19
mach/pdp/libsys/mknod.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _mknod
.globl _errno
_mknod:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys mknod; ..; ..; ..

19
mach/pdp/libsys/mount.s Normal file
View file

@ -0,0 +1,19 @@
#include "sys.h"
.globl _mount
.globl _errno
_mount:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys mount; ..; ..; ..

17
mach/pdp/libsys/mpxcall.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _mpxcall
.globl _errno
_mpxcall:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys mpx; ..; ..

14
mach/pdp/libsys/nice.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _nice
.globl _errno
_nice:
mov 2(sp),r0
sys nice
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

9
mach/pdp/libsys/nostk.s Normal file
View file

@ -0,0 +1,9 @@
#include "sys.h"
.globl _nostk
_nostk:
sys local; 0f
rts pc
.data:
0:
sys nostk

16
mach/pdp/libsys/open.s Normal file
View file

@ -0,0 +1,16 @@
#include "sys.h"
.globl _open
.globl _errno
_open:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys open; ..; ..

6
mach/pdp/libsys/pause.s Normal file
View file

@ -0,0 +1,6 @@
#include "sys.h"
.globl _pause
_pause:
sys pause
rts pc

18
mach/pdp/libsys/phys.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _phys
.globl _errno
_phys:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys phys; ..; ..; ..

18
mach/pdp/libsys/pipe.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _pipe
.globl _errno
_pipe:
sys pipe
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
mov r5,-(sp)
mov 4(sp),r5
mov r0,(r5)+
mov r1,(r5)
mov (sp)+,r5
clr r0
rts pc

13
mach/pdp/libsys/profil.s Normal file
View file

@ -0,0 +1,13 @@
#include "sys.h"
.globl _profil
_profil:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
mov 10(sp),0f+10
sys indir; 0f
rts pc
.data
0:
sys profil; ..; ..; ..; ..

20
mach/pdp/libsys/ptrace.s Normal file
View file

@ -0,0 +1,20 @@
#include "sys.h"
.globl _ptrace
.globl _errno
_ptrace:
mov 2(sp),0f+6
mov 4(sp),0f+2
mov 6(sp),0f+4
mov 10(sp),r0
clr _errno
sys indir; 9f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys ptrace; ..; ..; ..

18
mach/pdp/libsys/qfstat.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _qfstat
.globl _errno
_qfstat:
mov 2(sp),r0
mov 4(sp),0f+2
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys qfstat; ..

18
mach/pdp/libsys/qstat.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _qstat
.globl _errno
_qstat:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys qstat; ..; ..

21
mach/pdp/libsys/quota.s Normal file
View file

@ -0,0 +1,21 @@
#include "sys.h"
.globl _quota
.globl _errno
_quota:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
mov 10(sp),0f+10
mov 12(sp),0f+12
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys quota; ..; ..; ..; ..; ..

17
mach/pdp/libsys/read.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _read
.globl _errno
_read:
mov 2(sp),r0
mov 4(sp),0f+2
mov 6(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys read; ..; ..

View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _readlink
.globl _errno
_readlink:
mov 2(sp),r0
mov 4(sp),0f+2
mov 6(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys readlink; ..; ..

18
mach/pdp/libsys/reboot.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _reboot
.globl _errno
_reboot:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys reboot; ..; ..

18
mach/pdp/libsys/renice.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _renice
.globl _errno
_renice:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys renice; ..; ..

14
mach/pdp/libsys/rtp.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _rtp
.globl _errno
_rtp:
mov 2(sp),r0
sys rtp
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

38
mach/pdp/libsys/sbrk.s Normal file
View file

@ -0,0 +1,38 @@
#include "sys.h"
.globl _sbrk
.globl _brk
.globl _end
.globl _errno
_sbrk:
mov 2(sp),0f+2
beq 1f
add xxx,0f+2
bcs 2f
sys indir; 0f
bec 1f
2:
mov r0,_errno
mov $-1,r0
rts pc
1:
mov xxx,r0
add 2(sp),xxx
rts pc
_brk:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
mov 2(sp),xxx
clr r0
rts pc
.data
0:
sys break; ..
xxx: _end

14
mach/pdp/libsys/setgid.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _setgid
.globl _errno
_setgid:
mov 2(sp),r0
sys setgid
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

17
mach/pdp/libsys/setgrp.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _setgrp
.globl _errno
_setgrp:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys setgrp; ..

14
mach/pdp/libsys/setuid.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _setuid
.globl _errno
_setuid:
mov 2(sp),r0
sys setuid
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

88
mach/pdp/libsys/signal.s Normal file
View file

@ -0,0 +1,88 @@
#include <errno.h>
#include "sys.h"
rtt = 6
.globl _signal
.globl _errno
NSIGNALS = 0
tvect:
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
jsr r0,1f; NSIGNALS=NSIGNALS+1
1:
mov r1,-(sp)
mov r2,-(sp)
mov r3,-(sp)
mov r4,-(sp)
sub $tvect+4,r0
asr r0
mov r0,-(sp)
asr (sp)
jsr pc,*dvect(r0)
tst (sp)+
mov (sp)+,r4
mov (sp)+,r3
mov (sp)+,r2
mov (sp)+,r1
mov (sp)+,r0
rtt
_signal:
mov r5,-(sp)
mov sp,r5
mov 4(r5),r1
cmp r1,$NSIGNALS
bhis 2f
mov 6(r5),r0
mov r1,0f+2
asl r1
mov dvect(r1),-(sp)
mov r0,dvect(r1)
mov r0,0f+4
beq 1f
bit $1,r0
bne 1f
asl r1
add $tvect,r1
mov r1,0f+4
1:
sys indir; 0f
bes 3f
bit $1,r0
beq 1f
mov r0,(sp)
1:
mov (sp)+,r0
mov (sp)+,r5
rts pc
2:
mov $EINVAL.,r0
3:
mov r0,_errno
mov $-1,r0
mov (sp)+,r5
rts pc
.data
0:
sys signal; ..; ..
.bss
dvect: .=.+[NSIGNALS*2]

18
mach/pdp/libsys/stat.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _stat
.globl _errno
_stat:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys stat; ..; ..

16
mach/pdp/libsys/stime.s Normal file
View file

@ -0,0 +1,16 @@
#include "sys.h"
.globl _stime
.globl _errno
_stime:
mov 2(sp),r1
mov (r1)+,r0
mov (r1),r1
sys stime
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc

7
mach/pdp/libsys/stty.c Normal file
View file

@ -0,0 +1,7 @@
#include <sgtty.h>
int stty(fildes,argp)
int fildes ;
struct sgttyb *argp ;
{
return ioctl(fildes,TIOCSETP,argp) ;
}

15
mach/pdp/libsys/submit.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _submit
.globl _errno
_submit:
mov 2(sp),r0
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys submit

18
mach/pdp/libsys/symlink.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _symlink
.globl _errno
_symlink:
mov 2(sp),r0
mov 4(sp),0f+2
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys symlink; ..

6
mach/pdp/libsys/sync.s Normal file
View file

@ -0,0 +1,6 @@
#include "sys.h"
.globl _sync
_sync:
sys sync
rts pc

97
mach/pdp/libsys/sys.h Normal file
View file

@ -0,0 +1,97 @@
#define indir 0.
#define exit 1.
#define fork 2.
#define read 3.
#define write 4.
#define open 5.
#define close 6.
#define wait 7.
#define creat 8.
#define link 9.
#define unlink 10.
#define exec 11.
#define chdir 12.
#define time 13.
#define mknod 14.
#define chmod 15.
#define chown 16.
#define break 17.
#define stat 18.
#define lseek 19.
#define getpid 20.
#define mount 21.
#define umount 22.
#define setuid 23.
#define getuid 24.
#define stime 25.
#define ptrace 26.
#define alarm 27.
#define fstat 28.
#define pause 29.
#define utime 30.
#define smdate 30.
#define stty 31.
#define gtty 32.
#define access 33.
#define nice 34.
#define sleep 35.
#define ftime 35.
#define sync 36.
#define kill 37.
#define csw 38.
#define setpgrp 39.
#define dup 41.
#define pipe 42.
#define times 43.
#define profil 44.
#define getgrp 45.
#define setgid 46.
#define getgid 47.
#define signal 48.
#define rtp 49.
#define setgrp 50.
#define acct 51.
#define phys 52.
#define lock 53.
#define ioctl 54.
#define reboot 55.
#define mpx 56.
#define vfork 57.
#define setinf 59.
#define exece 59.
#define local 58.
#define umask 60.
#define getinf 60.
#define chroot 61.
#define login 1.
#define lstat 2.
#define submit 3.
#define nostk 4.
#define killbkg 5.
#define killpg 6.
#define renice 7.
#define fetchi 8.
#define ucall 9.
#define quota 10.
#define qfstat 11.
#define qstat 12.
#define gldav 14.
#define fperr 15.
#define vhangup 16.
#define symlink 29.
#define readlink 30.
#define select 18.
#define gethost 19.
#define sethost 20.
#define socket 21.
#define connect 22.
#define accept 23.
#define send 24.
#define receive 25.
#define socketa 26.
#define setreuid 27.
#define setregid 28.
#define gethstid 31.
#define sethstid 32.

13
mach/pdp/libsys/time.s Normal file
View file

@ -0,0 +1,13 @@
#include "sys.h"
.globl _time
_time:
sys time
mov r5,-(sp)
mov 4(sp),r5
beq 1f
mov r0,(r5)+
mov r1,(r5)+
1:
mov (sp)+,r5
rts pc

10
mach/pdp/libsys/times.s Normal file
View file

@ -0,0 +1,10 @@
#include "sys.h"
.globl _times
_times:
mov 2(sp),0f+2
sys indir; 0f
rts pc
.data
0:
sys times; ..

13
mach/pdp/libsys/ucall.s Normal file
View file

@ -0,0 +1,13 @@
#include "sys.h"
.globl _ucall
_ucall:
mov 2(sp),0f+2
mov 4(sp),0f+4
mov 6(sp),0f+6
mov 10(sp),0f+10
sys local; 0f
rts pc
.data
0:
sys ucall; ..; ..; ..; ..

15
mach/pdp/libsys/umask.s Normal file
View file

@ -0,0 +1,15 @@
#include "sys.h"
.globl _umask
.globl _errno
_umask:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys umask; ..

18
mach/pdp/libsys/umount.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _umount
.globl _errno
_umount:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys umount; ..

17
mach/pdp/libsys/unlink.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _unlink
.globl _errno
_unlink:
mov 2(sp),0f+2
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys unlink; ..

18
mach/pdp/libsys/utime.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _utime
.globl _errno
_utime:
mov 2(sp),0f+2
mov 4(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
clr r0
rts pc
.data
0:
sys utime; ..; ..

18
mach/pdp/libsys/vfork.s Normal file
View file

@ -0,0 +1,18 @@
#include "sys.h"
.globl _vfork
.globl _errno
_vfork:
mov (sp)+,r1
sys vfork
br 1f
bec 2f
3: mov r0,_errno
mov $-1,r0
jmp (r1)
1: / child, or vfork systemcall does not exist
bes 3b
clr r0
2:
jmp (r1)

14
mach/pdp/libsys/vhangup.s Normal file
View file

@ -0,0 +1,14 @@
#include "sys.h"
.globl _vhangup
.globl _errno
_vhangup:
sys local; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys vhangup

16
mach/pdp/libsys/wait.s Normal file
View file

@ -0,0 +1,16 @@
#include "sys.h"
.globl _wait
.globl _errno
_wait:
sys wait
bec 1f
mov r0,_errno
mov $-1,r0
rts pc
1:
tst 2(sp)
beq 1f
mov r1,*2(sp)
1:
rts pc

17
mach/pdp/libsys/write.s Normal file
View file

@ -0,0 +1,17 @@
#include "sys.h"
.globl _write
.globl _errno
_write:
mov 2(sp),r0
mov 4(sp),0f+2
mov 6(sp),0f+4
sys indir; 0f
bec 1f
mov r0,_errno
mov $-1,r0
1:
rts pc
.data
0:
sys write; ..; ..