diff --git a/mach/m68k2/libsys/LIST b/mach/m68k2/libsys/LIST new file mode 100644 index 00000000..4fccdc16 --- /dev/null +++ b/mach/m68k2/libsys/LIST @@ -0,0 +1,45 @@ +tail_mon.a +exit.s +_exit.s +access.s +alarm.s +chdir.s +chmod.s +chroot.s +close.s +creat.s +execl.s +execve.s +fork.s +getegid.s +getgid.s +getpid.s +getuid.s +stty.s +gtty.s +ioctl.s +kill.s +link.s +lseek.s +mknod.s +mount.s +nice.s +open.s +pause.s +read.s +setgid.s +setuid.s +stat.s +stime.s +sync.s +time.s +times.s +umount.s +unlink.s +write.s +brk.s +wait.s +fstat.s +signal.s +call.s +cleanup.s diff --git a/mach/m68k2/libsys/_exit.s b/mach/m68k2/libsys/_exit.s new file mode 100644 index 00000000..398c9390 --- /dev/null +++ b/mach/m68k2/libsys/_exit.s @@ -0,0 +1,6 @@ +.define __exit +.extern __exit +.text +__exit: move.w #0x1,d0 + move.w 4(sp),a0 + trap #0 diff --git a/mach/m68k2/libsys/access.s b/mach/m68k2/libsys/access.s new file mode 100644 index 00000000..fdceffbf --- /dev/null +++ b/mach/m68k2/libsys/access.s @@ -0,0 +1,8 @@ +.define _access +.extern _access +.text +_access: move.w #0x21,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k2/libsys/alarm.s b/mach/m68k2/libsys/alarm.s new file mode 100644 index 00000000..98781a70 --- /dev/null +++ b/mach/m68k2/libsys/alarm.s @@ -0,0 +1,9 @@ +.define _alarm +.extern _alarm +.text +_alarm: clr.l d0 + move.w 4(sp),d0 + move.l d0,a0 + move.w #0x1B,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/brk.s b/mach/m68k2/libsys/brk.s new file mode 100644 index 00000000..f337c053 --- /dev/null +++ b/mach/m68k2/libsys/brk.s @@ -0,0 +1,25 @@ +.define _brk +.define _sbrk +.extern _brk +.extern _sbrk +.text +_sbrk: move.l nd,d0 + add.l d0, 4(sp) + move.w #0x11,d0 + move.l 4(sp),a0 + trap #0 + bcs lcerror + move.l nd,d0 + move.l 4(sp),nd + rts +lcerror: jmp cerror +_brk: move.w #0x11,d0 + move.l 4(sp),a0 + trap #0 + bcs lcerror + move.l 4(sp),nd + clr.l d0 + rts +.data +nd: .long endbss +.text diff --git a/mach/m68k2/libsys/call.s b/mach/m68k2/libsys/call.s new file mode 100644 index 00000000..846fb779 --- /dev/null +++ b/mach/m68k2/libsys/call.s @@ -0,0 +1,28 @@ +.define call +.define callc +.define calle +.define cerror +.define _errno +.extern call +.extern callc +.extern calle +.extern cerror +.extern _errno +.text +call: trap #0 + bcs cerror + rts +callc: + trap #0 + bcs cerror + clr.l d0 + rts +calle: + trap #0 +cerror: + move.w d0,_errno + move.l #-1,d0 + rts +.bss +_errno: .space 4 +.text diff --git a/mach/m68k2/libsys/chdir.s b/mach/m68k2/libsys/chdir.s new file mode 100644 index 00000000..d03224ae --- /dev/null +++ b/mach/m68k2/libsys/chdir.s @@ -0,0 +1,6 @@ +.define _chdir +.extern _chdir +.text +_chdir: move.w #0xC,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/chmod.s b/mach/m68k2/libsys/chmod.s new file mode 100644 index 00000000..6c86e3a2 --- /dev/null +++ b/mach/m68k2/libsys/chmod.s @@ -0,0 +1,8 @@ +.define _chmod +.extern _chmod +.text +_chmod: move.w #0xF,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k2/libsys/chroot.s b/mach/m68k2/libsys/chroot.s new file mode 100644 index 00000000..ebf9f6a4 --- /dev/null +++ b/mach/m68k2/libsys/chroot.s @@ -0,0 +1,6 @@ +.define _chroot +.extern _chroot +.text +_chroot: move.w #0x3D,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/cleanup.s b/mach/m68k2/libsys/cleanup.s new file mode 100644 index 00000000..7df1860b --- /dev/null +++ b/mach/m68k2/libsys/cleanup.s @@ -0,0 +1,8 @@ +.define __cleanup +.extern __cleanup +.text +__cleanup: +tst.b -40(sp) +link a6,#-0 +unlk a6 +rts diff --git a/mach/m68k2/libsys/close.s b/mach/m68k2/libsys/close.s new file mode 100644 index 00000000..add7e701 --- /dev/null +++ b/mach/m68k2/libsys/close.s @@ -0,0 +1,6 @@ +.define _close +.extern _close +.text +_close: move.w #0x6,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/creat.s b/mach/m68k2/libsys/creat.s new file mode 100644 index 00000000..73e7db84 --- /dev/null +++ b/mach/m68k2/libsys/creat.s @@ -0,0 +1,8 @@ +.define _creat +.extern _creat +.text +_creat: move.w #0x8,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp call diff --git a/mach/m68k2/libsys/execl.s b/mach/m68k2/libsys/execl.s new file mode 100644 index 00000000..21e03dc9 --- /dev/null +++ b/mach/m68k2/libsys/execl.s @@ -0,0 +1,11 @@ +.define _execl +.extern _execl +_execl: link a6,#0 + tst.b -132(sp) + move.l _environ,-(sp) + pea 12(sp) + move.l 8(a6),-(sp) + jsr _execve + add.l #0xC,sp + unlk a6 + rts diff --git a/mach/m68k2/libsys/execve.s b/mach/m68k2/libsys/execve.s new file mode 100644 index 00000000..2b2de5f8 --- /dev/null +++ b/mach/m68k2/libsys/execve.s @@ -0,0 +1,8 @@ +.define _execve +.extern _execve +.text +_execve: move.w #0x3B,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp calle diff --git a/mach/m68k2/libsys/exit.s b/mach/m68k2/libsys/exit.s new file mode 100644 index 00000000..d766750e --- /dev/null +++ b/mach/m68k2/libsys/exit.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/m68k2/libsys/fork.s b/mach/m68k2/libsys/fork.s new file mode 100644 index 00000000..0401e631 --- /dev/null +++ b/mach/m68k2/libsys/fork.s @@ -0,0 +1,13 @@ +.define _fork +.extern _fork +.text +_fork: move.w #0x2,d0 + trap #0 + bra 1f + bcc 2f + jmp cerror +1: + !move.l d0,p_uid + clr.l d0 +2: + rts diff --git a/mach/m68k2/libsys/fstat.s b/mach/m68k2/libsys/fstat.s new file mode 100644 index 00000000..1dd3d66c --- /dev/null +++ b/mach/m68k2/libsys/fstat.s @@ -0,0 +1,6 @@ +.define _fstat +.extern _fstat +_fstat: move.w #0x1C,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + jmp callc diff --git a/mach/m68k2/libsys/getegid.s b/mach/m68k2/libsys/getegid.s new file mode 100644 index 00000000..b4da40c1 --- /dev/null +++ b/mach/m68k2/libsys/getegid.s @@ -0,0 +1,7 @@ +.define _getegid +.extern _getegid +.text +_getegid: move.w #0x2F,d0 + trap #0 + move.l d1,d0 + rts diff --git a/mach/m68k2/libsys/getgid.s b/mach/m68k2/libsys/getgid.s new file mode 100644 index 00000000..3ef4def3 --- /dev/null +++ b/mach/m68k2/libsys/getgid.s @@ -0,0 +1,6 @@ +.define _getgid +.extern _getgid +.text +_getgid: move.w #0x2F,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/getpid.s b/mach/m68k2/libsys/getpid.s new file mode 100644 index 00000000..1bf2aba7 --- /dev/null +++ b/mach/m68k2/libsys/getpid.s @@ -0,0 +1,6 @@ +.define _getpid +.extern _getpid +.text +_getpid: move.w #0x14,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/getuid.s b/mach/m68k2/libsys/getuid.s new file mode 100644 index 00000000..d0e15a1b --- /dev/null +++ b/mach/m68k2/libsys/getuid.s @@ -0,0 +1,6 @@ +.define _getuid +.extern _getuid +.text +_getuid: move.w #0x18,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/gtty.s b/mach/m68k2/libsys/gtty.s new file mode 100644 index 00000000..ee9f096c --- /dev/null +++ b/mach/m68k2/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/m68k2/libsys/ioctl.s b/mach/m68k2/libsys/ioctl.s new file mode 100644 index 00000000..75d16214 --- /dev/null +++ b/mach/m68k2/libsys/ioctl.s @@ -0,0 +1,9 @@ +.define _ioctl +.extern _ioctl +.text +_ioctl: move.w #0x36,d0 + move.w 4(sp),a0 + move.w 6(sp),d1 + ext.l d1 + move.l 8(sp),a1 + jmp callc diff --git a/mach/m68k2/libsys/kill.s b/mach/m68k2/libsys/kill.s new file mode 100644 index 00000000..c5c4038c --- /dev/null +++ b/mach/m68k2/libsys/kill.s @@ -0,0 +1,8 @@ +.define _kill +.extern _kill +.text +_kill: move.w #0x25,d0 + move.w 4(sp),a0 + move.w 6(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k2/libsys/link.s b/mach/m68k2/libsys/link.s new file mode 100644 index 00000000..161ca6d1 --- /dev/null +++ b/mach/m68k2/libsys/link.s @@ -0,0 +1,8 @@ +.define _link +.extern _link +.text +_link: move.w #0x9,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k2/libsys/lseek.s b/mach/m68k2/libsys/lseek.s new file mode 100644 index 00000000..96f670e7 --- /dev/null +++ b/mach/m68k2/libsys/lseek.s @@ -0,0 +1,8 @@ +.define _lseek +.extern _lseek +.text +_lseek: move.w #0x13,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call diff --git a/mach/m68k2/libsys/mknod.s b/mach/m68k2/libsys/mknod.s new file mode 100644 index 00000000..21d86ad0 --- /dev/null +++ b/mach/m68k2/libsys/mknod.s @@ -0,0 +1,9 @@ +.define _mknod +.extern _mknod +.text +_mknod: move.w #0xE,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + move.w 10(sp),a1 + jmp callc diff --git a/mach/m68k2/libsys/mount.s b/mach/m68k2/libsys/mount.s new file mode 100644 index 00000000..b7d37737 --- /dev/null +++ b/mach/m68k2/libsys/mount.s @@ -0,0 +1,9 @@ + +.define _mount +.extern _mount +.text +_mount: move.w #0x15,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp callc diff --git a/mach/m68k2/libsys/nice.s b/mach/m68k2/libsys/nice.s new file mode 100644 index 00000000..4929617b --- /dev/null +++ b/mach/m68k2/libsys/nice.s @@ -0,0 +1,6 @@ +.define _nice +.extern _nice +.text +_nice: move.w #0x22,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/open.s b/mach/m68k2/libsys/open.s new file mode 100644 index 00000000..04b3b505 --- /dev/null +++ b/mach/m68k2/libsys/open.s @@ -0,0 +1,8 @@ +.define _open +.extern _open +.text +_open: move.w #0x5,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp call diff --git a/mach/m68k2/libsys/pause.s b/mach/m68k2/libsys/pause.s new file mode 100644 index 00000000..53b99d73 --- /dev/null +++ b/mach/m68k2/libsys/pause.s @@ -0,0 +1,6 @@ +.define _pause +.extern _pause +.text +_pause: move.w #0x1D,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/read.s b/mach/m68k2/libsys/read.s new file mode 100644 index 00000000..a5e0449a --- /dev/null +++ b/mach/m68k2/libsys/read.s @@ -0,0 +1,8 @@ +.define _read +.extern _read +.text +_read: move.w #0x3,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call diff --git a/mach/m68k2/libsys/setgid.s b/mach/m68k2/libsys/setgid.s new file mode 100644 index 00000000..5ad03004 --- /dev/null +++ b/mach/m68k2/libsys/setgid.s @@ -0,0 +1,6 @@ +.define _setgid +.extern _setgid +.text +_setgid: move.w #0x2E,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/setuid.s b/mach/m68k2/libsys/setuid.s new file mode 100644 index 00000000..94cc45ef --- /dev/null +++ b/mach/m68k2/libsys/setuid.s @@ -0,0 +1,6 @@ +.define _setuid +.extern _setuid +.text +_setuid: move.w #0x17,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/signal.s b/mach/m68k2/libsys/signal.s new file mode 100644 index 00000000..8f18c1f8 --- /dev/null +++ b/mach/m68k2/libsys/signal.s @@ -0,0 +1,49 @@ +.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 d0,a0 + move.w #0x30,d0 + trap #0 + 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/m68k2/libsys/stat.s b/mach/m68k2/libsys/stat.s new file mode 100644 index 00000000..304c38b1 --- /dev/null +++ b/mach/m68k2/libsys/stat.s @@ -0,0 +1,8 @@ +.define _stat +.extern _stat +.text +_stat: move.w #0x12,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k2/libsys/stime.s b/mach/m68k2/libsys/stime.s new file mode 100644 index 00000000..bac6386d --- /dev/null +++ b/mach/m68k2/libsys/stime.s @@ -0,0 +1,11 @@ +.define _stime +.extern _stime +.text +_stime: move.w #0x19,d0 + move.l 4(sp),a0 + move.l (a0),a0 + trap #0 + bcs 1f + rts +1: + jmp cerror diff --git a/mach/m68k2/libsys/stty.s b/mach/m68k2/libsys/stty.s new file mode 100644 index 00000000..46a497cd --- /dev/null +++ b/mach/m68k2/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/m68k2/libsys/sync.s b/mach/m68k2/libsys/sync.s new file mode 100644 index 00000000..3c38a8ad --- /dev/null +++ b/mach/m68k2/libsys/sync.s @@ -0,0 +1,6 @@ +.define _sync +.extern _sync +.text +_sync: move.w #0x24,d0 + trap #0 + rts diff --git a/mach/m68k2/libsys/time.s b/mach/m68k2/libsys/time.s new file mode 100644 index 00000000..87b9d8bd --- /dev/null +++ b/mach/m68k2/libsys/time.s @@ -0,0 +1,11 @@ +.define _time +.extern _time +.text +_time: move.w #0xD,d0 + trap #0 + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d0,(a0) +1: + rts diff --git a/mach/m68k2/libsys/times.s b/mach/m68k2/libsys/times.s new file mode 100644 index 00000000..002f63be --- /dev/null +++ b/mach/m68k2/libsys/times.s @@ -0,0 +1,7 @@ +.define _times +.extern _times +.text +_times: move.w #0x2B,d0 + move.w 4(sp),a0 + trap #0 + rts diff --git a/mach/m68k2/libsys/umount.s b/mach/m68k2/libsys/umount.s new file mode 100644 index 00000000..59354ee9 --- /dev/null +++ b/mach/m68k2/libsys/umount.s @@ -0,0 +1,6 @@ +.define _umount +.extern _umount +.text +_umount: move.w #0x16,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/unlink.s b/mach/m68k2/libsys/unlink.s new file mode 100644 index 00000000..99e856a5 --- /dev/null +++ b/mach/m68k2/libsys/unlink.s @@ -0,0 +1,6 @@ +.define _unlink +.extern _unlink +.text +_unlink: move.w #0xA,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k2/libsys/wait.s b/mach/m68k2/libsys/wait.s new file mode 100644 index 00000000..a0ea1a5e --- /dev/null +++ b/mach/m68k2/libsys/wait.s @@ -0,0 +1,12 @@ +.define _wait +.extern _wait +_wait: move.w #0x7,d0 + move.l 4(sp),a0 + trap #0 + bcs cerror + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.w d1,(a0) +1: + rts diff --git a/mach/m68k2/libsys/write.s b/mach/m68k2/libsys/write.s new file mode 100644 index 00000000..192d7adb --- /dev/null +++ b/mach/m68k2/libsys/write.s @@ -0,0 +1,8 @@ +.define _write +.extern _write +.text +_write: move.w #0x4,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call diff --git a/mach/m68k4/libsys/LIST b/mach/m68k4/libsys/LIST new file mode 100644 index 00000000..4fccdc16 --- /dev/null +++ b/mach/m68k4/libsys/LIST @@ -0,0 +1,45 @@ +tail_mon.a +exit.s +_exit.s +access.s +alarm.s +chdir.s +chmod.s +chroot.s +close.s +creat.s +execl.s +execve.s +fork.s +getegid.s +getgid.s +getpid.s +getuid.s +stty.s +gtty.s +ioctl.s +kill.s +link.s +lseek.s +mknod.s +mount.s +nice.s +open.s +pause.s +read.s +setgid.s +setuid.s +stat.s +stime.s +sync.s +time.s +times.s +umount.s +unlink.s +write.s +brk.s +wait.s +fstat.s +signal.s +call.s +cleanup.s diff --git a/mach/m68k4/libsys/_exit.s b/mach/m68k4/libsys/_exit.s new file mode 100644 index 00000000..398c9390 --- /dev/null +++ b/mach/m68k4/libsys/_exit.s @@ -0,0 +1,6 @@ +.define __exit +.extern __exit +.text +__exit: move.w #0x1,d0 + move.w 4(sp),a0 + trap #0 diff --git a/mach/m68k4/libsys/access.s b/mach/m68k4/libsys/access.s new file mode 100644 index 00000000..fdceffbf --- /dev/null +++ b/mach/m68k4/libsys/access.s @@ -0,0 +1,8 @@ +.define _access +.extern _access +.text +_access: move.w #0x21,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k4/libsys/alarm.s b/mach/m68k4/libsys/alarm.s new file mode 100644 index 00000000..98781a70 --- /dev/null +++ b/mach/m68k4/libsys/alarm.s @@ -0,0 +1,9 @@ +.define _alarm +.extern _alarm +.text +_alarm: clr.l d0 + move.w 4(sp),d0 + move.l d0,a0 + move.w #0x1B,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/brk.s b/mach/m68k4/libsys/brk.s new file mode 100644 index 00000000..f337c053 --- /dev/null +++ b/mach/m68k4/libsys/brk.s @@ -0,0 +1,25 @@ +.define _brk +.define _sbrk +.extern _brk +.extern _sbrk +.text +_sbrk: move.l nd,d0 + add.l d0, 4(sp) + move.w #0x11,d0 + move.l 4(sp),a0 + trap #0 + bcs lcerror + move.l nd,d0 + move.l 4(sp),nd + rts +lcerror: jmp cerror +_brk: move.w #0x11,d0 + move.l 4(sp),a0 + trap #0 + bcs lcerror + move.l 4(sp),nd + clr.l d0 + rts +.data +nd: .long endbss +.text diff --git a/mach/m68k4/libsys/call.s b/mach/m68k4/libsys/call.s new file mode 100644 index 00000000..846fb779 --- /dev/null +++ b/mach/m68k4/libsys/call.s @@ -0,0 +1,28 @@ +.define call +.define callc +.define calle +.define cerror +.define _errno +.extern call +.extern callc +.extern calle +.extern cerror +.extern _errno +.text +call: trap #0 + bcs cerror + rts +callc: + trap #0 + bcs cerror + clr.l d0 + rts +calle: + trap #0 +cerror: + move.w d0,_errno + move.l #-1,d0 + rts +.bss +_errno: .space 4 +.text diff --git a/mach/m68k4/libsys/chdir.s b/mach/m68k4/libsys/chdir.s new file mode 100644 index 00000000..d03224ae --- /dev/null +++ b/mach/m68k4/libsys/chdir.s @@ -0,0 +1,6 @@ +.define _chdir +.extern _chdir +.text +_chdir: move.w #0xC,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/chmod.s b/mach/m68k4/libsys/chmod.s new file mode 100644 index 00000000..6c86e3a2 --- /dev/null +++ b/mach/m68k4/libsys/chmod.s @@ -0,0 +1,8 @@ +.define _chmod +.extern _chmod +.text +_chmod: move.w #0xF,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k4/libsys/chroot.s b/mach/m68k4/libsys/chroot.s new file mode 100644 index 00000000..ebf9f6a4 --- /dev/null +++ b/mach/m68k4/libsys/chroot.s @@ -0,0 +1,6 @@ +.define _chroot +.extern _chroot +.text +_chroot: move.w #0x3D,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/cleanup.s b/mach/m68k4/libsys/cleanup.s new file mode 100644 index 00000000..7df1860b --- /dev/null +++ b/mach/m68k4/libsys/cleanup.s @@ -0,0 +1,8 @@ +.define __cleanup +.extern __cleanup +.text +__cleanup: +tst.b -40(sp) +link a6,#-0 +unlk a6 +rts diff --git a/mach/m68k4/libsys/close.s b/mach/m68k4/libsys/close.s new file mode 100644 index 00000000..add7e701 --- /dev/null +++ b/mach/m68k4/libsys/close.s @@ -0,0 +1,6 @@ +.define _close +.extern _close +.text +_close: move.w #0x6,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/creat.s b/mach/m68k4/libsys/creat.s new file mode 100644 index 00000000..73e7db84 --- /dev/null +++ b/mach/m68k4/libsys/creat.s @@ -0,0 +1,8 @@ +.define _creat +.extern _creat +.text +_creat: move.w #0x8,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp call diff --git a/mach/m68k4/libsys/execl.s b/mach/m68k4/libsys/execl.s new file mode 100644 index 00000000..21e03dc9 --- /dev/null +++ b/mach/m68k4/libsys/execl.s @@ -0,0 +1,11 @@ +.define _execl +.extern _execl +_execl: link a6,#0 + tst.b -132(sp) + move.l _environ,-(sp) + pea 12(sp) + move.l 8(a6),-(sp) + jsr _execve + add.l #0xC,sp + unlk a6 + rts diff --git a/mach/m68k4/libsys/execve.s b/mach/m68k4/libsys/execve.s new file mode 100644 index 00000000..2b2de5f8 --- /dev/null +++ b/mach/m68k4/libsys/execve.s @@ -0,0 +1,8 @@ +.define _execve +.extern _execve +.text +_execve: move.w #0x3B,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp calle diff --git a/mach/m68k4/libsys/exit.s b/mach/m68k4/libsys/exit.s new file mode 100644 index 00000000..d766750e --- /dev/null +++ b/mach/m68k4/libsys/exit.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/m68k4/libsys/fork.s b/mach/m68k4/libsys/fork.s new file mode 100644 index 00000000..0401e631 --- /dev/null +++ b/mach/m68k4/libsys/fork.s @@ -0,0 +1,13 @@ +.define _fork +.extern _fork +.text +_fork: move.w #0x2,d0 + trap #0 + bra 1f + bcc 2f + jmp cerror +1: + !move.l d0,p_uid + clr.l d0 +2: + rts diff --git a/mach/m68k4/libsys/fstat.s b/mach/m68k4/libsys/fstat.s new file mode 100644 index 00000000..1dd3d66c --- /dev/null +++ b/mach/m68k4/libsys/fstat.s @@ -0,0 +1,6 @@ +.define _fstat +.extern _fstat +_fstat: move.w #0x1C,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + jmp callc diff --git a/mach/m68k4/libsys/getegid.s b/mach/m68k4/libsys/getegid.s new file mode 100644 index 00000000..b4da40c1 --- /dev/null +++ b/mach/m68k4/libsys/getegid.s @@ -0,0 +1,7 @@ +.define _getegid +.extern _getegid +.text +_getegid: move.w #0x2F,d0 + trap #0 + move.l d1,d0 + rts diff --git a/mach/m68k4/libsys/getgid.s b/mach/m68k4/libsys/getgid.s new file mode 100644 index 00000000..3ef4def3 --- /dev/null +++ b/mach/m68k4/libsys/getgid.s @@ -0,0 +1,6 @@ +.define _getgid +.extern _getgid +.text +_getgid: move.w #0x2F,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/getpid.s b/mach/m68k4/libsys/getpid.s new file mode 100644 index 00000000..1bf2aba7 --- /dev/null +++ b/mach/m68k4/libsys/getpid.s @@ -0,0 +1,6 @@ +.define _getpid +.extern _getpid +.text +_getpid: move.w #0x14,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/getuid.s b/mach/m68k4/libsys/getuid.s new file mode 100644 index 00000000..d0e15a1b --- /dev/null +++ b/mach/m68k4/libsys/getuid.s @@ -0,0 +1,6 @@ +.define _getuid +.extern _getuid +.text +_getuid: move.w #0x18,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/gtty.s b/mach/m68k4/libsys/gtty.s new file mode 100644 index 00000000..ee9f096c --- /dev/null +++ b/mach/m68k4/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/m68k4/libsys/ioctl.s b/mach/m68k4/libsys/ioctl.s new file mode 100644 index 00000000..75d16214 --- /dev/null +++ b/mach/m68k4/libsys/ioctl.s @@ -0,0 +1,9 @@ +.define _ioctl +.extern _ioctl +.text +_ioctl: move.w #0x36,d0 + move.w 4(sp),a0 + move.w 6(sp),d1 + ext.l d1 + move.l 8(sp),a1 + jmp callc diff --git a/mach/m68k4/libsys/kill.s b/mach/m68k4/libsys/kill.s new file mode 100644 index 00000000..c5c4038c --- /dev/null +++ b/mach/m68k4/libsys/kill.s @@ -0,0 +1,8 @@ +.define _kill +.extern _kill +.text +_kill: move.w #0x25,d0 + move.w 4(sp),a0 + move.w 6(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k4/libsys/link.s b/mach/m68k4/libsys/link.s new file mode 100644 index 00000000..161ca6d1 --- /dev/null +++ b/mach/m68k4/libsys/link.s @@ -0,0 +1,8 @@ +.define _link +.extern _link +.text +_link: move.w #0x9,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k4/libsys/lseek.s b/mach/m68k4/libsys/lseek.s new file mode 100644 index 00000000..96f670e7 --- /dev/null +++ b/mach/m68k4/libsys/lseek.s @@ -0,0 +1,8 @@ +.define _lseek +.extern _lseek +.text +_lseek: move.w #0x13,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call diff --git a/mach/m68k4/libsys/mknod.s b/mach/m68k4/libsys/mknod.s new file mode 100644 index 00000000..21d86ad0 --- /dev/null +++ b/mach/m68k4/libsys/mknod.s @@ -0,0 +1,9 @@ +.define _mknod +.extern _mknod +.text +_mknod: move.w #0xE,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + move.w 10(sp),a1 + jmp callc diff --git a/mach/m68k4/libsys/mount.s b/mach/m68k4/libsys/mount.s new file mode 100644 index 00000000..b7d37737 --- /dev/null +++ b/mach/m68k4/libsys/mount.s @@ -0,0 +1,9 @@ + +.define _mount +.extern _mount +.text +_mount: move.w #0x15,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp callc diff --git a/mach/m68k4/libsys/nice.s b/mach/m68k4/libsys/nice.s new file mode 100644 index 00000000..4929617b --- /dev/null +++ b/mach/m68k4/libsys/nice.s @@ -0,0 +1,6 @@ +.define _nice +.extern _nice +.text +_nice: move.w #0x22,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/open.s b/mach/m68k4/libsys/open.s new file mode 100644 index 00000000..04b3b505 --- /dev/null +++ b/mach/m68k4/libsys/open.s @@ -0,0 +1,8 @@ +.define _open +.extern _open +.text +_open: move.w #0x5,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp call diff --git a/mach/m68k4/libsys/pause.s b/mach/m68k4/libsys/pause.s new file mode 100644 index 00000000..53b99d73 --- /dev/null +++ b/mach/m68k4/libsys/pause.s @@ -0,0 +1,6 @@ +.define _pause +.extern _pause +.text +_pause: move.w #0x1D,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/read.s b/mach/m68k4/libsys/read.s new file mode 100644 index 00000000..a5e0449a --- /dev/null +++ b/mach/m68k4/libsys/read.s @@ -0,0 +1,8 @@ +.define _read +.extern _read +.text +_read: move.w #0x3,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call diff --git a/mach/m68k4/libsys/setgid.s b/mach/m68k4/libsys/setgid.s new file mode 100644 index 00000000..5ad03004 --- /dev/null +++ b/mach/m68k4/libsys/setgid.s @@ -0,0 +1,6 @@ +.define _setgid +.extern _setgid +.text +_setgid: move.w #0x2E,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/setuid.s b/mach/m68k4/libsys/setuid.s new file mode 100644 index 00000000..94cc45ef --- /dev/null +++ b/mach/m68k4/libsys/setuid.s @@ -0,0 +1,6 @@ +.define _setuid +.extern _setuid +.text +_setuid: move.w #0x17,d0 + move.w 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/signal.s b/mach/m68k4/libsys/signal.s new file mode 100644 index 00000000..8f18c1f8 --- /dev/null +++ b/mach/m68k4/libsys/signal.s @@ -0,0 +1,49 @@ +.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 d0,a0 + move.w #0x30,d0 + trap #0 + 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/m68k4/libsys/stat.s b/mach/m68k4/libsys/stat.s new file mode 100644 index 00000000..304c38b1 --- /dev/null +++ b/mach/m68k4/libsys/stat.s @@ -0,0 +1,8 @@ +.define _stat +.extern _stat +.text +_stat: move.w #0x12,d0 + move.l 4(sp),a0 + move.w 8(sp),d1 + ext.l d1 + jmp callc diff --git a/mach/m68k4/libsys/stime.s b/mach/m68k4/libsys/stime.s new file mode 100644 index 00000000..bac6386d --- /dev/null +++ b/mach/m68k4/libsys/stime.s @@ -0,0 +1,11 @@ +.define _stime +.extern _stime +.text +_stime: move.w #0x19,d0 + move.l 4(sp),a0 + move.l (a0),a0 + trap #0 + bcs 1f + rts +1: + jmp cerror diff --git a/mach/m68k4/libsys/stty.s b/mach/m68k4/libsys/stty.s new file mode 100644 index 00000000..46a497cd --- /dev/null +++ b/mach/m68k4/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/m68k4/libsys/sync.s b/mach/m68k4/libsys/sync.s new file mode 100644 index 00000000..3c38a8ad --- /dev/null +++ b/mach/m68k4/libsys/sync.s @@ -0,0 +1,6 @@ +.define _sync +.extern _sync +.text +_sync: move.w #0x24,d0 + trap #0 + rts diff --git a/mach/m68k4/libsys/time.s b/mach/m68k4/libsys/time.s new file mode 100644 index 00000000..87b9d8bd --- /dev/null +++ b/mach/m68k4/libsys/time.s @@ -0,0 +1,11 @@ +.define _time +.extern _time +.text +_time: move.w #0xD,d0 + trap #0 + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d0,(a0) +1: + rts diff --git a/mach/m68k4/libsys/times.s b/mach/m68k4/libsys/times.s new file mode 100644 index 00000000..002f63be --- /dev/null +++ b/mach/m68k4/libsys/times.s @@ -0,0 +1,7 @@ +.define _times +.extern _times +.text +_times: move.w #0x2B,d0 + move.w 4(sp),a0 + trap #0 + rts diff --git a/mach/m68k4/libsys/umount.s b/mach/m68k4/libsys/umount.s new file mode 100644 index 00000000..59354ee9 --- /dev/null +++ b/mach/m68k4/libsys/umount.s @@ -0,0 +1,6 @@ +.define _umount +.extern _umount +.text +_umount: move.w #0x16,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/unlink.s b/mach/m68k4/libsys/unlink.s new file mode 100644 index 00000000..99e856a5 --- /dev/null +++ b/mach/m68k4/libsys/unlink.s @@ -0,0 +1,6 @@ +.define _unlink +.extern _unlink +.text +_unlink: move.w #0xA,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/m68k4/libsys/wait.s b/mach/m68k4/libsys/wait.s new file mode 100644 index 00000000..a0ea1a5e --- /dev/null +++ b/mach/m68k4/libsys/wait.s @@ -0,0 +1,12 @@ +.define _wait +.extern _wait +_wait: move.w #0x7,d0 + move.l 4(sp),a0 + trap #0 + bcs cerror + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.w d1,(a0) +1: + rts diff --git a/mach/m68k4/libsys/write.s b/mach/m68k4/libsys/write.s new file mode 100644 index 00000000..192d7adb --- /dev/null +++ b/mach/m68k4/libsys/write.s @@ -0,0 +1,8 @@ +.define _write +.extern _write +.text +_write: move.w #0x4,d0 + move.w 4(sp),a0 + move.l 6(sp),d1 + move.w 10(sp),a1 + jmp call