From 9f0c356194171909455f4c84b7e2f9296b676612 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 22 Jan 1990 14:15:55 +0000 Subject: [PATCH] Added entry points for ANSI C --- mach/pmds4/libsys/LIST | 24 ++++++++++++++++++++++++ mach/pmds4/libsys/_alarm.s | 11 +++++++++++ mach/pmds4/libsys/_close.s | 14 ++++++++++++++ mach/pmds4/libsys/_creat.s | 13 +++++++++++++ mach/pmds4/libsys/_dup.s | 15 +++++++++++++++ mach/pmds4/libsys/_exec.s | 36 ++++++++++++++++++++++++++++++++++++ mach/pmds4/libsys/_fork.s | 18 ++++++++++++++++++ mach/pmds4/libsys/_fstat.s | 14 ++++++++++++++ mach/pmds4/libsys/_getpid.s | 10 ++++++++++ mach/pmds4/libsys/_gtty.s | 17 +++++++++++++++++ mach/pmds4/libsys/_ioctl.s | 14 ++++++++++++++ mach/pmds4/libsys/_kill.s | 14 ++++++++++++++ mach/pmds4/libsys/_link.s | 14 ++++++++++++++ mach/pmds4/libsys/_lseek.s | 13 +++++++++++++ mach/pmds4/libsys/_open.s | 13 +++++++++++++ mach/pmds4/libsys/_pause.s | 10 ++++++++++ mach/pmds4/libsys/_pipe.s | 17 +++++++++++++++++ mach/pmds4/libsys/_read.s | 13 +++++++++++++ mach/pmds4/libsys/_sbrk.s | 31 +++++++++++++++++++++++++++++++ mach/pmds4/libsys/_stty.s | 17 +++++++++++++++++ mach/pmds4/libsys/_time.s | 26 ++++++++++++++++++++++++++ mach/pmds4/libsys/_times.s | 11 +++++++++++ mach/pmds4/libsys/_unlink.s | 14 ++++++++++++++ mach/pmds4/libsys/_wait.s | 18 ++++++++++++++++++ mach/pmds4/libsys/_write.s | 13 +++++++++++++ mach/pmds4/libsys/sbrk.s | 14 ++++---------- 26 files changed, 414 insertions(+), 10 deletions(-) create mode 100644 mach/pmds4/libsys/_alarm.s create mode 100644 mach/pmds4/libsys/_close.s create mode 100644 mach/pmds4/libsys/_creat.s create mode 100644 mach/pmds4/libsys/_dup.s create mode 100644 mach/pmds4/libsys/_exec.s create mode 100644 mach/pmds4/libsys/_fork.s create mode 100644 mach/pmds4/libsys/_fstat.s create mode 100644 mach/pmds4/libsys/_getpid.s create mode 100644 mach/pmds4/libsys/_gtty.s create mode 100644 mach/pmds4/libsys/_ioctl.s create mode 100644 mach/pmds4/libsys/_kill.s create mode 100644 mach/pmds4/libsys/_link.s create mode 100644 mach/pmds4/libsys/_lseek.s create mode 100644 mach/pmds4/libsys/_open.s create mode 100644 mach/pmds4/libsys/_pause.s create mode 100644 mach/pmds4/libsys/_pipe.s create mode 100644 mach/pmds4/libsys/_read.s create mode 100644 mach/pmds4/libsys/_sbrk.s create mode 100644 mach/pmds4/libsys/_stty.s create mode 100644 mach/pmds4/libsys/_time.s create mode 100644 mach/pmds4/libsys/_times.s create mode 100644 mach/pmds4/libsys/_unlink.s create mode 100644 mach/pmds4/libsys/_wait.s create mode 100644 mach/pmds4/libsys/_write.s diff --git a/mach/pmds4/libsys/LIST b/mach/pmds4/libsys/LIST index c4b166770..e1b34bedb 100644 --- a/mach/pmds4/libsys/LIST +++ b/mach/pmds4/libsys/LIST @@ -51,3 +51,27 @@ write.s exit2.s cleanup.s cerror.s +_alarm.s +_close.s +_creat.s +_dup.s +_exec.s +_fork.s +_fstat.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 +_time.s +_times.s +_unlink.s +_wait.s +_write.s diff --git a/mach/pmds4/libsys/_alarm.s b/mach/pmds4/libsys/_alarm.s new file mode 100644 index 000000000..6c792325e --- /dev/null +++ b/mach/pmds4/libsys/_alarm.s @@ -0,0 +1,11 @@ +.define __alarm +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __alarm +.sect .text +__alarm: trap #0 +.data2 0x1B + rts diff --git a/mach/pmds4/libsys/_close.s b/mach/pmds4/libsys/_close.s new file mode 100644 index 000000000..a03cb9d7b --- /dev/null +++ b/mach/pmds4/libsys/_close.s @@ -0,0 +1,14 @@ +.define __close +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __close +__close: trap #0 +.data2 0x6 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_creat.s b/mach/pmds4/libsys/_creat.s new file mode 100644 index 000000000..e9bb672dc --- /dev/null +++ b/mach/pmds4/libsys/_creat.s @@ -0,0 +1,13 @@ +.define __creat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __creat +__creat: trap #0 +.data2 0x8 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/_dup.s b/mach/pmds4/libsys/_dup.s new file mode 100644 index 000000000..0c90dad2c --- /dev/null +++ b/mach/pmds4/libsys/_dup.s @@ -0,0 +1,15 @@ +.define __dup +.define __dup2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__dup2: or.l #64,4(sp) + +__dup: trap #0 +.data2 0x29 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/_exec.s b/mach/pmds4/libsys/_exec.s new file mode 100644 index 000000000..8cc2fbc68 --- /dev/null +++ b/mach/pmds4/libsys/_exec.s @@ -0,0 +1,36 @@ +.define __execl +.define __execve +.define __execv +.define __execle +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__execl: tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) +3: + pea 12(a6) +4: + move.l 8(a6),-(sp) + jsr __execve + unlk a6 + rts +__execve: trap #0 +.data2 0x3b + jmp cerror +__execv: + tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) + move.l 12(a6),-(sp) + bra 4b +__execle: tst.b -48(sp) + link a6,#0 + lea 12(a6),a0 +1: + tst.l (a0)+ + bne 1b + move.l a0,-(sp) + bra 3b diff --git a/mach/pmds4/libsys/_fork.s b/mach/pmds4/libsys/_fork.s new file mode 100644 index 000000000..4fc8fd782 --- /dev/null +++ b/mach/pmds4/libsys/_fork.s @@ -0,0 +1,18 @@ +.define __fork +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __fork +__fork: trap #0 +.data2 0x2 + bra 1f + bcs 2f + rts +2: + jmp cerror +1: + bcs 2b + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_fstat.s b/mach/pmds4/libsys/_fstat.s new file mode 100644 index 000000000..20538896a --- /dev/null +++ b/mach/pmds4/libsys/_fstat.s @@ -0,0 +1,14 @@ +.define __fstat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __fstat +__fstat: trap #0 +.data2 0x1C + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_getpid.s b/mach/pmds4/libsys/_getpid.s new file mode 100644 index 000000000..ba00fcbd0 --- /dev/null +++ b/mach/pmds4/libsys/_getpid.s @@ -0,0 +1,10 @@ +.define __getpid +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __getpid +__getpid: trap #0 +.data2 0x14 + rts diff --git a/mach/pmds4/libsys/_gtty.s b/mach/pmds4/libsys/_gtty.s new file mode 100644 index 000000000..322bf3592 --- /dev/null +++ b/mach/pmds4/libsys/_gtty.s @@ -0,0 +1,17 @@ +.define __gtty +.extern __gtty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__gtty: +tst.b -40(sp) +link a6,#-0 +move.l 12(a6),-(sp) +move.l #0x7408,-(sp) +move.l 8(a6),-(sp) +jsr __ioctl +add.l #12,sp +unlk a6 +rts diff --git a/mach/pmds4/libsys/_ioctl.s b/mach/pmds4/libsys/_ioctl.s new file mode 100644 index 000000000..d08648aea --- /dev/null +++ b/mach/pmds4/libsys/_ioctl.s @@ -0,0 +1,14 @@ +.define __ioctl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __ioctl +__ioctl: trap #0 +.data2 0x36 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_kill.s b/mach/pmds4/libsys/_kill.s new file mode 100644 index 000000000..d409d1da5 --- /dev/null +++ b/mach/pmds4/libsys/_kill.s @@ -0,0 +1,14 @@ +.define __kill +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __kill +__kill: trap #0 +.data2 0x25 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_link.s b/mach/pmds4/libsys/_link.s new file mode 100644 index 000000000..976b2a818 --- /dev/null +++ b/mach/pmds4/libsys/_link.s @@ -0,0 +1,14 @@ +.define __link +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __link +__link: trap #0 +.data2 0x9 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_lseek.s b/mach/pmds4/libsys/_lseek.s new file mode 100644 index 000000000..54e28b18d --- /dev/null +++ b/mach/pmds4/libsys/_lseek.s @@ -0,0 +1,13 @@ +.define __lseek +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __lseek +__lseek: trap #0 +.data2 0x13 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/_open.s b/mach/pmds4/libsys/_open.s new file mode 100644 index 000000000..1723bf769 --- /dev/null +++ b/mach/pmds4/libsys/_open.s @@ -0,0 +1,13 @@ +.define __open +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __open +__open: trap #0 +.data2 0x5 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/_pause.s b/mach/pmds4/libsys/_pause.s new file mode 100644 index 000000000..41154ecdf --- /dev/null +++ b/mach/pmds4/libsys/_pause.s @@ -0,0 +1,10 @@ +.define __pause +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __pause +__pause: trap #0 +.data2 0x1D + rts diff --git a/mach/pmds4/libsys/_pipe.s b/mach/pmds4/libsys/_pipe.s new file mode 100644 index 000000000..856954c16 --- /dev/null +++ b/mach/pmds4/libsys/_pipe.s @@ -0,0 +1,17 @@ +.define __pipe +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __pipe +__pipe: trap #0 +.data2 0x2A + bcc 1f + jmp cerror +1: + move.l 4(sp),a0 + move.l d0,(a0)+ + move.l d1,(a0) + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_read.s b/mach/pmds4/libsys/_read.s new file mode 100644 index 000000000..e42548d03 --- /dev/null +++ b/mach/pmds4/libsys/_read.s @@ -0,0 +1,13 @@ +.define __read +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __read +__read: trap #0 +.data2 0x3 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/_sbrk.s b/mach/pmds4/libsys/_sbrk.s new file mode 100644 index 000000000..0819a059d --- /dev/null +++ b/mach/pmds4/libsys/_sbrk.s @@ -0,0 +1,31 @@ +.define __sbrk +.define __brk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__sbrk: tst.b -8(sp) + move.l 4(sp),d0 + beq 1f + add.l .limhp,d0 + move.l d0,-(sp) + clr.l -(sp) + trap #0 +.data2 0x11 + add.l #8,sp + bcc 1f + jmp cerror +1: + move.l .limhp,d0 + move.l 4(sp),d1 + add.l d1,.limhp + rts +__brk: trap #0 +.data2 0x11 + bcc 1f + jmp cerror +1: + move.l 4(sp),.limhp + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_stty.s b/mach/pmds4/libsys/_stty.s new file mode 100644 index 000000000..29384a189 --- /dev/null +++ b/mach/pmds4/libsys/_stty.s @@ -0,0 +1,17 @@ +.define __stty +.extern __stty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__stty: +tst.b -40(sp) +link a6,#-0 +move.l 12(a6),-(sp) +move.l #0x7409,-(sp) +move.l 8(a6),-(sp) +jsr __ioctl +add.l #12,sp +unlk a6 +rts diff --git a/mach/pmds4/libsys/_time.s b/mach/pmds4/libsys/_time.s new file mode 100644 index 000000000..e209b6421 --- /dev/null +++ b/mach/pmds4/libsys/_time.s @@ -0,0 +1,26 @@ +.define _time +.define __ftime +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern _time +_time: + trap #0 +.data2 0xD + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d0,(a0) +1: + rts +.extern __ftime +__ftime: + trap #0 +.data2 0x23 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_times.s b/mach/pmds4/libsys/_times.s new file mode 100644 index 000000000..b3d6168eb --- /dev/null +++ b/mach/pmds4/libsys/_times.s @@ -0,0 +1,11 @@ +.define __times +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __times +__times: + trap #0 +.data2 0x2B + rts diff --git a/mach/pmds4/libsys/_unlink.s b/mach/pmds4/libsys/_unlink.s new file mode 100644 index 000000000..2806dd837 --- /dev/null +++ b/mach/pmds4/libsys/_unlink.s @@ -0,0 +1,14 @@ +.define __unlink +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __unlink +__unlink: trap #0 +.data2 0xA + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds4/libsys/_wait.s b/mach/pmds4/libsys/_wait.s new file mode 100644 index 000000000..21919407b --- /dev/null +++ b/mach/pmds4/libsys/_wait.s @@ -0,0 +1,18 @@ +.define __wait +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __wait +__wait: trap #0 +.data2 0x7 + bcc 1f + jmp cerror +1: + tst.l 4(sp) + beq 2f + move.l 4(sp),a0 + move.l d1,(a0) +2: + rts diff --git a/mach/pmds4/libsys/_write.s b/mach/pmds4/libsys/_write.s new file mode 100644 index 000000000..cc0cb58a6 --- /dev/null +++ b/mach/pmds4/libsys/_write.s @@ -0,0 +1,13 @@ +.define __write +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __write +__write: trap #0 +.data2 0x4 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds4/libsys/sbrk.s b/mach/pmds4/libsys/sbrk.s index 47d0032f9..04b2a7596 100644 --- a/mach/pmds4/libsys/sbrk.s +++ b/mach/pmds4/libsys/sbrk.s @@ -5,12 +5,10 @@ .sect .data .sect .bss .sect .text -.extern _sbrk -.extern _brk _sbrk: tst.b -8(sp) move.l 4(sp),d0 beq 1f - add.l nd,d0 + add.l .limhp,d0 move.l d0,-(sp) clr.l -(sp) trap #0 @@ -19,19 +17,15 @@ _sbrk: tst.b -8(sp) bcc 1f jmp cerror 1: - move.l nd,d0 + move.l .limhp,d0 move.l 4(sp),d1 - add.l d1,nd + add.l d1,.limhp rts _brk: trap #0 .data2 0x11 bcc 1f jmp cerror 1: - move.l 4(sp),nd + move.l 4(sp),.limhp clr.l d0 rts -.sect .data -nd: - .data4 endbss -.sect .text