~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/spinlock_api_up.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __LINUX_SPINLOCK_API_UP_H
  2 #define __LINUX_SPINLOCK_API_UP_H
  3 
  4 #ifndef __LINUX_INSIDE_SPINLOCK_H
  5 # error "please don't include this file directly"
  6 #endif
  7 
  8 /*
  9  * include/linux/spinlock_api_up.h
 10  *
 11  * spinlock API implementation on UP-nondebug (inlined implementation)
 12  *
 13  * portions Copyright 2005, Red Hat, Inc., Ingo Molnar
 14  * Released under the General Public License (GPL).
 15  */
 16 
 17 #define in_lock_functions(ADDR)         0
 18 
 19 #define assert_raw_spin_locked(lock)    do { (void)(lock); } while (0)
 20 
 21 /*
 22  * In the UP-nondebug case there's no real locking going on, so the
 23  * only thing we have to do is to keep the preempt counts and irq
 24  * flags straight, to suppress compiler warnings of unused lock
 25  * variables, and to add the proper checker annotations:
 26  */
 27 #define ___LOCK(lock) \
 28   do { __acquire(lock); (void)(lock); } while (0)
 29 
 30 #define __LOCK(lock) \
 31   do { preempt_disable(); ___LOCK(lock); } while (0)
 32 
 33 #define __LOCK_BH(lock) \
 34   do { __local_bh_disable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); ___LOCK(lock); } while (0)
 35 
 36 #define __LOCK_IRQ(lock) \
 37   do { local_irq_disable(); __LOCK(lock); } while (0)
 38 
 39 #define __LOCK_IRQSAVE(lock, flags) \
 40   do { local_irq_save(flags); __LOCK(lock); } while (0)
 41 
 42 #define ___UNLOCK(lock) \
 43   do { __release(lock); (void)(lock); } while (0)
 44 
 45 #define __UNLOCK(lock) \
 46   do { preempt_enable(); ___UNLOCK(lock); } while (0)
 47 
 48 #define __UNLOCK_BH(lock) \
 49   do { __local_bh_enable_ip(_THIS_IP_, SOFTIRQ_LOCK_OFFSET); \
 50        ___UNLOCK(lock); } while (0)
 51 
 52 #define __UNLOCK_IRQ(lock) \
 53   do { local_irq_enable(); __UNLOCK(lock); } while (0)
 54 
 55 #define __UNLOCK_IRQRESTORE(lock, flags) \
 56   do { local_irq_restore(flags); __UNLOCK(lock); } while (0)
 57 
 58 #define _raw_spin_lock(lock)                    __LOCK(lock)
 59 #define _raw_spin_lock_nested(lock, subclass)   __LOCK(lock)
 60 #define _raw_read_lock(lock)                    __LOCK(lock)
 61 #define _raw_write_lock(lock)                   __LOCK(lock)
 62 #define _raw_write_lock_nested(lock, subclass)  __LOCK(lock)
 63 #define _raw_spin_lock_bh(lock)                 __LOCK_BH(lock)
 64 #define _raw_read_lock_bh(lock)                 __LOCK_BH(lock)
 65 #define _raw_write_lock_bh(lock)                __LOCK_BH(lock)
 66 #define _raw_spin_lock_irq(lock)                __LOCK_IRQ(lock)
 67 #define _raw_read_lock_irq(lock)                __LOCK_IRQ(lock)
 68 #define _raw_write_lock_irq(lock)               __LOCK_IRQ(lock)
 69 #define _raw_spin_lock_irqsave(lock, flags)     __LOCK_IRQSAVE(lock, flags)
 70 #define _raw_read_lock_irqsave(lock, flags)     __LOCK_IRQSAVE(lock, flags)
 71 #define _raw_write_lock_irqsave(lock, flags)    __LOCK_IRQSAVE(lock, flags)
 72 #define _raw_spin_trylock(lock)                 ({ __LOCK(lock); 1; })
 73 #define _raw_read_trylock(lock)                 ({ __LOCK(lock); 1; })
 74 #define _raw_write_trylock(lock)                        ({ __LOCK(lock); 1; })
 75 #define _raw_spin_trylock_bh(lock)              ({ __LOCK_BH(lock); 1; })
 76 #define _raw_spin_unlock(lock)                  __UNLOCK(lock)
 77 #define _raw_read_unlock(lock)                  __UNLOCK(lock)
 78 #define _raw_write_unlock(lock)                 __UNLOCK(lock)
 79 #define _raw_spin_unlock_bh(lock)               __UNLOCK_BH(lock)
 80 #define _raw_write_unlock_bh(lock)              __UNLOCK_BH(lock)
 81 #define _raw_read_unlock_bh(lock)               __UNLOCK_BH(lock)
 82 #define _raw_spin_unlock_irq(lock)              __UNLOCK_IRQ(lock)
 83 #define _raw_read_unlock_irq(lock)              __UNLOCK_IRQ(lock)
 84 #define _raw_write_unlock_irq(lock)             __UNLOCK_IRQ(lock)
 85 #define _raw_spin_unlock_irqrestore(lock, flags) \
 86                                         __UNLOCK_IRQRESTORE(lock, flags)
 87 #define _raw_read_unlock_irqrestore(lock, flags) \
 88                                         __UNLOCK_IRQRESTORE(lock, flags)
 89 #define _raw_write_unlock_irqrestore(lock, flags) \
 90                                         __UNLOCK_IRQRESTORE(lock, flags)
 91 
 92 #endif /* __LINUX_SPINLOCK_API_UP_H */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php