Skip site navigation (1)Skip section navigation (2)
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

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060828195336.GD95772>