| plan 9 kernel history: overview | file list | diff list |
1990/1004/gnot/mmu.c (diff list | history)
| 1990/0928/sys/src/9/gnot/mmu.c:19,25 – 1990/1004/sys/src/9/gnot/mmu.c:19,26 (short | long | prev | next) | ||
| 1990/03091 | mapstack(Proc *p) { ulong tlbvirt, tlbphys; | |
| 1990/0921 |
| |
| 1990/1004 | ulong next; MMU *mm, *mn, *me; | |
| 1990/03091 | if(p->upage->va != (USERADDR|(p->pid&0xFFFF))) panic("mapstack %d 0x%lux 0x%lux", p->pid, p->upage->pa, p->upage->va); | |
| 1990/0928/sys/src/9/gnot/mmu.c:26,33 – 1990/1004/sys/src/9/gnot/mmu.c:27,55 | ||
| 1990/03091 | tlbvirt = USERADDR; tlbphys = PPN(p->upage->pa) | PTEVALID | PTEKERNEL; putkmmu(tlbvirt, tlbphys); | |
| 1990/1004 | /* * if not a kernel process and this process was not the * last process on this machine, flush & preload mmu */ 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 | } void | |
| 1990/0928/sys/src/9/gnot/mmu.c:45,51 – 1990/1004/sys/src/9/gnot/mmu.c:67,85 | ||
| 1990/03091 | if(tlbvirt&KZERO) 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 | } void | |
| 1990/0928/sys/src/9/gnot/mmu.c:54,59 – 1990/1004/sys/src/9/gnot/mmu.c:88,101 | ||
| 1990/03091 | flushcpucache(); *PARAM &= ~TLBFLUSH_; *PARAM |= TLBFLUSH_; | |
| 1990/1004 | } void clearmmucache(void) { if(u == 0) panic("flushmmucache"); u->mc.next = 0; | |
| 1990/06021 | } void | |