Date: Thu, 1 May 2008 13:00:34 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: "David O'Brien" <obrien@freebsd.org> Cc: Yar Tikhiy <yar@comp.chem.msu.su>, src-committers@freebsd.org, cvs-all@freebsd.org, cvs-src@freebsd.org, Oleksandr Tymoshenko <gonzo@freebsd.org> Subject: Re: cvs commit: src/sys/sys user.h Message-ID: <20080501123943.V93454@delplex.bde.org> In-Reply-To: <20080430180255.GB89079@dragon.NUXI.org> References: <200804291117.m3TBHjw3050979@repoman.freebsd.org> <fbaf9b70804290641t22fcffb6w20d0513d0b937fa@mail.gmail.com> <20080430180255.GB89079@dragon.NUXI.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 30 Apr 2008, David O'Brien wrote: > On Tue, Apr 29, 2008 at 05:41:18PM +0400, Yar Tikhiy wrote: >> On Tue, Apr 29, 2008 at 3:17 PM, Oleksandr Tymoshenko <gonzo@freebsd.org> wrote: >>> gonzo 2008-04-29 11:17:45 UTC >>> Modified files: >>> sys/sys user.h >>> Log: >>> Define KINFO_PROC_SIZE for mips. > .. >> Perhaps it's time to introduce MD .h files for that instead of adding >> MD #ifdefs to the MI .h file, isn't it? I.e., <sys/user.h> can include >> <machine/_user.h>, which can define KINFO_PROC_SIZE and its possible >> friends. > > I would like to see us go in that direction also. KINFO_PROC_SIZE is special. It can only be determined by looking at the MI struct declared in <sys.user.h>, and the looking must not be automated since the reason for existence of this macro is to prevent automated changes to the size of the struct. I would have used a definition like KI_NVOIDSTAR * sizeof(void *) + KI_NINTMAX_T * sizeof(intmax_t) + ... where KI_N* are MI. This requires the struct to not have any padding or for the padding to be countable by and actually counted by an expression like the above. Unfortunately, the struct is not laid out very carefully, (it has nested structs which it cannot control the layout of) so it might have MD padding which would make some of the KI_N*'s MD. All padding is MD in theory, but in practice padding can be made almost MI by a careful layout. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080501123943.V93454>