Added sparc_solaris stuff

This commit is contained in:
ceriel 1993-10-06 17:04:49 +00:00
parent 980faf36f0
commit 9e7c8d2c9f
145 changed files with 955 additions and 0 deletions

View file

@ -0,0 +1,4 @@
LIST
libmon_s.a
head_em.s
SYS.h

View file

@ -0,0 +1,142 @@
libmon_s.a
_execl.c
cleanup.c
execl.c
execle.c
execv.c
exit.c
tell.c
signal.c
_alarm.s
_brk.s
_close.s
_creat.s
_dup.s
_dup2.s
_execve.s
_exit.s
_fork.s
_fstat.s
_getpid.s
_gtty.s
_ioctl.s
_kill.s
_link.s
_lseek.s
_open.s
_pause.s
_pipe.s
_read.s
_signal.s
_sig_catch.s
_stty.s
_times.s
_unlink.s
_wait.s
_write.s
access.s
acct.s
adjtime.s
alarm.s
brk.s
chdir.s
chmod.s
chown.s
chroot.s
close.s
creat.s
dup.s
dup2.s
execve.s
fchdir.s
fchmod.s
fchown.s
fchroot.s
fcntl.s
fork.s
fstat.s
fsync.s
ftruncate.s
getdents.s
getegid.s
geteuid.s
getgid.s
getgroups.s
getitimer.s
getmsg.s
getpgid.s
getpgrp.s
getpid.s
getpmsg.s
getppid.s
getrlimit.s
getsid.s
gettimeofday.s
getuid.s
gtty.s
ioctl.s
kill.s
lchown.s
link.s
lockf.s
lseek.s
lstat.s
mincore.s
mkdir.s
mknod.s
mmap.s
mount.s
mprotect.s
munmap.s
nice.s
open.s
pause.s
pipe.s
plock.s
poll.s
pread.s
profil.s
ptrace.s
putmsg.s
putpmsg.s
pwrite.s
read.s
readlink.s
readv.s
rename.s
rmdir.s
setegid.s
seteuid.s
setgid.s
setgroups.s
setitimer.s
setpgrp.s
setrlimit.s
setsid.s
settimeofday.s
setuid.s
sighold.s
sigignore.s
sigpause.s
sigrelse.s
sigset.s
stat.s
stime.s
stty.s
symlink.s
sync.s
time.s
times.s
truncate.s
ulimit.s
umask.s
umount.s
uname.s
unlink.s
utime.s
utimes.s
vfork.s
wait.s
write.s
writev.s
cerror.s

View file

@ -0,0 +1,119 @@
/*
SYS.h
*/
#ifndef SYS_H
#define SYS_H
#define SYS_call_0(x) \
LABEL_(x); \
BODY(x)
#define _SYS_call_0(x) \
LABEL__(x); \
BODY(x)
#define SYS_call_1(x) \
LABEL_(x); \
ENTRY1; \
BODY(x)
#define _SYS_call_1(x) \
LABEL__(x); \
ENTRY1; \
BODY(x)
#define SYS_call_2(x) \
LABEL_(x); \
ENTRY2; \
BODY(x)
#define _SYS_call_2(x) \
LABEL__(x); \
ENTRY2; \
BODY(x)
#define SYS_call_3(x) \
LABEL_(x); \
ENTRY3; \
BODY(x)
#define _SYS_call_3(x) \
LABEL__(x); \
ENTRY3; \
BODY(x)
#define SYS_call_4(x) \
LABEL_(x); \
ENTRY4; \
BODY(x)
#define _SYS_call_4(x) \
LABEL__(x); \
ENTRY4; \
BODY(x)
#define SYS_call_5(x) \
LABEL_(x); \
ENTRY5; \
BODY(x)
#define _SYS_call_5(x) \
LABEL__(x); \
ENTRY5; \
BODY(x)
#define SYS_call_6(x) \
LABEL_(x); \
ENTRY6; \
BODY(x)
#define _SYS_call_6(x) \
LABEL__(x); \
ENTRY6; \
BODY(x)
#define BODY(x) \
b x; \
nop
#if __STDC__
#define LABEL_(x) \
.global $ ## x; \
$ ## x:
#define LABEL__(x) \
.global $_ ## x; \
$_ ## x:
#else
#define LABEL_(x) \
.global $/**/x; \
$/**/x:
#define LABEL__(x) \
.global $_/**/x; \
$_/**/x:
#endif
#define ENTRY1 \
ld [%l0], %o0 \
#define ENTRY2 \
ENTRY1; \
ld [%l0+4], %o1 \
#define ENTRY3 \
ENTRY2; \
ld [%l0+8], %o2 \
#define ENTRY4 \
ENTRY3; \
ld [%l0+12], %o3 \
#define ENTRY5 \
ENTRY4; \
ld [%l0+16], %o4 \
#define ENTRY6 \
ENTRY5; \
ld [%l0+20], %o5 \
#endif /* SYS_H */

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(alarm)

