From e43fdbaadc83df2caab1c25fbef1f517a71f572f Mon Sep 17 00:00:00 2001 From: Ed Cashin Date: Mon, 17 Dec 2012 16:03:25 -0800 Subject: [PATCH] --- yaml --- r: 346464 b: refs/heads/master c: 6e9766317fd51a33a32c65d2b76a6bde3227bbbd h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/Documentation/sparse.txt | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e898d187a242..b75191cc33ba 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8529091e8e2ae25e0f4003086f619765ff255e4b +refs/heads/master: 6e9766317fd51a33a32c65d2b76a6bde3227bbbd diff --git a/trunk/Documentation/sparse.txt b/trunk/Documentation/sparse.txt index 4909d4116356..eceab1308a8c 100644 --- a/trunk/Documentation/sparse.txt +++ b/trunk/Documentation/sparse.txt @@ -49,6 +49,24 @@ be generated without __CHECK_ENDIAN__. __bitwise - noisy stuff; in particular, __le*/__be* are that. We really don't want to drown in noise unless we'd explicitly asked for it. +Using sparse for lock checking +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following macros are undefined for gcc and defined during a sparse +run to use the "context" tracking feature of sparse, applied to +locking. These annotations tell sparse when a lock is held, with +regard to the annotated function's entry and exit. + +__must_hold - The specified lock is held on function entry and exit. + +__acquires - The specified lock is held on function exit, but not entry. + +__releases - The specified lock is held on function entry, but not exit. + +If the function enters and exits without the lock held, acquiring and +releasing the lock inside the function in a balanced way, no +annotation is needed. The tree annotations above are for cases where +sparse would otherwise report a context imbalance. Getting sparse ~~~~~~~~~~~~~~