~kris/9p

9hist

de8f8e8817987bda09267416068b975910fcc00e — David du Colombier 25 years ago aeb605a
Plan 9 from Bell Labs 2001-04-25
5 files changed, 8 insertions(+), 12 deletions(-)

M port/devproc.c
M port/fault.c
M port/portdat.h
M port/swap.c
M port/sysproc.c
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();