Use .limhp
This commit is contained in:
		
							parent
							
								
									ee026dd2ab
								
							
						
					
					
						commit
						786665c582
					
				
					 3 changed files with 15 additions and 19 deletions
				
			
		|  | @ -1,28 +1,25 @@ | |||
| #include "syscall.h" | ||||
| DEFINE(__brk) | ||||
| 	cmpl	4(ap),Imin | ||||
| 	cmpl	4(ap),$endbss | ||||
| 	bgeq	Iok | ||||
| 	movl	Imin,4(ap) | ||||
| 	movl	$endbss,4(ap) | ||||
| Iok: | ||||
| 	chmk	$17 | ||||
| 	bcs	Ierr | ||||
| 	movl	4(ap),Icur | ||||
| 	movl	4(ap),.limhp | ||||
| 	clrl	r0 | ||||
| 	ret | ||||
| Ierr: | ||||
| 	jmp	cerror | ||||
| 
 | ||||
| DEFINE(__sbrk) | ||||
| 	addl3	Icur,4(ap),-(sp) | ||||
| 	addl3	.limhp,4(ap),-(sp) | ||||
| 	bcs	Ierr | ||||
| 	pushl	$1 | ||||
| 	movl	ap,r3 | ||||
| 	movl	sp,ap | ||||
| 	chmk	$17 | ||||
| 	bcs	Ierr | ||||
| 	movl	Icur,r0 | ||||
| 	addl2	4(r3),Icur | ||||
| 	movl	.limhp,r0 | ||||
| 	addl2	4(r3),.limhp | ||||
| 	ret | ||||
| .sect .data | ||||
| Imin: .data4	endbss | ||||
| Icur: .data4	endbss | ||||
|  |  | |||
|  | @ -1,29 +1,25 @@ | |||
| #include "syscall.h" | ||||
| .extern	_end
 | ||||
| DEFINE(_brk) | ||||
| 	cmpl	4(ap),Imin | ||||
| 	cmpl	4(ap),$endbss | ||||
| 	bgeq	Iok | ||||
| 	movl	Imin,4(ap) | ||||
| 	movl	$endbss,4(ap) | ||||
| Iok: | ||||
| 	chmk	$17 | ||||
| 	bcs	Ierr | ||||
| 	movl	4(ap),Icur | ||||
| 	movl	4(ap),.limhp | ||||
| 	clrl	r0 | ||||
| 	ret | ||||
| Ierr: | ||||
| 	jmp	cerror | ||||
| 
 | ||||
| DEFINE(_sbrk) | ||||
| 	addl3	Icur,4(ap),-(sp) | ||||
| 	addl3	.limhp,4(ap),-(sp) | ||||
| 	bcs	Ierr | ||||
| 	pushl	$1 | ||||
| 	movl	ap,r3 | ||||
| 	movl	sp,ap | ||||
| 	chmk	$17 | ||||
| 	bcs	Ierr | ||||
| 	movl	Icur,r0 | ||||
| 	addl2	4(r3),Icur | ||||
| 	movl	.limhp,r0 | ||||
| 	addl2	4(r3),.limhp | ||||
| 	ret | ||||
| .sect .data | ||||
| Imin: .data4	_end | ||||
| Icur: .data4	_end | ||||
|  |  | |||
|  | @ -6,6 +6,7 @@ | |||
| .sect .text | ||||
| .define	hol0
 | ||||
| .define	.reghp | ||||
| .define	.limhp | ||||
| .define	.trppc | ||||
| .define	.trpim | ||||
| 
 | ||||
|  | @ -84,6 +85,8 @@ Im2: | |||
| 	.data4	0
 | ||||
| .reghp: | ||||
| 	.data4	_end
 | ||||
| .limhp: | ||||
| 	.data4	_end
 | ||||
| hol0: | ||||
| 	.space	8
 | ||||
| .trppc: | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue