From d2e1446d81725c351dc73a03b397ce043fb18452 Mon Sep 17 00:00:00 2001 From: Meizu OpenSource Date: Mon, 15 Aug 2016 10:19:42 +0800 Subject: first commit --- include/linux/mt_export.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/linux/mt_export.h (limited to 'include/linux/mt_export.h') diff --git a/include/linux/mt_export.h b/include/linux/mt_export.h new file mode 100644 index 000000000..86e989f08 --- /dev/null +++ b/include/linux/mt_export.h @@ -0,0 +1,27 @@ +#include +#include + +/*mutex*/ +extern struct mutex *mt_mutex_init(void); +extern void mt_mutex_lock_nested(struct mutex *lock, unsigned int subclass); +extern void mt_mutex_lock_nest_lock(struct mutex *lock, struct rw_semaphore *nest_lock); +extern int mt_mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass); + +extern int mt_mutex_lock_killable_nested(struct mutex *lock, unsigned int subclass); +extern void mt_mutex_lock(struct mutex *lock); +extern int mt_mutex_lock_interruptible(struct mutex *lock); +extern int mt_mutex_lock_killable(struct mutex *lock); + +extern int mt_mutex_trylock(struct mutex *lock); +extern void mt_mutex_unlock(struct mutex *lock); +extern int mt_atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); + + +/* semaphore */ +extern struct semaphore *mt_sema_init(int val); +extern void mt_down(struct semaphore *sem); +extern int mt_down_interruptible(struct semaphore *sem); +extern int mt_down_killable(struct semaphore *sem); +extern int mt_down_trylock(struct semaphore *sem); +extern int mt_down_timeout(struct semaphore *sem, long jiffies); +extern void mt_up(struct semaphore *sem); -- cgit v1.2.3