changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: kernel: interpret service= boot parameter to set "cpuserver" variable

changeset 3448: 9ebd6b091242
parent 3447: cf86d1503296
child 3452: 7555fde4ce55
author: cinap_lenrek@felloff.net
date: Sat, 15 Mar 2014 00:55:02 +0100
files: sys/src/9/bcm/main.c sys/src/9/pc/main.c sys/src/9/pc64/main.c sys/src/9/ppc/main.c sys/src/9/teg2/main.c
description: kernel: interpret service= boot parameter to set "cpuserver" variable
     1.1--- a/sys/src/9/bcm/main.c
     1.2+++ b/sys/src/9/bcm/main.c
     1.3@@ -430,17 +430,18 @@ confinit(void)
     1.4 	uintptr pa;
     1.5 	char *p;
     1.6 
     1.7+	if(p = getconf("service")){
     1.8+		if(strcmp(p, "cpu") == 0)
     1.9+			cpuserver = 1;
    1.10+		else if(strcmp(p,"terminal") == 0)
    1.11+			cpuserver = 0;
    1.12+	}
    1.13+
    1.14 	if(p = getconf("*kernelpercent"))
    1.15 		userpcnt = 100 - strtol(p, 0, 0);
    1.16 	else
    1.17 		userpcnt = 0;
    1.18 
    1.19-	if(0 && (p = getconf("service")) != nil){
    1.20-		if(strcmp(p, "cpu") == 0)
    1.21-			cpuserver = 1;
    1.22-		else if(strcmp(p,"terminal") == 0)
    1.23-			cpuserver = 0;
    1.24-	}
    1.25 	if((p = getconf("*maxmem")) != nil){
    1.26 		memsize = strtoul(p, 0, 0) - PHYSDRAM;
    1.27 		if (memsize < 16*MB)		/* sanity */
     2.1--- a/sys/src/9/pc/main.c
     2.2+++ b/sys/src/9/pc/main.c
     2.3@@ -416,6 +416,13 @@ confinit(void)
     2.4 	int i, userpcnt;
     2.5 	ulong kpages;
     2.6 
     2.7+	if(p = getconf("service")){
     2.8+		if(strcmp(p, "cpu") == 0)
     2.9+			cpuserver = 1;
    2.10+		else if(strcmp(p,"terminal") == 0)
    2.11+			cpuserver = 0;
    2.12+	}
    2.13+
    2.14 	if(p = getconf("*kernelpercent"))
    2.15 		userpcnt = 100 - strtol(p, 0, 0);
    2.16 	else
     3.1--- a/sys/src/9/pc64/main.c
     3.2+++ b/sys/src/9/pc64/main.c
     3.3@@ -140,6 +140,13 @@ confinit(void)
     3.4 	int i, userpcnt;
     3.5 	ulong kpages;
     3.6 
     3.7+	if(p = getconf("service")){
     3.8+		if(strcmp(p, "cpu") == 0)
     3.9+			cpuserver = 1;
    3.10+		else if(strcmp(p,"terminal") == 0)
    3.11+			cpuserver = 0;
    3.12+	}
    3.13+
    3.14 	if(p = getconf("*kernelpercent"))
    3.15 		userpcnt = 100 - strtol(p, 0, 0);
    3.16 	else
     4.1--- a/sys/src/9/ppc/main.c
     4.2+++ b/sys/src/9/ppc/main.c
     4.3@@ -334,6 +334,13 @@ confinit(void)
     4.4 	ulong pa, kpages;
     4.5 	/* passed in from ROM monitor: */
     4.6 
     4.7+	if(p = getconf("service")){
     4.8+		if(strcmp(p, "cpu") == 0)
     4.9+			cpuserver = 1;
    4.10+		else if(strcmp(p,"terminal") == 0)
    4.11+			cpuserver = 0;
    4.12+	}
    4.13+
    4.14 	if(p = getconf("*kernelpercent"))
    4.15 		userpcnt = 100 - strtol(p, 0, 0);
    4.16 	else
     5.1--- a/sys/src/9/teg2/main.c
     5.2+++ b/sys/src/9/teg2/main.c
     5.3@@ -833,6 +833,13 @@ confinit(void)
     5.4 	uintptr pa;
     5.5 	char *p;
     5.6 
     5.7+	if(p = getconf("service")){
     5.8+		if(strcmp(p, "cpu") == 0)
     5.9+			cpuserver = 1;
    5.10+		else if(strcmp(p,"terminal") == 0)
    5.11+			cpuserver = 0;
    5.12+	}
    5.13+
    5.14 	/*
    5.15 	 * Copy the physical memory configuration to Conf.mem.
    5.16 	 */
    5.17@@ -912,8 +919,6 @@ confinit(void)
    5.18 		 * be careful with 32-bit overflow.
    5.19 		 */
    5.20 		imagmem->maxsize = kpages;
    5.21-
    5.22-//	archconfinit();
    5.23 }
    5.24 
    5.25 int