From owner-freebsd-arch@FreeBSD.ORG Mon Feb 11 20:46:22 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C651016A469 for ; Mon, 11 Feb 2008 20:46:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 453EE13C4DD for ; Mon, 11 Feb 2008 20:46:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8s) with ESMTP id 231612671-1834499 for multiple; Mon, 11 Feb 2008 15:46:26 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.14.2/8.14.2) with ESMTP id m1BKk4Im052106; Mon, 11 Feb 2008 15:46:04 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Mon, 11 Feb 2008 14:31:00 -0500 User-Agent: KMail/1.9.7 References: <200802081802.54313.jhb@freebsd.org> <20080209.160817.168016724.imp@bsdimp.com> <86lk5taway.fsf@ds4.des.no> In-Reply-To: <86lk5taway.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200802111431.00640.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Mon, 11 Feb 2008 15:46:05 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5778/Mon Feb 11 13:53:43 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: arch@freebsd.org Subject: Re: [PATCH] Automatic kernel version module dependencies.. X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Feb 2008 20:46:22 -0000 On Sunday 10 February 2008 06:24:37 am Dag-Erling Sm=C3=B8rgrav wrote: > "M. Warner Losh" writes: > > Dag-Erling_Sm=C3=B8rgrav writes: > > > ...provided they were built from the same config... I think > > > MUTEX_PROFILING has been fixed, but there may still be cases where > > > the ABI changes dependening on kernel options. > > These are usually well documented. But I can't find any in the > > current doc set. Maybe you could point me at options that do this so > > we can document them (and maybe add a #warning when compiling with > > them)? >=20 > Here's one I found: DEBUG_LOCKS changes the size of struct lock, which > changes the size and layout of struct vnode. Yes, DEBUG_LOCKS, MUTEX_PROFILING (O.B.E), and PAE are the ones I know of. = We=20 could employ a similar strategy for these btw. For example, you could do=20 this for PAE: sys/i386/i386/pmap.c: #ifdef PAE MODULE_VERSION(pae, 1); #else MODULE_VERSION(pae, 0); #endif sys/module.h: #if defined(__i386__) #ifdef PAE #define PAE_DEPEND(name) MODULE_DEPEND(name, pae, 1, 1, 1) #else #define PAE_DEPEND(name) MODULE_DEPEND(name, pae, 0, 0, 0) #endif #else #define PAE_DEPEND(name) struct __hack #endif #define DECLARE_MODULE(name, ...) \ ... PAE_DEPEND(name); \ ... It sucks to have the MD-ness there. Could perhaps have an MI macro like th= is: sys/module.h: #include #ifndef MACHINE_MODULE_DEPEND #define MACHINE_MODULE_DEPEND struct __hack #endif sys/i386/include/module.h: PAE bits from above but s/PAE_DEPEND/MACHINE_MODULE_DEPEND/. In general we= =20 try to keep the number of such ABI-breaking options to a very bare minimum,= =20 so perhaps one-off hacks in sys/module.h rather than abstracting it is=20 sufficient. =2D-=20 John Baldwin