Added entry points for ANSI C
This commit is contained in:
		
							parent
							
								
									68e198f375
								
							
						
					
					
						commit
						c6d87355db
					
				
					 25 changed files with 398 additions and 4 deletions
				
			
		|  | @ -3,7 +3,6 @@ exit.c | |||
| cleanup.c | ||||
| stty.c | ||||
| gtty.c | ||||
| _exit.s | ||||
| access.s | ||||
| acct.s | ||||
| alarm.s | ||||
|  | @ -79,3 +78,26 @@ vhangup.s | |||
| wait.s | ||||
| write.s | ||||
| errno.s | ||||
| _alarm.s | ||||
| _close.s | ||||
| _creat.s | ||||
| _dup.s | ||||
| _execl.s | ||||
| _exit.s | ||||
| _fork.s | ||||
| _fstat.s | ||||
| _ftime.s | ||||
| _getpid.s | ||||
| _gtty.c | ||||
| _ioctl.s | ||||
| _kill.s | ||||
| _link.s | ||||
| _lseek.s | ||||
| _open.s | ||||
| _pause.s | ||||
| _pipe.s | ||||
| _read.s | ||||
| _sbrk.s | ||||
| _unlink.s | ||||
| _wait.s | ||||
| _write.s | ||||
|  |  | |||
							
								
								
									
										12
									
								
								mach/pdp/libsys/_alarm.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								mach/pdp/libsys/_alarm.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| #include "sys.h" | ||||
| .define	__alarm
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __alarm: | ||||
| 	mov	2(sp),r0 | ||||
| 	sys	alarm | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
							
								
								
									
										14
									
								
								mach/pdp/libsys/_close.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								mach/pdp/libsys/_close.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| #include "sys.h" | ||||
| .define	__close
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __close: | ||||
| 	mov	2(sp),r0 | ||||
| 	sys	close | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
							
								
								
									
										17
									
								
								mach/pdp/libsys/_creat.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								mach/pdp/libsys/_creat.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| #include "sys.h" | ||||
| .define	__creat
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __creat: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	mov	4(sp),0f+4 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	creat | ||||
| 	.data2	0, 0 | ||||
							
								
								
									
										20
									
								
								mach/pdp/libsys/_dup.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								mach/pdp/libsys/_dup.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| #include "sys.h" | ||||
| .define	__dup
 | ||||
| .define	__dup2
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __dup2: | ||||
| 	mov	2(sp),r0 | ||||
| 	bis	$100,r0 | ||||
| 	br	1f | ||||
| 
 | ||||
| __dup: | ||||
| 	mov	2(sp),r0 | ||||
| 1: | ||||
| 	mov	4(sp),r1 | ||||
| 	sys	dup | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
							
								
								
									
										19
									
								
								mach/pdp/libsys/_execl.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								mach/pdp/libsys/_execl.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| #include "sys.h" | ||||
| .define	__execl
 | ||||
| .extern	_environ
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __execl: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	mov	sp,r0 | ||||
| 	add	$4,r0 | ||||
| 	mov	r0,0f+4 | ||||
| 	mov	_environ,0f+6 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	exece | ||||
| 	.data2	0, 0, 0 | ||||
							
								
								
									
										15
									
								
								mach/pdp/libsys/_fork.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								mach/pdp/libsys/_fork.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,15 @@ | |||
| #include "sys.h" | ||||
| .define	__fork
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __fork: | ||||
| 	sys	fork | ||||
| 	br	1f | ||||
| 	bcc	2f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 2: | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
							
								
								
									
										19
									
								
								mach/pdp/libsys/_fstat.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								mach/pdp/libsys/_fstat.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| #include "sys.h" | ||||
| .define	__fstat
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __fstat: | ||||
| 	mov	2(sp),r0 | ||||
| 	mov	4(sp),0f+2 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	fstat | ||||
| 	.data2	0
 | ||||
							
								
								
									
										12
									
								
								mach/pdp/libsys/_ftime.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								mach/pdp/libsys/_ftime.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| #include "sys.h" | ||||
| .define	__ftime
 | ||||
| 
 | ||||
| __ftime: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	rts	pc | ||||
| 
 | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	ftime | ||||
| 	.data2	0
 | ||||
							
								
								
									
										6
									
								
								mach/pdp/libsys/_getpid.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/pdp/libsys/_getpid.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| #include "sys.h" | ||||
| .define	__getpid
 | ||||
| 
 | ||||
| __getpid: | ||||
| 	sys	getpid | ||||
| 	rts	pc | ||||
							
								
								
									
										7
									
								
								mach/pdp/libsys/_gtty.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								mach/pdp/libsys/_gtty.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| int | ||||
| _gtty(fildes,argp) | ||||
| 	int fildes ; | ||||
| 	char *argp ; | ||||
| { | ||||
| 	return _ioctl(fildes,/*TIOCGETP*/(('t'<<8)|8),argp) ; | ||||
| } | ||||
							
								
								
									
										20
									
								
								mach/pdp/libsys/_ioctl.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								mach/pdp/libsys/_ioctl.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| #include "sys.h" | ||||
| .define	__ioctl
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __ioctl: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	mov	4(sp),0f+4 | ||||
| 	mov	6(sp),0f+6 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	ioctl | ||||
| 	.data2	0, 0, 0 | ||||
							
								
								
									
										20
									
								
								mach/pdp/libsys/_kill.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								mach/pdp/libsys/_kill.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| #include "sys.h" | ||||
