added new routines for ansi
authoreck <none@none>
Mon, 22 Jan 1990 08:51:54 +0000 (08:51 +0000)
committereck <none@none>
Mon, 22 Jan 1990 08:51:54 +0000 (08:51 +0000)
26 files changed:
mach/m68020/libsys/LIST
mach/m68020/libsys/Xstat.c
mach/m68020/libsys/_Xstat.c [new file with mode: 0644]
mach/m68020/libsys/_alarm.s [new file with mode: 0644]
mach/m68020/libsys/_brk.s [new file with mode: 0644]
mach/m68020/libsys/_close.s [new file with mode: 0644]
mach/m68020/libsys/_dup2.s [new file with mode: 0644]
mach/m68020/libsys/_execl.s [new file with mode: 0644]
mach/m68020/libsys/_execve.s [new file with mode: 0644]
mach/m68020/libsys/_fork.s [new file with mode: 0644]
mach/m68020/libsys/_ftime.s [new file with mode: 0644]
mach/m68020/libsys/_getpid.s [new file with mode: 0644]
mach/m68020/libsys/_gtty.s [new file with mode: 0644]
mach/m68020/libsys/_ioctl.s [new file with mode: 0644]
mach/m68020/libsys/_kill.s [new file with mode: 0644]
mach/m68020/libsys/_link.s [new file with mode: 0644]
mach/m68020/libsys/_lseek.s [new file with mode: 0644]
mach/m68020/libsys/_open.s [new file with mode: 0644]
mach/m68020/libsys/_pause.s [new file with mode: 0644]
mach/m68020/libsys/_pipe.s [new file with mode: 0644]
mach/m68020/libsys/_read.s [new file with mode: 0644]
mach/m68020/libsys/_times.s [new file with mode: 0644]
mach/m68020/libsys/_unlink.s [new file with mode: 0644]
mach/m68020/libsys/_wait.s [new file with mode: 0644]
mach/m68020/libsys/_write.s [new file with mode: 0644]
mach/m68020/libsys/fstat.s

index a1e04e3..cb419b9 100644 (file)
@@ -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
index b18276f..3569aac 100644 (file)
@@ -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 (file)
index 0000000..772200e
--- /dev/null
@@ -0,0 +1,30 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+
+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 (file)
index 0000000..377a399
--- /dev/null
@@ -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 (file)
index 0000000..36edc68
--- /dev/null
@@ -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 (file)
index 0000000..9626851
--- /dev/null
@@ -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 (file)
index 0000000..aee59b1
--- /dev/null
@@ -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 (file)
index 0000000..a3716a5
--- /dev/null
@@ -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 (file)
index 0000000..ec6b175
--- /dev/null
@@ -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 (file)
index 0000000..8dbca80
--- /dev/null
@@ -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 (file)
index 0000000..1e130a0
--- /dev/null
@@ -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 (file)
index 0000000..6337be7
--- /dev/null
@@ -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 (file)
index 0000000..03b2a79
--- /dev/null
@@ -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 (file)
index 0000000..15e45a1
--- /dev/null
@@ -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 (file)
index 0000000..357e81c
--- /dev/null
@@ -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 (file)
index 0000000..0e62cbe
--- /dev/null
@@ -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 (file)
index 0000000..df03c9d
--- /dev/null
@@ -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 (file)
index 0000000..bbac720
--- /dev/null
@@ -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 (file)
index 0000000..40e9dae
--- /dev/null
@@ -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 (file)
index 0000000..b81fd43
--- /dev/null
@@ -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 (file)
index 0000000..2f8483b
--- /dev/null
@@ -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 (file)
index 0000000..40f7dcc
--- /dev/null
@@ -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 (file)
index 0000000..e2c1259
--- /dev/null
@@ -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 (file)
index 0000000..2bf73ff
--- /dev/null
@@ -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 (file)
index 0000000..e1fb285
--- /dev/null
@@ -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)
index 13ca1ae..3071028 100644 (file)
@@ -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)