| plan 9 kernel history: overview | file list | diff list |
1999/0128/mpc/mmu.c (diff list | history)
| 1999/0121/sys/src/9/mpc/mmu.c:6,68 – 1999/0126/sys/src/9/mpc/mmu.c:6,28 (short | long) | ||
| 1999/0121 | #include "io.h" | |
| 1999/0126 | iprint("mmuinit\n"); kernelmmu(); | |
| 1999/0121 | } void | |
| 1999/0126 | mmuswitch(Proc*) | |
| 1999/0121 | { | |
| 1999/0126 | flushmmu(); | |
| 1999/0121 | } | |
| 1999/0126/sys/src/9/mpc/mmu.c:9,15 – 1999/0127/sys/src/9/mpc/mmu.c:9,15 (short | long) | ||
| 1999/0121 | void mmuinit(void) { | |
| 1999/0126 |
| |
| 1999/0127 | print("mmuinit\n"); | |
| 1999/0126 | kernelmmu(); | |
| 1999/0121 | } | |
| 1999/0126/sys/src/9/mpc/mmu.c:26,28 – 1999/0127/sys/src/9/mpc/mmu.c:26,37 | ||
| 1999/0121 | } | |
| 1999/0127 | void putmmu(ulong va, ulong pa, Page*) { int x, r; print("putmmu va=%ux pa=%ux\n", va, pa); x = splhi(); r = _putmmu(va, pa); splx(x); } | |
| 1999/0127/sys/src/9/mpc/mmu.c:14,19 – 1999/0128/sys/src/9/mpc/mmu.c:14,26 (short | long) | ||
| 1999/0121 | } void | |
| 1999/0128 | flushmmu(void) { // print("flushmmu()\n"); _flushmmu(); } void | |
| 1999/0126 | mmuswitch(Proc*) | |
| 1999/0121 | { | |
| 1999/0126 | flushmmu(); | |
| 1999/0127/sys/src/9/mpc/mmu.c:30,36 – 1999/0128/sys/src/9/mpc/mmu.c:37,43 | ||
| 1999/0127 | putmmu(ulong va, ulong pa, Page*) { int x, r; | |
| 1999/0128 | //print("putmmu va=%ux pa=%ux\n", va, pa); | |
| 1999/0127 | x = splhi(); r = _putmmu(va, pa); splx(x); | |
| 1999/0128/sys/src/9/mpc/mmu.c:34,44 – 1999/0608/sys/src/9/mpc/mmu.c:34,65 (short | long) | ||
| 1999/0121 | ||
| 1999/0127 | void | |
| 1999/0608 | putmmu(ulong va, ulong pa, Page *pg) | |
| 1999/0127 | { int x, r; | |
| 1999/0608 | char *ctl; //if((va&0x8000000) == 0) | |
| 1999/0128 | //print("putmmu va=%ux pa=%ux\n", va, pa); | |
| 1999/0127 | x = splhi(); r = _putmmu(va, pa); | |
| 1999/0608 | ctl = &pg->cachectl[m->machno]; switch(*ctl) { default: panic("putmmu: %d\n", *ctl); break; case PG_NOFLUSH: break; case PG_TXTFLUSH: icflush((void*)pg->va, BY2PG); *ctl = PG_NOFLUSH; break; case PG_NEWCOL: dcflush((void*)pg->va, BY2PG); *ctl = PG_NOFLUSH; break; } | |
| 1999/0127 | splx(x); } | |
| 1999/0608/sys/src/9/mpc/mmu.c:5,50 – 2000/0516/sys/src/9/mpc/mmu.c:5,158 (short | long) | ||
| 1999/0121 | #include "fns.h" #include "io.h" | |
| 2000/0516 | #define TLBINVLAID KZERO | |
| 1999/0121 | void mmuinit(void) { | |
| 2000/0516 | int i; | |
| 1999/0127 | print("mmuinit\n"); | |
| 1999/0126 |
| |
| 2000/0516 | for(i=0; i<STLBSIZE; i++) m->stb[i].virt = TLBINVLAID; | |
| 1999/0121 | } void | |
| 1999/0128 | flushmmu(void) { | |
| 2000/0516 | int x; if(0)print("flushmmu(%d)\n", up->pid); x = splhi(); up->newtlb = 1; mmuswitch(up); splx(x); | |
| 1999/0128 | } | |
| 2000/0516 | /* * called with splhi */ | |
| 1999/0128 | void | |
| 1999/0126 |
| |
| 2000/0516 | mmuswitch(Proc *p) | |
| 1999/0121 | { | |
| 1999/0126 |
| |
| 2000/0516 | int tp; if(0)print("mmuswitch()\n"); if(p->newtlb) { memset(p->pidonmach, 0, sizeof p->pidonmach); p->newtlb = 0; } tp = p->pidonmach[m->machno]; putcasid(tp); | |
| 1999/0121 | } void | |
| 2000/0516 | mmurelease(Proc* p) | |
| 1999/0121 | { | |
| 2000/0516 | if(0)print("mmurelease(%d)\n", p->pid); memset(p->pidonmach, 0, sizeof p->pidonmach); | |
| 1999/0121 | } | |
| 2000/0516 | void purgetlb(int pid) { int i, mno; Proc *sp, **pidproc; Softtlb *entry, *etab; | |
| 1999/0121 | ||
| 2000/0516 | if(0)print("purgetlb: pid = %d\n", pid); m->tlbpurge++; /* * find all pid entries that are no longer used by processes */ mno = m->machno; pidproc = m->pidproc; for(i=1; i<NTLBPID; i++) { sp = pidproc[i]; if(sp && sp->pidonmach[mno] != i) pidproc[i] = 0; } /* * shoot down the one we want */ sp = pidproc[pid]; if(sp != 0) sp->pidonmach[mno] = 0; pidproc[pid] = 0; /* * clean out all dead pids from the stlb; */ entry = m->stb; for(etab = &entry[STLBSIZE]; entry < etab; entry++) if(pidproc[TLBPID(entry->virt)] == 0) entry->virt = TLBINVLAID; /* * clean up the hardware */ tlbflushall(); } int newtlbpid(Proc *p) { int i, s; Proc **h; i = m->lastpid; h = m->pidproc; for(s = 0; s < NTLBPID; s++) { i++; if(i >= NTLBPID) i = 1; if(h[i] == 0) break; } if(h[i]) { i = m->purgepid+1; if(i >= NTLBPID) i = 1; m->purgepid = i; purgetlb(i); } if(h[i] != 0) panic("newtlb"); m->pidproc[i] = p; p->pidonmach[m->machno] = i; m->lastpid = i; if(0)print("newtlbpid: pid=%d = tlbpid = %d\n", p->pid, i); return i; } | |
| 1999/0127 | void | |
| 1999/0608 | putmmu(ulong va, ulong pa, Page *pg) | |
| 1999/0127 | { | |
| 1999/0608 | char *ctl; | |
| 2000/0516 | int tp; ulong h; | |
| 1999/0608 |
| |
| 1999/0128 |
| |
| 1999/0127 |
| |
| 2000/0516 | qlock(&m->stlblk); | |
| 1999/0608 | ||
| 2000/0516 | tp = up->pidonmach[m->machno]; if(tp == 0) { tp = newtlbpid(up); putcasid(tp); } h = ((va>>12)^(va>>24)^(tp<<8)) & 0xfff; m->stb[h].virt = va|tp; m->stb[h].phys = pa; tlbflush(va); qunlock(&m->stlblk); | |
| 1999/0608 | ctl = &pg->cachectl[m->machno]; | |
| 2000/0516 | if(0)print("putmmu tp=%d h=%d va=%ux pa=%ux ctl=%x\n", tp, h,va, pa, *ctl); | |
| 1999/0608 | switch(*ctl) { default: panic("putmmu: %d\n", *ctl); | |
| 1999/0608/sys/src/9/mpc/mmu.c:52,65 – 2000/0516/sys/src/9/mpc/mmu.c:160,172 | ||
| 1999/0608 | case PG_NOFLUSH: break; case PG_TXTFLUSH: | |
| 2000/0516 | dcflush((void*)pg->va, BY2PG); | |
| 1999/0608 | icflush((void*)pg->va, BY2PG); *ctl = PG_NOFLUSH; break; case PG_NEWCOL: | |
| 2000/0516 | print("PG_NEWCOL!!\n"); | |
| 1999/0608 | *ctl = PG_NOFLUSH; break; } | |
| 1999/0127 |
| |
| 2000/0516/sys/src/9/mpc/mmu.c:22,28 – 2000/0521/sys/src/9/mpc/mmu.c:22,28 (short | long) | ||
| 1999/0128 | { | |
| 2000/0516 | int x; | |
| 2000/0521 | if(0)print("flushmmu(%ld)\n", up->pid); | |
| 2000/0516 | x = splhi(); up->newtlb = 1; mmuswitch(up); | |
| 2000/0516/sys/src/9/mpc/mmu.c:49,55 – 2000/0521/sys/src/9/mpc/mmu.c:49,55 | ||
| 1999/0121 | void | |
| 2000/0516 | mmurelease(Proc* p) | |
| 1999/0121 | { | |
| 2000/0516 |
| |
| 2000/0521 | if(0)print("mmurelease(%ld)\n", p->pid); | |
| 2000/0516 | memset(p->pidonmach, 0, sizeof p->pidonmach); | |
| 1999/0121 | } | |
| 2000/0516/sys/src/9/mpc/mmu.c:125,131 – 2000/0521/sys/src/9/mpc/mmu.c:125,131 | ||
| 2000/0516 | m->pidproc[i] = p; p->pidonmach[m->machno] = i; m->lastpid = i; | |
| 2000/0521 | if(0)print("newtlbpid: pid=%ld = tlbpid = %d\n", p->pid, i); | |
| 2000/0516 | return i; } | |
| 2000/0516/sys/src/9/mpc/mmu.c:152,158 – 2000/0521/sys/src/9/mpc/mmu.c:152,158 | ||
| 2000/0516 | qunlock(&m->stlblk); | |
| 1999/0608 | ctl = &pg->cachectl[m->machno]; | |
| 2000/0516 |
| |
| 2000/0521 | if(0)print("putmmu tp=%d h=%ld va=%lux pa=%lux ctl=%x\n", tp, h,va, pa, *ctl); | |
| 1999/0608 | switch(*ctl) { default: panic("putmmu: %d\n", *ctl); | |
| 2000/0521/sys/src/9/mpc/mmu.c:1,172 – 2001/0527/sys/src/9/mpc/mmu.c:0 (short | long) | ||
|
Deleted.
rsc Mon Mar 7 10:28:45 2005 | ||
| 1999/0121 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 2000/0516 |
| |
| 1999/0127 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 1999/0128 |
| |
| 2000/0516 |
| |
| 2000/0521 |
| |
| 2000/0516 |
| |
| 1999/0128 |
| |
| 2000/0516 |
| |
| 1999/0128 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 2000/0521 |
| |
| 2000/0516 |
| |
| 1999/0121 |
| |
| 2000/0516 |
| |
| 1999/0121 | ||
| 2000/0516 |
| |
| 2000/0521 |
| |
| 2000/0516 |
| |
| 1999/0127 |
| |
| 1999/0608 |
| |
| 1999/0127 |
| |
| 1999/0608 |
| |
| 2000/0516 |
| |
| 1999/0608 | ||
| 2000/0516 |
| |
| 1999/0608 | ||
| 2000/0516 |
| |
| 1999/0608 |
| |
| 2000/0521 |
| |
| 1999/0608 |
| |
| 2000/0516 |
| |
| 1999/0608 |
| |
| 2000/0516 |
| |
| 1999/0608 |
| |
| 1999/0127 |
| |