From owner-freebsd-arch Mon Sep 18 19:55: 6 2000 Delivered-To: freebsd-arch@freebsd.org Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200]) by hub.freebsd.org (Postfix) with ESMTP id 4655837B424 for ; Mon, 18 Sep 2000 19:54:56 -0700 (PDT) Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1]) by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id LAA77533 for ; Tue, 19 Sep 2000 11:55:00 +0900 (JST) (envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp) Message-Id: <200009190255.LAA77533@shidahara1.planet.sci.kobe-u.ac.jp> To: freebsd-arch@freebsd.org Subject: [CFR]patch for kern/kern_exec.c and sys/imgact.h Date: Tue, 19 Sep 2000 11:55:00 +0900 From: Takanori Watanabe Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I suggested by imp to talk about this issue in this list, So I write again in this list. I ported kernel part of PEACE (Portable Executable win32 API Compatible Environment) and I want to change kern/kern_exec.c and sys/imgact.h as follows to make the module run correctly. The main reason fot this change is as mentioned above but this change is useful for farther executable format support, I convince. Are there anyone review this patch?If this patch is reviewed,I'll commit ASAP. Takanori Watanabe Public Key Key fingerprint = 2C 51 E2 78 2C E1 C5 2D 0F F1 20 A3 11 3A 62 2A --- sys/imgact.h.orig Mon Sep 18 02:18:46 2000 +++ sys/imgact.h Mon Sep 18 02:19:25 2000 @@ -58,6 +58,7 @@ struct vm_page *firstpage; /* first page that we mapped */ char *fname; /* pointer to filename of executable (user space) */ unsigned long ps_strings; /* PS_STRINGS for BSD/OS binaries */ + size_t auxarg_size; }; #ifdef _KERNEL --- kern/kern_exec.c.orig Fri Jul 14 15:44:45 2000 +++ kern/kern_exec.c Mon Sep 18 02:59:45 2000 @@ -127,6 +127,7 @@ imgp->vp = NULL; imgp->firstpage = NULL; imgp->ps_strings = 0; + imgp->auxarg_size=0; /* * Allocate temporary demand zeroed space for argument and @@ -613,14 +614,21 @@ * If we have a valid auxargs ptr, prepare some room * on the stack. */ - if (imgp->auxargs) + if (imgp->auxargs){ + /* + * 'AT_COUNT*2' is size for the ELF Auxargs data. + * This is for lower compatibility. + */ + imgp->auxarg_size=(imgp->auxarg_size)?imgp->auxarg_size + :(AT_COUNT*2); /* * The '+ 2' is for the null pointers at the end of each of the - * arg and env vector sets, and 'AT_COUNT*2' is room for the - * ELF Auxargs data. + * arg and env vector sets,and imgp->auxarg_size is room for argument + * of Runtime loader. */ vectp = (char **)(destp - (imgp->argc + imgp->envc + 2 + - AT_COUNT*2) * sizeof(char*)); + imgp->auxarg_size) * sizeof(char*)); + } else /* * The '+ 2' is for the null pointers at the end of each of the To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message