From ee026dd2ab2e84e15ef2ebc112e789a17c0327be Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 22 Jan 1990 13:59:43 +0000 Subject: [PATCH] Added entry points for ANSI C --- mach/pmds/libsys/LIST | 23 +++++++++++++++++ mach/pmds/libsys/_alarm.s | 20 +++++++++++++++ mach/pmds/libsys/_close.s | 25 ++++++++++++++++++ mach/pmds/libsys/_creat.s | 25 ++++++++++++++++++ mach/pmds/libsys/_dup.s | 41 ++++++++++++++++++++++++++++++ mach/pmds/libsys/_exec.s | 32 +++++++++++++++++++++++ mach/pmds/libsys/_fork.s | 17 +++++++++++++ mach/pmds/libsys/_fstat.s | 26 +++++++++++++++++++ mach/pmds/libsys/_getpid.s | 10 ++++++++ mach/pmds/libsys/_gtty.s | 18 +++++++++++++ mach/pmds/libsys/_ioctl.s | 29 +++++++++++++++++++++ mach/pmds/libsys/_kill.s | 28 ++++++++++++++++++++ mach/pmds/libsys/_link.s | 14 ++++++++++ mach/pmds/libsys/_lseek.s | 28 ++++++++++++++++++++ mach/pmds/libsys/_open.s | 25 ++++++++++++++++++ mach/pmds/libsys/_pause.s | 13 ++++++++++ mach/pmds/libsys/_pipe.s | 17 +++++++++++++ mach/pmds/libsys/_read.s | 28 ++++++++++++++++++++ mach/pmds/libsys/_sbrk.s | 52 ++++++++++++++++++++++++++++++++++++++ mach/pmds/libsys/_stty.s | 18 +++++++++++++ mach/pmds/libsys/_time.s | 26 +++++++++++++++++++ mach/pmds/libsys/_unlink.s | 14 ++++++++++ mach/pmds/libsys/_wait.s | 18 +++++++++++++ mach/pmds/libsys/_write.s | 28 ++++++++++++++++++++ 24 files changed, 575 insertions(+) create mode 100644 mach/pmds/libsys/_alarm.s create mode 100644 mach/pmds/libsys/_close.s create mode 100644 mach/pmds/libsys/_creat.s create mode 100644 mach/pmds/libsys/_dup.s create mode 100644 mach/pmds/libsys/_exec.s create mode 100644 mach/pmds/libsys/_fork.s create mode 100644 mach/pmds/libsys/_fstat.s create mode 100644 mach/pmds/libsys/_getpid.s create mode 100644 mach/pmds/libsys/_gtty.s create mode 100644 mach/pmds/libsys/_ioctl.s create mode 100644 mach/pmds/libsys/_kill.s create mode 100644 mach/pmds/libsys/_link.s create mode 100644 mach/pmds/libsys/_lseek.s create mode 100644 mach/pmds/libsys/_open.s create mode 100644 mach/pmds/libsys/_pause.s create mode 100644 mach/pmds/libsys/_pipe.s create mode 100644 mach/pmds/libsys/_read.s create mode 100644 mach/pmds/libsys/_sbrk.s create mode 100644 mach/pmds/libsys/_stty.s create mode 100644 mach/pmds/libsys/_time.s create mode 100644 mach/pmds/libsys/_unlink.s create mode 100644 mach/pmds/libsys/_wait.s create mode 100644 mach/pmds/libsys/_write.s diff --git a/mach/pmds/libsys/LIST b/mach/pmds/libsys/LIST index 43cdccb08..52c15a36b 100644 --- a/mach/pmds/libsys/LIST +++ b/mach/pmds/libsys/LIST @@ -37,3 +37,26 @@ exit2.s time.s cleanup.s pause.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 +_unlink.s +_wait.s +_write.s diff --git a/mach/pmds/libsys/_alarm.s b/mach/pmds/libsys/_alarm.s new file mode 100644 index 000000000..17b64cc9f --- /dev/null +++ b/mach/pmds/libsys/_alarm.s @@ -0,0 +1,20 @@ +.define __alarm +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __alarm +.sect .text +__alarm: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6),-(sp) +clr.w -(sp) +jsr __Salarm +add.l #4,sp +unlk a6 +rts +__Salarm: trap #0 +.data2 0x1B + rts diff --git a/mach/pmds/libsys/_close.s b/mach/pmds/libsys/_close.s new file mode 100644 index 000000000..dbc66919d --- /dev/null +++ b/mach/pmds/libsys/_close.s @@ -0,0 +1,25 @@ +.define __close +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __close +.sect .text +__close: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Sclose +add.l #4,sp +unlk a6 +rts +__Sclose: trap #0 +.data2 0x6 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/_creat.s b/mach/pmds/libsys/_creat.s new file mode 100644 index 000000000..45c31e65a --- /dev/null +++ b/mach/pmds/libsys/_creat.s @@ -0,0 +1,25 @@ +.define __creat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __creat +.sect .text +__creat: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Screat +add.l #8,sp +unlk a6 +rts +__Screat: trap #0 +.data2 0x8 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_dup.s b/mach/pmds/libsys/_dup.s new file mode 100644 index 000000000..88b36e1a4 --- /dev/null +++ b/mach/pmds/libsys/_dup.s @@ -0,0 +1,41 @@ +.define __dup +.define __dup2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __dup +.sect .text +__dup: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Sdup +add.l #4,sp +unlk a6 +rts +.extern __dup2 +__dup2: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Sdup2 +add.l #8,sp +unlk a6 +rts +__Sdup2: or.l #64,4(sp) + +__Sdup: trap #0 +.data2 0x29 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_exec.s b/mach/pmds/libsys/_exec.s new file mode 100644 index 000000000..5b0bdf2ef --- /dev/null +++ b/mach/pmds/libsys/_exec.s @@ -0,0 +1,32 @@ +.define __execl +.define __execve +.define __execv +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __execl +.extern __execve +.extern __execv +__execl: tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) + pea 12(a6) + move.l 8(a6),-(sp) + jsr __execve + add.l #12,sp + unlk a6 + rts +__execve: trap #0 +.data2 59 + jmp cerror +__execv: tst.b -48(sp) + link a6,#0 + move.l _environ,-(sp) + move.l 12(a6),-(sp) + move.l 8(a6),-(sp) + jsr __execve + add.l #12,sp + unlk a6 + rts diff --git a/mach/pmds/libsys/_fork.s b/mach/pmds/libsys/_fork.s new file mode 100644 index 000000000..ae6355b35 --- /dev/null +++ b/mach/pmds/libsys/_fork.s @@ -0,0 +1,17 @@ +.define __fork +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __fork +__fork: trap #0 +.data2 0x2 + bra 3f + rts +3: + bcc 2f + jmp cerror +2: + clr.l d0 + rts diff --git a/mach/pmds/libsys/_fstat.s b/mach/pmds/libsys/_fstat.s new file mode 100644 index 000000000..564f5d56b --- /dev/null +++ b/mach/pmds/libsys/_fstat.s @@ -0,0 +1,26 @@ +.define __fstat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __fstat +.sect .text +__fstat: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l 10(a6),-(sp) +move.l d2,-(sp) +jsr __Sfstat +add.l #8,sp +unlk a6 +rts +__Sfstat: trap #0 +.data2 0x1C + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/_getpid.s b/mach/pmds/libsys/_getpid.s new file mode 100644 index 000000000..ba00fcbd0 --- /dev/null +++ b/mach/pmds/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/pmds/libsys/_gtty.s b/mach/pmds/libsys/_gtty.s new file mode 100644 index 000000000..0d1d52f14 --- /dev/null +++ b/mach/pmds/libsys/_gtty.s @@ -0,0 +1,18 @@ +.define __gtty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __gtty +.sect .text +__gtty: +tst.b -40(sp) +link a6,#-0 +move.l 10(a6),-(sp) +move.w #29704,-(sp) +move.w 8(a6),-(sp) +jsr __ioctl +add.l #8,sp +unlk a6 +rts diff --git a/mach/pmds/libsys/_ioctl.s b/mach/pmds/libsys/_ioctl.s new file mode 100644 index 000000000..0f1eed7e4 --- /dev/null +++ b/mach/pmds/libsys/_ioctl.s @@ -0,0 +1,29 @@ +.define __ioctl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __ioctl +.sect .text +__ioctl: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l 12(a6),-(sp) +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Sioctl +lea 12(sp),sp +unlk a6 +rts +__Sioctl: trap #0 +.data2 0x36 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/_kill.s b/mach/pmds/libsys/_kill.s new file mode 100644 index 000000000..46be033d8 --- /dev/null +++ b/mach/pmds/libsys/_kill.s @@ -0,0 +1,28 @@ +.define __kill +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __kill +.sect .text +__kill: +tst.b -40(sp) +link a6,#-0 +move.w 10(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l d1,-(sp) +jsr __Skill +add.l #8,sp +unlk a6 +rts +__Skill: trap #0 +.data2 0x25 + bcc 1f + jmp cerror +1: + clr.l d0 + rts diff --git a/mach/pmds/libsys/_link.s b/mach/pmds/libsys/_link.s new file mode 100644 index 000000000..976b2a818 --- /dev/null +++ b/mach/pmds/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/pmds/libsys/_lseek.s b/mach/pmds/libsys/_lseek.s new file mode 100644 index 000000000..965a44e20 --- /dev/null +++ b/mach/pmds/libsys/_lseek.s @@ -0,0 +1,28 @@ +.define __lseek +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __lseek +.sect .text +__lseek: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Slseek +lea 12(sp),sp +unlk a6 +rts +__Slseek: trap #0 +.data2 0x13 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_open.s b/mach/pmds/libsys/_open.s new file mode 100644 index 000000000..a85433c80 --- /dev/null +++ b/mach/pmds/libsys/_open.s @@ -0,0 +1,25 @@ +.define __open +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __open +.sect .text +__open: +tst.b -40(sp) +link a6,#-0 +move.w 12(a6), d2 +ext.l d2 +move.l d2,-(sp) +move.l 8(a6),-(sp) +jsr __Sopen +add.l #8,sp +unlk a6 +rts +__Sopen: trap #0 +.data2 0x5 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_pause.s b/mach/pmds/libsys/_pause.s new file mode 100644 index 000000000..971bb3156 --- /dev/null +++ b/mach/pmds/libsys/_pause.s @@ -0,0 +1,13 @@ +.define __pause +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __pause +__pause: trap #0 +.data2 29 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_pipe.s b/mach/pmds/libsys/_pipe.s new file mode 100644 index 000000000..482f838f1 --- /dev/null +++ b/mach/pmds/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.w d0,(a0)+ + move.w d1,(a0) + clr.l d0 + rts diff --git a/mach/pmds/libsys/_read.s b/mach/pmds/libsys/_read.s new file mode 100644 index 000000000..2a0c3e452 --- /dev/null +++ b/mach/pmds/libsys/_read.s @@ -0,0 +1,28 @@ +.define __read +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __read +.sect .text +__read: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Sread +lea 12(sp),sp +unlk a6 +rts +__Sread: trap #0 +.data2 0x3 + bcc 1f + jmp cerror +1: + rts diff --git a/mach/pmds/libsys/_sbrk.s b/mach/pmds/libsys/_sbrk.s new file mode 100644 index 000000000..6a873e24a --- /dev/null +++ b/mach/pmds/libsys/_sbrk.s @@ -0,0 +1,52 @@ +.define __brk +.define __sbrk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __brk +.sect .text +__brk: +tst.b -40(sp) +link a6,#-0 +move.l 8(a6),-(sp) +jsr __Sbrk +add.l #4,sp +unlk a6 +rts +.extern __sbrk +__sbrk: +tst.b -40(sp) +link a6,#-0 +move.w 8(a6), d2 +ext.l d2 +move.l d2,-(sp) +jsr __Ssbrk +add.l #4,sp +unlk a6 +rts +__Ssbrk: 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 +__Sbrk: trap #0 +.data2 0x11 + bcc 1f + jmp cerror +1: + move.l 4(sp),.limhp + clr.l d0 + rts diff --git a/mach/pmds/libsys/_stty.s b/mach/pmds/libsys/_stty.s new file mode 100644 index 000000000..6b3b5b4ea --- /dev/null +++ b/mach/pmds/libsys/_stty.s @@ -0,0 +1,18 @@ +.define __stty +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __stty +.sect .text +__stty: +tst.b -40(sp) +link a6,#-0 +move.l 10(a6),-(sp) +move.w #29705,-(sp) +move.w 8(a6),-(sp) +jsr __ioctl +add.l #8,sp +unlk a6 +rts diff --git a/mach/pmds/libsys/_time.s b/mach/pmds/libsys/_time.s new file mode 100644 index 000000000..7f9f0886e --- /dev/null +++ b/mach/pmds/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/pmds/libsys/_unlink.s b/mach/pmds/libsys/_unlink.s new file mode 100644 index 000000000..2806dd837 --- /dev/null +++ b/mach/pmds/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/pmds/libsys/_wait.s b/mach/pmds/libsys/_wait.s new file mode 100644 index 000000000..de5436dc9 --- /dev/null +++ b/mach/pmds/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.w d1,(a0) +2: + rts diff --git a/mach/pmds/libsys/_write.s b/mach/pmds/libsys/_write.s new file mode 100644 index 000000000..a8a425e83 --- /dev/null +++ b/mach/pmds/libsys/_write.s @@ -0,0 +1,28 @@ +.define __write +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +.extern __write +.sect .text +__write: +tst.b -40(sp) +link a6,#-0 +move.w 14(a6), d2 +ext.l d2 +move.w 8(a6), d1 +ext.l d1 +move.l d2,-(sp) +move.l 10(a6),-(sp) +move.l d1,-(sp) +jsr __Swrite +lea 12(sp),sp +unlk a6 +rts +__Swrite: trap #0 +.data2 0x4 + bcc 1f + jmp cerror +1: + rts