Added entry points for ANSI C
This commit is contained in:
		
							parent
							
								
									9eff28dac8
								
							
						
					
					
						commit
						66327ddda6
					
				
					 28 changed files with 289 additions and 23 deletions
				
			
		|  | @ -14,13 +14,6 @@ sdget.c | |||
| stime.c | ||||
| time.c | ||||
| wait.c | ||||
| _exit.s | ||||
| _pipe.s | ||||
| _profil.s | ||||
| _sdget.s | ||||
| _stime.s | ||||
| _time.s | ||||
| _wait.s | ||||
| access.s | ||||
| acct.s | ||||
| alarm.s | ||||
|  | @ -85,4 +78,34 @@ ustat.s | |||
| utime.s | ||||
| waitsem.s | ||||
| write.s | ||||
| _Xpipe.s | ||||
| _Xwait.s | ||||
| _alarm.s | ||||
| _brk.s | ||||
| _close.s | ||||
| _dup2.c | ||||
| _execl.c | ||||
| _execve.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.c | ||||
| _profil.s | ||||
| _read.s | ||||
| _sbrk.s | ||||
| _sdget.s | ||||
| _stime.s | ||||
| _time.s | ||||
| _unlink.s | ||||
| _wait.c | ||||
| _write.s | ||||
| xdup.s | ||||
|  |  | |||
							
								
								
									
										13
									
								
								mach/xenix3/libsys/_Xpipe.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								mach/xenix3/libsys/_Xpipe.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __Xpipe
 | ||||
| .sect .text | ||||
| __Xpipe: | ||||
| 	mov	ax,42 | ||||
| 	call	syscal | ||||
| 	mov	dx,bx | ||||
| 	jae	1f | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 	cwd | ||||
| 1: | ||||
| 	ret | ||||
							
								
								
									
										13
									
								
								mach/xenix3/libsys/_Xwait.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								mach/xenix3/libsys/_Xwait.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __Xwait
 | ||||
| .sect .text | ||||
| __Xwait: | ||||
| 	mov	ax,7 | ||||
| 	call	syscal | ||||
| 	mov	dx,bx | ||||
| 	jae	1f | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 	cwd | ||||
| 1: | ||||
| 	ret | ||||
							
								
								
									
										11
									
								
								mach/xenix3/libsys/_alarm.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								mach/xenix3/libsys/_alarm.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __alarm
 | ||||
| .sect .text | ||||
| __alarm: | ||||
| 	mov	ax,27 | ||||
| 	push	bp | ||||
| 	mov	bp,sp | ||||
| 	mov	bx,4(bp) | ||||
| 	call	syscal | ||||
| 	pop	bp | ||||
| 	ret | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_brk.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_brk.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __brk
 | ||||
| .sect .text | ||||
| __brk: | ||||
| 	mov	ax,17 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_close.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_close.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __close
 | ||||
| .sect .text | ||||
| __close: | ||||
| 	mov	ax,6 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_dup2.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_dup2.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| int | ||||
| _dup2(oldd, newd) | ||||
| { | ||||
| 	oldd |= 64; | ||||
| 	return __xdup(oldd, newd); | ||||
| } | ||||
							
								
								
									
										9
									
								
								mach/xenix3/libsys/_execl.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								mach/xenix3/libsys/_execl.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| int | ||||
| _execl(name,args) | ||||
| 	char *name; | ||||
| 	int args; | ||||
| { | ||||
| 	extern char **environ; | ||||
| 
 | ||||
| 	return _execve(name,&args,environ); | ||||
| } | ||||
							
								
								
									
										19
									
								
								mach/xenix3/libsys/_execve.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								mach/xenix3/libsys/_execve.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,19 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __execve
 | ||||
| .sect .text | ||||
| __execve: | ||||
| 	mov	ax,59 | ||||
| 	push	bp | ||||
| 	mov	bp,sp | ||||
| 	push	si | ||||
| 	mov	si,8(bp) | ||||
| 	mov	cx,6(bp) | ||||
| 	mov	bx,4(bp) | ||||
| 	call	syscal | ||||
| 	pop	si | ||||
| 	jae	1f | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 1: | ||||
| 	pop	bp | ||||
| 	ret | ||||
							
								
								
									
										20
									
								
								mach/xenix3/libsys/_fork.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								mach/xenix3/libsys/_fork.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __fork, _par_uid | ||||
| .sect .bss | ||||
| .comm	_par_uid, 2 | ||||
| .sect .text | ||||
| __fork: | ||||
| 	mov	ax,2 | ||||
| 	call	syscal | ||||
| 	jb	1f | ||||
| 	and	bx,bx | ||||
| 	je	2f | ||||
| 	ret | ||||
| 1: | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 	ret | ||||
| 2: | ||||
| 	mov	(_par_uid),ax | ||||
| 	xor	ax,ax | ||||
| 	ret | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_fstat.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_fstat.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __fstat
 | ||||
| .sect .text | ||||
| __fstat: | ||||
| 	mov	ax,28 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										12
									
								
								mach/xenix3/libsys/_ftime.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								mach/xenix3/libsys/_ftime.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __ftime
 | ||||
| .sect .text | ||||
| __ftime: | ||||
| 	mov	ax,2856 | ||||
| 	push	bp | ||||
| 	mov	bp,sp | ||||
| 	mov	bx,4(bp) | ||||
| 	call	syscal | ||||
| 	pop	bp | ||||
| 	ret | ||||
| 
 | ||||
							
								
								
									
										7
									
								
								mach/xenix3/libsys/_getpid.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								mach/xenix3/libsys/_getpid.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __getpid
 | ||||
