Added entry points for ANSI C
authorceriel <none@none>
Mon, 22 Jan 1990 11:01:47 +0000 (11:01 +0000)
committerceriel <none@none>
Mon, 22 Jan 1990 11:01:47 +0000 (11:01 +0000)
36 files changed:
mach/i386/libsys/LIST
mach/i386/libsys/_alarm.s [new file with mode: 0644]
mach/i386/libsys/_brk.s [new file with mode: 0644]
mach/i386/libsys/_close.s [new file with mode: 0644]
mach/i386/libsys/_creat.s [new file with mode: 0644]
mach/i386/libsys/_dup.c [new file with mode: 0644]
mach/i386/libsys/_dup2.c [new file with mode: 0644]
mach/i386/libsys/_execl.c [new file with mode: 0644]
mach/i386/libsys/_execve.s [new file with mode: 0644]
mach/i386/libsys/_fork.s [new file with mode: 0644]
mach/i386/libsys/_fstat.s [new file with mode: 0644]
mach/i386/libsys/_ftime.s [new file with mode: 0644]
mach/i386/libsys/_getpid.s [new file with mode: 0644]
mach/i386/libsys/_gtty.c [new file with mode: 0644]
mach/i386/libsys/_ioctl.s [new file with mode: 0644]
mach/i386/libsys/_kill.s [new file with mode: 0644]
mach/i386/libsys/_link.s [new file with mode: 0644]
mach/i386/libsys/_lseek.s [new file with mode: 0644]
mach/i386/libsys/_open.s [new file with mode: 0644]
mach/i386/libsys/_pause.s [new file with mode: 0644]
mach/i386/libsys/_pipe.c [new file with mode: 0644]
mach/i386/libsys/_read.s [new file with mode: 0644]
mach/i386/libsys/_sbrk.s [new file with mode: 0644]
mach/i386/libsys/_unlink.s [new file with mode: 0644]
mach/i386/libsys/_wait.c [new file with mode: 0644]
mach/i386/libsys/_write.s [new file with mode: 0644]
mach/i386/libsys/pipe.c
mach/i386/libsys/profil.c
mach/i386/libsys/stime.c
mach/i386/libsys/time.c
mach/i386/libsys/wait.c
mach/i386/libsys/xpipe.s [new file with mode: 0644]
mach/i386/libsys/xprofil.s [new file with mode: 0644]
mach/i386/libsys/xstime.s [new file with mode: 0644]
mach/i386/libsys/xtime.s [new file with mode: 0644]
mach/i386/libsys/xwait.s [new file with mode: 0644]

index 0a9b5dc..67d0a7b 100644 (file)
@@ -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 (file)
index 0000000..212e531
--- /dev/null
@@ -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 (file)
index 0000000..4ed994e
--- /dev/null
@@ -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 (file)
index 0000000..1402ff3
--- /dev/null
@@ -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 (file)
index 0000000..453c9e9
--- /dev/null
@@ -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 (file)
index 0000000..c3a6e63
--- /dev/null
@@ -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 (file)
index 0000000..b3106b2
--- /dev/null
@@ -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 (file)
index 0000000..bddc42a
--- /dev/null
@@ -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 (file)
index 0000000..8ae55ab
--- /dev/null
@@ -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 (file)
index 0000000..467250f
--- /dev/null
@@ -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 (file)
index 0000000..a5dbf47
--- /dev/null
@@ -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 (file)
index 0000000..e2cdeea
--- /dev/null
@@ -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 (file)
index 0000000..b55f59c
--- /dev/null
@@ -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 (file)
index 0000000..336ab97
--- /dev/null
@@ -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 (file)
index 0000000..96081f9
--- /dev/null
@@ -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 (file)
index 0000000..6fba08f
--- /dev/null
@@ -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 (file)
index 0000000..f50ecaa
--- /dev/null
@@ -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 (file)
index 0000000..c2d0a29
--- /dev/null
@@ -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 (file)
index 0000000..bfbf03b
--- /dev/null
@@ -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 (file)
index 0000000..812d35d
--- /dev/null
@@ -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 (file)
index 0000000..780a422
--- /dev/null
@@ -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 (file)
index 0000000..2032e79
--- /dev/null
@@ -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 (file)
index 0000000..2010c7c
--- /dev/null
@@ -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 (file)
index 0000000..02b631e
--- /dev/null
@@ -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 (file)
index 0000000..605daf3
--- /dev/null
@@ -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 (file)
index 0000000..cd53efb
--- /dev/null
@@ -0,0 +1,6 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.define __write
+.sect .text
+__write:
+       mov     ax,4
+       jmp     syscal
index fa38108..063a526 100644 (file)
@@ -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;
index f20e10c..6cdb463 100644 (file)
@@ -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);
 }
index ce03130..db81ff6 100644 (file)
@@ -1,5 +1,5 @@
 stime(p)
        long *p;
 {
-       return _stime(*p);
+       return _xstime(*p);
 }
index 600b941..a48bf6e 100644 (file)
@@ -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;
index d8d01d7..eb0f91b 100644 (file)
@@ -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 (file)
index 0000000..e490360
--- /dev/null
@@ -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 (file)
index 0000000..f8d2b9a
--- /dev/null
@@ -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 (file)
index 0000000..e03a421
--- /dev/null
@@ -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 (file)
index 0000000..eaa9c7f
--- /dev/null
@@ -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 (file)
index 0000000..e012798
--- /dev/null
@@ -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