Date: Tue, 10 Feb 2004 06:47:25 -0800 (PST) From: Andrew Reisse <areisse@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 46749 for review Message-ID: <200402101447.i1AElPxl065301@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=46749 Change 46749 by areisse@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402101447.i1AElPxl065301>