plan 9 kernel history: overview | file list | diff list

1991/1004/gnot/mmu.c (diff list | history)

1991/1004/sys/src/9/gnot/mmu.c:32,381992/0103/sys/src/9/gnot/mmu.c:32,37 (short | long | prev | next)
1990/1004    
 
1991/0705    
	if(p->newtlb) { 
		flushmmu(); 
		clearmmucache(); 
		p->newtlb = 0; 
	} 
 
1991/1004/sys/src/9/gnot/mmu.c:42,611992/0103/sys/src/9/gnot/mmu.c:41,46
1990/1004    
	 */ 
	if(!p->kp && p!=m->lproc){ 
		flushmmu(); 
                 
		/* 
		 *  preload the MMU with the last (up to) NMMU user entries 
		 *  previously faulted into it for this process. 
		 */ 
		mn = &u->mc.mmu[u->mc.next&(NMMU-1)]; 
		me = &u->mc.mmu[NMMU]; 
		if(u->mc.next >= NMMU){ 
			for(mm = mn; mm < me; mm++) 
				UMAP[mm->va] = mm->pa; 
		} 
		for(mm = u->mc.mmu; mm < mn; mm++) 
			UMAP[mm->va] = mm->pa; 
                 
		m->lproc = p; 
	} 
1990/03091    
} 
1991/1004/sys/src/9/gnot/mmu.c:82,981992/0103/sys/src/9/gnot/mmu.c:67,72
1990/03091    
		panic("putmmu"); 
	tlbphys |= VTAG(tlbvirt)<<24; 
1990/1004    
	tlbvirt = (tlbvirt&0x003FE000L)>>2; 
	if(u){ 
		MMU *mp; 
		int s; 
                 
		s = splhi(); 
		mp = &(u->mc.mmu[u->mc.next&(NMMU-1)]); 
		mp->pa = tlbphys; 
		mp->va = tlbvirt; 
		u->mc.next++; 
		splx(s); 
	} 
	UMAP[tlbvirt] = tlbphys; 
1990/03091    
} 
 
1991/1004/sys/src/9/gnot/mmu.c:102,1151992/0103/sys/src/9/gnot/mmu.c:76,81
1990/03091    
	flushcpucache(); 
	*PARAM &= ~TLBFLUSH_; 
	*PARAM |= TLBFLUSH_; 
1990/1004    
} 
                 
void 
clearmmucache(void) 
{ 
	if(u == 0) 
1991/0705    
		panic("clearmmucache"); 
1990/1004    
	u->mc.next = 0; 
1990/06021    
} 
 
void 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)