diff --git a/mach/m68020/libsys/LIST b/mach/m68020/libsys/LIST index a1e04e318..cb419b950 100644 --- a/mach/m68020/libsys/LIST +++ b/mach/m68020/libsys/LIST @@ -6,53 +6,76 @@ _exit.s access.s acct.s alarm.s +_alarm.s chdir.s chmod.s chown.s chroot.s close.s +_close.s creat.s dup.s dup2.s +_dup2.s execl.s +_execl.s execve.s +_execve.s fork.s +_fork.s ftime.s +_ftime.s getegid.s getgid.s getpid.s +_getpid.s getuid.s stty.s gtty.s +_gtty.s ioctl.s +_ioctl.s kill.s +_kill.s link.s +_link.s lock.s lseek.s +_lseek.s mknod.s mount.s nice.s open.s +_open.s pause.s +_pause.s pipe.s +_pipe.s profil.s ptrace.s read.s +_read.s setgid.s setuid.s Xstat.c +_Xstat.c stat.s stime.s sync.s time.s times.s +_times.s umask.s umount.s unlink.s +_unlink.s utime.s write.s +_write.s brk.s +_brk.s wait.s +_wait.s fstat.s signal.s fcntl.s diff --git a/mach/m68020/libsys/Xstat.c b/mach/m68020/libsys/Xstat.c index b18276f4e..3569aac49 100644 --- a/mach/m68020/libsys/Xstat.c +++ b/mach/m68020/libsys/Xstat.c @@ -24,7 +24,7 @@ fstat(fd, buf) char Xbuf[100]; int retval; - retval = _fstat(fd, Xbuf); + retval = __fstat(fd, Xbuf); Xcvt(Xbuf, (char *)buf); return retval; } diff --git a/mach/m68020/libsys/_Xstat.c b/mach/m68020/libsys/_Xstat.c new file mode 100644 index 000000000..772200ec9 --- /dev/null +++ b/mach/m68020/libsys/_Xstat.c @@ -0,0 +1,30 @@ +#include +#include + +static Xcvt(); + +int +_fstat(fd, buf) + int fd; + struct stat *buf; +{ + char Xbuf[100]; + int retval; + + retval = __fstat(fd, Xbuf); + Xcvt(Xbuf, (char *)buf); + return retval; +} + +static +Xcvt(buf, statbuf) + char *buf, *statbuf; +{ + register char *s, *t; + register int i; + + s = buf; t = statbuf; + for (i = 14; i; i--) *t++ = *s++; + *t++ = 0; *t++ = 0; + for (i = 16; i; i--) *t++ = *s++; +} diff --git a/mach/m68020/libsys/_alarm.s b/mach/m68020/libsys/_alarm.s new file mode 100644 index 000000000..377a399bb --- /dev/null +++ b/mach/m68020/libsys/_alarm.s @@ -0,0 +1,10 @@ +.define __alarm +.extern __alarm +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__alarm: move.l #0x1B,d0 + trap #0 + rts diff --git a/mach/m68020/libsys/_brk.s b/mach/m68020/libsys/_brk.s new file mode 100644 index 000000000..36edc68c6 --- /dev/null +++ b/mach/m68020/libsys/_brk.s @@ -0,0 +1,25 @@ +.define __brk +.define __sbrk +.extern __brk +.extern __sbrk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__sbrk: move.l (.reghp),d0 + add.l d0,(4,sp) + move.l #0x11,d0 + trap #0 + bcs lcerror + move.l (.reghp),d0 + move.l d0,a0 + move.l (4,sp),(.reghp) + rts +lcerror: jmp (cerror) +__brk: move.l #0x11,d0 + trap #0 + bcs lcerror + move.l (4,sp),(.reghp) + clr.l d0 + rts diff --git a/mach/m68020/libsys/_close.s b/mach/m68020/libsys/_close.s new file mode 100644 index 000000000..962685191 --- /dev/null +++ b/mach/m68020/libsys/_close.s @@ -0,0 +1,9 @@ +.define __close +.extern __close +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__close: move.l #0x6,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_dup2.s b/mach/m68020/libsys/_dup2.s new file mode 100644 index 000000000..aee59b1c8 --- /dev/null +++ b/mach/m68020/libsys/_dup2.s @@ -0,0 +1,16 @@ +.define __dup2 +.extern __dup2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__dup2: +link a6,#0 +move.l (12,a6),-(sp) +move.l #0,-(sp) +move.l (8,a6),-(sp) +jsr (_fcntl) +add.l #12,sp +unlk a6 +rts diff --git a/mach/m68020/libsys/_execl.s b/mach/m68020/libsys/_execl.s new file mode 100644 index 000000000..a3716a522 --- /dev/null +++ b/mach/m68020/libsys/_execl.s @@ -0,0 +1,15 @@ +.define __execl +.extern __execl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__execl: link a6,#0 + move.l (_environ),-(sp) + pea (12,a6) + move.l (8,a6),-(sp) + jsr (_execve) + add.l #0xC,sp + unlk a6 + rts diff --git a/mach/m68020/libsys/_execve.s b/mach/m68020/libsys/_execve.s new file mode 100644 index 000000000..ec6b1758e --- /dev/null +++ b/mach/m68020/libsys/_execve.s @@ -0,0 +1,9 @@ +.define __execve +.extern __execve +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__execve: move.l #0x3B,d0 + jmp (calle) diff --git a/mach/m68020/libsys/_fork.s b/mach/m68020/libsys/_fork.s new file mode 100644 index 000000000..8dbca8096 --- /dev/null +++ b/mach/m68020/libsys/_fork.s @@ -0,0 +1,17 @@ +.define __fork +.extern __fork +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__fork: move.l #0x2,d0 + trap #0 + bcc 1f ! 68020 way to do it + jmp (cerror) +1: + tst.b d1 + beq 2f + clr.l d0 +2: + rts diff --git a/mach/m68020/libsys/_ftime.s b/mach/m68020/libsys/_ftime.s new file mode 100644 index 000000000..1e130a02c --- /dev/null +++ b/mach/m68020/libsys/_ftime.s @@ -0,0 +1,9 @@ +.define __ftime +.extern __ftime +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__ftime: move.l #0x23,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_getpid.s b/mach/m68020/libsys/_getpid.s new file mode 100644 index 000000000..6337be79b --- /dev/null +++ b/mach/m68020/libsys/_getpid.s @@ -0,0 +1,10 @@ +.define __getpid +.extern __getpid +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__getpid: move.l #0x14,d0 + trap #0 + rts diff --git a/mach/m68020/libsys/_gtty.s b/mach/m68020/libsys/_gtty.s new file mode 100644 index 000000000..03b2a7932 --- /dev/null +++ b/mach/m68020/libsys/_gtty.s @@ -0,0 +1,9 @@ +.define __gtty +.extern __gtty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__gtty: move.l #0x20, d0 + jmp (call) diff --git a/mach/m68020/libsys/_ioctl.s b/mach/m68020/libsys/_ioctl.s new file mode 100644 index 000000000..15e45a105 --- /dev/null +++ b/mach/m68020/libsys/_ioctl.s @@ -0,0 +1,9 @@ +.define __ioctl +.extern __ioctl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__ioctl: move.l #0x36,d0 + jmp (call) diff --git a/mach/m68020/libsys/_kill.s b/mach/m68020/libsys/_kill.s new file mode 100644 index 000000000..357e81cfb --- /dev/null +++ b/mach/m68020/libsys/_kill.s @@ -0,0 +1,9 @@ +.define __kill +.extern __kill +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__kill: move.l #0x25,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_link.s b/mach/m68020/libsys/_link.s new file mode 100644 index 000000000..0e62cbea6 --- /dev/null +++ b/mach/m68020/libsys/_link.s @@ -0,0 +1,9 @@ +.define __link +.extern __link +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__link: move.l #0x9,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_lseek.s b/mach/m68020/libsys/_lseek.s new file mode 100644 index 000000000..df03c9d49 --- /dev/null +++ b/mach/m68020/libsys/_lseek.s @@ -0,0 +1,9 @@ +.define __lseek +.extern __lseek +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__lseek: move.l #0x13,d0 + jmp (call) diff --git a/mach/m68020/libsys/_open.s b/mach/m68020/libsys/_open.s new file mode 100644 index 000000000..bbac720f1 --- /dev/null +++ b/mach/m68020/libsys/_open.s @@ -0,0 +1,9 @@ +.define __open +.extern __open +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__open: move.l #0x5,d0 + jmp (call) diff --git a/mach/m68020/libsys/_pause.s b/mach/m68020/libsys/_pause.s new file mode 100644 index 000000000..40e9dae8c --- /dev/null +++ b/mach/m68020/libsys/_pause.s @@ -0,0 +1,9 @@ +.define __pause +.extern __pause +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__pause: move.l #0x1D,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_pipe.s b/mach/m68020/libsys/_pipe.s new file mode 100644 index 000000000..b81fd43f5 --- /dev/null +++ b/mach/m68020/libsys/_pipe.s @@ -0,0 +1,18 @@ +.define __pipe +.extern __pipe +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__pipe: + move.l #0x2A,d0 + trap #0 + bcc 1f + jmp (cerror) +1: + move.l (4,sp),a0 + move.l d0,(a0)+ + move.l d1,(a0) + clr.l d0 + rts diff --git a/mach/m68020/libsys/_read.s b/mach/m68020/libsys/_read.s new file mode 100644 index 000000000..2f8483bae --- /dev/null +++ b/mach/m68020/libsys/_read.s @@ -0,0 +1,9 @@ +.define __read +.extern __read +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__read: move.l #0x3,d0 + jmp (call) diff --git a/mach/m68020/libsys/_times.s b/mach/m68020/libsys/_times.s new file mode 100644 index 000000000..40f7dcc45 --- /dev/null +++ b/mach/m68020/libsys/_times.s @@ -0,0 +1,10 @@ +.define __times +.extern __times +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__times: move.l #0x2B,d0 + trap #0 + jmp (call) diff --git a/mach/m68020/libsys/_unlink.s b/mach/m68020/libsys/_unlink.s new file mode 100644 index 000000000..e2c125977 --- /dev/null +++ b/mach/m68020/libsys/_unlink.s @@ -0,0 +1,9 @@ +.define __unlink +.extern __unlink +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__unlink: move.l #0xA,d0 + jmp (callc) diff --git a/mach/m68020/libsys/_wait.s b/mach/m68020/libsys/_wait.s new file mode 100644 index 000000000..2bf73ffcc --- /dev/null +++ b/mach/m68020/libsys/_wait.s @@ -0,0 +1,15 @@ +.define __wait +.extern __wait +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__wait: move.l #0x7,d0 + trap #0 + bcs cerror + tst.l (4,sp) + beq 1f + move.l d1,([4,sp]) +1: + rts diff --git a/mach/m68020/libsys/_write.s b/mach/m68020/libsys/_write.s new file mode 100644 index 000000000..e1fb2854b --- /dev/null +++ b/mach/m68020/libsys/_write.s @@ -0,0 +1,9 @@ +.define __write +.extern __write +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__write: move.l #0x4,d0 + jmp (call) diff --git a/mach/m68020/libsys/fstat.s b/mach/m68020/libsys/fstat.s index 13ca1aedd..30710281b 100644 --- a/mach/m68020/libsys/fstat.s +++ b/mach/m68020/libsys/fstat.s @@ -1,9 +1,9 @@ -.define __fstat -.extern __fstat +.define ___fstat +.extern ___fstat .sect .text .sect .rom .sect .data .sect .bss .sect .text -__fstat: move.l #0x1C,d0 +___fstat: move.l #0x1C,d0 jmp (callc)