#ifndef _LIBLOCKDEP_MUTEX_H #define _LIBLOCKDEP_MUTEX_H #include #include "common.h" struct liblockdep_pthread_mutex { pthread_mutex_t mutex; struct lockdep_map dep_map; }; typedef struct liblockdep_pthread_mutex liblockdep_pthread_mutex_t; #define LIBLOCKDEP_PTHREAD_MUTEX_INITIALIZER(mtx) \ (const struct liblockdep_pthread_mutex) { \ .mutex = PTHREAD_MUTEX_INITIALIZER, \ .dep_map = STATIC_LOCKDEP_MAP_INIT(#mtx, &((&(mtx))->dep_map)), \ } static inline int __mutex_init(liblockdep_pthread_mutex_t *lock, const char *name, struct lock_class_key *key, const pthread_mutexattr_t *__mutexattr) { lockdep_init_map(&lock->dep_map, name, key, 0); return pthread_mutex_init(&lock->mutex, __mutexattr); } #define liblockdep_pthread_mutex_init(mutex, mutexattr) \ ({ \ static struct lock_class_key __key; \ \ __mutex_init((mutex), #mutex, &__key, (mutexattr)); \ }) static inline int liblockdep_pthread_mutex_lock(liblockdep_pthread_mutex_t *lock) { lock_acquire(&lock->dep_map, 0, 0, 0, 1, NULL, (unsigned long)_RET_IP_); return pthread_mutex_lock(&lock->mutex); } static inline int liblockdep_pthread_mutex_unlock(liblockdep_pthread_mutex_t *lock) { lock_release(&lock->dep_map, 0, (unsigned long)_RET_IP_); return pthread_mutex_unlock(&lock->mutex); } static inline int liblockdep_pthread_mutex_trylock(liblockdep_pthread_mutex_t *lock) { lock_acquire(&lock->dep_map, 0, 1, 0, 1, NULL, (unsigned long)_RET_IP_); return pthread_mutex_trylock(&lock->mutex) == 0 ? 1 : 0; } static inline int liblockdep_pthread_mutex_destroy(liblockdep_pthread_mutex_t *lock) { return pthread_mutex_destroy(&lock->mutex); } #ifdef __USE_LIBLOCKDEP #define pthread_mutex_t liblockdep_pthread_mutex_t #define pthread_mutex_init liblockdep_pthread_mutex_init #define pthread_mutex_lock liblockdep_pthread_mutex_lock #define pthread_mutex_unlock liblockdep_pthread_mutex_unlock #define pthread_mutex_trylock liblockdep_pthread_mutex_trylock #define pthread_mutex_destroy liblockdep_pthread_mutex_destroy #endif #endif iff/net/irda/irnet/Makefile?id=2c5d9555d6d937966d79d4c6529a5f7b9206e405'>diff
path: root/net/irda/irnet/Makefile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 10:56:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-29 10:56:56 -0800
commit2c5d9555d6d937966d79d4c6529a5f7b9206e405 (patch)
tree4f3d220ea3aeaadcae0796c5456e0ef9a908071d /net/irda/irnet/Makefile
parent53cd1ad1a68fd10f677445e04ed63aa9ce39b36b (diff)
parent2ad5d52d42810bed95100a3d912679d8864421ec (diff)
Merge branch 'parisc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull two parisc fixes from Helge Deller: "One fix to avoid usage of BITS_PER_LONG in user-space exported swab.h header which breaks compiling qemu, and one trivial fix for printk continuation in the parisc parport driver" * 'parisc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Don't use BITS_PER_LONG in userspace-exported swab.h header parisc, parport_gsc: Fixes for printk continuation lines
Diffstat (limited to 'net/irda/irnet/Makefile')