View file

@ -0,0 +1,44 @@
#include "SYS.h"
LABEL__(brk)
mov %o7,%g2
ld [%l0], %o0
inc 7, %o0
andn %o0, 7, %o0
call brk
mov %o0, %o2
mov %g2,%o7
tst %o0
bge 0f
nop
retl
nop
0:
set limhp, %g1
st %o2, [%g1]
retl
nop
LABEL__(sbrk)
mov %o7,%g2
ld [%l0], %o0
inc 7, %o0
andn %o0, 7, %o0
set limhp, %o1
ld [%o1], %o2
inc 7, %o2
andn %o2, 7, %o3
add %o3, %o0, %o0
call brk
mov %o0, %o4
mov %g2,%o7
tst %o0
blt 0f
nop
set limhp, %g1
st %o4, [%g1]
mov %o3, %o0
0:
retl
nop

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(close)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(creat)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(dup)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(dup2)

View file

@ -0,0 +1,8 @@
_execl(name,args)
char *name;
int args;
{
extern char **environ;
_execve(name,&args,environ);
}

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(execve)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(exit)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_0(fork)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(fstat)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_0(getpid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(gtty)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(ioctl)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(kill)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(link)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(lseek)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(open)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_0(pause)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(pipe)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(read)

View file

@ -0,0 +1,21 @@
#include "SYS.h"
LABEL__(sig_catch)
save %sp, %g4, %sp
mov %fp, %l0 ! get new EM frame pointer
dec 4, %l0
st %i0, [%l0] ! push signal number on EM stack
set $_sig_funcs, %l1
dec 1, %i0
sll %i0, 2, %l2
add %l1, %l2, %l3
ld [%l3], %l2 ! get signal handler into %l2
call %l2
nop
restore
retl
add %sp,%g4,%sp

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(signal)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_2(stty)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(times)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(unlink)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_1(wait)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
_SYS_call_3(write)

View file

@ -0,0 +1,4 @@
#include "SYS.h"
SYS_call_2(access)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(acct)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(adjtime)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(alarm)

View file

@ -0,0 +1,44 @@
#include "SYS.h"
LABEL_(brk)
mov %o7,%g2
ld [%l0], %o0
inc 7, %o0
andn %o0, 7, %o0
call brk
mov %o0, %o2
mov %g2,%o7
tst %o0
bge 0f
nop
retl
nop
0:
set limhp, %g1
st %o2, [%g1]
retl
nop
LABEL_(sbrk)
mov %o7,%g2
ld [%l0], %o0
inc 7, %o0
andn %o0, 7, %o0
set limhp, %o1
ld [%o1], %o2
inc 7, %o2
andn %o2, 7, %o3
add %o3, %o0, %o0
call brk
mov %o0, %o4
mov %g2,%o7
tst %o0
blt 0f
nop
set limhp, %g1
st %o4, [%g1]
mov %o3, %o0
0:
retl
nop

View file

@ -0,0 +1,18 @@
.global $errno, cerror, _cerror
.type _cerror, #function
.section ".text"
cerror:
_cerror:
set $errno, %o5
st %o0, [%o5]
set errno, %o5
st %o0, [%o5]
set -1, %o0
retl
nop
.section ".data"
$errno:
.long 0

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(chdir)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(chmod)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(chown)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(chroot)

View file

@ -0,0 +1 @@
_cleanup() { }

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(close)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(creat)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(dup)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(dup2)

View file

@ -0,0 +1,8 @@
execl(name,args)
char *name;
int args;
{
extern char **environ;
execve(name,&args,environ);
}

View file

@ -0,0 +1,9 @@
execle(name,args)
char *name;
char *args;
{
char **p = &args;
while (*p++) ;
execve(name,&args,*p);
}

View file

@ -0,0 +1,7 @@
execv(name,args)
char *name;
char **args;
{
extern char **environ;
execve(name,args,environ);
}

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(execve)

View file

@ -0,0 +1,5 @@
exit(n)
{
_cleanup();
_exit(n);
}

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(fchdir)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(fchmod)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(fchown)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(fchroot)

View file

@ -0,0 +1,4 @@
#include "SYS.h"
SYS_call_3(fcntl)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(fork)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(fstat)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(fsync)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(ftruncate)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(getdents)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(getegid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(geteuid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(getgid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(getgroups)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(getitimer)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_4(getmsg)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(getpgid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(getpgrp)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(getpid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_5(getpmsg)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(getppid)

View file

@ -0,0 +1,4 @@
#include "SYS.h"
SYS_call_2(getrlimit)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(getsid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(gettimeofday)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(getuid)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(gtty)

View file

@ -0,0 +1,84 @@
.global lino,filn
.global EXIT
.global begtext,begdata,begbss
.global EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
.global hol0,reghp,limhp,trpim,trppc
.global _start
! runtime startof for sparc on sun4
LINO_AD = 0
FILN_AD = 4
EARRAY = 0
ERANGE = 1
ESET = 2
EIDIVZ = 6
EHEAP = 17
EILLINS = 18
ECASE = 20
EBADGTO = 27
.section ".text"
begtext:
_start:
clr %fp
ld [%sp + 0x40], %o0
add %sp, 0x44, %o1
sub %sp, 32, %sp
sll %o0, 0x2, %o2
add %o2, 0x4, %o2
add %o1, %o2, %o2
set -0x100000, %g4 ! should be a few M
clr %l1
mov %sp, %l0
add %sp, %g4, %sp
dec 12, %l0
! enable divide by 0 trap and improper
! trap
st %fsr, [%l0]
ld [%l0], %o3
set 0x09000000, %o4
or %o3, %o4, %o3
st %o3, [%l0]
ld [%l0], %fsr
st %o0, [%l0]
st %o1, [%l0+4]
st %o2, [%l0+8]
call $_m_a_i_n
nop
dec 4, %l0
st %g0, [%l0]
EXIT:
call $_exit
nop
.type _start,#function
.size _start,.-_start
.section ".data"
begdata:
.word 0 ! may be at virtual address 0 with no problem
hol0:
lino:
.word 0 ! lino
filn:
.word 0 ! filn
reghp:
.word $_end
limhp:
.word $_end
trppc:
.word 0
trpim:
.word 0 ! USED TO BE 2 BYTES; IS THIS RIGHT?
.section ".bss"
begbss: !initialization is not needed because ALL entries are in zero space!

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(ioctl)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(kill)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(lchown)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(link)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(lockf)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(lseek)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(lstat)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(mincore)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(mkdir)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(mknod)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_6(mmap)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_4(mount)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(mprotect)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_2(munmap)

View file

@ -0,0 +1,4 @@
#include "SYS.h"
SYS_call_1(nice)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(open)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_0(pause)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(pipe)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_1(plock)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_3(poll)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_4(pread)

View file

@ -0,0 +1,3 @@
#include "SYS.h"
SYS_call_4(profil)

Some files were not shown because too many files have changed in this diff Show more