| .sect .text | ||||
| __getpid: | ||||
| 	mov	ax,20 | ||||
| 	call	syscal | ||||
| 	ret | ||||
							
								
								
									
										5
									
								
								mach/xenix3/libsys/_gtty.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								mach/xenix3/libsys/_gtty.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | |||
| _gtty(fildes, arg) | ||||
| 	char *arg; | ||||
| { | ||||
| 	return _ioctl(fildes, ('t' << 8) | 8, arg); | ||||
| } | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_ioctl.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_ioctl.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __ioctl
 | ||||
| .sect .text | ||||
| __ioctl: | ||||
| 	mov	ax,54 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_kill.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_kill.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __kill
 | ||||
| .sect .text | ||||
| __kill: | ||||
| 	mov	ax,37 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_link.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_link.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __link
 | ||||
| .sect .text | ||||
| __link: | ||||
| 	mov	ax,9 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										25
									
								
								mach/xenix3/libsys/_lseek.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								mach/xenix3/libsys/_lseek.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,25 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __lseek
 | ||||
| .sect .text | ||||
| __lseek: | ||||
| 	mov	ax,19 | ||||
| 	push	bp | ||||
| 	mov	bp,sp | ||||
| 	push	si | ||||
| 	push	di | ||||
| 	mov	di,10(bp) | ||||
| 	mov	si,8(bp) | ||||
| 	mov	cx,6(bp) | ||||
| 	mov	bx,4(bp) | ||||
| 	call	syscal | ||||
| 	pop	di | ||||
| 	pop	si | ||||
| 	pop	bp | ||||
| 	jae	1f | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 	mov	dx,ax | ||||
| 	ret | ||||
| 1: | ||||
| 	mov	dx,bx | ||||
| 	ret | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_open.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_open.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __open
 | ||||
| .sect .text | ||||
| __open: | ||||
| 	mov	ax,5 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										11
									
								
								mach/xenix3/libsys/_pause.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								mach/xenix3/libsys/_pause.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __pause
 | ||||
| .sect .text | ||||
| __pause: | ||||
| 	mov	ax,29 | ||||
| 	call	syscal | ||||
| 	jae	1f | ||||
| 	mov	(_errno),ax | ||||
| 	mov	ax,-1 | ||||
| 1: | ||||
| 	ret | ||||
							
								
								
									
										14
									
								
								mach/xenix3/libsys/_pipe.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								mach/xenix3/libsys/_pipe.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| long _Xpipe(); | ||||
| 
 | ||||
| int | ||||
| _pipe(f) | ||||
| 	int f[2]; | ||||
| { | ||||
| 	long x; | ||||
| 
 | ||||
| 	x = _Xpipe(); | ||||
| 	if (x == -1) return -1; | ||||
| 	f[0] = x; | ||||
| 	f[1] = x >> 16; | ||||
| 	return 0; | ||||
| } | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_read.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_read.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __read
 | ||||
| .sect .text | ||||
| __read: | ||||
| 	mov	ax,3 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										22
									
								
								mach/xenix3/libsys/_sbrk.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								mach/xenix3/libsys/_sbrk.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __sbrk
 | ||||
| .sect .text | ||||
| __sbrk: | ||||
| 	push	bp | ||||
| 	mov	bp,sp | ||||
| 	push	ds | ||||
| 	mov	ax,4(bp) | ||||
| 	cwd | ||||
| 	push	dx | ||||
| 	push	ax | ||||
| 	mov	ax,1 | ||||
| 	push	ax | ||||
| 	call	__brkctl | ||||
| 	add	sp,8 | ||||
| 	pop	bp | ||||
| 	ret | ||||
| 
 | ||||
| 
 | ||||
| __brkctl: | ||||
| 	mov	ax,4904 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_unlink.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_unlink.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __unlink
 | ||||
| .sect .text | ||||
| __unlink: | ||||
| 	mov	ax,10 | ||||
| 	jmp	sysal | ||||
							
								
								
									
										10
									
								
								mach/xenix3/libsys/_wait.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								mach/xenix3/libsys/_wait.c
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,10 @@ | |||
| long _Xwait(); | ||||
| _wait(p) | ||||
| 	int *p; | ||||
| { | ||||
| 	long l = _Xwait(); | ||||
| 
 | ||||
| 	if (l == -1) return -1; | ||||
| 	if (p) *p = (l >> 16); | ||||
| 	return (int) l; | ||||
| } | ||||
							
								
								
									
										6
									
								
								mach/xenix3/libsys/_write.s
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								mach/xenix3/libsys/_write.s
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| .sect .text; .sect .rom; .sect .data; .sect .bss
 | ||||
| .define __write
 | ||||
| .sect .text | ||||
| __write: | ||||
| 	mov	ax,4 | ||||
| 	jmp	sysal | ||||
|  | @ -1,14 +1,6 @@ | |||
| long _pipe(); | ||||
| 
 | ||||
| int | ||||
| pipe(f) | ||||
| 	int f[2]; | ||||
| { | ||||
| 	long x; | ||||
| 
 | ||||
| 	x = _pipe(); | ||||
| 	if (x == -1) return -1; | ||||
| 	f[0] = x; | ||||
| 	f[1] = x >> 16; | ||||
| 	return 0; | ||||
| 	return _pipe(f); | ||||
| } | ||||
|  |  | |||
|  | @ -1,11 +1,5 @@ | |||
| long _wait(); | ||||
| 
 | ||||
| wait(p) | ||||
| 	int *p; | ||||
| { | ||||
| 	long l = _wait(); | ||||
| 
 | ||||
| 	if (l == -1) return -1; | ||||
| 	if (p) *p = (l >> 16); | ||||
| 	return (int) l; | ||||
| 	return _wait(p); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue