From: ceriel Date: Mon, 22 Jan 1990 11:01:47 +0000 (+0000) Subject: Added entry points for ANSI C X-Git-Tag: release-5-5~1910 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=67f0c958882ec1032f3949ecacf425b542d0f9ed;p=ack.git Added entry points for ANSI C --- diff --git a/mach/i386/libsys/LIST b/mach/i386/libsys/LIST index 0a9b5dc39..67d0a7b8d 100644 --- a/mach/i386/libsys/LIST +++ b/mach/i386/libsys/LIST @@ -13,12 +13,11 @@ profil.c stime.c time.c wait.c -_exit.s -_pipe.s -_profil.s -_stime.s -_time.s -_wait.s +xwait.s +xpipe.s +xprofil.s +xstime.s +xtime.s access.s acct.s alarm.s @@ -67,3 +66,29 @@ unlink.s utime.s write.s xdup.s +_alarm.s +_brk.s +_close.s +_creat.s +_dup.c +_dup2.c +_execl.c +_execve.s +_exit.s +_fork.s +_fstat.s +_ftime.s +_getpid.s +_gtty.c +_ioctl.s +_kill.s +_link.s +_lseek.s +_open.s +_pause.s +_pipe.c +_read.s +_sbrk.s +_unlink.s +_wait.c +_write.s diff --git a/mach/i386/libsys/_alarm.s b/mach/i386/libsys/_alarm.s new file mode 100644 index 000000000..212e531b2 --- /dev/null +++ b/mach/i386/libsys/_alarm.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __alarm +.sect .text +__alarm: + mov ax,27 + jmp syscal diff --git a/mach/i386/libsys/_brk.s b/mach/i386/libsys/_brk.s new file mode 100644 index 000000000..4ed994e4a --- /dev/null +++ b/mach/i386/libsys/_brk.s @@ -0,0 +1,13 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __brk +.sect .text +__brk: + mov ax,17 + callf 0x7:0x0 + jb 1f + mov ax,4(sp) + mov (.limhp),ax + xor ax,ax + ret +1: + jmp cerror diff --git a/mach/i386/libsys/_close.s b/mach/i386/libsys/_close.s new file mode 100644 index 000000000..1402ff318 --- /dev/null +++ b/mach/i386/libsys/_close.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __close +.sect .text +__close: + mov ax,6 + jmp sysx diff --git a/mach/i386/libsys/_creat.s b/mach/i386/libsys/_creat.s new file mode 100644 index 000000000..453c9e9e4 --- /dev/null +++ b/mach/i386/libsys/_creat.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __creat +.sect .text +__creat: + mov ax,8 + jmp syscal diff --git a/mach/i386/libsys/_dup.c b/mach/i386/libsys/_dup.c new file mode 100644 index 000000000..c3a6e63af --- /dev/null +++ b/mach/i386/libsys/_dup.c @@ -0,0 +1,5 @@ +int +_dup(d) +{ + return __xdup(d, 0); +} diff --git a/mach/i386/libsys/_dup2.c b/mach/i386/libsys/_dup2.c new file mode 100644 index 000000000..b3106b20e --- /dev/null +++ b/mach/i386/libsys/_dup2.c @@ -0,0 +1,6 @@ +int +_dup2(oldd, newd) +{ + oldd |= 64; + return __xdup(oldd, newd); +} diff --git a/mach/i386/libsys/_execl.c b/mach/i386/libsys/_execl.c new file mode 100644 index 000000000..bddc42abd --- /dev/null +++ b/mach/i386/libsys/_execl.c @@ -0,0 +1,9 @@ +int +_execl(name,args) + char *name; + int args; +{ + extern char **environ; + + return _execve(name,&args,environ); +} diff --git a/mach/i386/libsys/_execve.s b/mach/i386/libsys/_execve.s new file mode 100644 index 000000000..8ae55abe7 --- /dev/null +++ b/mach/i386/libsys/_execve.s @@ -0,0 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __execve +.sect .text +__execve: + mov ax,59 + callf 0x7:0x0 + jmp cerror diff --git a/mach/i386/libsys/_fork.s b/mach/i386/libsys/_fork.s new file mode 100644 index 000000000..467250fe4 --- /dev/null +++ b/mach/i386/libsys/_fork.s @@ -0,0 +1,15 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __fork +.sect .text +__fork: + mov ax,2 + callf 0x7:0x0 + jb 1f + and dx,dx + jne 2f + ret +1: + jmp cerror +2: + xor ax,ax + ret diff --git a/mach/i386/libsys/_fstat.s b/mach/i386/libsys/_fstat.s new file mode 100644 index 000000000..a5dbf4779 --- /dev/null +++ b/mach/i386/libsys/_fstat.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __fstat +.sect .text +__fstat: + mov ax,28 + jmp sysx diff --git a/mach/i386/libsys/_ftime.s b/mach/i386/libsys/_ftime.s new file mode 100644 index 000000000..e2cdeea9a --- /dev/null +++ b/mach/i386/libsys/_ftime.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __ftime +.sect .text +__ftime: + mov ax,2856 + jmp syscal diff --git a/mach/i386/libsys/_getpid.s b/mach/i386/libsys/_getpid.s new file mode 100644 index 000000000..b55f59c4b --- /dev/null +++ b/mach/i386/libsys/_getpid.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __getpid +.sect .text +__getpid: + mov ax,20 + jmp syscal diff --git a/mach/i386/libsys/_gtty.c b/mach/i386/libsys/_gtty.c new file mode 100644 index 000000000..336ab97b8 --- /dev/null +++ b/mach/i386/libsys/_gtty.c @@ -0,0 +1,5 @@ +_gtty(fildes, arg) + char *arg; +{ + return _ioctl(fildes, ('t' << 8) | 8, arg); +} diff --git a/mach/i386/libsys/_ioctl.s b/mach/i386/libsys/_ioctl.s new file mode 100644 index 000000000..96081f98c --- /dev/null +++ b/mach/i386/libsys/_ioctl.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __ioctl +.sect .text +__ioctl: + mov ax,54 + jmp syscal diff --git a/mach/i386/libsys/_kill.s b/mach/i386/libsys/_kill.s new file mode 100644 index 000000000..6fba08fb0 --- /dev/null +++ b/mach/i386/libsys/_kill.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __kill +.sect .text +__kill: + mov ax,37 + jmp sysx diff --git a/mach/i386/libsys/_link.s b/mach/i386/libsys/_link.s new file mode 100644 index 000000000..f50ecaa35 --- /dev/null +++ b/mach/i386/libsys/_link.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __link +.sect .text +__link: + mov ax,9 + jmp sysx diff --git a/mach/i386/libsys/_lseek.s b/mach/i386/libsys/_lseek.s new file mode 100644 index 000000000..c2d0a29d7 --- /dev/null +++ b/mach/i386/libsys/_lseek.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __lseek +.sect .text +__lseek: + mov ax,19 + jmp syscal diff --git a/mach/i386/libsys/_open.s b/mach/i386/libsys/_open.s new file mode 100644 index 000000000..bfbf03bb8 --- /dev/null +++ b/mach/i386/libsys/_open.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __open +.sect .text +__open: + mov ax,5 + jmp syscal diff --git a/mach/i386/libsys/_pause.s b/mach/i386/libsys/_pause.s new file mode 100644 index 000000000..812d35da1 --- /dev/null +++ b/mach/i386/libsys/_pause.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __pause +.sect .text +__pause: + mov ax,29 + jmp syscal diff --git a/mach/i386/libsys/_pipe.c b/mach/i386/libsys/_pipe.c new file mode 100644 index 000000000..780a42201 --- /dev/null +++ b/mach/i386/libsys/_pipe.c @@ -0,0 +1,14 @@ +long _xpipe(); + +int +_pipe(f) + int f[2]; +{ + long x; + + x = _xpipe(); + if (x == -1) return -1; + f[0] = x; + f[1] = x >> 16; + return 0; +} diff --git a/mach/i386/libsys/_read.s b/mach/i386/libsys/_read.s new file mode 100644 index 000000000..2032e7980 --- /dev/null +++ b/mach/i386/libsys/_read.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __read +.sect .text +__read: + mov ax,3 + jmp syscal diff --git a/mach/i386/libsys/_sbrk.s b/mach/i386/libsys/_sbrk.s new file mode 100644 index 000000000..2010c7ca5 --- /dev/null +++ b/mach/i386/libsys/_sbrk.s @@ -0,0 +1,29 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __sbrk +.sect .text +__sbrk: + push bp + mov bp,sp + mov ax,8(bp) + or ax,ax + jne 1f + mov ax,(.limhp) + pop bp + ret +1: + mov bx,(.limhp) + add ax,bx + push ax + call _brk + or ax,ax + jne 1f + pop ax + mov (.limhp),ax + mov ax,bx + pop bp + ret +1: + pop ax + mov ax,-1 + pop bp + ret diff --git a/mach/i386/libsys/_unlink.s b/mach/i386/libsys/_unlink.s new file mode 100644 index 000000000..02b631e8d --- /dev/null +++ b/mach/i386/libsys/_unlink.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __unlink +.sect .text +__unlink: + mov ax,10 + jmp sysx diff --git a/mach/i386/libsys/_wait.c b/mach/i386/libsys/_wait.c new file mode 100644 index 000000000..605daf3c7 --- /dev/null +++ b/mach/i386/libsys/_wait.c @@ -0,0 +1,11 @@ +long _xwait(); + +_wait(p) + int *p; +{ + long l = _xwait(); + + if (l == -1) return -1; + if (p) *p = (l >> 16); + return l & 0xffff; +} diff --git a/mach/i386/libsys/_write.s b/mach/i386/libsys/_write.s new file mode 100644 index 000000000..cd53efbd0 --- /dev/null +++ b/mach/i386/libsys/_write.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __write +.sect .text +__write: + mov ax,4 + jmp syscal diff --git a/mach/i386/libsys/pipe.c b/mach/i386/libsys/pipe.c index fa38108f9..063a5268b 100644 --- a/mach/i386/libsys/pipe.c +++ b/mach/i386/libsys/pipe.c @@ -1,4 +1,4 @@ -long _pipe(); +long _xpipe(); int pipe(f) @@ -6,7 +6,7 @@ pipe(f) { long x; - x = _pipe(); + x = _xpipe(); if (x == -1) return -1; f[0] = x; f[1] = x >> 16; diff --git a/mach/i386/libsys/profil.c b/mach/i386/libsys/profil.c index f20e10c47..6cdb463a6 100644 --- a/mach/i386/libsys/profil.c +++ b/mach/i386/libsys/profil.c @@ -1,6 +1,8 @@ +char *_syspc; + profil(buff, bufsiz, offset, scale) char *buff; int (*offset)(); { - _profil(buff, bufsiz, offset, scale, 7262); + _xprofil(buff, bufsiz, offset, scale, &_syspc); } diff --git a/mach/i386/libsys/stime.c b/mach/i386/libsys/stime.c index ce0313064..db81ff6cf 100644 --- a/mach/i386/libsys/stime.c +++ b/mach/i386/libsys/stime.c @@ -1,5 +1,5 @@ stime(p) long *p; { - return _stime(*p); + return _xstime(*p); } diff --git a/mach/i386/libsys/time.c b/mach/i386/libsys/time.c index 600b94143..a48bf6ee8 100644 --- a/mach/i386/libsys/time.c +++ b/mach/i386/libsys/time.c @@ -1,10 +1,10 @@ -long _time(); +long _xtime(); long time(p) long *p; { - long l = _time(); + long l = _xtime(); if (p) *p = l; return l; diff --git a/mach/i386/libsys/wait.c b/mach/i386/libsys/wait.c index d8d01d758..eb0f91b4b 100644 --- a/mach/i386/libsys/wait.c +++ b/mach/i386/libsys/wait.c @@ -1,9 +1,9 @@ -long _wait(); +long _xwait(); wait(p) int *p; { - long l = _wait(); + long l = _xwait(); if (l == -1) return -1; if (p) *p = (l >> 16); diff --git a/mach/i386/libsys/xpipe.s b/mach/i386/libsys/xpipe.s new file mode 100644 index 000000000..e490360cf --- /dev/null +++ b/mach/i386/libsys/xpipe.s @@ -0,0 +1,12 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __xpipe +.sect .text +__xpipe: + mov ax,42 + callf 0x7:0x0 + jae 1f + jmp cerror +1: + shl dx,0x10 + or eax,edx + ret diff --git a/mach/i386/libsys/xprofil.s b/mach/i386/libsys/xprofil.s new file mode 100644 index 000000000..f8d2b9a56 --- /dev/null +++ b/mach/i386/libsys/xprofil.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __xprofil +.sect .text +__xprofil: + mov ax,44 + jmp syscal diff --git a/mach/i386/libsys/xstime.s b/mach/i386/libsys/xstime.s new file mode 100644 index 000000000..e03a42129 --- /dev/null +++ b/mach/i386/libsys/xstime.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __xstime +.sect .text +__xstime: + mov ax,25 + jmp sysx diff --git a/mach/i386/libsys/xtime.s b/mach/i386/libsys/xtime.s new file mode 100644 index 000000000..eaa9c7f30 --- /dev/null +++ b/mach/i386/libsys/xtime.s @@ -0,0 +1,6 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __xtime +.sect .text +__xtime: + mov ax,13 + jmp syscal diff --git a/mach/i386/libsys/xwait.s b/mach/i386/libsys/xwait.s new file mode 100644 index 000000000..e01279890 --- /dev/null +++ b/mach/i386/libsys/xwait.s @@ -0,0 +1,12 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.define __xwait +.sect .text +__xwait: + mov ax,7 + callf 0x7:0x0 + jb 1f + shl dx,0x10 + or eax,edx + ret +1: + jmp cerror