Added entry points for ANSI C

This commit is contained in:
ceriel 1990-01-22 14:15:55 +00:00
parent 5241920b3c
commit 9f0c356194
26 changed files with 414 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

15
mach/pmds4/libsys/_dup.s Normal file
View file

@ -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

36
mach/pmds4/libsys/_exec.s Normal file
View file

@ -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

18
mach/pmds4/libsys/_fork.s Normal file
View file

@ -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

View file

@ -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

View file

@ -0,0 +1,10 @@
.define __getpid
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.extern __getpid
__getpid: trap #0
.data2 0x14
rts

17
mach/pmds4/libsys/_gtty.s Normal file
View file

@ -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

View file

@ -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

14
mach/pmds4/libsys/_kill.s Normal file
View file

@ -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

14
mach/pmds4/libsys/_link.s Normal file
View file

@ -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

View file

@ -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

13
mach/pmds4/libsys/_open.s Normal file
View file

@ -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

View file

@ -0,0 +1,10 @@
.define __pause
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.extern __pause
__pause: trap #0
.data2 0x1D
rts

17
mach/pmds4/libsys/_pipe.s Normal file
View file

@ -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

13
mach/pmds4/libsys/_read.s Normal file
View file

@ -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

31
mach/pmds4/libsys/_sbrk.s Normal file
View file

@ -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

17
mach/pmds4/libsys/_stty.s Normal file
View file

@ -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

26
mach/pmds4/libsys/_time.s Normal file
View file

@ -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

View file

@ -0,0 +1,11 @@
.define __times
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.extern __times
__times:
trap #0
.data2 0x2B
rts

View file

@ -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

18
mach/pmds4/libsys/_wait.s Normal file
View file

@ -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

View file

@ -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

View file

@ -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