Added entry points for ANSI C
authorceriel <none@none>
Fri, 19 Jan 1990 17:05:29 +0000 (17:05 +0000)
committerceriel <none@none>
Fri, 19 Jan 1990 17:05:29 +0000 (17:05 +0000)
23 files changed:
mach/i86/libsys/LIST
mach/i86/libsys/_alarm.s [new file with mode: 0644]
mach/i86/libsys/_brk.s [new file with mode: 0644]
mach/i86/libsys/_close.s [new file with mode: 0644]
mach/i86/libsys/_execl.s [new file with mode: 0644]
mach/i86/libsys/_execve.s [new file with mode: 0644]
mach/i86/libsys/_fork.s [new file with mode: 0644]
mach/i86/libsys/_fstat.s [new file with mode: 0644]
mach/i86/libsys/_ftime.s [new file with mode: 0644]
mach/i86/libsys/_getpid.s [new file with mode: 0644]
mach/i86/libsys/_gtty.s [new file with mode: 0644]
mach/i86/libsys/_ioctl.s [new file with mode: 0644]
mach/i86/libsys/_kill.s [new file with mode: 0644]
mach/i86/libsys/_link.s [new file with mode: 0644]
mach/i86/libsys/_lseek.s [new file with mode: 0644]
mach/i86/libsys/_open.s [new file with mode: 0644]
mach/i86/libsys/_pause.s [new file with mode: 0644]
mach/i86/libsys/_pipe.s [new file with mode: 0644]
mach/i86/libsys/_read.s [new file with mode: 0644]
mach/i86/libsys/_sbrk.s [new file with mode: 0644]
mach/i86/libsys/_unlink.s [new file with mode: 0644]
mach/i86/libsys/_wait.s [new file with mode: 0644]
mach/i86/libsys/_write.s [new file with mode: 0644]

index 0e0418e..304bf8d 100644 (file)
@@ -1,4 +1,26 @@
 libmon_s.a
+_alarm.s
+_sbrk.s
+_brk.s
+_close.s
+_execl.s
+_execve.s
+_fork.s
+_fstat.s
+_ftime.s
+_getpid.s
+_gtty.s
+_ioctl.s
+_kill.s
+_link.s
+_lseek.s
+_open.s
+_pause.s
+_pipe.s
+_read.s
+_unlink.s
+_wait.s
+_write.s
 exit.s
 _exit.s
 abort.s
