From 281e2d38e3f80281900682d7a23d5a6c0c056e36 Mon Sep 17 00:00:00 2001 From: ceriel Date: Mon, 22 Jan 1990 13:09:29 +0000 Subject: [PATCH] Added entry points for ANSI C --- mach/mantra/libsys/LIST | 30 +++++++++++++++++++++++++++++- mach/mantra/libsys/_alarm.s | 12 ++++++++++++ mach/mantra/libsys/_brk.s | 25 +++++++++++++++++++++++++ mach/mantra/libsys/_close.s | 10 ++++++++++ mach/mantra/libsys/_creat.s | 11 +++++++++++ mach/mantra/libsys/_dup.s | 10 ++++++++++ mach/mantra/libsys/_dup2.s | 17 +++++++++++++++++ mach/mantra/libsys/_execl.s | 16 ++++++++++++++++ mach/mantra/libsys/_execve.s | 12 ++++++++++++ mach/mantra/libsys/_fcntl.s | 12 ++++++++++++ mach/mantra/libsys/_fork.s | 17 +++++++++++++++++ mach/mantra/libsys/_fstat.s | 11 +++++++++++ mach/mantra/libsys/_ftime.s | 16 ++++++++++++++++ mach/mantra/libsys/_getpid.s | 10 ++++++++++ mach/mantra/libsys/_gtty.s | 17 +++++++++++++++++ mach/mantra/libsys/_ioctl.s | 12 ++++++++++++ mach/mantra/libsys/_kill.s | 11 +++++++++++ mach/mantra/libsys/_link.s | 11 +++++++++++ mach/mantra/libsys/_lseek.s | 12 ++++++++++++ mach/mantra/libsys/_open.s | 11 +++++++++++ mach/mantra/libsys/_pause.s | 10 ++++++++++ mach/mantra/libsys/_pipe.s | 18 ++++++++++++++++++ mach/mantra/libsys/_read.s | 12 ++++++++++++ mach/mantra/libsys/_stty.s | 17 +++++++++++++++++ mach/mantra/libsys/_time.s | 15 +++++++++++++++ mach/mantra/libsys/_times.s | 11 +++++++++++ mach/mantra/libsys/_unlink.s | 10 ++++++++++ mach/mantra/libsys/_wait.s | 17 +++++++++++++++++ mach/mantra/libsys/_write.s | 12 ++++++++++++ mach/mantra/libsys/brk.s | 20 +++++++------------- 30 files changed, 411 insertions(+), 14 deletions(-) create mode 100644 mach/mantra/libsys/_alarm.s create mode 100644 mach/mantra/libsys/_brk.s create mode 100644 mach/mantra/libsys/_close.s create mode 100644 mach/mantra/libsys/_creat.s create mode 100644 mach/mantra/libsys/_dup.s create mode 100644 mach/mantra/libsys/_dup2.s create mode 100644 mach/mantra/libsys/_execl.s create mode 100644 mach/mantra/libsys/_execve.s create mode 100644 mach/mantra/libsys/_fcntl.s create mode 100644 mach/mantra/libsys/_fork.s create mode 100644 mach/mantra/libsys/_fstat.s create mode 100644 mach/mantra/libsys/_ftime.s create mode 100644 mach/mantra/libsys/_getpid.s create mode 100644 mach/mantra/libsys/_gtty.s create mode 100644 mach/mantra/libsys/_ioctl.s create mode 100644 mach/mantra/libsys/_kill.s create mode 100644 mach/mantra/libsys/_link.s create mode 100644 mach/mantra/libsys/_lseek.s create mode 100644 mach/mantra/libsys/_open.s create mode 100644 mach/mantra/libsys/_pause.s create mode 100644 mach/mantra/libsys/_pipe.s create mode 100644 mach/mantra/libsys/_read.s create mode 100644 mach/mantra/libsys/_stty.s create mode 100644 mach/mantra/libsys/_time.s create mode 100644 mach/mantra/libsys/_times.s create mode 100644 mach/mantra/libsys/_unlink.s create mode 100644 mach/mantra/libsys/_wait.s create mode 100644 mach/mantra/libsys/_write.s diff --git a/mach/mantra/libsys/LIST b/mach/mantra/libsys/LIST index 1a21ff84..9d148687 100644 --- a/mach/mantra/libsys/LIST +++ b/mach/mantra/libsys/LIST @@ -1,6 +1,5 @@ libmon_s.a exit.s -_exit.s access.s acct.s alarm.s @@ -62,3 +61,32 @@ syscall.s call.s cleanup.s errno.s +_alarm.s +_brk.s +_close.s +_creat.s +_dup.s +_dup2.s +_execl.s +_execve.s +_exit.s +_fcntl.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 +_stty.s +_time.s +_times.s +_unlink.s +_wait.s +_write.s diff --git a/mach/mantra/libsys/_alarm.s b/mach/mantra/libsys/_alarm.s new file mode 100644 index 00000000..b0d8d923 --- /dev/null +++ b/mach/mantra/libsys/_alarm.s @@ -0,0 +1,12 @@ +.define __alarm +.extern __alarm +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__alarm: + move.l 4(sp),a0 + move.l #0x1B,d0 + trap #0 + rts diff --git a/mach/mantra/libsys/_brk.s b/mach/mantra/libsys/_brk.s new file mode 100644 index 00000000..6ddf33f8 --- /dev/null +++ b/mach/mantra/libsys/_brk.s @@ -0,0 +1,25 @@ +.define __brk +.define __sbrk +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__sbrk: move.l .limhp,a0 + add.l 4(sp),a0 + move.l #0x11,d0 + trap #0 + bcs Icerror + move.l .limhp,d0 + move.l d0,a0 + add.l 4(sp),a0 + move.l a0,.limhp + rts +Icerror: jmp cerror +__brk: move.l #0x11,d0 + move.l 4(sp),a0 + trap #0 + bcs Icerror + move.l 4(sp),.limhp + clr.l d0 + rts diff --git a/mach/mantra/libsys/_close.s b/mach/mantra/libsys/_close.s new file mode 100644 index 00000000..9944023f --- /dev/null +++ b/mach/mantra/libsys/_close.s @@ -0,0 +1,10 @@ +.define __close +.extern __close +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__close: move.l #0x6,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/mantra/libsys/_creat.s b/mach/mantra/libsys/_creat.s new file mode 100644 index 00000000..0bf7db7e --- /dev/null +++ b/mach/mantra/libsys/_creat.s @@ -0,0 +1,11 @@ +.define __creat +.extern __creat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__creat: move.l #0x8,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + jmp call diff --git a/mach/mantra/libsys/_dup.s b/mach/mantra/libsys/_dup.s new file mode 100644 index 00000000..db5e8034 --- /dev/null +++ b/mach/mantra/libsys/_dup.s @@ -0,0 +1,10 @@ +.define __dup +.extern __dup +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__dup: move.l #0x29,d0 + move.l 4(sp),a0 + jmp call diff --git a/mach/mantra/libsys/_dup2.s b/mach/mantra/libsys/_dup2.s new file mode 100644 index 00000000..1a7d6832 --- /dev/null +++ b/mach/mantra/libsys/_dup2.s @@ -0,0 +1,17 @@ +.define __dup2 +.extern __dup2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__dup2: +tst.b -40(sp) +link a6,#-0 +move.l 12(a6),-(sp) +move.l #0,-(sp) +move.l 8(a6),-(sp) +jsr __fcntl +add.l #12,sp +unlk a6 +rts diff --git a/mach/mantra/libsys/_execl.s b/mach/mantra/libsys/_execl.s new file mode 100644 index 00000000..017370ed --- /dev/null +++ b/mach/mantra/libsys/_execl.s @@ -0,0 +1,16 @@ +.define __execl +.extern __execl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__execl: link a6,#0 + tst.b -132(sp) + move.l _environ,-(sp) + pea 12(a6) + move.l 8(a6),-(sp) + jsr __execve + add.l #0xC,sp + unlk a6 + rts diff --git a/mach/mantra/libsys/_execve.s b/mach/mantra/libsys/_execve.s new file mode 100644 index 00000000..4a42f24e --- /dev/null +++ b/mach/mantra/libsys/_execve.s @@ -0,0 +1,12 @@ +.define __execve +.extern __execve +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__execve: move.l #0x3B,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp calle diff --git a/mach/mantra/libsys/_fcntl.s b/mach/mantra/libsys/_fcntl.s new file mode 100644 index 00000000..7b61a2c8 --- /dev/null +++ b/mach/mantra/libsys/_fcntl.s @@ -0,0 +1,12 @@ +.define __fcntl +.extern __fcntl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__fcntl: move.l #0x3E,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp callc diff --git a/mach/mantra/libsys/_fork.s b/mach/mantra/libsys/_fork.s new file mode 100644 index 00000000..bf8f1dbd --- /dev/null +++ b/mach/mantra/libsys/_fork.s @@ -0,0 +1,17 @@ +.define __fork +.extern __fork +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__fork: move.l #0x2,d0 + trap #0 + bra 1f + bcc 2f + jmp cerror +1: + !move.l d0,p_uid + clr.l d0 +2: + rts diff --git a/mach/mantra/libsys/_fstat.s b/mach/mantra/libsys/_fstat.s new file mode 100644 index 00000000..48ec96e9 --- /dev/null +++ b/mach/mantra/libsys/_fstat.s @@ -0,0 +1,11 @@ +.define __fstat +.extern __fstat +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__fstat: move.l #0x1C,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + jmp callc diff --git a/mach/mantra/libsys/_ftime.s b/mach/mantra/libsys/_ftime.s new file mode 100644 index 00000000..85f01338 --- /dev/null +++ b/mach/mantra/libsys/_ftime.s @@ -0,0 +1,16 @@ +.define __ftime +.extern __ftime +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__ftime: clr.l -(sp) + jsr __time + lea 4(sp),sp + move.l 4(sp),a0 + move.l d0,(a0) + clr.l 4(a0) + clr.w 8(a0) + clr.l d0 + rts diff --git a/mach/mantra/libsys/_getpid.s b/mach/mantra/libsys/_getpid.s new file mode 100644 index 00000000..6337be79 --- /dev/null +++ b/mach/mantra/libsys/_getpid.s @@ -0,0 +1,10 @@ +.define __getpid +.extern __getpid +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__getpid: move.l #0x14,d0 + trap #0 + rts diff --git a/mach/mantra/libsys/_gtty.s b/mach/mantra/libsys/_gtty.s new file mode 100644 index 00000000..fa42d836 --- /dev/null +++ b/mach/mantra/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 #29704,-(sp) +move.l 8(a6),-(sp) +jsr __ioctl +add.l #12,sp +unlk a6 +rts diff --git a/mach/mantra/libsys/_ioctl.s b/mach/mantra/libsys/_ioctl.s new file mode 100644 index 00000000..aa5110aa --- /dev/null +++ b/mach/mantra/libsys/_ioctl.s @@ -0,0 +1,12 @@ +.define __ioctl +.extern __ioctl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__ioctl: move.l #0x36,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp callc diff --git a/mach/mantra/libsys/_kill.s b/mach/mantra/libsys/_kill.s new file mode 100644 index 00000000..8873ec44 --- /dev/null +++ b/mach/mantra/libsys/_kill.s @@ -0,0 +1,11 @@ +.define __kill +.extern __kill +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__kill: move.l #0x25,d0 + move.l 4(sp),a0 + move.l 6(sp),d1 + jmp callc diff --git a/mach/mantra/libsys/_link.s b/mach/mantra/libsys/_link.s new file mode 100644 index 00000000..d87fd29c --- /dev/null +++ b/mach/mantra/libsys/_link.s @@ -0,0 +1,11 @@ +.define __link +.extern __link +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__link: move.l #0x9,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + jmp callc diff --git a/mach/mantra/libsys/_lseek.s b/mach/mantra/libsys/_lseek.s new file mode 100644 index 00000000..64a8bee0 --- /dev/null +++ b/mach/mantra/libsys/_lseek.s @@ -0,0 +1,12 @@ +.define __lseek +.extern __lseek +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__lseek: move.l #0x13,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp call diff --git a/mach/mantra/libsys/_open.s b/mach/mantra/libsys/_open.s new file mode 100644 index 00000000..24c87386 --- /dev/null +++ b/mach/mantra/libsys/_open.s @@ -0,0 +1,11 @@ +.define __open +.extern __open +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__open: move.l #0x5,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + jmp call diff --git a/mach/mantra/libsys/_pause.s b/mach/mantra/libsys/_pause.s new file mode 100644 index 00000000..0a3ca43a --- /dev/null +++ b/mach/mantra/libsys/_pause.s @@ -0,0 +1,10 @@ +.define __pause +.extern __pause +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__pause: move.l #0x1D,d0 + trap #0 + rts diff --git a/mach/mantra/libsys/_pipe.s b/mach/mantra/libsys/_pipe.s new file mode 100644 index 00000000..d50254a4 --- /dev/null +++ b/mach/mantra/libsys/_pipe.s @@ -0,0 +1,18 @@ +.define __pipe +.extern __pipe +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__pipe: + move.l #0x2A,d0 + trap #0 + 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/mantra/libsys/_read.s b/mach/mantra/libsys/_read.s new file mode 100644 index 00000000..6da3d60d --- /dev/null +++ b/mach/mantra/libsys/_read.s @@ -0,0 +1,12 @@ +.define __read +.extern __read +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__read: move.l #0x3,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp call diff --git a/mach/mantra/libsys/_stty.s b/mach/mantra/libsys/_stty.s new file mode 100644 index 00000000..1bb38981 --- /dev/null +++ b/mach/mantra/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 #29705,-(sp) +move.l 8(a6),-(sp) +jsr __ioctl +add.l #12,sp +unlk a6 +rts diff --git a/mach/mantra/libsys/_time.s b/mach/mantra/libsys/_time.s new file mode 100644 index 00000000..4c7f6152 --- /dev/null +++ b/mach/mantra/libsys/_time.s @@ -0,0 +1,15 @@ +.define __time +.extern __time +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__time: move.l #0xD,d0 + trap #0 + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d0,(a0) +1: + rts diff --git a/mach/mantra/libsys/_times.s b/mach/mantra/libsys/_times.s new file mode 100644 index 00000000..70726950 --- /dev/null +++ b/mach/mantra/libsys/_times.s @@ -0,0 +1,11 @@ +.define __times +.extern __times +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__times: move.l #0x2B,d0 + move.l 4(sp),a0 + trap #0 + rts diff --git a/mach/mantra/libsys/_unlink.s b/mach/mantra/libsys/_unlink.s new file mode 100644 index 00000000..c22feffd --- /dev/null +++ b/mach/mantra/libsys/_unlink.s @@ -0,0 +1,10 @@ +.define __unlink +.extern __unlink +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__unlink: move.l #0xA,d0 + move.l 4(sp),a0 + jmp callc diff --git a/mach/mantra/libsys/_wait.s b/mach/mantra/libsys/_wait.s new file mode 100644 index 00000000..e6efc71b --- /dev/null +++ b/mach/mantra/libsys/_wait.s @@ -0,0 +1,17 @@ +.define __wait +.extern __wait +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__wait: move.l #0x7,d0 + move.l 4(sp),a0 + trap #0 + bcs cerror + tst.l 4(sp) + beq 1f + move.l 4(sp),a0 + move.l d1,(a0) +1: + rts diff --git a/mach/mantra/libsys/_write.s b/mach/mantra/libsys/_write.s new file mode 100644 index 00000000..6cc63eab --- /dev/null +++ b/mach/mantra/libsys/_write.s @@ -0,0 +1,12 @@ +.define __write +.extern __write +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text +__write: move.l #0x4,d0 + move.l 4(sp),a0 + move.l 8(sp),d1 + move.l 12(sp),a1 + jmp call diff --git a/mach/mantra/libsys/brk.s b/mach/mantra/libsys/brk.s index aceb347d..07fae0c5 100644 --- a/mach/mantra/libsys/brk.s +++ b/mach/mantra/libsys/brk.s @@ -1,31 +1,25 @@ .define _brk .define _sbrk -.extern _brk -.extern _sbrk .sect .text .sect .rom .sect .data .sect .bss .sect .text -_sbrk: move.l nd,a0 +_sbrk: move.l .limhp,a0 add.l 4(sp),a0 move.l #0x11,d0 trap #0 - bcs lcerror - move.l nd,d0 + bcs Icerror + move.l .limhp,d0 move.l d0,a0 add.l 4(sp),a0 - move.l a0,nd + move.l a0,.limhp rts -lcerror: jmp cerror +Icerror: jmp cerror _brk: move.l #0x11,d0 move.l 4(sp),a0 trap #0 - bcs lcerror - move.l 4(sp),nd + bcs Icerror + move.l 4(sp),.limhp clr.l d0 rts -.sect .data -nd: - .data4 endbss -.sect .text