M gnot/main.c => gnot/main.c +7 -0
@@ 303,6 303,8 @@ void
confinit(void)
{
int mul;
+ ulong ktop;
+
conf.nmach = 1;
if(conf.nmach > MAXMACH)
panic("confinit");
@@ 315,6 317,11 @@ confinit(void)
conf.npage = conf.npage0+conf.npage1;
conf.upages = (conf.npage*70)/100;
+ ktop = PGROUND((ulong)end);
+ ktop = PADDR(ktop);
+ conf.npage0 -= ktop/BY2PG;
+ conf.base0 += ktop;
+
mul = 1 + (conf.npage1>0);
conf.nproc = 50*mul;
conf.nswap = 4096;
M pc/main.c => pc/main.c +6 -0
@@ 199,6 199,7 @@ confinit(void)
{
long x, i, j, *l;
int mul;
+ ulong ktop;
/*
* the first 640k is the standard useful memory
@@ 238,6 239,11 @@ confinit(void)
conf.npage = conf.npage0 + conf.npage1;
conf.upages = (conf.npage*70)/100;
+ ktop = PGROUND((ulong)end);
+ ktop = PADDR(ktop);
+ conf.npage0 -= ktop/BY2PG;
+ conf.base0 += ktop;
+
/* for meminit() */
conf.topofmem = i*MB;
M port/alloc.c => port/alloc.c +0 -6
@@ 79,7 79,6 @@ static Xalloc xlists;
void
xinit(void)
{
- ulong ktop;
Hole *h, *eh;
int up, np0, np1;
@@ 89,11 88,6 @@ xinit(void)
xlists.flist = xlists.hole;
- ktop = PGROUND((ulong)end);
- ktop = PADDR(ktop);
- conf.npage0 -= ktop/BY2PG;
- conf.base0 += ktop;
-
up = conf.upages;
np1 = up;
if(np1 > conf.npage1)
M port/sysproc.c => port/sysproc.c +5 -3
@@ 169,13 169,15 @@ sysrfork(ulong *arg)
p->parentpid = parent->pid;
if(flag&RFNOWAIT)
p->parentpid = 1;
+ else {
+ lock(&parent->exl);
+ parent->nchild++;
+ unlock(&parent->exl);
+ }
if((flag&RFNOTEG) == 0)
p->noteid = parent->noteid;
p->fpstate = parent->fpstate;
- lock(&parent->exl);
- parent->nchild++;
- unlock(&parent->exl);
pid = p->pid;
memset(p->time, 0, sizeof(p->time));
p->time[TReal] = MACHP(0)->ticks;
M power/main.c => power/main.c +6 -0
@@ 490,6 490,7 @@ void
confinit(void)
{
long x, i, *l;
+ ulong ktop;
/*
* copy configuration down from high memory
@@ 515,6 516,11 @@ confinit(void)
conf.npage1 = 0;
conf.base1 = 0;
+ ktop = PGROUND((ulong)end);
+ ktop = PADDR(ktop);
+ conf.npage0 -= ktop/BY2PG;
+ conf.base0 += ktop;
+
conf.upages = (conf.npage*70)/100;
i = conf.npage-conf.upages;
if(i > (12*MB)/BY2PG)
M ss/main.c => ss/main.c +6 -0
@@ 190,6 190,7 @@ void
confinit(void)
{
int mul;
+ ulong ktop;
conf.nmach = 1;
if(conf.nmach > MAXMACH)
@@ 203,6 204,11 @@ confinit(void)
conf.upages = 1400;
+ ktop = PGROUND((ulong)end);
+ ktop = PADDR(ktop);
+ conf.npage0 -= ktop/BY2PG;
+ conf.base0 += ktop;
+
mul = conf.upages/700;
conf.nproc = 50*mul;