From owner-freebsd-current@FreeBSD.ORG Mon Aug 28 19:53:17 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 26D1E16A4DD for ; Mon, 28 Aug 2006 19:53:17 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6B24E43D46 for ; Mon, 28 Aug 2006 19:53:16 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id 85F5F5E94; Mon, 28 Aug 2006 23:53:15 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id 646495F16; Mon, 28 Aug 2006 23:53:15 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.6/8.13.6) id k7SJraIx096143; Mon, 28 Aug 2006 23:53:36 +0400 (MSD) (envelope-from ru) Date: Mon, 28 Aug 2006 23:53:36 +0400 From: Ruslan Ermilov To: Jun Kuriyama Message-ID: <20060828195336.GD95772@rambler-co.ru> References: <7m3bbhx6vc.wl%kuriyama@imgsrc.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lCAWRPmW1mITcIfM" Content-Disposition: inline In-Reply-To: <7m3bbhx6vc.wl%kuriyama@imgsrc.co.jp> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: No virus found Cc: Current Subject: Re: INVARIANTS in sys/sys/sx.h X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 19:53:17 -0000 --lCAWRPmW1mITcIfM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 28, 2006 at 11:38:47PM +0900, Jun Kuriyama wrote: >=20 > I found this when I compiled my kernel with INVARIANTS without > INVARIANT_SUPPORT. >=20 > In src/sys/sys/sx.h, _sx_assert() is defined in INVARIANT_SUPPORT, >=20 > > #ifdef INVARIANT_SUPPORT > > void _sx_assert(struct sx *sx, int what, const char *file, int line); > > #endif >=20 > but sx_assert() uses this function in INVARIANTS option. >=20 > > #ifdef INVARIANTS > > #define sx_assert(sx, what) _sx_assert((sx), (what), LOCK_FILE, LOCK_LI= NE) > > #else > > #define sx_assert(sx, what) > > #endif >=20 > Is this consistent? >=20 Well, yes. The idea is that you can compile your entire kernel with INVARIANT_SUPPORT and only certain files with INVARIANTS. I believe this info is in the NOTES files... yes it is: : # : # The INVARIANT_SUPPORT option makes us compile in support for : # verifying some of the internal structures. It is a prerequisite for : # 'INVARIANTS', as enabling 'INVARIANTS' will make these functions be : # called. The intent is that you can set 'INVARIANTS' for single : # source files (by changing the source file or specifying it on the : # command line) if you have 'INVARIANT_SUPPORT' enabled. Also, if you : # wish to build a kernel module with 'INVARIANTS', then adding : # 'INVARIANT_SUPPORT' to your kernel will provide all the necessary : # infrastructure without the added overhead. : # : options INVARIANT_SUPPORT Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --lCAWRPmW1mITcIfM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE80nAqRfpzJluFF4RAi9FAJ9l5VBDNvE2OFbmALWbpN/1H3xVxACfRbl6 ZrBRVv0xWvDYiXAV+r5K0pg= =6t+v -----END PGP SIGNATURE----- --lCAWRPmW1mITcIfM--