shithub: riscv

Download patch

ref: a8af25ef8105058d4bde5674701a2f6a9024e80a
parent: 11489407ecb860a1836ebfab5e4c1620ffd8b23b
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Mar 14 20:55:02 EDT 2014

kernel: interpret service= boot parameter to set "cpuserver" variable

--- a/sys/src/9/bcm/main.c
+++ b/sys/src/9/bcm/main.c
@@ -430,17 +430,18 @@
 	uintptr pa;
 	char *p;
 
-	if(p = getconf("*kernelpercent"))
-		userpcnt = 100 - strtol(p, 0, 0);
-	else
-		userpcnt = 0;
-
-	if(0 && (p = getconf("service")) != nil){
+	if(p = getconf("service")){
 		if(strcmp(p, "cpu") == 0)
 			cpuserver = 1;
 		else if(strcmp(p,"terminal") == 0)
 			cpuserver = 0;
 	}
+
+	if(p = getconf("*kernelpercent"))
+		userpcnt = 100 - strtol(p, 0, 0);
+	else
+		userpcnt = 0;
+
 	if((p = getconf("*maxmem")) != nil){
 		memsize = strtoul(p, 0, 0) - PHYSDRAM;
 		if (memsize < 16*MB)		/* sanity */
--- a/sys/src/9/pc/main.c
+++ b/sys/src/9/pc/main.c
@@ -416,6 +416,13 @@
 	int i, userpcnt;
 	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"))
 		userpcnt = 100 - strtol(p, 0, 0);
 	else
--- a/sys/src/9/pc64/main.c
+++ b/sys/src/9/pc64/main.c
@@ -140,6 +140,13 @@
 	int i, userpcnt;
 	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"))
 		userpcnt = 100 - strtol(p, 0, 0);
 	else
--- a/sys/src/9/ppc/main.c
+++ b/sys/src/9/ppc/main.c
@@ -334,6 +334,13 @@
 	ulong pa, kpages;
 	/* 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"))
 		userpcnt = 100 - strtol(p, 0, 0);
 	else
--- a/sys/src/9/teg2/main.c
+++ b/sys/src/9/teg2/main.c
@@ -833,6 +833,13 @@
 	uintptr pa;
 	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.
 	 */
@@ -912,8 +919,6 @@
 		 * be careful with 32-bit overflow.
 		 */
 		imagmem->maxsize = kpages;
-
-//	archconfinit();
 }
 
 int