Added entry points for ANSI C
This commit is contained in:
parent
69e2ddcb49
commit
67f0c95888
36 changed files with 287 additions and 14 deletions
|
@ -13,12 +13,11 @@ profil.c
|
||||||
stime.c
|
stime.c
|
||||||
time.c
|
time.c
|
||||||
wait.c
|
wait.c
|
||||||
_exit.s
|
xwait.s
|
||||||
_pipe.s
|
xpipe.s
|
||||||
_profil.s
|
xprofil.s
|
||||||
_stime.s
|
xstime.s
|
||||||
_time.s
|
xtime.s
|
||||||
_wait.s
|
|
||||||
access.s
|
access.s
|
||||||
acct.s
|
acct.s
|
||||||
alarm.s
|
alarm.s
|
||||||
|
@ -67,3 +66,29 @@ unlink.s
|
||||||
utime.s
|
utime.s
|
||||||
write.s
|
write.s
|
||||||
xdup.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
|
||||||
|
|
6
mach/i386/libsys/_alarm.s
Normal file
6
mach/i386/libsys/_alarm.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __alarm
|
||||||
|
.sect .text
|
||||||
|
__alarm:
|
||||||
|
mov ax,27
|
||||||
|
jmp syscal
|
13
mach/i386/libsys/_brk.s
Normal file
13
mach/i386/libsys/_brk.s
Normal file
|
@ -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
|
6
mach/i386/libsys/_close.s
Normal file
6
mach/i386/libsys/_close.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __close
|
||||||
|
.sect .text
|
||||||
|
__close:
|
||||||
|
mov ax,6
|
||||||
|
jmp sysx
|
6
mach/i386/libsys/_creat.s
Normal file
6
mach/i386/libsys/_creat.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __creat
|
||||||
|
.sect .text
|
||||||
|
__creat:
|
||||||
|
mov ax,8
|
||||||
|
jmp syscal
|
5
mach/i386/libsys/_dup.c
Normal file
5
mach/i386/libsys/_dup.c
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
int
|
||||||
|
_dup(d)
|
||||||
|
{
|
||||||
|
return __xdup(d, 0);
|
||||||
|
}
|
6
mach/i386/libsys/_dup2.c
Normal file
6
mach/i386/libsys/_dup2.c
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
int
|
||||||
|
_dup2(oldd, newd)
|
||||||
|
{
|
||||||
|
oldd |= 64;
|
||||||
|
return __xdup(oldd, newd);
|
||||||
|
}
|
9
mach/i386/libsys/_execl.c
Normal file
9
mach/i386/libsys/_execl.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
int
|
||||||
|
_execl(name,args)
|
||||||
|
char *name;
|
||||||
|
int args;
|
||||||
|
{
|
||||||
|
extern char **environ;
|
||||||
|
|
||||||
|
return _execve(name,&args,environ);
|
||||||
|
}
|
7
mach/i386/libsys/_execve.s
Normal file
7
mach/i386/libsys/_execve.s
Normal file
|
@ -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
|
15
mach/i386/libsys/_fork.s
Normal file
15
mach/i386/libsys/_fork.s
Normal file
|
@ -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
|
6
mach/i386/libsys/_fstat.s
Normal file
6
mach/i386/libsys/_fstat.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __fstat
|
||||||
|
.sect .text
|
||||||
|
__fstat:
|
||||||
|
mov ax,28
|
||||||
|
jmp sysx
|
6
mach/i386/libsys/_ftime.s
Normal file
6
mach/i386/libsys/_ftime.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __ftime
|
||||||
|
.sect .text
|
||||||
|
__ftime:
|
||||||
|
mov ax,2856
|
||||||
|
jmp syscal
|
6
mach/i386/libsys/_getpid.s
Normal file
6
mach/i386/libsys/_getpid.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __getpid
|
||||||
|
.sect .text
|
||||||
|
__getpid:
|
||||||
|
mov ax,20
|
||||||
|
jmp syscal
|
5
mach/i386/libsys/_gtty.c
Normal file
5
mach/i386/libsys/_gtty.c
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
_gtty(fildes, arg)
|
||||||
|
char *arg;
|
||||||
|
{
|
||||||
|
return _ioctl(fildes, ('t' << 8) | 8, arg);
|
||||||
|
}
|
6
mach/i386/libsys/_ioctl.s
Normal file
6
mach/i386/libsys/_ioctl.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __ioctl
|
||||||
|
.sect .text
|
||||||
|
__ioctl:
|
||||||
|
mov ax,54
|
||||||
|
jmp syscal
|
6
mach/i386/libsys/_kill.s
Normal file
6
mach/i386/libsys/_kill.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __kill
|
||||||
|
.sect .text
|
||||||
|
__kill:
|
||||||
|
mov ax,37
|
||||||
|
jmp sysx
|
6
mach/i386/libsys/_link.s
Normal file
6
mach/i386/libsys/_link.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __link
|
||||||
|
.sect .text
|
||||||
|
__link:
|
||||||
|
mov ax,9
|
||||||
|
jmp sysx
|
6
mach/i386/libsys/_lseek.s
Normal file
6
mach/i386/libsys/_lseek.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __lseek
|
||||||
|
.sect .text
|
||||||
|
__lseek:
|
||||||
|
mov ax,19
|
||||||
|
jmp syscal
|
6
mach/i386/libsys/_open.s
Normal file
6
mach/i386/libsys/_open.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __open
|
||||||
|
.sect .text
|
||||||
|
__open:
|
||||||
|
mov ax,5
|
||||||
|
jmp syscal
|
6
mach/i386/libsys/_pause.s
Normal file
6
mach/i386/libsys/_pause.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __pause
|
||||||
|
.sect .text
|
||||||
|
__pause:
|
||||||
|
mov ax,29
|
||||||
|
jmp syscal
|
14
mach/i386/libsys/_pipe.c
Normal file
14
mach/i386/libsys/_pipe.c
Normal file
|
@ -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;
|
||||||
|
}
|
6
mach/i386/libsys/_read.s
Normal file
6
mach/i386/libsys/_read.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __read
|
||||||
|
.sect .text
|
||||||
|
__read:
|
||||||
|
mov ax,3
|
||||||
|
jmp syscal
|
29
mach/i386/libsys/_sbrk.s
Normal file
29
mach/i386/libsys/_sbrk.s
Normal file
|
@ -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
|
6
mach/i386/libsys/_unlink.s
Normal file
6
mach/i386/libsys/_unlink.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __unlink
|
||||||
|
.sect .text
|
||||||
|
__unlink:
|
||||||
|
mov ax,10
|
||||||
|
jmp sysx
|
11
mach/i386/libsys/_wait.c
Normal file
11
mach/i386/libsys/_wait.c
Normal file
|
@ -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;
|
||||||
|
}
|
6
mach/i386/libsys/_write.s
Normal file
6
mach/i386/libsys/_write.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __write
|
||||||
|
.sect .text
|
||||||
|
__write:
|
||||||
|
mov ax,4
|
||||||
|
jmp syscal
|
|
@ -1,4 +1,4 @@
|
||||||
long _pipe();
|
long _xpipe();
|
||||||
|
|
||||||
int
|
int
|
||||||
pipe(f)
|
pipe(f)
|
||||||
|
@ -6,7 +6,7 @@ pipe(f)
|
||||||
{
|
{
|
||||||
long x;
|
long x;
|
||||||
|
|
||||||
x = _pipe();
|
x = _xpipe();
|
||||||
if (x == -1) return -1;
|
if (x == -1) return -1;
|
||||||
f[0] = x;
|
f[0] = x;
|
||||||
f[1] = x >> 16;
|
f[1] = x >> 16;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
|
char *_syspc;
|
||||||
|
|
||||||
profil(buff, bufsiz, offset, scale)
|
profil(buff, bufsiz, offset, scale)
|
||||||
char *buff;
|
char *buff;
|
||||||
int (*offset)();
|
int (*offset)();
|
||||||
{
|
{
|
||||||
_profil(buff, bufsiz, offset, scale, 7262);
|
_xprofil(buff, bufsiz, offset, scale, &_syspc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
stime(p)
|
stime(p)
|
||||||
long *p;
|
long *p;
|
||||||
{
|
{
|
||||||
return _stime(*p);
|
return _xstime(*p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
long _time();
|
long _xtime();
|
||||||
|
|
||||||
long
|
long
|
||||||
time(p)
|
time(p)
|
||||||
long *p;
|
long *p;
|
||||||
{
|
{
|
||||||
long l = _time();
|
long l = _xtime();
|
||||||
if (p) *p = l;
|
if (p) *p = l;
|
||||||
|
|
||||||
return l;
|
return l;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
long _wait();
|
long _xwait();
|
||||||
|
|
||||||
wait(p)
|
wait(p)
|
||||||
int *p;
|
int *p;
|
||||||
{
|
{
|
||||||
long l = _wait();
|
long l = _xwait();
|
||||||
|
|
||||||
if (l == -1) return -1;
|
if (l == -1) return -1;
|
||||||
if (p) *p = (l >> 16);
|
if (p) *p = (l >> 16);
|
||||||
|
|
12
mach/i386/libsys/xpipe.s
Normal file
12
mach/i386/libsys/xpipe.s
Normal file
|
@ -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
|
6
mach/i386/libsys/xprofil.s
Normal file
6
mach/i386/libsys/xprofil.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __xprofil
|
||||||
|
.sect .text
|
||||||
|
__xprofil:
|
||||||
|
mov ax,44
|
||||||
|
jmp syscal
|
6
mach/i386/libsys/xstime.s
Normal file
6
mach/i386/libsys/xstime.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __xstime
|
||||||
|
.sect .text
|
||||||
|
__xstime:
|
||||||
|
mov ax,25
|
||||||
|
jmp sysx
|
6
mach/i386/libsys/xtime.s
Normal file
6
mach/i386/libsys/xtime.s
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
|
.define __xtime
|
||||||
|
.sect .text
|
||||||
|
__xtime:
|
||||||
|
mov ax,13
|
||||||
|
jmp syscal
|
12
mach/i386/libsys/xwait.s
Normal file
12
mach/i386/libsys/xwait.s
Normal file
|
@ -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
|
Loading…
Reference in a new issue