Browse Source

added new routines for ansi

eck 34 years ago
parent
commit
c78fcdb719

+ 25 - 0
mach/m68k2/libsys/LIST

@@ -4,37 +4,56 @@ _exit.s
 access.s
 acct.s
 alarm.s
+_alarm.s
 chdir.s
 chmod.s
 chown.s
 chroot.s
 close.s
+_close.s
 creat.s
+_creat.s
 dup.s
+_dup.s
 dup2.s
+_dup2.s
 execl.s
+_execl.s
 execve.s
+_execve.s
 fork.s
+_fork.s
 ftime.s
+_ftime.s
 getegid.s
 getgid.s
 getpid.s
+_getpid.s
 getuid.s
 stty.s
 gtty.s
+_gtty.s
 ioctl.s
+_ioctl.s
 kill.s
+_kill.s
 link.s
+_link.s
 lock.s
 lseek.s
+_lseek.s
 mknod.s
 mount.s
 nice.s
 open.s
+_open.s
 pause.s
+_pause.s
 pipe.s
+_pipe.s
 profil.s
 read.s
+_read.s
 setgid.s
 setuid.s
 stat.s
@@ -42,14 +61,20 @@ stime.s
 sync.s
 time.s
 times.s
+_times.s
 umask.s
 umount.s
 unlink.s
+_unlink.s
 utime.s
 write.s
+_write.s
 brk.s
+_brk.s
 wait.s
+_wait.s
 fstat.s
+_fstat.s
 signal.s
 call.s
 cleanup.s

+ 13 - 0
mach/m68k2/libsys/_alarm.s

@@ -0,0 +1,13 @@
+.define __alarm
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __alarm
+.sect .text
+__alarm:		clr.l d0
+		move.w 4(sp),d0
+		move.l d0,a0
+		move.w #0x1B,d0
+		trap #0
+		rts

+ 30 - 0
mach/m68k2/libsys/_brk.s

@@ -0,0 +1,30 @@
+.define _brk
+.define __sbrk
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern _brk
+.extern __sbrk
+.sect .text
+__sbrk:		move.l nd,a0
+		add.w  4(sp),a0
+		move.w #0x11,d0
+		trap #0
+		bcs lcerror
+		move.l nd,d0
+		move.l d0,a0
+		add.w  4(sp),a0
+		move.l a0,nd
+		rts
+lcerror:	jmp cerror
+_brk:		move.w #0x11,d0
+		move.l 4(sp),a0
+		trap #0
+		bcs lcerror
+		move.l 4(sp),nd
+		clr.l d0
+		rts
+.sect .data
+nd:		.data4 endbss
+.sect .text

+ 10 - 0
mach/m68k2/libsys/_close.s

@@ -0,0 +1,10 @@
+.define __close
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __close
+.sect .text
+__close:		move.w #0x6,d0
+		move.w 4(sp),a0
+		jmp callc

+ 12 - 0
mach/m68k2/libsys/_creat.s

@@ -0,0 +1,12 @@
+.define __creat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __creat
+.sect .text
+__creat:		move.w #0x8,d0
+		move.l 4(sp),a0
+		move.w 8(sp),d1
+		ext.l  d1
+		jmp call

+ 11 - 0
mach/m68k2/libsys/_dup.s

@@ -0,0 +1,11 @@
+.define __dup
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+.extern __dup
+.sect .text
+__dup:		move.w #0x29,d0
+		move.w 4(sp),a0
+		jmp call

+ 14 - 0
mach/m68k2/libsys/_dup2.s

@@ -0,0 +1,14 @@
+.define __dup2
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+.extern __dup2
+.sect .text
+__dup2:		move.w #0x29,d0
+		move.w 4(sp),a0
+		move.w 6(sp),d1
+		ext.l  d1
+		add.l #0x40,a0
+		jmp call

+ 16 - 0
mach/m68k2/libsys/_execl.s

@@ -0,0 +1,16 @@
+.define __execl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __execl
+		.sect .text
+__execl:		link a6,#0
+		tst.b -132(sp)
+		move.l _environ,-(sp)
+		pea 12(sp)
+		move.l 8(a6),-(sp)
+		jsr _execve
+		add.l #0xC,sp
+		unlk a6
+		rts

+ 12 - 0
mach/m68k2/libsys/_execve.s

@@ -0,0 +1,12 @@
+.define __execve
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __execve
+.sect .text
+__execve:	move.w #0x3B,d0
+		move.l 4(sp),a0
+		move.l 8(sp),d1
+		move.l 12(sp),a1
+		jmp calle

+ 17 - 0
mach/m68k2/libsys/_fork.s

