From de8f8e8817987bda09267416068b975910fcc00e Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 25 Apr 2001 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 2001-04-25 --- port/devproc.c | 2 +- port/fault.c | 1 - port/portdat.h | 1 - port/swap.c | 2 -- port/sysproc.c | 14 +++++++------- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/port/devproc.c b/port/devproc.c index 75da0631a200ed33905ce31056565d1db5443214..aed13f94543d15eaa601d74124bef83d946ea89d 100644 --- a/port/devproc.c +++ b/port/devproc.c @@ -49,7 +49,7 @@ Dirtab procdir[] = }; /* Segment type from portdat.h */ -char *sname[]={ "Text", "Data", "Bss", "Stack", "Shared", "Phys", "Shdata" }; +char *sname[]={ "Text", "Data", "Bss", "Stack", "Shared", "Phys" }; /* * Qids are, in path: diff --git a/port/fault.c b/port/fault.c index 7520d0c5879d6b7dd0156d79b65ecef173e1e8cd..39baa0296021fb9788839103037ffdf4d9ec45df 100644 --- a/port/fault.c +++ b/port/fault.c @@ -98,7 +98,6 @@ fixfault(Segment *s, ulong addr, int read, int doputmmu) goto common; case SG_DATA: - case SG_SHDATA: common: /* Demand load/pagein/copy on write */ if(pagedout(*pg)) pio(s, addr, soff, pg); diff --git a/port/portdat.h b/port/portdat.h index 55204347e4337f869e1b093e421548cdf8c921ff..c5ba29c26a345b71bb9ad323cd4b1d1a793b7c2d 100644 --- a/port/portdat.h +++ b/port/portdat.h @@ -342,7 +342,6 @@ enum SG_STACK = 03, SG_SHARED = 04, SG_PHYSICAL = 05, - SG_SHDATA = 06, SG_RONLY = 0040, /* Segment is read only */ SG_CEXEC = 0100, /* Detach at exec */ diff --git a/port/swap.c b/port/swap.c index 44e3d291f16b0d8d3e445589d7507b8234821a12..cecf52af8dcab8adc057ec243b7de3b537b9c20c 100644 --- a/port/swap.c +++ b/port/swap.c @@ -147,7 +147,6 @@ loop: case SG_BSS: case SG_STACK: case SG_SHARED: - case SG_SHDATA: up->psstate = "Pageout"; pageout(p, s); if(ioptr != 0) { @@ -280,7 +279,6 @@ pagepte(int type, Page **pg) case SG_BSS: case SG_STACK: case SG_SHARED: - case SG_SHDATA: /* * get a new swap address and clear any pages * referring to it from the cache diff --git a/port/sysproc.c b/port/sysproc.c index db255d84bfdf5dd0a5bfd5dfce84524b4f036d6f..00a497e937db7076869b7ba7bb30ed0a643b6f6c 100644 --- a/port/sysproc.c +++ b/port/sysproc.c @@ -665,21 +665,21 @@ long syssegfree(ulong *arg) { Segment *s; - ulong from, pages; + ulong from, to; - from = PGROUND(arg[0]); + from = arg[0]; s = seg(up, from, 1); - if(s == 0) + if(s == nil) error(Ebadarg); + to = (from + arg[1]) & ~(BY2PG-1); + from = PGROUND(from); - pages = (arg[1]+BY2PG-1)/BY2PG; - - if(from+pages*BY2PG > s->top) { + if(to > s->top) { qunlock(&s->lk); error(Ebadarg); } - mfreeseg(s, from, pages); + mfreeseg(s, from, (to - from) / BY2PG); qunlock(&s->lk); flushmmu();