ack/mach/mantra/int/mloopc

530 lines
7.9 KiB
Plaintext
Raw Normal View History

1986-12-09 11:13:14 +00:00
.sect .text
.sect .rom
.sect .data
1987-03-31 09:23:20 +00:00
.retaddr:
.data4 0
1986-12-09 11:13:14 +00:00
.sect .bss
.sect .text
1984-07-23 11:49:00 +00:00
!THIS FILE CONTAINS THE SYSTEM CALLS FOR PMDS-II AS SUBROUTINES FOR THE
1987-03-31 09:23:20 +00:00
!EM-INTERPRETER. a5 CONTAINS A POINTER TO THE RETURN AREA . EACH SUBROUTINE
1984-07-23 11:49:00 +00:00
!EXPECTS ITS DATA IN THE FORM EM PRODUCES AND GIVES ITS RESULTS AS EM
!REQUIRES.
!THE PMDS-II REQUIRES THE ARGUMENTS ON THE STACK AS 4 BYTE INTEGERS OR
!POINTERS , AND USES THE C-CALLING CONVENTION. THE 2 BYTE WORDS 4 BYTE
!POINTERS VERSION HAS TO DO SOME CONVERSION FIRST .
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xexit: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr __exit
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xfork: move.l (sp)+,.retaddr
jsr _fork
tst.l d0
blt 2f
1984-07-23 11:49:00 +00:00
bne 1f
1987-03-31 09:23:20 +00:00
jsr _getpid
1984-07-23 11:49:00 +00:00
mov d1,-(sp) !PID OF PARENT IN d1
mov #1,-(sp) !(PID OF CHILD IN D0),FLAG 1 IN CHILD
bra 0f
1: mov d0,-(sp) !PID OF CHILD IN d0
cl -(sp) !FLAG 0 IN PARENT
0: cl -(sp)
bra 3f
1987-03-31 09:23:20 +00:00
2: move.l _errno,d0
mov d0,-(sp)
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
1987-03-31 09:23:20 +00:00
3: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-30 09:39:38 +00:00
!_Xfork is special
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xread: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _read
sys0: lea 12(sp),sp
cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l d0,-(sp)
cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xwrite: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _write
1984-07-23 11:49:00 +00:00
bra sys0
1987-03-31 09:23:20 +00:00
_Xopen: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
1987-03-31 09:23:20 +00:00
jsr _open
sys1: lea 8(sp),sp
sys5: cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: mov d0,-(sp)
cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xclose: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _close
sys3: lea 4(sp),sp
sys4: cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xwait: move.l (sp)+,.retaddr
.sect .data
xxxx:
1988-04-22 18:49:13 +00:00
.data4 0
1987-03-31 09:23:20 +00:00
.sect .text
move.l #xxxx,-(sp)
jsr _wait
add.l #4,sp
sys6: cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1988-04-22 18:49:13 +00:00
1: mov d0,-(sp) ! ??
1988-04-22 19:41:22 +00:00
#ifdef lword
move.l xxxx,-(sp)
#else
move.w xxxx+2,-(sp)
#endif
1984-07-23 11:49:00 +00:00
cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xcreat: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
1987-03-31 09:23:20 +00:00
jsr _creat
1984-07-23 11:49:00 +00:00
bra sys1
1987-03-31 09:23:20 +00:00
_Xlink: move.l (sp)+,.retaddr
jsr _link
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xunlink: move.l (sp)+,.retaddr
jsr _unlink
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xchdir: move.l (sp)+,.retaddr
jsr _chdir
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xmknod: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st244
#endif
1987-03-31 09:23:20 +00:00
jsr _mknod
lea 12(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xchmod: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st243
#endif
1987-03-31 09:23:20 +00:00
jsr _chmod
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xchown: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st244
#endif
1987-03-31 09:23:20 +00:00
jsr _chown
lea 12(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xbreak: move.l (sp)+,.retaddr
jsr _brk
lea 4(sp),sp
cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l -4(sp),nd
cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1986-12-09 11:13:14 +00:00
.sect .data
nd: .data4 endbss
.sect .text
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xstat: move.l (sp)+,.retaddr
jsr _stat
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xlseek: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st245
#endif
1987-03-31 09:23:20 +00:00
jsr _lseek
lea 12(sp),sp
cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1: move.l d0,-(sp)
1984-07-23 11:49:00 +00:00
cl -(sp)
1987-03-31 09:23:20 +00:00
2: move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xgetpid: move.l (sp)+,.retaddr
jsr _getpid
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
1987-03-31 09:23:20 +00:00
move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xmount: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st246
#endif
1987-03-31 09:23:20 +00:00
jsr _mount
lea 12(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xumount: move.l (sp)+,.retaddr
jsr _umount
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xsetuid: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _setuid
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xgetuid: move.l (sp)+,.retaddr
jsr _getuid
sys7: mov d1,-(sp)
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
1987-03-31 09:23:20 +00:00
move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xstime: move.l (sp)+,.retaddr
jsr _stime
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xptrace: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st247
#endif
1987-03-31 09:23:20 +00:00
jsr _ptrace
lea 16(sp),sp
1984-07-23 11:49:00 +00:00
bra sys5
1987-03-31 09:23:20 +00:00
_Xalarm: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
sub.l #2,sp
1987-03-31 09:23:20 +00:00
clr.w (sp)
1984-07-23 11:49:00 +00:00
#endif
1987-03-31 09:23:20 +00:00
jsr _alarm
lea 4(sp),sp
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
1987-03-31 09:23:20 +00:00
move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xfstat: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _fstat
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xpause: jsr _pause
1984-07-23 11:49:00 +00:00
rts
1987-03-31 09:23:20 +00:00
_Xutime: move.l (sp)+,.retaddr
jsr _utime
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xaccess: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
1987-04-07 09:57:50 +00:00
bsr st243
1984-07-23 11:49:00 +00:00
#endif
1987-03-31 09:23:20 +00:00
jsr _access
lea 8(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xnice: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr 241
#endif
1987-03-31 09:23:20 +00:00
jsr _nice
move.l .retaddr,(sp)
1984-07-23 11:49:00 +00:00
rts
1987-03-31 09:23:20 +00:00
_Xftime: move.l (sp)+,.retaddr
jsr _ftime
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xsync: jsr _sync
1984-07-23 11:49:00 +00:00
rts
1987-03-31 09:23:20 +00:00
_Xkill: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
1987-03-31 09:23:20 +00:00
jsr _kill
lea 4(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xdup: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
1987-03-31 09:23:20 +00:00
jsr _dup
1984-07-23 11:49:00 +00:00
bra sys1
1987-03-31 09:23:20 +00:00
_Xpipe: move.l (sp)+,.retaddr
move.l #xxxx,-(sp)
jsr _pipe
add.l #4,sp
1984-07-23 11:49:00 +00:00
bra sys6
1987-03-31 09:23:20 +00:00
_Xtimes: move.l (sp)+,.retaddr
jsr _times
move.l .retaddr,a0
add.l #4,sp
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xprofil: move.l (sp)+,.retaddr
jsr _profil
move.l .retaddr,a0
lea 16(sp),sp
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xsetgid: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _setgid
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
_Xgetgid: move.l (sp)+,.retaddr
1988-04-22 16:19:56 +00:00
jsr _getgid
1984-07-23 11:49:00 +00:00
bra sys7
1987-03-31 09:23:20 +00:00
_Xsignal: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
mov (sp)+,d4
extend d4
move.l d4,-(sp)
1987-03-31 09:23:20 +00:00
jsr _signal
1987-10-16 17:57:09 +00:00
lea 8(sp),sp !remove arguments
1987-03-31 09:23:20 +00:00
cmp.l #-1,d0
bne 1f
move.l _errno,d0
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
mov d0,-(sp)
bra 2f
1987-03-31 09:23:20 +00:00
1:
mov d0,-(sp)
cl -(sp)
1987-03-31 09:23:20 +00:00
2:
move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xacct: move.l (sp)+,.retaddr
jsr _acct
1984-07-23 11:49:00 +00:00
bra sys3
1987-03-31 09:23:20 +00:00
!_Xlock: move.l (sp)+,.retaddr
!#ifndef lword
! bsr st241
!#endif
! jsr _lock
! bra sys3
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xioctl: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st248
#endif
1988-04-22 19:41:22 +00:00
#ifdef __USG
! only support TIOCGETP and TIOCSETP
move.l 4(sp),d0
1988-06-13 15:01:54 +00:00
cmp.l #0x7408,d0 ! TIOCGETP
1988-04-22 19:41:22 +00:00
bne 1f
move.l (sp)+,d0
move.l d0,(sp)
jsr _gtty
lea 8(sp),sp
bra sys4
1:
1988-06-13 15:01:54 +00:00
cmp.l #0x7409,d0 ! TIOCSETP
1988-04-22 19:41:22 +00:00
bne 9f
move.l (sp)+,d0
move.l d0,(sp)
jsr _stty
lea 8(sp),sp
bra sys4
#endif
#ifdef __BSD4_2
.sect .data
XXmapping:
.data4 0x7408,0x40067408 ! TIOCGETP
.data4 0x7409,0x80067409 ! TIOCSETP
.data4 0x740a,0x8006740a ! TIOCSETN
.data4 0x740d,0x2000740d ! TIOCEXCL
.data4 0x740e,0x2000740e ! TIOCNXCL
.data4 0x7402,0x20007402 ! TIOCHPCL
.data4 0x7412,0x40067412 ! TIOCGETC
.data4 0x7411,0x40067411 ! TIOCSETC
.data4 0
.sect .text
lea XXmapping, a0
move.l 4(sp),d0
1:
tst.l (a0)
beq 9f
cmp.l (a0),d0
beq 1f
add.l #8,a0
bra 1b
1:
move.l 4(a0),d0
move.l d0,4(sp)
#endif
9:
1987-03-31 09:23:20 +00:00
jsr _ioctl
lea 12(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
!_Xmpxcall: move.l (sp)+,.retaddr
1987-03-30 09:39:38 +00:00
!#ifndef lword
! bsr st241
!#endif
! trap #0
! .data2 56
! lea 12(sp),sp
! bra sys4
1984-07-23 11:49:00 +00:00
1987-03-31 09:23:20 +00:00
_Xexece: move.l (sp)+,.retaddr
jsr _execve
lea 12(sp),sp
1984-07-23 11:49:00 +00:00
bra sys4
1987-03-31 09:23:20 +00:00
_Xumask: move.l (sp)+,.retaddr
1984-07-23 11:49:00 +00:00
#ifndef lword
bsr st241
#endif
1987-03-31 09:23:20 +00:00
jsr _umask
add.l #4,sp
1984-07-23 11:49:00 +00:00
mov d0,-(sp)
1987-03-31 09:23:20 +00:00
move.l .retaddr,a0
1984-07-23 11:49:00 +00:00
jmp (a0)
1987-03-31 09:23:20 +00:00
_Xchroot: move.l (sp)+,.retaddr
jsr _chroot
1984-07-23 11:49:00 +00:00
bra sys3
!----------------------------------------------------------------------------
! STACK ADJUSTMENT FOR THE TWO BYTE INTERPRETER
!-----------------------------------------------------------------------------
#ifndef lword
st241: sub.l #2,sp
move.l 2(sp),(sp)
1987-03-31 09:23:20 +00:00
move.w 6(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,4(sp)
1984-07-23 11:49:00 +00:00
rts
st243: sub.l #2,sp
move.l 2(sp),(sp)
move.l 6(sp),4(sp)
1987-03-31 09:23:20 +00:00
move.w 10(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,8(sp)
1984-07-23 11:49:00 +00:00
rts
st244: move.l (sp),-(sp)
move.l 8(sp),4(sp)
1987-03-31 09:23:20 +00:00
move.w 12(sp),d0
ext.l d0
move.l d0,8(sp)
1984-07-23 11:49:00 +00:00
move.w 16(sp),d0
ext.l d0
move.l d0,12(sp)
rts
st245: move.l (sp),-(sp)
1987-03-31 09:23:20 +00:00
move.w 8(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,4(sp)
move.l 10(sp),8(sp)
move.w 14(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,12(sp)
1984-07-23 11:49:00 +00:00
rts
st246: sub.l #2,sp
move.l 2(sp),(sp)
move.l 6(sp),4(sp)
move.l 10(sp),8(sp)
1987-03-31 09:23:20 +00:00
move.w 14(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,12(sp)
1984-07-23 11:49:00 +00:00
rts
st247: sub.l #6,sp
move.l 6(sp),(sp)
1987-03-31 09:23:20 +00:00
move.w 10(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,4(sp)
move.w 12(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,8(sp)
move.l 14(sp),12(sp)
move.w 18(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
1987-03-31 09:23:20 +00:00
move.l d0,16(sp)
1984-07-23 11:49:00 +00:00
rts
st248: move.l (sp),-(sp)
1987-03-31 09:23:20 +00:00
move.w 8(sp),d0
ext.l d0
move.l d0,4(sp)
1987-04-07 09:57:50 +00:00
move.w 10(sp),d0
1984-07-23 11:49:00 +00:00
ext.l d0
move.l d0,8(sp)
rts
#endif