lkml.org 
[lkml]   [2014]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[patch 53/55] 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 NMI safe clock monotonic[_raw] accessor
    functions.

    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>
    ---
    include/linux/seqlock.h | 16 ++++++++++++++++
    1 file changed, 16 insertions(+)

    Index: tip/include/linux/seqlock.h
    ===================================================================
    --- tip.orig/include/linux/seqlock.h
    +++ tip/include/linux/seqlock.h
    @@ -117,6 +117,22 @@ repeat:
    }

    /**
    + * 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
    * Returns: count to be passed to read_seqcount_retry



    \
     
     \ /
      Last update: 2014-07-11 19:21    [W:3.390 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site