Skip to content

Commit

Permalink
seqcount: Provide raw_read_seqcount()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner authored and John Stultz committed Jul 23, 2014
1 parent 0e5ac3a commit 0ea5a52
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions include/linux/seqlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,22 @@ static inline unsigned __read_seqcount_begin(const seqcount_t *s)
return ret;
}

/**
* raw_read_seqcount - Read the raw seqcount
* @s: pointer to seqcount_t
* Returns: count to be passed to read_seqcount_retry
*
* 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.
*/
static inline unsigned raw_read_seqcount(const seqcount_t *s)
{
unsigned ret = ACCESS_ONCE(s->sequence);
smp_rmb();
return ret;
}

/**
* raw_read_seqcount_begin - start seq-read critical section w/o lockdep
* @s: pointer to seqcount_t
Expand Down

0 comments on commit 0ea5a52

Please sign in to comment.