aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-07-16 17:05:20 -0400
committerJohn Stultz <john.stultz@linaro.org>2014-07-23 18:01:54 -0400
commit0ea5a520f73ca31abc4c10b6d5bc14a884a0641b (patch)
tree8d97283712062b622411281cd5bb7f19e9447689
parent0e5ac3a8b100469ea154f87dd57b685fbdd356f6 (diff)
seqcount: Provide raw_read_seqcount()
raw_read_seqcount opens a read critical section of the given seqcount without any lockdep checking and without checking or masking the LSB. Calling code is responsible for handling that. Preparatory patch to provide a NMI safe clock monotonic accessor function. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--include/linux/seqlock.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 535f158977b9..dcc64b9bfc41 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -117,6 +117,22 @@ repeat:
117} 117}
118 118
119/** 119/**
120 * raw_read_seqcount - Read the raw seqcount
121 * @s: pointer to seqcount_t
122 * Returns: count to be passed to read_seqcount_retry
123 *
124 * raw_read_seqcount opens a read critical section of the given
125 * seqcount without any lockdep checking and without checking or
126 * masking the LSB. Calling code is responsible for handling that.
127 */
128static inline unsigned raw_read_seqcount(const seqcount_t *s)
129{
130 unsigned ret = ACCESS_ONCE(s->sequence);
131 smp_rmb();
132 return ret;
133}
134
135/**
120 * raw_read_seqcount_begin - start seq-read critical section w/o lockdep 136 * raw_read_seqcount_begin - start seq-read critical section w/o lockdep
121 * @s: pointer to seqcount_t 137 * @s: pointer to seqcount_t
122 * Returns: count to be passed to read_seqcount_retry 138 * Returns: count to be passed to read_seqcount_retry