Date: Mon, 28 Aug 2006 23:53:36 +0400 From: Ruslan Ermilov <ru@freebsd.org> To: Jun Kuriyama <kuriyama@imgsrc.co.jp> Cc: Current <freebsd-current@freebsd.org> Subject: Re: INVARIANTS in sys/sys/sx.h Message-ID: <20060828195336.GD95772@rambler-co.ru> In-Reply-To: <7m3bbhx6vc.wl%kuriyama@imgsrc.co.jp> References: <7m3bbhx6vc.wl%kuriyama@imgsrc.co.jp>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Mon, Aug 28, 2006 at 11:38:47PM +0900, Jun Kuriyama wrote: > > I found this when I compiled my kernel with INVARIANTS without > INVARIANT_SUPPORT. > > In src/sys/sys/sx.h, _sx_assert() is defined in INVARIANT_SUPPORT, > > > #ifdef INVARIANT_SUPPORT > > void _sx_assert(struct sx *sx, int what, const char *file, int line); > > #endif > > but sx_assert() uses this function in INVARIANTS option. > > > #ifdef INVARIANTS > > #define sx_assert(sx, what) _sx_assert((sx), (what), LOCK_FILE, LOCK_LINE) > > #else > > #define sx_assert(sx, what) > > #endif > > Is this consistent? > 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, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE80nAqRfpzJluFF4RAi9FAJ9l5VBDNvE2OFbmALWbpN/1H3xVxACfRbl6 ZrBRVv0xWvDYiXAV+r5K0pg= =6t+v -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060828195336.GD95772>
