This commit is contained in:
aiju 2014-03-15 00:57:46 +01:00
commit 586ab94b05
5 changed files with 35 additions and 8 deletions

View file

@ -430,17 +430,18 @@ confinit(void)
uintptr pa; uintptr pa;
char *p; char *p;
if(p = getconf("*kernelpercent")) if(p = getconf("service")){
userpcnt = 100 - strtol(p, 0, 0);
else
userpcnt = 0;
if(0 && (p = getconf("service")) != nil){
if(strcmp(p, "cpu") == 0) if(strcmp(p, "cpu") == 0)
cpuserver = 1; cpuserver = 1;
else if(strcmp(p,"terminal") == 0) else if(strcmp(p,"terminal") == 0)
cpuserver = 0; cpuserver = 0;
} }
if(p = getconf("*kernelpercent"))
userpcnt = 100 - strtol(p, 0, 0);
else
userpcnt = 0;
if((p = getconf("*maxmem")) != nil){ if((p = getconf("*maxmem")) != nil){
memsize = strtoul(p, 0, 0) - PHYSDRAM; memsize = strtoul(p, 0, 0) - PHYSDRAM;
if (memsize < 16*MB) /* sanity */ if (memsize < 16*MB) /* sanity */

View file

@ -416,6 +416,13 @@ confinit(void)
int i, userpcnt; int i, userpcnt;
ulong kpages; ulong kpages;
if(p = getconf("service")){
if(strcmp(p, "cpu") == 0)
cpuserver = 1;
else if(strcmp(p,"terminal") == 0)
cpuserver = 0;
}
if(p = getconf("*kernelpercent")) if(p = getconf("*kernelpercent"))
userpcnt = 100 - strtol(p, 0, 0); userpcnt = 100 - strtol(p, 0, 0);
else else

View file

@ -140,6 +140,13 @@ confinit(void)
int i, userpcnt; int i, userpcnt;
ulong kpages; ulong kpages;
if(p = getconf("service")){
if(strcmp(p, "cpu") == 0)
cpuserver = 1;
else if(strcmp(p,"terminal") == 0)
cpuserver = 0;
}
if(p = getconf("*kernelpercent")) if(p = getconf("*kernelpercent"))
userpcnt = 100 - strtol(p, 0, 0); userpcnt = 100 - strtol(p, 0, 0);
else else

View file

@ -334,6 +334,13 @@ confinit(void)
ulong pa, kpages; ulong pa, kpages;
/* passed in from ROM monitor: */ /* passed in from ROM monitor: */
if(p = getconf("service")){
if(strcmp(p, "cpu") == 0)
cpuserver = 1;
else if(strcmp(p,"terminal") == 0)
cpuserver = 0;
}
if(p = getconf("*kernelpercent")) if(p = getconf("*kernelpercent"))
userpcnt = 100 - strtol(p, 0, 0); userpcnt = 100 - strtol(p, 0, 0);
else else

View file

@ -833,6 +833,13 @@ confinit(void)
uintptr pa; uintptr pa;
char *p; char *p;
if(p = getconf("service")){
if(strcmp(p, "cpu") == 0)
cpuserver = 1;
else if(strcmp(p,"terminal") == 0)
cpuserver = 0;
}
/* /*
* Copy the physical memory configuration to Conf.mem. * Copy the physical memory configuration to Conf.mem.
*/ */
@ -912,8 +919,6 @@ confinit(void)
* be careful with 32-bit overflow. * be careful with 32-bit overflow.
*/ */
imagmem->maxsize = kpages; imagmem->maxsize = kpages;
// archconfinit();
} }
int int