From owner-cvs-src-old@FreeBSD.ORG Fri Aug 14 21:47:10 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77C3A106568C for ; Fri, 14 Aug 2009 21:47:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 662618FC52 for ; Fri, 14 Aug 2009 21:47:10 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n7ELlAUA046346 for ; Fri, 14 Aug 2009 21:47:10 GMT (envelope-from bz@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n7ELlAA4046345 for cvs-src-old@freebsd.org; Fri, 14 Aug 2009 21:47:10 GMT (envelope-from bz@repoman.freebsd.org) Message-Id: <200908142147.n7ELlAA4046345@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to bz@repoman.freebsd.org using -f From: "Bjoern A. Zeeb" Date: Fri, 14 Aug 2009 21:46:54 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern kern_mutex.c kern_rwlock.c kern_sx.c src/sys/sys systm.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Aug 2009 21:47:10 -0000 bz 2009-08-14 21:46:54 UTC FreeBSD src repository Modified files: sys/kern kern_mutex.c kern_rwlock.c kern_sx.c sys/sys systm.h Log: SVN rev 196226 on 2009-08-14 21:46:54Z by bz 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) Revision Changes Path 1.214 +2 -0 src/sys/kern/kern_mutex.c 1.49 +2 -0 src/sys/kern/kern_rwlock.c 1.68 +2 -0 src/sys/kern/kern_sx.c 1.277 +4 -0 src/sys/sys/systm.h