From ae26e5d6f7adeb936a4592fb2889e483870ee9e9 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 24 Sep 2002 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2002-09-24 --- pc/trap.c | 2 +- port/devcons.c | 3 +-- port/portdat.h | 4 ++-- port/segment.c | 19 +++++++++++++++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pc/trap.c b/pc/trap.c index 3486ed3054af61f62b6612ba458c211c3a7f62ca..23762bea11088fd7efd2c421e7204fca342c703c 100644 --- a/pc/trap.c +++ b/pc/trap.c @@ -534,7 +534,7 @@ fault386(Ureg* ureg, void*) return; read = !(ureg->ecode & 2); if(up == nil) - panic("what? up is zero pc 0x%8.8lux\n", ureg->pc); + panic("fault but up is zero; pc 0x%8.8lux addr 0x%8.8lux\n", ureg->pc, addr); insyscall = up->insyscall; up->insyscall = 1; n = fault(addr, read); diff --git a/port/devcons.c b/port/devcons.c index af26c2b4a2319c69d02d45786904f1c081489330..f0506ed6b243b0d5813862a4abf848f7715195ff 100644 --- a/port/devcons.c +++ b/port/devcons.c @@ -381,8 +381,7 @@ echo(char *buf, int n) scheddump(); return; case 'k': - if(!cpuserver) - killbig(); + killbig(); return; case 'r': exit(0); diff --git a/port/portdat.h b/port/portdat.h index a851a12a286239d63a59f5f60fbdfb2205070927..ee208027ca893e7c5b3a26272ea75b71f1b77812 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -860,8 +860,8 @@ struct Edfinterface { void (*edfexpel)(Task*); char * (*edfadmit)(Task*); void (*edfdeadline)(Proc*); - void (*edfacquire)(Task*, CSN*); - void (*edfrelease)(Task*); + void (*resacquire)(Task*, CSN*); + void (*resrelease)(Task*); }; /* diff --git a/port/segment.c b/port/segment.c index 018df80493e5c66212e642d52ea3a6af4a6f2af5..d7ca9d6eabf3183056c006a6479d44c78d50da99 100644 --- a/port/segment.c +++ b/port/segment.c @@ -520,10 +520,25 @@ mfreeseg(Segment *s, ulong start, int pages) } while(j < PTEPERTAB) { pg = s->map[i]->pages[j]; + /* + * We want to zero s->map[i]->page[j] and putpage(pg), + * but we have to make sure other processors flush the entry + * entry from their TLBs before the page is freed. + * We construct a list of the pages to be freed, zero + * the entries, then (below) call procflushseg, and call + * putpage on the whole list. + * + * Swapped-out pages don't appear in TLBs, so it's okay + * to putswap those pages before procflushseg. + */ if(pg){ + if(onswap(pg)) + putswap(pg); + else{ + pg->next = list; + list = pg; + } s->map[i]->pages[j] = 0; - pg->next = list; - list = pg; } if(--pages == 0) goto out;