From bf95ea8fd94e5b1a7d964170c3b2b5877f037e29 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 22 Jan 1990 13:41:58 +0000 Subject: [PATCH] Added entry points for ANSI C --- mach/ns/libsys/LIST | 29 ++++++++++++++++++++++++++++- mach/ns/libsys/_alarm.s | 17 +++++++++++++++++ mach/ns/libsys/_brk.s | 14 ++++++++++++++ mach/ns/libsys/_close.s | 11 +++++++++++ mach/ns/libsys/_creat.s | 24 ++++++++++++++++++++++++ mach/ns/libsys/_dup.s | 24 ++++++++++++++++++++++++ mach/ns/libsys/_dup2.s | 26 ++++++++++++++++++++++++++ mach/ns/libsys/_execl.s | 20 ++++++++++++++++++++ mach/ns/libsys/_execve.s | 24 ++++++++++++++++++++++++ mach/ns/libsys/_fork.s | 27 +++++++++++++++++++++++++++ mach/ns/libsys/_fstat.s | 25 +++++++++++++++++++++++++ mach/ns/libsys/_ftime.s | 15 +++++++++++++++ mach/ns/libsys/_getpid.s | 16 ++++++++++++++++ mach/ns/libsys/_gtty.s | 17 +++++++++++++++++ mach/ns/libsys/_ioctl.s | 30 ++++++++++++++++++++++++++++++ mach/ns/libsys/_kill.s | 25 +++++++++++++++++++++++++ mach/ns/libsys/_link.s | 25 +++++++++++++++++++++++++ mach/ns/libsys/_lseek.s | 29 +++++++++++++++++++++++++++++ mach/ns/libsys/_open.s | 24 ++++++++++++++++++++++++ mach/ns/libsys/_pause.s | 14 ++++++++++++++ mach/ns/libsys/_pipe.s | 28 ++++++++++++++++++++++++++++ mach/ns/libsys/_read.s | 20 ++++++++++++++++++++ mach/ns/libsys/_sbrk.s | 16 ++++++++++++++++ mach/ns/libsys/_stty.s | 17 +++++++++++++++++ mach/ns/libsys/_times.s | 15 +++++++++++++++ mach/ns/libsys/_unlink.s | 24 ++++++++++++++++++++++++ mach/ns/libsys/_wait.s | 34 ++++++++++++++++++++++++++++++++++ mach/ns/libsys/_write.s | 20 ++++++++++++++++++++ 28 files changed, 609 insertions(+), 1 deletion(-) create mode 100644 mach/ns/libsys/_alarm.s create mode 100644 mach/ns/libsys/_brk.s create mode 100644 mach/ns/libsys/_close.s create mode 100644 mach/ns/libsys/_creat.s create mode 100644 mach/ns/libsys/_dup.s create mode 100644 mach/ns/libsys/_dup2.s create mode 100644 mach/ns/libsys/_execl.s create mode 100644 mach/ns/libsys/_execve.s create mode 100644 mach/ns/libsys/_fork.s create mode 100644 mach/ns/libsys/_fstat.s create mode 100644 mach/ns/libsys/_ftime.s create mode 100644 mach/ns/libsys/_getpid.s create mode 100644 mach/ns/libsys/_gtty.s create mode 100644 mach/ns/libsys/_ioctl.s create mode 100644 mach/ns/libsys/_kill.s create mode 100644 mach/ns/libsys/_link.s create mode 100644 mach/ns/libsys/_lseek.s create mode 100644 mach/ns/libsys/_open.s create mode 100644 mach/ns/libsys/_pause.s create mode 100644 mach/ns/libsys/_pipe.s create mode 100644 mach/ns/libsys/_read.s create mode 100644 mach/ns/libsys/_sbrk.s create mode 100644 mach/ns/libsys/_stty.s create mode 100644 mach/ns/libsys/_times.s create mode 100644 mach/ns/libsys/_unlink.s create mode 100644 mach/ns/libsys/_wait.s create mode 100644 mach/ns/libsys/_write.s diff --git a/mach/ns/libsys/LIST b/mach/ns/libsys/LIST index c239e828d..7afca84f6 100644 --- a/mach/ns/libsys/LIST +++ b/mach/ns/libsys/LIST @@ -22,7 +22,6 @@ execl.s execle.s execv.s execve.s -_exit.s fork.s fstat.s ftime.s @@ -62,3 +61,31 @@ utime.s wait.s write.s errno.s +_alarm.s +_brk.s +_close.s +_creat.s +_dup.s +_dup2.s +_execl.s +_execve.s +_exit.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 +_sbrk.s +_stty.s +_times.s +_unlink.s +_wait.s +_write.s diff --git a/mach/ns/libsys/_alarm.s b/mach/ns/libsys/_alarm.s new file mode 100644 index 000000000..107f7840f --- /dev/null +++ b/mach/ns/libsys/_alarm.s @@ -0,0 +1,17 @@ +.define __alarm +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __alarm +.sect .text +__alarm: +enter[], 0 +movd 8(fp),tos +movd 27,tos +jsr @.mon +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_brk.s b/mach/ns/libsys/_brk.s new file mode 100644 index 000000000..69cd0a83b --- /dev/null +++ b/mach/ns/libsys/_brk.s @@ -0,0 +1,14 @@ +.define __brk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __brk +.sect .text +__brk: +enter[], 0 +movd 8(fp),@.reghp +movd 0,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_close.s b/mach/ns/libsys/_close.s new file mode 100644 index 000000000..d4b732403 --- /dev/null +++ b/mach/ns/libsys/_close.s @@ -0,0 +1,11 @@ +.define __close +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __close +.sect .text +__close: +movd 0, r4 +ret 0 diff --git a/mach/ns/libsys/_creat.s b/mach/ns/libsys/_creat.s new file mode 100644 index 000000000..faffa6726 --- /dev/null +++ b/mach/ns/libsys/_creat.s @@ -0,0 +1,24 @@ +.define __creat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __creat +.sect .text +__creat: +enter[], 0 +movd 12(fp),tos +movd 8(fp),tos +movd 8,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,tos +I0011: +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_dup.s b/mach/ns/libsys/_dup.s new file mode 100644 index 000000000..a2376082c --- /dev/null +++ b/mach/ns/libsys/_dup.s @@ -0,0 +1,24 @@ +.define __dup +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __dup +.sect .text +__dup: +enter[], 0 +movd 8(fp),tos +movd 8(fp),tos +movd 41,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,tos +I0011: +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_dup2.s b/mach/ns/libsys/_dup2.s new file mode 100644 index 000000000..2ff3f0506 --- /dev/null +++ b/mach/ns/libsys/_dup2.s @@ -0,0 +1,26 @@ +.define __dup2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __dup2 +.sect .text +__dup2: +enter[], 0 +movd 8(fp),r7 +ord 64,r7 +movd 12(fp),tos +movd r7,tos +movd 41,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,tos +I0011: +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_execl.s b/mach/ns/libsys/_execl.s new file mode 100644 index 000000000..f006b535d --- /dev/null +++ b/mach/ns/libsys/_execl.s @@ -0,0 +1,20 @@ +.define __execl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __execl +.sect .text +__execl: +enter[], 0 +movd @__penvp,tos +addr 12(fp),tos +movd 8(fp),tos +movd 59,tos +jsr @.mon +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_execve.s b/mach/ns/libsys/_execve.s new file mode 100644 index 000000000..f8673092d --- /dev/null +++ b/mach/ns/libsys/_execve.s @@ -0,0 +1,24 @@ +.define __execve +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __execve +.sect .text +__execve: +enter[], 0 +addr 8(fp),r7 +movd 12,r0 +addd r0,r7 +1: +subd 4,r7 +movd 0(r7),tos +acbd -4,r0,1b +movd 59,tos +jsr @.mon +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_fork.s b/mach/ns/libsys/_fork.s new file mode 100644 index 000000000..c3e555836 --- /dev/null +++ b/mach/ns/libsys/_fork.s @@ -0,0 +1,27 @@ +.define __fork +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__fork: +enter[], 0 +movd 2,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 +I0011: +cmpqd 0,tos +beq I0012 +movd tos,r7 +movd 0,tos +I0012: +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_fstat.s b/mach/ns/libsys/_fstat.s new file mode 100644 index 000000000..923e25f13 --- /dev/null +++ b/mach/ns/libsys/_fstat.s @@ -0,0 +1,25 @@ +.define __fstat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __fstat +.sect .text +__fstat: +enter[], 0 +movd 12(fp),tos +movd 8(fp),tos +movd 28,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +movd 0,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_ftime.s b/mach/ns/libsys/_ftime.s new file mode 100644 index 000000000..4044b13f3 --- /dev/null +++ b/mach/ns/libsys/_ftime.s @@ -0,0 +1,15 @@ +.define __ftime +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __ftime +.sect .text +__ftime: +enter[], 0 +movd 8(fp),tos +movd 35,tos +jsr @.mon +exit [] +ret 0 diff --git a/mach/ns/libsys/_getpid.s b/mach/ns/libsys/_getpid.s new file mode 100644 index 000000000..6c5a11518 --- /dev/null +++ b/mach/ns/libsys/_getpid.s @@ -0,0 +1,16 @@ +.define __getpid +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __getpid +.sect .text +__getpid: +enter[], 0 +movd 20,tos +jsr @.mon +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_gtty.s b/mach/ns/libsys/_gtty.s new file mode 100644 index 000000000..ef688caae --- /dev/null +++ b/mach/ns/libsys/_gtty.s @@ -0,0 +1,17 @@ +.define __gtty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __gtty +.sect .text +__gtty: +enter[], 0 +movd 12(fp),tos +movd 29704,tos +movd 8(fp),tos +jsr @__ioctl +adjspd -12 +exit [] +ret 0 diff --git a/mach/ns/libsys/_ioctl.s b/mach/ns/libsys/_ioctl.s new file mode 100644 index 000000000..b88a104cd --- /dev/null +++ b/mach/ns/libsys/_ioctl.s @@ -0,0 +1,30 @@ +.define __ioctl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __ioctl +.sect .text +__ioctl: +enter[], 0 +addr 8(fp),r7 +movd 12,r0 +addd r0,r7 +1: +subd 4,r7 +movd 0(r7),tos +acbd -4,r0,1b +movd 54,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +movd 0,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_kill.s b/mach/ns/libsys/_kill.s new file mode 100644 index 000000000..ab52a3b92 --- /dev/null +++ b/mach/ns/libsys/_kill.s @@ -0,0 +1,25 @@ +.define __kill +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __kill +.sect .text +__kill: +enter[], 0 +movd 12(fp),tos +movd 8(fp),tos +movd 37,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +movd 0,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_link.s b/mach/ns/libsys/_link.s new file mode 100644 index 000000000..295e7594a --- /dev/null +++ b/mach/ns/libsys/_link.s @@ -0,0 +1,25 @@ +.define __link +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __link +.sect .text +__link: +enter[], 0 +movd 12(fp),tos +movd 8(fp),tos +movd 9,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +movd 0,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_lseek.s b/mach/ns/libsys/_lseek.s new file mode 100644 index 000000000..aa2fc9375 --- /dev/null +++ b/mach/ns/libsys/_lseek.s @@ -0,0 +1,29 @@ +.define __lseek +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __lseek +.sect .text +__lseek: +enter[], 0 +addr 8(fp),r7 +movd 16,r0 +addd r0,r7 +1: +subd 4,r7 +movd 0(r7),tos +acbd -4,r0,1b +movd 19,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,tos +I0011: +movd tos,r4 +movd tos,r5 +exit [] +ret 0 diff --git a/mach/ns/libsys/_open.s b/mach/ns/libsys/_open.s new file mode 100644 index 000000000..95196b82e --- /dev/null +++ b/mach/ns/libsys/_open.s @@ -0,0 +1,24 @@ +.define __open +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __open +.sect .text +__open: +enter[], 0 +movd 12(fp),tos +movd 8(fp),tos +movd 5,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,tos +I0011: +movd tos,r7 +movd r7,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_pause.s b/mach/ns/libsys/_pause.s new file mode 100644 index 000000000..54d8fd6fb --- /dev/null +++ b/mach/ns/libsys/_pause.s @@ -0,0 +1,14 @@ +.define __pause +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __pause +.sect .text +__pause: +enter[], 0 +movd 29,tos +jsr @.mon +exit [] +ret 0 diff --git a/mach/ns/libsys/_pipe.s b/mach/ns/libsys/_pipe.s new file mode 100644 index 000000000..f5df62c59 --- /dev/null +++ b/mach/ns/libsys/_pipe.s @@ -0,0 +1,28 @@ +.define __pipe +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __pipe +.sect .text +__pipe: +enter[], 0 +movd 42,tos +jsr @.mon +cmpqd 0,tos +beq I0011 +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 +I0011: +movd 8(fp),r7 +movd tos,r6 +movd r6,4(r7) +movd tos,r6 +movd r6,0(8(fp)) +movd 0,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_read.s b/mach/ns/libsys/_read.s new file mode 100644 index 000000000..9757ee00a --- /dev/null +++ b/mach/ns/libsys/_read.s @@ -0,0 +1,20 @@ +.define __read +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __read +.sect .text +__read: +enter[], 0 +save [r0,r1,r2,r3] +movd 3,r0 +movd 12(fp),r1 +movd 16(fp),r2 +movd 0,r3 +svc +movd 16(fp),r4 +restore [r0,r1,r2,r3] +exit[] +ret 0 diff --git a/mach/ns/libsys/_sbrk.s b/mach/ns/libsys/_sbrk.s new file mode 100644 index 000000000..49ca74592 --- /dev/null +++ b/mach/ns/libsys/_sbrk.s @@ -0,0 +1,16 @@ +.define __sbrk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __sbrk +.sect .text +__sbrk: +enter[], 0 +movd @.reghp,r7 +addd 8(fp),r7 +movd r7,@.reghp +movd @.reghp,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_stty.s b/mach/ns/libsys/_stty.s new file mode 100644 index 000000000..93e00076f --- /dev/null +++ b/mach/ns/libsys/_stty.s @@ -0,0 +1,17 @@ +.define __stty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __stty +.sect .text +__stty: +enter[], 0 +movd 12(fp),tos +movd 29705,tos +movd 8(fp),tos +jsr @__ioctl +adjspd -12 +exit [] +ret 0 diff --git a/mach/ns/libsys/_times.s b/mach/ns/libsys/_times.s new file mode 100644 index 000000000..7321081e5 --- /dev/null +++ b/mach/ns/libsys/_times.s @@ -0,0 +1,15 @@ +.define __times +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __times +.sect .text +__times: +enter[], 0 +movd 8(fp),tos +movd 43,tos +jsr @.mon +exit [] +ret 0 diff --git a/mach/ns/libsys/_unlink.s b/mach/ns/libsys/_unlink.s new file mode 100644 index 000000000..44d0dc091 --- /dev/null +++ b/mach/ns/libsys/_unlink.s @@ -0,0 +1,24 @@ +.define __unlink +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __unlink +.sect .text +__unlink: +enter[], 0 +movd 8(fp),tos +movd 10,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +movd 0,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_wait.s b/mach/ns/libsys/_wait.s new file mode 100644 index 000000000..444e22437 --- /dev/null +++ b/mach/ns/libsys/_wait.s @@ -0,0 +1,34 @@ +.define __wait +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __wait +.sect .text +__wait: +enter[], 0 +movd 7,tos +jsr @.mon +cmpqd 0,tos +bne I0011 +cmpqd 0,8(fp) +beq I0012 +movd tos,r7 +movd r7,0(8(fp)) +movd tos,r6 +movd r6,r4 +exit [] +ret 0 +I0012: +adjspd -4 +movd tos,r7 +movd r7,r4 +exit [] +ret 0 +I0011: +movd tos,r7 +movd r7,@_errno +movd -1,r4 +exit [] +ret 0 diff --git a/mach/ns/libsys/_write.s b/mach/ns/libsys/_write.s new file mode 100644 index 000000000..1f1c7d244 --- /dev/null +++ b/mach/ns/libsys/_write.s @@ -0,0 +1,20 @@ +.define __write +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __write +.sect .text +__write: +enter[], 0 +save [r0,r1,r2,r3] +movd 4,r0 +movd 12(fp),r1 +movd 16(fp),r2 +movd 0,r3 +svc +movd 16(fp),r4 +restore [r0,r1,r2,r3] +exit[] +ret 0