@@ -0,0 +1,17 @@
+.define __fork
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __fork
+.sect .text
+__fork:		move.w #0x2,d0
+		trap #0
+		bra 1f
+		bcc 2f
+		jmp cerror
+1:
+		!move.l d0,p_uid
+		clr.l d0
+2:
+		rts

+ 11 - 0
mach/m68k2/libsys/_fstat.s

@@ -0,0 +1,11 @@
+.define __fstat
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __fstat
+		.sect .text
+__fstat:		move.w	#0x1C,d0
+		move.w	4(sp),a0
+		move.l	6(sp),d1
+		jmp callc

+ 11 - 0
mach/m68k2/libsys/_ftime.s

@@ -0,0 +1,11 @@
+.define __ftime
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+.extern __ftime
+.sect .text
+__ftime:		move.w #0x23,d0
+		move.l 4(sp),a0
+		jmp callc

+ 10 - 0
mach/m68k2/libsys/_getpid.s

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

+ 17 - 0
mach/m68k2/libsys/_gtty.s

@@ -0,0 +1,17 @@
+.define __gtty
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.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

+ 13 - 0
mach/m68k2/libsys/_ioctl.s

@@ -0,0 +1,13 @@
+.define __ioctl
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __ioctl
+.sect .text
+__ioctl:		move.w #0x36,d0
+		move.w 4(sp),a0
+		move.w 6(sp),d1
+		ext.l  d1
+		move.l 8(sp),a1
+		jmp callc

+ 12 - 0
mach/m68k2/libsys/_kill.s

@@ -0,0 +1,12 @@
+.define __kill
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __kill
+.sect .text
+__kill:		move.w #0x25,d0
+		move.w 4(sp),a0
+		move.w 6(sp),d1
+		ext.l  d1
+		jmp callc

+ 12 - 0
mach/m68k2/libsys/_link.s

@@ -0,0 +1,12 @@
+.define __link
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __link
+.sect .text
+__link:		move.w #0x9,d0
+		move.l 4(sp),a0
+		move.w 8(sp),d1
+		ext.l  d1
+		jmp callc

+ 12 - 0
mach/m68k2/libsys/_lseek.s

@@ -0,0 +1,12 @@
+.define __lseek
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __lseek
+.sect .text
+__lseek:		move.w #0x13,d0
+		move.w 4(sp),a0
+		move.l 6(sp),d1
+		move.w 10(sp),a1
+		jmp call

+ 12 - 0
mach/m68k2/libsys/_open.s

@@ -0,0 +1,12 @@
+.define __open
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __open
+.sect .text
+__open:		move.w #0x5,d0
+		move.l 4(sp),a0
+		move.w 8(sp),d1
+		ext.l  d1
+		jmp call

+ 10 - 0
mach/m68k2/libsys/_pause.s

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

+ 18 - 0
mach/m68k2/libsys/_pipe.s

@@ -0,0 +1,18 @@
+.define __pipe
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.sect .text
+.extern __pipe
+__pipe:		
+		move.w #0x2A,d0
+		trap #0
+		bcc 1f
+		jmp cerror
+1:
+		move.l 4(sp),a0
+		move.w d0,(a0)+
+		move.w d1,(a0)
+		clr.l d0
+		rts

+ 12 - 0
mach/m68k2/libsys/_read.s

@@ -0,0 +1,12 @@
+.define __read
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __read
+.sect .text
+__read:		move.w #0x3,d0
+		move.w 4(sp),a0
+		move.l 6(sp),d1
+		move.w 10(sp),a1
+		jmp call

+ 11 - 0
mach/m68k2/libsys/_times.s

@@ -0,0 +1,11 @@
+.define __times
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __times
+.sect .text
+__times:		move.w #0x2B,d0
+		move.l 4(sp),a0
+		trap #0
+		rts

+ 10 - 0
mach/m68k2/libsys/_unlink.s

@@ -0,0 +1,10 @@
+.define __unlink
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __unlink
+.sect .text
+__unlink:	move.w #0xA,d0
+		move.l 4(sp),a0
+		jmp callc

+ 17 - 0
mach/m68k2/libsys/_wait.s

@@ -0,0 +1,17 @@
+.define __wait
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __wait
+	.sect .text
+__wait:		move.w	#0x7,d0
+		move.l	4(sp),a0
+		trap #0
+		bcs cerror
+		tst.l 4(sp)
+		beq 1f
+		move.l 4(sp),a0
+		move.w d1,(a0)
+1:
+		rts

+ 12 - 0
mach/m68k2/libsys/_write.s

@@ -0,0 +1,12 @@
+.define __write
+.sect .text
+.sect .rom
+.sect .data
+.sect .bss
+.extern __write
+.sect .text
+__write:		move.w #0x4,d0
+		move.w 4(sp),a0
+		move.l 6(sp),d1
+		move.w 10(sp),a1
+		jmp call