diff --git a/mach/i86/libsys/_alarm.s b/mach/i86/libsys/_alarm.s
new file mode 100644 (file)
index 0000000..5f70bde
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __alarm
+.extern __alarm, cerror
+__alarm:       int 0x9b
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/_brk.s b/mach/i86/libsys/_brk.s
new file mode 100644 (file)
index 0000000..5f19bbb
--- /dev/null
@@ -0,0 +1,39 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __brk
+.define xbrk
+.define np
+.extern __brk
+.extern xbrk,endbss
+.extern np, cerror
+__brk: 
+       mov bx,sp
+       mov ax,2(bx)
+       mov cx,sp
+       sub cx,128
+       jbe 1f
+       mov bx,(np)
+       mov (np),ax
+       sub ax,bx
+       jbe 2f
+       call xbrk
+2:
+       xor ax,ax
+       ret
+1:
+       mov ax,0xc
+       jmp cerror
+xbrk:
+       push di
+       mov di,bx
+       mov cx,ax
+       xor ax,ax
+       shr cx,1
+       repz stos
+       jae 3f
+       stosb
+3:
+       pop di
+       ret
+.sect .data
+np: .data2 endbss
+.sect .text
diff --git a/mach/i86/libsys/_close.s b/mach/i86/libsys/_close.s
new file mode 100644 (file)
index 0000000..c3a9b91
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __close
+.extern __close, cerror
+__close:       int 0x86
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_execl.s b/mach/i86/libsys/_execl.s
new file mode 100644 (file)
index 0000000..9ae7d48
--- /dev/null
@@ -0,0 +1,20 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+
+.define __execl
+.extern __execl, _environ, __execve
+__execl:
+       push    si
+       push    di
+       push    bp
+       mov     bp,sp
+       push    (_environ)
+       lea     ax,10(bp)
+       push    ax
+       push    8(bp)
+       call    __execve
+       add     sp,6
+       mov     sp,bp
+       pop     bp
+       pop     di
+       pop     si
+       ret
diff --git a/mach/i86/libsys/_execve.s b/mach/i86/libsys/_execve.s
new file mode 100644 (file)
index 0000000..c6a7e03
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __execve
+.extern __execve, cerror
+__execve:
+       int 0x8b
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_fork.s b/mach/i86/libsys/_fork.s
new file mode 100644 (file)
index 0000000..a61b18a
--- /dev/null
@@ -0,0 +1,11 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __fork
+.extern __fork, cerror
+__fork:        int 0x82
+       jmp 1f
+       jae 2f
+       jmp cerror
+1:
+       xor ax,ax
+2:
+       ret
diff --git a/mach/i86/libsys/_fstat.s b/mach/i86/libsys/_fstat.s
new file mode 100644 (file)
index 0000000..869102a
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __fstat
+.extern __fstat, cerror
+__fstat:       int 0x9c
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_ftime.s b/mach/i86/libsys/_ftime.s
new file mode 100644 (file)
index 0000000..aa5d5eb
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __ftime
+.extern __ftime, cerror
+__ftime:       int 0xa3
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/_getpid.s b/mach/i86/libsys/_getpid.s
new file mode 100644 (file)
index 0000000..0aaedff
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __getpid
+.extern __getpid, cerror
+__getpid:      int 0x94
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/_gtty.s b/mach/i86/libsys/_gtty.s
new file mode 100644 (file)
index 0000000..79c75e4
--- /dev/null
@@ -0,0 +1,15 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __gtty
+.extern __gtty, __ioctl
+__gtty:
+       push    bp
+       mov     bp,sp
+push 6(bp)
+mov ax,0x5401
+push ax
+push 4(bp)
+call __ioctl
+add sp,6
+mov sp,bp
+pop bp
+ret
diff --git a/mach/i86/libsys/_ioctl.s b/mach/i86/libsys/_ioctl.s
new file mode 100644 (file)
index 0000000..f425339
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __ioctl
+.extern __ioctl, cerror
+__ioctl:       int 0xb6
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_kill.s b/mach/i86/libsys/_kill.s
new file mode 100644 (file)
index 0000000..18f4590
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __kill
+.extern __kill, cerror
+__kill:        int 0xa5
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_link.s b/mach/i86/libsys/_link.s
new file mode 100644 (file)
index 0000000..8ecd92d
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __link
+.extern __link, cerror
+__link:        int 0x89
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_lseek.s b/mach/i86/libsys/_lseek.s
new file mode 100644 (file)
index 0000000..ba5e861
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __lseek
+.extern __lseek, cerror
+__lseek:       int 0x93
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_open.s b/mach/i86/libsys/_open.s
new file mode 100644 (file)
index 0000000..e411555
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __open
+.extern __open, cerror
+__open:        int 0x85
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_pause.s b/mach/i86/libsys/_pause.s
new file mode 100644 (file)
index 0000000..6e980d9
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __pause
+.extern __pause, cerror
+__pause:       int 0x9d
+       jb 9f
+       ret
+9:
+       jmp cerror
diff --git a/mach/i86/libsys/_pipe.s b/mach/i86/libsys/_pipe.s
new file mode 100644 (file)
index 0000000..46433e9
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __pipe
+.extern __pipe, cerror
+__pipe:        int 0xaa
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_read.s b/mach/i86/libsys/_read.s
new file mode 100644 (file)
index 0000000..f79558c
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __read
+.extern __read, cerror
+__read:        int 0x83
+       jb 9f
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_sbrk.s b/mach/i86/libsys/_sbrk.s
new file mode 100644 (file)
index 0000000..322d288
--- /dev/null
@@ -0,0 +1,25 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __sbrk
+.extern __sbrk, xbrk, cerror
+__sbrk:
+push   bp
+mov    bp,sp
+mov    ax,4(bp)
+mov    bx,(np)
+add    ax,bx
+mov    cx,sp
+sub    cx,128
+sub    cx,ax
+jbe    1f
+mov    (np),ax
+sub    ax,bx
+jbe    2f
+call   xbrk
+2:
+mov    ax,bx
+pop    bp
+ret
+1:
+mov    ax,0xc
+pop    bp
+jmp    cerror
diff --git a/mach/i86/libsys/_unlink.s b/mach/i86/libsys/_unlink.s
new file mode 100644 (file)
index 0000000..bc344c0
--- /dev/null
@@ -0,0 +1,8 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __unlink
+.extern __unlink, cerror
+__unlink:      int 0x8a
+       jb 9f
+       xor ax,ax
+       ret
+9: jmp cerror
diff --git a/mach/i86/libsys/_wait.s b/mach/i86/libsys/_wait.s
new file mode 100644 (file)
index 0000000..e43ea93
--- /dev/null
@@ -0,0 +1,17 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __wait
+.extern __wait, cerror
+__wait:
+       mov bx,sp
+       mov ax,2        ! void info about unused memory
+       ! Should be 0 according to /usr/include/sys.s, but
+       ! that doesn't work
+       push ax
+       push 2(bx)
+       push ax         ! dummy return address
+       int 0x87
+       jb 9f
+       add sp,6
+       ret
+9:     add sp,6
+       jmp cerror
diff --git a/mach/i86/libsys/_write.s b/mach/i86/libsys/_write.s
new file mode 100644 (file)
index 0000000..d6f7d0b
--- /dev/null
@@ -0,0 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss; .sect .text
+.define __write
+.extern __write, cerror
+__write:       int 0x84
+       jb 9f
+       ret
+9: jmp cerror