From 8a6d48c0542876eb3acfc0970c0ab7872db08d5f Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sun, 6 Dec 2009 05:26:23 +0100 Subject: check in the original version of dde linux26. --- libdde_linux26/contrib/include/linux/mutex-debug.h | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 libdde_linux26/contrib/include/linux/mutex-debug.h (limited to 'libdde_linux26/contrib/include/linux/mutex-debug.h') diff --git a/libdde_linux26/contrib/include/linux/mutex-debug.h b/libdde_linux26/contrib/include/linux/mutex-debug.h new file mode 100644 index 00000000..731d77d6 --- /dev/null +++ b/libdde_linux26/contrib/include/linux/mutex-debug.h @@ -0,0 +1,23 @@ +#ifndef __LINUX_MUTEX_DEBUG_H +#define __LINUX_MUTEX_DEBUG_H + +#include +#include + +/* + * Mutexes - debugging helpers: + */ + +#define __DEBUG_MUTEX_INITIALIZER(lockname) \ + , .magic = &lockname + +#define mutex_init(mutex) \ +do { \ + static struct lock_class_key __key; \ + \ + __mutex_init((mutex), #mutex, &__key); \ +} while (0) + +extern void mutex_destroy(struct mutex *lock); + +#endif -- cgit v1.2.3 From 51299b970600d28df634708557f80df3526014ae Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sat, 16 Jan 2010 00:08:24 +0100 Subject: rename __mutex_init to avoid the name conflict. --- libdde_linux26/contrib/include/linux/mutex-debug.h | 2 +- libdde_linux26/contrib/include/linux/mutex.h | 6 +++--- libdde_linux26/contrib/kernel/mutex.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'libdde_linux26/contrib/include/linux/mutex-debug.h') diff --git a/libdde_linux26/contrib/include/linux/mutex-debug.h b/libdde_linux26/contrib/include/linux/mutex-debug.h index 731d77d6..4382d53b 100644 --- a/libdde_linux26/contrib/include/linux/mutex-debug.h +++ b/libdde_linux26/contrib/include/linux/mutex-debug.h @@ -10,7 +10,7 @@ #define __DEBUG_MUTEX_INITIALIZER(lockname) \ , .magic = &lockname - +#define __mutex_init __dde_mutex_init #define mutex_init(mutex) \ do { \ static struct lock_class_key __key; \ diff --git a/libdde_linux26/contrib/include/linux/mutex.h b/libdde_linux26/contrib/include/linux/mutex.h index cf30c48c..360dd9e3 100644 --- a/libdde_linux26/contrib/include/linux/mutex.h +++ b/libdde_linux26/contrib/include/linux/mutex.h @@ -77,6 +77,7 @@ struct mutex_waiter { # include #else # define __DEBUG_MUTEX_INITIALIZER(lockname) +#define __mutex_init __dde_mutex_init # define mutex_init(mutex) \ do { \ static struct lock_class_key __key; \ @@ -102,10 +103,9 @@ do { \ #define DEFINE_MUTEX(mutexname) \ struct mutex mutexname = __MUTEX_INITIALIZER(mutexname) -#define HIDDEN __attribute__ ((visibility("hidden"))) -extern void HIDDEN __mutex_init(struct mutex *lock, const char *name, - struct lock_class_key *key); +extern void __dde_mutex_init(struct mutex *lock, const char *name, + struct lock_class_key *key); /** * mutex_is_locked - is the mutex locked diff --git a/libdde_linux26/contrib/kernel/mutex.c b/libdde_linux26/contrib/kernel/mutex.c index 4f45d4b6..0173f29a 100644 --- a/libdde_linux26/contrib/kernel/mutex.c +++ b/libdde_linux26/contrib/kernel/mutex.c @@ -41,7 +41,8 @@ * It is not allowed to initialize an already locked mutex. */ void -__mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key) +__dde_mutex_init(struct mutex *lock, const char *name, + struct lock_class_key *key) { atomic_set(&lock->count, 1); spin_lock_init(&lock->wait_lock); @@ -50,7 +51,7 @@ __mutex_init(struct mutex *lock, const char *name, struct lock_class_key *key) debug_mutex_init(lock, name, key); } -EXPORT_SYMBOL(__mutex_init); +EXPORT_SYMBOL(__dde_mutex_init); #ifndef CONFIG_DEBUG_LOCK_ALLOC /* -- cgit v1.2.3