From owner-p4-projects@FreeBSD.ORG Tue Feb 10 06:47:26 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 10CD016A4D6; Tue, 10 Feb 2004 06:47:26 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC85C16A4D1 for ; Tue, 10 Feb 2004 06:47:25 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D84BF43D1D for ; Tue, 10 Feb 2004 06:47:25 -0800 (PST) (envelope-from areisse@nailabs.com) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1AElPGe065304 for ; Tue, 10 Feb 2004 06:47:25 -0800 (PST) (envelope-from areisse@nailabs.com) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1AElPxl065301 for perforce@freebsd.org; Tue, 10 Feb 2004 06:47:25 -0800 (PST) (envelope-from areisse@nailabs.com) Date: Tue, 10 Feb 2004 06:47:25 -0800 (PST) Message-Id: <200402101447.i1AElPxl065301@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to areisse@nailabs.com using -f From: Andrew Reisse To: Perforce Change Reviews Subject: PERFORCE change 46749 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2004 14:47:26 -0000 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);