M port/devproc.c => port/devproc.c +1 -1
@@ 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:
M port/fault.c => port/fault.c +0 -1
@@ 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);
M port/portdat.h => port/portdat.h +0 -1
@@ 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 */
M port/swap.c => port/swap.c +0 -2
@@ 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
M port/sysproc.c => port/sysproc.c +7 -7
@@ 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();