Initial revision
authorbal <none@none>
Fri, 14 Dec 1984 15:52:15 +0000 (15:52 +0000)
committerbal <none@none>
Fri, 14 Dec 1984 15:52:15 +0000 (15:52 +0000)
90 files changed:
mach/m68k2/libsys/LIST [new file with mode: 0644]
mach/m68k2/libsys/_exit.s [new file with mode: 0644]
mach/m68k2/libsys/access.s [new file with mode: 0644]
mach/m68k2/libsys/alarm.s [new file with mode: 0644]
mach/m68k2/libsys/brk.s [new file with mode: 0644]
mach/m68k2/libsys/call.s [new file with mode: 0644]
mach/m68k2/libsys/chdir.s [new file with mode: 0644]
mach/m68k2/libsys/chmod.s [new file with mode: 0644]
mach/m68k2/libsys/chroot.s [new file with mode: 0644]
mach/m68k2/libsys/cleanup.s [new file with mode: 0644]
mach/m68k2/libsys/close.s [new file with mode: 0644]
mach/m68k2/libsys/creat.s [new file with mode: 0644]
mach/m68k2/libsys/execl.s [new file with mode: 0644]
mach/m68k2/libsys/execve.s [new file with mode: 0644]
mach/m68k2/libsys/exit.s [new file with mode: 0644]
mach/m68k2/libsys/fork.s [new file with mode: 0644]
mach/m68k2/libsys/fstat.s [new file with mode: 0644]
mach/m68k2/libsys/getegid.s [new file with mode: 0644]
mach/m68k2/libsys/getgid.s [new file with mode: 0644]
mach/m68k2/libsys/getpid.s [new file with mode: 0644]
mach/m68k2/libsys/getuid.s [new file with mode: 0644]
mach/m68k2/libsys/gtty.s [new file with mode: 0644]
mach/m68k2/libsys/ioctl.s [new file with mode: 0644]
mach/m68k2/libsys/kill.s [new file with mode: 0644]
mach/m68k2/libsys/link.s [new file with mode: 0644]
mach/m68k2/libsys/lseek.s [new file with mode: 0644]
mach/m68k2/libsys/mknod.s [new file with mode: 0644]
mach/m68k2/libsys/mount.s [new file with mode: 0644]
mach/m68k2/libsys/nice.s [new file with mode: 0644]
mach/m68k2/libsys/open.s [new file with mode: 0644]
mach/m68k2/libsys/pause.s [new file with mode: 0644]
mach/m68k2/libsys/read.s [new file with mode: 0644]
mach/m68k2/libsys/setgid.s [new file with mode: 0644]
mach/m68k2/libsys/setuid.s [new file with mode: 0644]
mach/m68k2/libsys/signal.s [new file with mode: 0644]
mach/m68k2/libsys/stat.s [new file with mode: 0644]
mach/m68k2/libsys/stime.s [new file with mode: 0644]
mach/m68k2/libsys/stty.s [new file with mode: 0644]
mach/m68k2/libsys/sync.s [new file with mode: 0644]
mach/m68k2/libsys/time.s [new file with mode: 0644]
mach/m68k2/libsys/times.s [new file with mode: 0644]
mach/m68k2/libsys/umount.s [new file with mode: 0644]
mach/m68k2/libsys/unlink.s [new file with mode: 0644]
mach/m68k2/libsys/wait.s [new file with mode: 0644]
mach/m68k2/libsys/write.s [new file with mode: 0644]
mach/m68k4/libsys/LIST [new file with mode: 0644]
mach/m68k4/libsys/_exit.s [new file with mode: 0644]
mach/m68k4/libsys/access.s [new file with mode: 0644]
mach/m68k4/libsys/alarm.s [new file with mode: 0644]
mach/m68k4/libsys/brk.s [new file with mode: 0644]
mach/m68k4/libsys/call.s [new file with mode: 0644]
mach/m68k4/libsys/chdir.s [new file with mode: 0644]
mach/m68k4/libsys/chmod.s [new file with mode: 0644]
mach/m68k4/libsys/chroot.s [new file with mode: 0644]
mach/m68k4/libsys/cleanup.s [new file with mode: 0644]
mach/m68k4/libsys/close.s [new file with mode: 0644]
mach/m68k4/libsys/creat.s [new file with mode: 0644]
mach/m68k4/libsys/execl.s [new file with mode: 0644]
mach/m68k4/libsys/execve.s [new file with mode: 0644]
mach/m68k4/libsys/exit.s [new file with mode: 0644]
mach/m68k4/libsys/fork.s [new file with mode: 0644]
mach/m68k4/libsys/fstat.s [new file with mode: 0644]
mach/m68k4/libsys/getegid.s [new file with mode: 0644]
mach/m68k4/libsys/getgid.s [new file with mode: 0644]
mach/m68k4/libsys/getpid.s [new file with mode: 0644]
mach/m68k4/libsys/getuid.s [new file with mode: 0644]
mach/m68k4/libsys/gtty.s [new file with mode: 0644]
mach/m68k4/libsys/ioctl.s [new file with mode: 0644]
mach/m68k4/libsys/kill.s [new file with mode: 0644]
mach/m68k4/libsys/link.s [new file with mode: 0644]
mach/m68k4/libsys/lseek.s [new file with mode: 0644]
mach/m68k4/libsys/mknod.s [new file with mode: 0644]
mach/m68k4/libsys/mount.s [new file with mode: 0644]
mach/m68k4/libsys/nice.s [new file with mode: 0644]
mach/m68k4/libsys/open.s [new file with mode: 0644]
mach/m68k4/libsys/pause.s [new file with mode: 0644]
mach/m68k4/libsys/read.s [new file with mode: 0644]
mach/m68k4/libsys/setgid.s [new file with mode: 0644]
mach/m68k4/libsys/setuid.s [new file with mode: 0644]
mach/m68k4/libsys/signal.s [new file with mode: 0644]
mach/m68k4/libsys/stat.s [new file with mode: 0644]
mach/m68k4/libsys/stime.s [new file with mode: 0644]
mach/m68k4/libsys/stty.s [new file with mode: 0644]
mach/m68k4/libsys/sync.s [new file with mode: 0644]
mach/m68k4/libsys/time.s [new file with mode: 0644]
mach/m68k4/libsys/times.s [new file with mode: 0644]
mach/m68k4/libsys/umount.s [new file with mode: 0644]
mach/m68k4/libsys/unlink.s [new file with mode: 0644]
mach/m68k4/libsys/wait.s [new file with mode: 0644]
mach/m68k4/libsys/write.s [new file with mode: 0644]

