View Single Post
Old 28 October 2019, 14:39   #3
Hedeon
PPC Hacker

 
Join Date: Mar 2012
Location: Leiden / The Netherlands
Posts: 1,319
Had hoped that some directive would do. Current source does not use stack and only modifies the software page table.

I'd guess this is one of those parts that will stay in assembly.

Excerpt:

Code:
.DLoadTLBMiss:
		mfspr	r2,HASH1				#get first pointer
		li	r1,8   					#load 8 for counter
		mfctr	r0   					#save counter
		mfspr	r3,DCMP   				#get first compare value
		addi	r2,r2,-8  				#pre dec the pointer
dm0:
		mtctr	r1  					#load counter
dm1:
		lwzu	r1,8(r2)				#get next pte
		cmpw	r1,r3 					#see if found pte
		bdnzf	eq,dm1 					#dec count br if cmp ne and if count not zero
		bne	dataSecHash 				#if not found set up second hash or exit
		lwz	r1,4(r2) 				#load tlb entry lower-word
		mtctr	r0   					#restore counter
		mfspr	r0,DMISS  				#get the miss address for the tlbld
		mfsrr1	r3   					#get the saved cr0 bits
		mtcrf	0x80,r3 				#restore CR0
		mtspr	RPA,r1  				#set the pte
		ori	r1,r1,PTE_REFERENCED   			#set reference bit
		srwi	r1,r1,8  				#get byte 7 of pte
		tlbld	r0    					#load the dtlb
		stb	r1,6(r2) 				#update page table
		rfi      					#return to executing program

dataSecHash:
 		andi.	r1,r3,PTE_HASHID 			#see if we have done second hash
		bne	doDSI       				#if so, go to DSI interrupt
		mfspr	r2,HASH2   				#get the second pointer
		ori	r3,r3,PTE_HASHID 			#change the compare value
		li	r1,8   					#load 8 for counter
		addi	r2,r2,-8  				#pre dec for update on load
		b	dm0  					#try second hash
Hedeon is offline  
 
Page generated in 0.07971 seconds with 11 queries