diff --git a/mach/pmds/libsys/access.s b/mach/pmds/libsys/access.s new file mode 100644 index 000000000..24a8235af --- /dev/null +++ b/mach/pmds/libsys/access.s @@ -0,0 +1,21 @@ +.define _access +.extern _access +.text +_access: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Saccess +add.l #8,sp +unlk a6 +rts +__Saccess: trap #0 +.short 0x21 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/alarm.s b/mach/pmds/libsys/alarm.s new file mode 100644 index 000000000..88bcb728c --- /dev/null +++ b/mach/pmds/libsys/alarm.s @@ -0,0 +1,15 @@ +.define _alarm +.extern _alarm +.text +_alarm: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6),-(sp) +clr.w -(sp) +jsr __Salarm +add.l #4,sp +unlk a6 +rts +__Salarm: trap #0 +.short 0x1B + rts diff --git a/mach/pmds/libsys/cerror.s b/mach/pmds/libsys/cerror.s new file mode 100644 index 000000000..d9fff34c9 --- /dev/null +++ b/mach/pmds/libsys/cerror.s @@ -0,0 +1,9 @@ +.define cerror +.extern cerror +cerror: move.l d0,_errno + move.l #-1,d0 + rts +.bss +_errno: + .space 4 +.text diff --git a/mach/pmds/libsys/chmod.s b/mach/pmds/libsys/chmod.s new file mode 100644 index 000000000..3e6287695 --- /dev/null +++ b/mach/pmds/libsys/chmod.s @@ -0,0 +1,21 @@ +.define _chmod +.extern _chmod +.text +_chmod: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Schmod +add.l #8,sp +unlk a6 +rts +__Schmod: trap #0 +.short 0xF + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/chown.s b/mach/pmds/libsys/chown.s new file mode 100644 index 000000000..8cd896804 --- /dev/null +++ b/mach/pmds/libsys/chown.s @@ -0,0 +1,24 @@ +.define _chown +.extern _chown +.text +_chown: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 12(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +move.l 8(a6),-(sp) +jsr __Schown +lea 12(sp),sp +unlk a6 +rts +__Schown: trap #0 +.short 0x10 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/cleanup.s b/mach/pmds/libsys/cleanup.s new file mode 100644 index 000000000..ce4a76359 --- /dev/null +++ b/mach/pmds/libsys/cleanup.s @@ -0,0 +1,5 @@ +.define __cleanup +.extern __cleanup +.text +__cleanup: +rts diff --git a/mach/pmds/libsys/close.s b/mach/pmds/libsys/close.s new file mode 100644 index 000000000..a32ac79c8 --- /dev/null +++ b/mach/pmds/libsys/close.s @@ -0,0 +1,20 @@ +.define _close +.extern _close +.text +_close: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Sclose +add.l #4,sp +unlk a6 +rts +__Sclose: trap #0 +.short 0x6 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/creat.s b/mach/pmds/libsys/creat.s new file mode 100644 index 000000000..88df10317 --- /dev/null +++ b/mach/pmds/libsys/creat.s @@ -0,0 +1,20 @@ +.define _creat +.extern _creat +.text +_creat: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Screat +add.l #8,sp +unlk a6 +rts +__Screat: trap #0 +.short 0x8 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/dup.s b/mach/pmds/libsys/dup.s new file mode 100644 index 000000000..f189fb53d --- /dev/null +++ b/mach/pmds/libsys/dup.s @@ -0,0 +1,36 @@ +.define _dup +.define _dup2 +.extern _dup +.text +_dup: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Sdup +add.l #4,sp +unlk a6 +rts +.extern _dup2 +_dup2: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Sdup2 +add.l #8,sp +unlk a6 +rts +__Sdup2: or.l #64,4(sp) + +__Sdup: trap #0 +.short 0x29 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/exec.s b/mach/pmds/libsys/exec.s new file mode 100644 index 000000000..22a8260dd --- /dev/null +++ b/mach/pmds/libsys/exec.s @@ -0,0 +1,27 @@ +.define _execl +.define _execve +.define _execv +.extern _execl +.extern _execve +.extern _execv +_execl: tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) + pea 12(a6) + move.l 8(a6),-(sp) + jsr _execve + add.l #12,sp + unlk a6 + rts +_execve: trap #0 +.short 59 + jmp cerror +_execv: tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) + move.l 12(a6),-(sp) + move.l 8(a6),-(sp) + jsr _execve + add.l #12,sp + unlk a6 + rts diff --git a/mach/pmds/libsys/exit1.s b/mach/pmds/libsys/exit1.s new file mode 100644 index 000000000..d766750e7 --- /dev/null +++ b/mach/pmds/libsys/exit1.s @@ -0,0 +1,12 @@ +.define _exit +.extern _exit +.text +_exit: +tst.b -40(sp) +link a6,#-0 +jsr __cleanup +move.w 8(a6),-(sp) +jsr __exit +add.l #2,sp +unlk a6 +rts diff --git a/mach/pmds/libsys/exit2.s b/mach/pmds/libsys/exit2.s new file mode 100644 index 000000000..ea2bea6f4 --- /dev/null +++ b/mach/pmds/libsys/exit2.s @@ -0,0 +1,15 @@ +.define __exit +.extern __exit +.text +__exit: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Sexit +add.l #4,sp +unlk a6 +rts +__Sexit: trap #0 +.short 0x1 diff --git a/mach/pmds/libsys/fork.s b/mach/pmds/libsys/fork.s new file mode 100644 index 000000000..ca96887de --- /dev/null +++ b/mach/pmds/libsys/fork.s @@ -0,0 +1,12 @@ +.define _fork +.extern _fork +_fork: trap #0 +.short 0x2 + bra 3f + rts +3: + bcc 2f + jmp cerror +2: + clr.l d0 + rts diff --git a/mach/pmds/libsys/fstat.s b/mach/pmds/libsys/fstat.s new file mode 100644 index 000000000..3aaee95ea --- /dev/null +++ b/mach/pmds/libsys/fstat.s @@ -0,0 +1,21 @@ +.define _fstat +.extern _fstat +.text +_fstat: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l 10(a6),-(sp) +move.l d2,-(sp) +jsr __Sfstat +add.l #8,sp +unlk a6 +rts +__Sfstat: trap #0 +.short 0x1C + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/getgid.s b/mach/pmds/libsys/getgid.s new file mode 100644 index 000000000..098977ada --- /dev/null +++ b/mach/pmds/libsys/getgid.s @@ -0,0 +1,12 @@ +.define _getgid +.define _getegid +.extern _getgid +.extern _getegid +_getgid: trap #0 +.short 0x2F + rts + +_getegid: trap #0 +.short 0x2F + move.l d1,d0 + rts diff --git a/mach/pmds/libsys/getpid.s b/mach/pmds/libsys/getpid.s new file mode 100644 index 000000000..75894271d --- /dev/null +++ b/mach/pmds/libsys/getpid.s @@ -0,0 +1,5 @@ +.define _getpid +.extern _getpid +_getpid: trap #0 +.short 0x14 + rts diff --git a/mach/pmds/libsys/getuid.s b/mach/pmds/libsys/getuid.s new file mode 100644 index 000000000..53f6b0be9 --- /dev/null +++ b/mach/pmds/libsys/getuid.s @@ -0,0 +1,12 @@ +.define _getuid +.define _geteuid +.extern _getuid +.extern _geteuid +_getuid: trap #0 +.short 0x18 + rts + +_geteuid: trap #0 +.short 0x18 + move.l d1,d0 + rts diff --git a/mach/pmds/libsys/gtty.s b/mach/pmds/libsys/gtty.s new file mode 100644 index 000000000..ee9f096c8 --- /dev/null +++ b/mach/pmds/libsys/gtty.s @@ -0,0 +1,13 @@ +.define _gtty +.extern _gtty +.text +_gtty: +tst.b -40(sp) +link a6,#-0 +move.l 10(a6),-(sp) +move.w #29704,-(sp) +move.w 8(a6),-(sp) +jsr _ioctl +add.l #8,sp +unlk a6 +rts diff --git a/mach/pmds/libsys/ioctl.s b/mach/pmds/libsys/ioctl.s new file mode 100644 index 000000000..fea858793 --- /dev/null +++ b/mach/pmds/libsys/ioctl.s @@ -0,0 +1,24 @@ +.define _ioctl +.extern _ioctl +.text +_ioctl: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l 12(a6),-(sp) +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Sioctl +lea 12(sp),sp +unlk a6 +rts +__Sioctl: trap #0 +.short 0x36 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/kill.s b/mach/pmds/libsys/kill.s new file mode 100644 index 000000000..d900ac2ba --- /dev/null +++ b/mach/pmds/libsys/kill.s @@ -0,0 +1,23 @@ +.define _kill +.extern _kill +.text +_kill: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Skill +add.l #8,sp +unlk a6 +rts +__Skill: trap #0 +.short 0x25 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/link.s b/mach/pmds/libsys/link.s new file mode 100644 index 000000000..e1531b952 --- /dev/null +++ b/mach/pmds/libsys/link.s @@ -0,0 +1,9 @@ +.define _link +.extern _link +_link: trap #0 +.short 0x9 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/lseek.s b/mach/pmds/libsys/lseek.s new file mode 100644 index 000000000..8be8d2bd9 --- /dev/null +++ b/mach/pmds/libsys/lseek.s @@ -0,0 +1,23 @@ +.define _lseek +.extern _lseek +.text +_lseek: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Slseek +lea 12(sp),sp +unlk a6 +rts +__Slseek: trap #0 +.short 0x13 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/mknod.s b/mach/pmds/libsys/mknod.s new file mode 100644 index 000000000..306035fdd --- /dev/null +++ b/mach/pmds/libsys/mknod.s @@ -0,0 +1,24 @@ +.define _mknod +.extern _mknod +.text +_mknod: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 12(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +move.l 8(a6),-(sp) +jsr __Smknod +lea 12(sp),sp +unlk a6 +rts +__Smknod: trap #0 +.short 0xE + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/mount.s b/mach/pmds/libsys/mount.s new file mode 100644 index 000000000..849678353 --- /dev/null +++ b/mach/pmds/libsys/mount.s @@ -0,0 +1,22 @@ +.define _mount +.extern _mount +.text +_mount: +tst.b -40(sp) +link a6,#-0 +move.w 16(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 12(a6),-(sp) +move.l 8(a6),-(sp) +jsr __Smount +lea 12(sp),sp +unlk a6 +rts +__Smount: trap #0 +.short 0x15 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/nice.s b/mach/pmds/libsys/nice.s new file mode 100644 index 000000000..b264a5d6e --- /dev/null +++ b/mach/pmds/libsys/nice.s @@ -0,0 +1,20 @@ +.define _nice +.extern _nice +.text +_nice: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Snice +add.l #4,sp +unlk a6 +rts +__Snice: trap #0 +.short 0x22 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/open.s b/mach/pmds/libsys/open.s new file mode 100644 index 000000000..6a9476224 --- /dev/null +++ b/mach/pmds/libsys/open.s @@ -0,0 +1,20 @@ +.define _open +.extern _open +.text +_open: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Sopen +add.l #8,sp +unlk a6 +rts +__Sopen: trap #0 +.short 0x5 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/pause.s b/mach/pmds/libsys/pause.s new file mode 100644 index 000000000..3ce0e8c9c --- /dev/null +++ b/mach/pmds/libsys/pause.s @@ -0,0 +1,8 @@ +.define _pause +.extern _pause +_pause: trap #0 +.short 29 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/pipe.s b/mach/pmds/libsys/pipe.s new file mode 100644 index 000000000..0b57d35f5 --- /dev/null +++ b/mach/pmds/libsys/pipe.s @@ -0,0 +1,12 @@ +.define _pipe +.extern _pipe +_pipe: trap #0 +.short 0x2A + bcc 1f + jmp cerror +1: + move.l 4(sp),a0 + move.w d0,(a0)+ + move.w d1,(a0) + clr.l d0 + rts diff --git a/mach/pmds/libsys/profil.s b/mach/pmds/libsys/profil.s new file mode 100644 index 000000000..475087c06 --- /dev/null +++ b/mach/pmds/libsys/profil.s @@ -0,0 +1,23 @@ +.define _profil +.extern _profil +.text +_profil: +tst.b -40(sp) +link a6,#-0 +move.w 16(a6), d2 +ext.l d2 +move.w 14(a6), d1 +ext.l d1 +move.w 12(a6), d0 +ext.l d0 +move.l d2,-(sp) +move.l d1,-(sp) +move.l d0,-(sp) +move.l 8(a6),-(sp) +jsr __Sprofil +lea 16(sp),sp +unlk a6 +rts +__Sprofil: trap #0 +.short 0x2C + rts diff --git a/mach/pmds/libsys/read.s b/mach/pmds/libsys/read.s new file mode 100644 index 000000000..ccf421ca6 --- /dev/null +++ b/mach/pmds/libsys/read.s @@ -0,0 +1,23 @@ +.define _read +.extern _read +.text +_read: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Sread +lea 12(sp),sp +unlk a6 +rts +__Sread: trap #0 +.short 0x3 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/sbrk.s b/mach/pmds/libsys/sbrk.s new file mode 100644 index 000000000..4ec68dcee --- /dev/null +++ b/mach/pmds/libsys/sbrk.s @@ -0,0 +1,50 @@ +.define _brk +.define _sbrk +.extern _brk +.text +_brk: +tst.b -40(sp) +link a6,#-0 +move.l 8(a6),-(sp) +jsr __Sbrk +add.l #4,sp +unlk a6 +rts +.extern _sbrk +_sbrk: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Ssbrk +add.l #4,sp +unlk a6 +rts +__Ssbrk: tst.b -8(sp) + move.l 4(sp),d0 + beq 1f + add.l nd,d0 + move.l d0,-(sp) + clr.l -(sp) + trap #0 +.short 0x11 + add.l #8,sp + bcc 1f + jmp cerror +1: + move.l nd,d0 + move.l 4(sp),d1 + add.l d1,nd + rts +__Sbrk: trap #0 +.short 0x11 + bcc 1f + jmp cerror +1: + move.l 4(sp),nd + clr.l d0 + rts +.data +nd: .long endbss +.text diff --git a/mach/pmds/libsys/signal.s b/mach/pmds/libsys/signal.s new file mode 100644 index 000000000..22fdd1d4f --- /dev/null +++ b/mach/pmds/libsys/signal.s @@ -0,0 +1,52 @@ +.define _signal +.extern _signal +NSIG=32 +_signal: + move.w 4(sp), d0 + ext.l d0 + cmp.l #NSIG,d0 + bcc 1f + move.l 6(sp),d1 + move.l d0,a0 + add.l a0,a0 + add.l a0,a0 + add.l #dvect,a0 + move.l (a0),a1 + move.l d1,(a0) + beq 2f + btst #0,d1 + bne 2f + move.l #enter,d1 +2: + move.l d1,-(sp) + move.l d0,-(sp) + clr.l -(sp) + trap #0 +.short 48 + add.l #12,sp + bcs 3f + btst #0,d0 + bne 4f + move.l a1,d0 +4: + rts +1: + move.l #22,d0 +3: + jmp cerror + +enter: + movem.l d0/d1/a0/a1,-(sp) + move.l 16(sp),a0 + move.l a0,-(sp) + add.l a0,a0 + add.l a0,a0 + add.l #dvect,a0 + move.l (a0),a0 + jsr (a0) + add.l #4,sp + movem.l (sp)+,d0/d1/a0/a1 + add.l #4,sp + rtr +.bss +dvect: .space 4*NSIG diff --git a/mach/pmds/libsys/stat.s b/mach/pmds/libsys/stat.s new file mode 100644 index 000000000..45dfa7555 --- /dev/null +++ b/mach/pmds/libsys/stat.s @@ -0,0 +1,9 @@ +.define _stat +.extern _stat +_stat: trap #0 +.short 0x12 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/stty.s b/mach/pmds/libsys/stty.s new file mode 100644 index 000000000..46a497cd8 --- /dev/null +++ b/mach/pmds/libsys/stty.s @@ -0,0 +1,13 @@ +.define _stty +.extern _stty +.text +_stty: +tst.b -40(sp) +link a6,#-0 +move.l 10(a6),-(sp) +move.w #29705,-(sp) +move.w 8(a6),-(sp) +jsr _ioctl +add.l #8,sp +unlk a6 +rts diff --git a/mach/pmds/libsys/time.s b/mach/pmds/libsys/time.s new file mode 100644 index 000000000..dce236575 --- /dev/null +++ b/mach/pmds/libsys/time.s @@ -0,0 +1,21 @@ +.define _time +.define _ftime +.extern _time +_time: + trap #0 +.short 0xD + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d0,(a0) +1: + rts +.extern _ftime +_ftime: + trap #0 +.short 0x23 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/unlink.s b/mach/pmds/libsys/unlink.s new file mode 100644 index 000000000..2093ce74d --- /dev/null +++ b/mach/pmds/libsys/unlink.s @@ -0,0 +1,9 @@ +.define _unlink +.extern _unlink +_unlink: trap #0 +.short 0xA + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/wait.s b/mach/pmds/libsys/wait.s new file mode 100644 index 000000000..fa84833cf --- /dev/null +++ b/mach/pmds/libsys/wait.s @@ -0,0 +1,13 @@ +.define _wait +.extern _wait +_wait: trap #0 +.short 0x7 + bcc 1f + jmp cerror +1: + tst.l 4(sp) + beq 2f + move.l 4(sp),a0 + move.w d1,(a0) +2: + rts diff --git a/mach/pmds/libsys/write.s b/mach/pmds/libsys/write.s new file mode 100644 index 000000000..8789104ee --- /dev/null +++ b/mach/pmds/libsys/write.s @@ -0,0 +1,23 @@ +.define _write +.extern _write +.text +_write: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Swrite +lea 12(sp),sp +unlk a6 +rts +__Swrite: trap #0 +.short 0x4 + bcc 1f + jmp cerror +1: + rts