PERFORCE change 46749 for review

Andrew Reisse areisse at FreeBSD.org
Tue Feb 10 14:47:25 GMT 2004


http://perforce.freebsd.org/chv.cgi?CH=46749

Change 46749 by areisse at areisse_ibook on 2004/02/10 06:46:29

	Fix for using more than 1 preload
	Prefix "kenv" stores its argument as a preload

Affected files ...

.. //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/main.c#3 edit

Differences ...

==== //depot/projects/trustedbsd/sedarwin/apsl/BootX/bootx.tproj/sl.subproj/main.c#3 (text+ko) ====

@@ -481,7 +481,7 @@
       char pfilename[255];
       size = GetProp(gOptionsPH, propname, pfilename, 255);
 
-      if (size > 0) {
+      if (size > 0 && strlen(propname+4) < sizeof(int) * 4) {
 	char datfile[512];
 	strcpy (datfile, gRootDir);
 	strcat (datfile, pfilename);
@@ -494,10 +494,26 @@
 
 	  if (args->exdata == NULL)
 	    args->exdata = v;
-	  args->exdatalen += size + sizeof(int) * 5;
+	  //args->exdatalen += size + sizeof(int) * 5;
+	  args->exdatalen = (char*)AllocateKernelMemory(0)-(char*)args->exdata;
 	}
       }
     }
+    else if (!strncmp (propname, "kenv_", 5)) {
+      char pvar[255];
+      size = GetProp(gOptionsPH, propname, pvar, 255);
+
+      if (size > 0 && strlen(propname+4) < sizeof(int) * 4) {
+	int *v = (int *) AllocateKernelMemory (size + sizeof (int) * 5);
+	*v = size;
+	strcpy ((char *) (v + 1), propname + 5);
+	memcpy (v + 5, pvar, size);
+
+	if (args->exdata == NULL)
+	  args->exdata = v;
+	args->exdatalen = (char*)AllocateKernelMemory(0)-(char*)args->exdata;
+      }
+    }
   }
 
   args->topOfKernelData = AllocateKernelMemory(0);
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list