diff --git a/mach/m68k2/libsys/LIST b/mach/m68k2/libsys/LIST
new file mode 100644 (file)
index 0000000..4fccdc1
--- /dev/null
@@ -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 (file)
index 0000000..398c939
--- /dev/null
@@ -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 (file)
index 0000000..fdceffb
--- /dev/null
@@ -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 (file)
index 0000000..98781a7
--- /dev/null
@@ -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 (file)
index 0000000..f337c05
--- /dev/null
@@ -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 (file)
index 0000000..846fb77
--- /dev/null
@@ -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 (file)
index 0000000..d03224a
--- /dev/null
@@ -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 (file)
index 0000000..6c86e3a
--- /dev/null
@@ -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 (file)
index 0000000..ebf9f6a
--- /dev/null
@@ -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 (file)
index 0000000..7df1860
--- /dev/null
@@ -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 (file)
index 0000000..add7e70
--- /dev/null
@@ -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 (file)
index 0000000..73e7db8
--- /dev/null
@@ -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 (file)
index 0000000..21e03dc
--- /dev/null
@@ -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 (file)
index 0000000..2b2de5f
--- /dev/null
@@ -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 (file)
index 0000000..d766750
--- /dev/null
@@ -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 (file)
index 0000000..0401e63
--- /dev/null
@@ -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 (file)
index 0000000..1dd3d66
--- /dev/null
@@ -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 (file)
index 0000000..b4da40c
--- /dev/null
@@ -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 (file)
index 0000000..3ef4def
--- /dev/null
@@ -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 (file)
index 0000000..1bf2aba
--- /dev/null
@@ -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 (file)
index 0000000..d0e15a1
--- /dev/null
@@ -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 (file)
index 0000000..ee9f096
--- /dev/null
@@ -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 (file)
index 0000000..75d1621
--- /dev/null
@@ -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 (file)
index 0000000..c5c4038
--- /dev/null
@@ -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 (file)
index 0000000..161ca6d
--- /dev/null
@@ -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 (file)
index 0000000..96f670e
--- /dev/null
@@ -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 (file)
index 0000000..21d86ad
--- /dev/null
@@ -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 (file)
index 0000000..b7d3773
--- /dev/null
@@ -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 (file)
index 0000000..4929617
--- /dev/null
@@ -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 (file)
index 0000000..04b3b50
--- /dev/null
@@ -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 (file)
index 0000000..53b99d7
--- /dev/null
@@ -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 (file)
index 0000000..a5e0449
--- /dev/null
@@ -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 (file)
index 0000000..5ad0300
--- /dev/null
@@ -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 (file)
index 0000000..94cc45e
--- /dev/null
@@ -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 (file)
index 0000000..8f18c1f
--- /dev/null
@@ -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 (file)
index 0000000..304c38b
--- /dev/null
@@ -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 (file)
index 0000000..bac6386
--- /dev/null
@@ -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 (file)
index 0000000..46a497c
--- /dev/null
@@ -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 (file)
index 0000000..3c38a8a
--- /dev/null
@@ -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 (file)
index 0000000..87b9d8b
--- /dev/null
@@ -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 (file)
index 0000000..002f63b
--- /dev/null
@@ -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 (file)
index 0000000..59354ee
--- /dev/null
@@ -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 (file)
index 0000000..99e856a
--- /dev/null
@@ -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 (file)
index 0000000..a0ea1a5
--- /dev/null
@@ -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 (file)
index 0000000..192d7ad
--- /dev/null
@@ -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 (file)
index 0000000..4fccdc1
--- /dev/null
@@ -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 (file)
index 0000000..398c939
--- /dev/null
@@ -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 (file)
index 0000000..fdceffb
--- /dev/null
@@ -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 (file)
index 0000000..98781a7
--- /dev/null
@@ -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 (file)
index 0000000..f337c05
--- /dev/null
@@ -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 (file)
index 0000000..846fb77
--- /dev/null
@@ -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 (file)
index 0000000..d03224a
--- /dev/null
@@ -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 (file)
index 0000000..6c86e3a
--- /dev/null
@@ -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 (file)
index 0000000..ebf9f6a
--- /dev/null
@@ -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 (file)
index 0000000..7df1860
--- /dev/null
@@ -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 (file)
index 0000000..add7e70
--- /dev/null
@@ -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 (file)
index 0000000..73e7db8
--- /dev/null
@@ -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 (file)
index 0000000..21e03dc
--- /dev/null
@@ -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 (file)
index 0000000..2b2de5f
--- /dev/null
@@ -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 (file)
index 0000000..d766750
--- /dev/null
@@ -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 (file)
index 0000000..0401e63
--- /dev/null
@@ -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 (file)
index 0000000..1dd3d66
--- /dev/null
@@ -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 (file)
index 0000000..b4da40c
--- /dev/null
@@ -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 (file)
index 0000000..3ef4def
--- /dev/null
@@ -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 (file)
index 0000000..1bf2aba
--- /dev/null
@@ -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 (file)
index 0000000..d0e15a1
--- /dev/null
@@ -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 (file)
index 0000000..ee9f096
--- /dev/null
@@ -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 (file)
index 0000000..75d1621
--- /dev/null
@@ -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 (file)
index 0000000..c5c4038
--- /dev/null
@@ -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 (file)
index 0000000..161ca6d
--- /dev/null
@@ -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 (file)
index 0000000..96f670e
--- /dev/null
@@ -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 (file)
index 0000000..21d86ad
--- /dev/null
@@ -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 (file)
index 0000000..b7d3773
--- /dev/null
@@ -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 (file)
index 0000000..4929617
--- /dev/null
@@ -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 (file)
index 0000000..04b3b50
--- /dev/null
@@ -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 (file)
index 0000000..53b99d7
--- /dev/null
@@ -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 (file)
index 0000000..a5e0449
--- /dev/null
@@ -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 (file)
index 0000000..5ad0300
--- /dev/null
@@ -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 (file)
index 0000000..94cc45e
--- /dev/null
@@ -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 (file)
index 0000000..8f18c1f
--- /dev/null
@@ -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 (file)
index 0000000..304c38b
--- /dev/null
@@ -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 (file)
index 0000000..bac6386
--- /dev/null
@@ -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 (file)
index 0000000..46a497c
--- /dev/null
@@ -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 (file)
index 0000000..3c38a8a
--- /dev/null
@@ -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 (file)
index 0000000..87b9d8b
--- /dev/null
@@ -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 (file)
index 0000000..002f63b
--- /dev/null
@@ -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 (file)
index 0000000..59354ee
--- /dev/null
@@ -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 (file)
index 0000000..99e856a
--- /dev/null
@@ -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 (file)
index 0000000..a0ea1a5
--- /dev/null
@@ -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 (file)
index 0000000..192d7ad
--- /dev/null
@@ -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