LCOV - code coverage report
Current view: top level - lkbce/include/linux - rwlock_types.h (source / functions) Hit Total Coverage
Test: coverage.info Lines: 1 1 100.0 %
Date: 2017-01-25 Functions: 0 0 -

          Line data    Source code
       1             : #ifndef __LINUX_RWLOCK_TYPES_H
       2             : #define __LINUX_RWLOCK_TYPES_H
       3             : 
       4             : /*
       5             :  * include/linux/rwlock_types.h - generic rwlock type definitions
       6             :  *                                and initializers
       7             :  *
       8             :  * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
       9             :  * Released under the General Public License (GPL).
      10             :  */
      11             : typedef struct {
      12             :         arch_rwlock_t raw_lock;
      13             : #ifdef CONFIG_GENERIC_LOCKBREAK
      14             :         unsigned int break_lock;
      15             : #endif
      16             : #ifdef CONFIG_DEBUG_SPINLOCK
      17             :         unsigned int magic, owner_cpu;
      18             :         void *owner;
      19             : #endif
      20             : #ifdef CONFIG_DEBUG_LOCK_ALLOC
      21             :         struct lockdep_map dep_map;
      22             : #endif
      23           2 : } rwlock_t;
      24             : 
      25             : #define RWLOCK_MAGIC            0xdeaf1eed
      26             : 
      27             : #ifdef CONFIG_DEBUG_LOCK_ALLOC
      28             : # define RW_DEP_MAP_INIT(lockname)      .dep_map = { .name = #lockname }
      29             : #else
      30             : # define RW_DEP_MAP_INIT(lockname)
      31             : #endif
      32             : 
      33             : #ifdef CONFIG_DEBUG_SPINLOCK
      34             : #define __RW_LOCK_UNLOCKED(lockname)                                    \
      35             :         (rwlock_t)      {       .raw_lock = __ARCH_RW_LOCK_UNLOCKED,    \
      36             :                                 .magic = RWLOCK_MAGIC,                  \
      37             :                                 .owner = SPINLOCK_OWNER_INIT,           \
      38             :                                 .owner_cpu = -1,                        \
      39             :                                 RW_DEP_MAP_INIT(lockname) }
      40             : #else
      41             : #define __RW_LOCK_UNLOCKED(lockname) \
      42             :         (rwlock_t)      {       .raw_lock = __ARCH_RW_LOCK_UNLOCKED,    \
      43             :                                 RW_DEP_MAP_INIT(lockname) }
      44             : #endif
      45             : 
      46             : /*
      47             :  * RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence
      48             :  * deprecated.
      49             :  *
      50             :  * Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate.
      51             :  */
      52             : #define RW_LOCK_UNLOCKED        __RW_LOCK_UNLOCKED(old_style_rw_init)
      53             : 
      54             : #define DEFINE_RWLOCK(x)        rwlock_t x = __RW_LOCK_UNLOCKED(x)
      55             : 
      56             : #endif /* __LINUX_RWLOCK_TYPES_H */

Generated by: LCOV version 1.10