]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r196226:
authorbz <bz@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 14 Aug 2009 21:50:47 +0000 (21:50 +0000)
committerbz <bz@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 14 Aug 2009 21:50:47 +0000 (21:50 +0000)
commitbbbb9420850f9eb4caba156b0b819a7daba329aa
tree8049453015b8a4eec94e106e636f23ac4a258f45
parenta3a82404435faf0a7b54a50b9dcb0901d4434603
MFC r196226:

  Add a new macro to test that a variable could be loaded atomically.
  Check that the given variable is at most uintptr_t in size and that
  it is aligned.

  Note: ASSERT_ATOMIC_LOAD() uses ALIGN() to check for adequate
        alignment -- however, the function of ALIGN() is to guarantee
        alignment, and therefore may lead to stronger alignment
        enforcement than necessary for types that are smaller than
        sizeof(uintptr_t).

  Add checks to mtx, rw and sx locks init functions to detect possible
  breakage. This was used during debugging of the problem fixed with
  r196118 where a pointer was on an un-aligned address in the dpcpu area.

  In collaboration with:  rwatson
  Reviewed by:            rwatson

Approved by: re (kib)

git-svn-id: svn://svn.freebsd.org/base/stable/8@196227 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/kern_mutex.c
sys/kern/kern_rwlock.c
sys/kern/kern_sx.c
sys/sys/systm.h