| .define	__kill
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __kill: | ||||
| 	mov	2(sp),r0 | ||||
| 	mov	4(sp),0f+2 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| 
 | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	kill | ||||
| 	.data2	0
 | ||||
							
								
								
									
										19
									
								
								mach/pdp/libsys/_link.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								mach/pdp/libsys/_link.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| #include "sys.h" | ||||
| .define	__link
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __link: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	mov	4(sp),0f+4 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	link | ||||
| 	.data2	0, 0 | ||||
							
								
								
									
										20
									
								
								mach/pdp/libsys/_lseek.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								mach/pdp/libsys/_lseek.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| #include "sys.h" | ||||
| .define	__lseek
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __lseek: | ||||
| 	mov	2(sp),r0 | ||||
| 	mov	4(sp),0f+2 | ||||
| 	mov	6(sp),0f+4 | ||||
| 	mov	010(sp),0f+6 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	$-1,r1 | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	lseek | ||||
| 	.data2	0, 0, 0 | ||||
							
								
								
									
										17
									
								
								mach/pdp/libsys/_open.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								mach/pdp/libsys/_open.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | |||
| #include "sys.h" | ||||
| .define	__open
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __open: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	mov	4(sp),0f+4 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	open | ||||
| 	.data2	0, 0 | ||||
							
								
								
									
										6
									
								
								mach/pdp/libsys/_pause.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/pdp/libsys/_pause.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| #include "sys.h" | ||||
| .define	__pause
 | ||||
| 
 | ||||
| __pause: | ||||
| 	sys	pause | ||||
| 	rts	pc | ||||
							
								
								
									
										18
									
								
								mach/pdp/libsys/_pipe.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								mach/pdp/libsys/_pipe.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include "sys.h" | ||||
| .define	__pipe
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __pipe: | ||||
| 	sys	pipe | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	mov	r5,-(sp) | ||||
| 	mov	4(sp),r5 | ||||
| 	mov	r0,(r5)+ | ||||
| 	mov	r1,(r5) | ||||
| 	mov	(sp)+,r5 | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
							
								
								
									
										18
									
								
								mach/pdp/libsys/_read.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								mach/pdp/libsys/_read.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include "sys.h" | ||||
| .define	__read
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __read: | ||||
| 	mov	2(sp),r0 | ||||
| 	mov	4(sp),0f+2 | ||||
| 	mov	6(sp),0f+4 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	read | ||||
| 	.data2	0, 0 | ||||
							
								
								
									
										39
									
								
								mach/pdp/libsys/_sbrk.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								mach/pdp/libsys/_sbrk.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,39 @@ | |||
| #include "sys.h" | ||||
| .define	__sbrk
 | ||||
| .define	__brk
 | ||||
| .extern	_end
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __sbrk: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	beq	1f | ||||
| 	add	Ixxx,0f+2 | ||||
| 	bcs	2f | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 2: | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	mov	Ixxx,r0 | ||||
| 	add	2(sp),Ixxx | ||||
| 	rts	pc | ||||
| 
 | ||||
| __brk: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	mov	2(sp),Ixxx | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| 
 | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	break | ||||
| 	.data2	0
 | ||||
| Ixxx:	.data2 _end | ||||
							
								
								
									
										18
									
								
								mach/pdp/libsys/_unlink.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								mach/pdp/libsys/_unlink.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include "sys.h" | ||||
| .define	__unlink
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __unlink: | ||||
| 	mov	2(sp),0f+2 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	clr	r0 | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	unlink | ||||
| 	.data2	0
 | ||||
							
								
								
									
										16
									
								
								mach/pdp/libsys/_wait.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								mach/pdp/libsys/_wait.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| #include "sys.h" | ||||
| .define	__wait
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __wait: | ||||
| 	sys	wait | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 	rts	pc | ||||
| 1: | ||||
| 	tst	2(sp) | ||||
| 	beq	1f | ||||
| 	mov	r1,*2(sp) | ||||
| 1: | ||||
| 	rts	pc | ||||
							
								
								
									
										18
									
								
								mach/pdp/libsys/_write.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								mach/pdp/libsys/_write.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| #include "sys.h" | ||||
| .define	__write
 | ||||
| .extern	_errno
 | ||||
| 
 | ||||
| __write: | ||||
| 	mov	2(sp),r0 | ||||
| 	mov	4(sp),0f+2 | ||||
| 	mov	6(sp),0f+4 | ||||
| 	sys	indir; .data2 0f
 | ||||
| 	bcc	1f | ||||
| 	mov	r0,_errno | ||||
| 	mov	$-1,r0 | ||||
| 1: | ||||
| 	rts	pc | ||||
| .sect .data | ||||
| 0: | ||||
| 	sys	write | ||||
| 	.data2	0, 0 | ||||
|  | @ -1,4 +1,5 @@ | |||
| int gtty(fildes,argp) | ||||
| int | ||||
| gtty(fildes,argp) | ||||
| 	int fildes ; | ||||
| 	char *argp ; | ||||
| { | ||||
|  |  | |||
|  | @ -1,6 +1,7 @@ | |||
| int stty(fildes,argp) | ||||
| int | ||||
| stty(fildes,argp) | ||||
| 	int fildes ; | ||||
| 	char *argp; | ||||
| { | ||||
| 	return ioctl(fildes,/*TIOCSETP*/(('t'<<8)|9),argp) ; | ||||
| 	return _ioctl(fildes,/*TIOCSETP*/(('t'<<8)|9),argp) ; | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue