From 9eff28dac8a4879e5d6b5f82a4e0eaf9dc018254 Mon Sep 17 00:00:00 2001 From: ceriel Date: Fri, 19 Jan 1990 17:22:11 +0000 Subject: [PATCH] Added entry points for ANSI C --- mach/vax4/libbsd4_2/LIST | 27 +++++++++++++++++++++++++++ mach/vax4/libbsd4_2/_alarm.c | 13 +++++++++++++ mach/vax4/libbsd4_2/_brk.s | 28 ++++++++++++++++++++++++++++ mach/vax4/libbsd4_2/_close.s | 3 +++ mach/vax4/libbsd4_2/_dup2.s | 3 +++ mach/vax4/libbsd4_2/_execl.s | 8 ++++++++ mach/vax4/libbsd4_2/_execve.s | 3 +++ mach/vax4/libbsd4_2/_fork.s | 10 ++++++++++ mach/vax4/libbsd4_2/_fstat.s | 3 +++ mach/vax4/libbsd4_2/_ftime.c | 15 +++++++++++++++ mach/vax4/libbsd4_2/_getpid.s | 3 +++ mach/vax4/libbsd4_2/_getrusage.s | 3 +++ mach/vax4/libbsd4_2/_gettimday.s | 3 +++ mach/vax4/libbsd4_2/_gtty.c | 8 ++++++++ mach/vax4/libbsd4_2/_ioctl.s | 3 +++ mach/vax4/libbsd4_2/_kill.s | 3 +++ mach/vax4/libbsd4_2/_link.s | 3 +++ mach/vax4/libbsd4_2/_lseek.s | 3 +++ mach/vax4/libbsd4_2/_open.s | 3 +++ mach/vax4/libbsd4_2/_pause.c | 3 +++ mach/vax4/libbsd4_2/_pipe.s | 8 ++++++++ mach/vax4/libbsd4_2/_read.s | 3 +++ mach/vax4/libbsd4_2/_setitimer.s | 3 +++ mach/vax4/libbsd4_2/_sigblock.s | 3 +++ mach/vax4/libbsd4_2/_sigpause.s | 3 +++ mach/vax4/libbsd4_2/_unlink.s | 3 +++ mach/vax4/libbsd4_2/_wait.s | 8 ++++++++ mach/vax4/libbsd4_2/_write.s | 3 +++ mach/vax4/libbsd4_2/gtty.c | 3 ++- 29 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 mach/vax4/libbsd4_2/_alarm.c create mode 100644 mach/vax4/libbsd4_2/_brk.s create mode 100644 mach/vax4/libbsd4_2/_close.s create mode 100644 mach/vax4/libbsd4_2/_dup2.s create mode 100644 mach/vax4/libbsd4_2/_execl.s create mode 100644 mach/vax4/libbsd4_2/_execve.s create mode 100644 mach/vax4/libbsd4_2/_fork.s create mode 100644 mach/vax4/libbsd4_2/_fstat.s create mode 100644 mach/vax4/libbsd4_2/_ftime.c create mode 100644 mach/vax4/libbsd4_2/_getpid.s create mode 100644 mach/vax4/libbsd4_2/_getrusage.s create mode 100644 mach/vax4/libbsd4_2/_gettimday.s create mode 100644 mach/vax4/libbsd4_2/_gtty.c create mode 100644 mach/vax4/libbsd4_2/_ioctl.s create mode 100644 mach/vax4/libbsd4_2/_kill.s create mode 100644 mach/vax4/libbsd4_2/_link.s create mode 100644 mach/vax4/libbsd4_2/_lseek.s create mode 100644 mach/vax4/libbsd4_2/_open.s create mode 100644 mach/vax4/libbsd4_2/_pause.c create mode 100644 mach/vax4/libbsd4_2/_pipe.s create mode 100644 mach/vax4/libbsd4_2/_read.s create mode 100644 mach/vax4/libbsd4_2/_setitimer.s create mode 100644 mach/vax4/libbsd4_2/_sigblock.s create mode 100644 mach/vax4/libbsd4_2/_sigpause.s create mode 100644 mach/vax4/libbsd4_2/_unlink.s create mode 100644 mach/vax4/libbsd4_2/_wait.s create mode 100644 mach/vax4/libbsd4_2/_write.s diff --git a/mach/vax4/libbsd4_2/LIST b/mach/vax4/libbsd4_2/LIST index 673088dcb..dd0c08f72 100644 --- a/mach/vax4/libbsd4_2/LIST +++ b/mach/vax4/libbsd4_2/LIST @@ -1,4 +1,31 @@ libmon_s.a +_alarm.c +_ftime.c +_gtty.c +_pause.c +_gettimday.s +_open.s +_sigpause.s +_brk.s +_fork.s +_unlink.s +_close.s +_fstat.s +_ioctl.s +_pipe.s +_wait.s +_dup2.s +_kill.s +_read.s +_write.s +_execl.s +_getpid.s +_link.s +_setitimer.s +_execve.s +_getrusage.s +_lseek.s +_sigblock.s accept.s access.s acct.s diff --git a/mach/vax4/libbsd4_2/_alarm.c b/mach/vax4/libbsd4_2/_alarm.c new file mode 100644 index 000000000..595cb139b --- /dev/null +++ b/mach/vax4/libbsd4_2/_alarm.c @@ -0,0 +1,13 @@ +unsigned +_alarm(n) + unsigned n; +{ + struct { long l1,l2,l3,l4; } t1,t2; + t1.l1 = 0; + t1.l2 = 0; + t1.l4 = 0; + t1.l3 = n; + if (_setitimer(0,&t1,&t2) < 0) return -1; + if (t2.l4) t2.l3++; + return t2.l3; +} diff --git a/mach/vax4/libbsd4_2/_brk.s b/mach/vax4/libbsd4_2/_brk.s new file mode 100644 index 000000000..0e11f5fbf --- /dev/null +++ b/mach/vax4/libbsd4_2/_brk.s @@ -0,0 +1,28 @@ +#include "syscall.h" +DEFINE(__brk) + cmpl 4(ap),Imin + bgeq Iok + movl Imin,4(ap) +Iok: + chmk $17 + bcs Ierr + movl 4(ap),Icur + clrl r0 + ret +Ierr: + jmp cerror + +DEFINE(__sbrk) + addl3 Icur,4(ap),-(sp) + bcs Ierr + pushl $1 + movl ap,r3 + movl sp,ap + chmk $17 + bcs Ierr + movl Icur,r0 + addl2 4(r3),Icur + ret +.sect .data +Imin: .data4 endbss +Icur: .data4 endbss diff --git a/mach/vax4/libbsd4_2/_close.s b/mach/vax4/libbsd4_2/_close.s new file mode 100644 index 000000000..6a5ad5278 --- /dev/null +++ b/mach/vax4/libbsd4_2/_close.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__close) +SYSTEM(SYS_close) diff --git a/mach/vax4/libbsd4_2/_dup2.s b/mach/vax4/libbsd4_2/_dup2.s new file mode 100644 index 000000000..30128475d --- /dev/null +++ b/mach/vax4/libbsd4_2/_dup2.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__dup2) +SYSTEM(SYS_dup2) diff --git a/mach/vax4/libbsd4_2/_execl.s b/mach/vax4/libbsd4_2/_execl.s new file mode 100644 index 000000000..8d2c8f791 --- /dev/null +++ b/mach/vax4/libbsd4_2/_execl.s @@ -0,0 +1,8 @@ +#include "syscall.h" +.extern _environ +DEFINE(__execl) + pushl _environ + pushab 8(ap) + pushl 4(ap) + calls $3,__execve + ret diff --git a/mach/vax4/libbsd4_2/_execve.s b/mach/vax4/libbsd4_2/_execve.s new file mode 100644 index 000000000..05cd23b41 --- /dev/null +++ b/mach/vax4/libbsd4_2/_execve.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__execve) +SYSTEM(SYS_execve) diff --git a/mach/vax4/libbsd4_2/_fork.s b/mach/vax4/libbsd4_2/_fork.s new file mode 100644 index 000000000..3b38b3eec --- /dev/null +++ b/mach/vax4/libbsd4_2/_fork.s @@ -0,0 +1,10 @@ +#include "syscall.h" +DEFINE(__fork) + chmk $SYS_fork + bcs Ierr + blbc r1,Iparent + clrl r0 +Iparent: + ret +Ierr: + jmp cerror diff --git a/mach/vax4/libbsd4_2/_fstat.s b/mach/vax4/libbsd4_2/_fstat.s new file mode 100644 index 000000000..38b5cc022 --- /dev/null +++ b/mach/vax4/libbsd4_2/_fstat.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__fstat) +SYSTEM(SYS_fstat) diff --git a/mach/vax4/libbsd4_2/_ftime.c b/mach/vax4/libbsd4_2/_ftime.c new file mode 100644 index 000000000..15d69132e --- /dev/null +++ b/mach/vax4/libbsd4_2/_ftime.c @@ -0,0 +1,15 @@ +#include + +_ftime(p) + struct { time_t time; unsigned short millitm; + short timezone; short dstflag; } *p; +{ + struct { long l1,l2; } t1,t2; + + if (_gettimeofday(&t1,&t2) < 0) return -1; + p->time = t1.l1; + p->millitm = t1.l2/1000; + p->dstflag = t2.l2; + p->timezone = t2.l1; + return 0; +} diff --git a/mach/vax4/libbsd4_2/_getpid.s b/mach/vax4/libbsd4_2/_getpid.s new file mode 100644 index 000000000..f4a859735 --- /dev/null +++ b/mach/vax4/libbsd4_2/_getpid.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__getpid) +SYSTEM(SYS_getpid) diff --git a/mach/vax4/libbsd4_2/_getrusage.s b/mach/vax4/libbsd4_2/_getrusage.s new file mode 100644 index 000000000..569b2d494 --- /dev/null +++ b/mach/vax4/libbsd4_2/_getrusage.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__getrusage) +SYSTEM(SYS_getrusage) diff --git a/mach/vax4/libbsd4_2/_gettimday.s b/mach/vax4/libbsd4_2/_gettimday.s new file mode 100644 index 000000000..b3ac8f49e --- /dev/null +++ b/mach/vax4/libbsd4_2/_gettimday.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__gettimeofday) +SYSTEM(SYS_gettimeofday) diff --git a/mach/vax4/libbsd4_2/_gtty.c b/mach/vax4/libbsd4_2/_gtty.c new file mode 100644 index 000000000..afa1b0349 --- /dev/null +++ b/mach/vax4/libbsd4_2/_gtty.c @@ -0,0 +1,8 @@ +#include +int +_gtty(fildes,argp) + int fildes ; + struct sgttyb *argp ; +{ + return ioctl(fildes,TIOCGETP,argp) ; +} diff --git a/mach/vax4/libbsd4_2/_ioctl.s b/mach/vax4/libbsd4_2/_ioctl.s new file mode 100644 index 000000000..fac8e1aec --- /dev/null +++ b/mach/vax4/libbsd4_2/_ioctl.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__ioctl) +SYSTEM(SYS_ioctl) diff --git a/mach/vax4/libbsd4_2/_kill.s b/mach/vax4/libbsd4_2/_kill.s new file mode 100644 index 000000000..1547d5edb --- /dev/null +++ b/mach/vax4/libbsd4_2/_kill.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__kill) +SYSTEM(SYS_kill) diff --git a/mach/vax4/libbsd4_2/_link.s b/mach/vax4/libbsd4_2/_link.s new file mode 100644 index 000000000..9865f21b4 --- /dev/null +++ b/mach/vax4/libbsd4_2/_link.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__link) +SYSTEM(SYS_link) diff --git a/mach/vax4/libbsd4_2/_lseek.s b/mach/vax4/libbsd4_2/_lseek.s new file mode 100644 index 000000000..4334b694d --- /dev/null +++ b/mach/vax4/libbsd4_2/_lseek.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__lseek) +SYSTEM(SYS_lseek) diff --git a/mach/vax4/libbsd4_2/_open.s b/mach/vax4/libbsd4_2/_open.s new file mode 100644 index 000000000..feb758da7 --- /dev/null +++ b/mach/vax4/libbsd4_2/_open.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__open) +SYSTEM(SYS_open) diff --git a/mach/vax4/libbsd4_2/_pause.c b/mach/vax4/libbsd4_2/_pause.c new file mode 100644 index 000000000..90da57572 --- /dev/null +++ b/mach/vax4/libbsd4_2/_pause.c @@ -0,0 +1,3 @@ +_pause() { + _sigpause(_sigblock()); +} diff --git a/mach/vax4/libbsd4_2/_pipe.s b/mach/vax4/libbsd4_2/_pipe.s new file mode 100644 index 000000000..1f205334b --- /dev/null +++ b/mach/vax4/libbsd4_2/_pipe.s @@ -0,0 +1,8 @@ +#include "syscall.h" +DEFINE(__pipe) +SYSNORET(SYS_pipe) + movl 4(ap),r2 + movl r0,(r2)+ + movl r1,(r2) + clrl r0 + ret diff --git a/mach/vax4/libbsd4_2/_read.s b/mach/vax4/libbsd4_2/_read.s new file mode 100644 index 000000000..d2fe58bb2 --- /dev/null +++ b/mach/vax4/libbsd4_2/_read.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__read) +SYSTEM(SYS_read) diff --git a/mach/vax4/libbsd4_2/_setitimer.s b/mach/vax4/libbsd4_2/_setitimer.s new file mode 100644 index 000000000..7fdde347b --- /dev/null +++ b/mach/vax4/libbsd4_2/_setitimer.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__setitimer) +SYSTEM(SYS_setitimer) diff --git a/mach/vax4/libbsd4_2/_sigblock.s b/mach/vax4/libbsd4_2/_sigblock.s new file mode 100644 index 000000000..31f48f579 --- /dev/null +++ b/mach/vax4/libbsd4_2/_sigblock.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__sigblock) +SYSTEM(SYS_sigblock) diff --git a/mach/vax4/libbsd4_2/_sigpause.s b/mach/vax4/libbsd4_2/_sigpause.s new file mode 100644 index 000000000..a24deef65 --- /dev/null +++ b/mach/vax4/libbsd4_2/_sigpause.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__sigpause) +SYSTEM(SYS_sigpause) diff --git a/mach/vax4/libbsd4_2/_unlink.s b/mach/vax4/libbsd4_2/_unlink.s new file mode 100644 index 000000000..0e576b6ab --- /dev/null +++ b/mach/vax4/libbsd4_2/_unlink.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__unlink) +SYSTEM(SYS_unlink) diff --git a/mach/vax4/libbsd4_2/_wait.s b/mach/vax4/libbsd4_2/_wait.s new file mode 100644 index 000000000..25da8489e --- /dev/null +++ b/mach/vax4/libbsd4_2/_wait.s @@ -0,0 +1,8 @@ +#include "syscall.h" +DEFINE(__wait) +SYSNORET(SYS_wait) + tstl 4(ap) + beql Iout + movl r1,*4(ap) +Iout: + ret diff --git a/mach/vax4/libbsd4_2/_write.s b/mach/vax4/libbsd4_2/_write.s new file mode 100644 index 000000000..166f2f070 --- /dev/null +++ b/mach/vax4/libbsd4_2/_write.s @@ -0,0 +1,3 @@ +#include "syscall.h" +DEFINE(__write) +SYSTEM(SYS_write) diff --git a/mach/vax4/libbsd4_2/gtty.c b/mach/vax4/libbsd4_2/gtty.c index 7f42ea1fb..be841e7d0 100644 --- a/mach/vax4/libbsd4_2/gtty.c +++ b/mach/vax4/libbsd4_2/gtty.c @@ -1,5 +1,6 @@ #include -int gtty(fildes,argp) +int +gtty(fildes,argp) int fildes ; struct sgttyb *argp ; {