| plan 9 kernel history: overview | file list | diff list |
1994/0406/power/mmu.c (diff list | history)
| 1993/0812/sys/src/9/power/mmu.c:7,20 – 1994/0406/sys/src/9/power/mmu.c:7,23 (short | long | prev | next) | ||
| 1990/0227 | void | |
| 1993/0501 | mmuswitch(Proc *p) | |
| 1990/0227 | { | |
| 1994/0406 | int tp; | |
| 1991/0705 | if(p->newtlb) { memset(p->pidonmach, 0, sizeof p->pidonmach); p->newtlb = 0; } | |
| 1993/0501 |
| |
| 1994/0406 | tp = p->pidonmach[m->machno]; if(tp == 0) tp = newtlbpid(p); | |
| 1991/0705 | ||
| 1993/0501 |
| |
| 1994/0406 | putcontext(tp); | |
| 1990/0227 | } | |
| 1991/0507 | void | |
| 1993/0812/sys/src/9/power/mmu.c:30,63 – 1994/0406/sys/src/9/power/mmu.c:33,59 | ||
| 1990/0227 | newtlbpid(Proc *p) { | |
| 1991/0425 | int i, s; | |
| 1990/0227 |
| |
| 1991/0425 |
| |
| 1994/0406 | Proc **h; | |
| 1991/0426 | ||
| 1991/0425 |
| |
| 1991/0501 |
| |
| 1994/0406 | i = m->lastpid; h = m->pidproc; for(s = 0; s < NTLBPID; s++) { | |
| 1991/0501 | i++; if(i >= NTLBPID) i = 1; | |
| 1991/0425 |
| |
| 1991/0426 |
| |
| 1994/0406 | if(h[i] == 0) break; | |
| 1991/0425 | } | |
| 1994/0406 | ||
| 1991/0501 | if(h[i]) purgetlb(i); | |
| 1994/0406 | if(h[i] != 0) panic("newtlb"); | |
| 1992/1130 | ||
| 1990/0227 |
| |
| 1991/0501 |
| |
| 1991/0430 | m->pidproc[i] = p; p->pidonmach[m->machno] = i; | |
| 1991/0501 | m->lastpid = i; | |
| 1994/0406 | ||
| 1990/0227 | return i; } | |
| 1993/0812/sys/src/9/power/mmu.c:73,79 – 1994/0406/sys/src/9/power/mmu.c:69,75 | ||
| 1993/0812 | if(*ctl == PG_TXTFLUSH) { | |
| 1991/0705 | dcflush((void*)pg->pa, BY2PG); icflush((void*)pg->pa, BY2PG); | |
| 1993/0806 |
| |
| 1994/0406 | *ctl = PG_NOFLUSH; | |
| 1991/0705 | } | |
| 1993/0501 | tp = up->pidonmach[m->machno]; | |
| 1993/0812/sys/src/9/power/mmu.c:83,136 – 1994/0406/sys/src/9/power/mmu.c:79,128 | ||
| 1990/0227 | tlbvirt |= PTEPID(tp); | |
| 1991/0425 | putstlb(tlbvirt, tlbphys); | |
| 1990/0227 | puttlb(tlbvirt, tlbphys); | |
| 1994/0406 | purgetlb(int tlbpid) | |
| 1990/0227 | { | |
| 1991/0425 |
| |
| 1991/0501 |
| |
| 1994/0406 | int i, mno; | |
| 1991/0430 | Proc *sp, **pidproc; | |
| 1991/0501 |
| |
| 1994/0406 | Softtlb *entry, *etab; | |
| 1990/0227 | ||
| 1991/0425 | m->tlbpurge++; | |
| 1994/0406 | ||
| 1991/0501 | /* * find all pid entries that are no longer used by processes */ mno = m->machno; pidproc = m->pidproc; | |
| 1994/0406 | for(i=1; i<NTLBPID; i++) { | |
| 1991/0501 | sp = pidproc[i]; | |
| 1994/0406 | if(sp && sp->pidonmach[mno] != i) | |
| 1991/0501 | pidproc[i] = 0; | |
| 1994/0406 | ||
| 1991/0501 | /* | |
| 1992/1130 |
| |
| 1994/0406 | * shoot down the one we want | |
| 1991/0501 | */ | |
| 1991/0426 |
| |
| 1991/0501 |
| |
| 1994/0406 | sp = pidproc[tlbpid]; if(sp != 0) sp->pidonmach[mno] = 0; pidproc[tlbpid] = 0; /* * clean out all dead tlbpids from the stlb; */ | |
| 1991/0425 | entry = m->stb; | |
| 1991/0501 |
| |
| 1994/0406 | for(etab = &entry[STLBSIZE]; entry < etab; entry++) if(pidproc[TLBPID(entry->virt)] == 0) | |
| 1991/0425 | entry->virt = 0; | |
| 1991/0501 |
| |
| 1990/0227 |
| |
| 1994/0406 | ||
| 1991/0501 | /* * clean up the hardware */ | |
| 1991/0430 | for(i=TLBROFF; i<NTLB; i++) | |
| 1991/0501 |
| |
| 1994/0406 | if(pidproc[TLBPID(gettlbvirt(i))] == 0) | |
| 1991/0430 | puttlbx(i, KZERO | PTEPID(i), 0); | |
| 1990/0227 | } | |