added new routines for ansi

This commit is contained in:
eck 1990-01-22 08:51:54 +00:00
parent 66327ddda6
commit 9ee0876c2b
26 changed files with 310 additions and 4 deletions

View 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

View 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;
}

View file

@ -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++;
}

View file

@ -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

25
mach/m68020/libsys/_brk.s Normal file
View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -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)

View 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)