00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef RWSEM_DEBUG_H
00022 #define RWSEM_DEBUG_H
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include "config/config.h"
00026 #endif
00027 #ifdef init_rwsem
00028 # error "Don't include <linux/rwsem.h> if you include this file!"
00029 #endif
00030
00031 struct rw_semaphore;
00032
00033 void init_rwsem_orig(struct rw_semaphore *sem);
00034 void down_read_orig(struct rw_semaphore *sem);
00035 int down_read_trylock_orig(struct rw_semaphore *sem);
00036 void up_read_orig(struct rw_semaphore *sem);
00037 void down_write_orig(struct rw_semaphore *sem);
00038 int down_write_trylock_orig(struct rw_semaphore *sem);
00039 void up_write_orig(struct rw_semaphore *sem);
00040 void downgrade_wrte_orig(struct rw_semaphore *sem);
00041
00042 #define init_rwsem(sem) \
00043 do { \
00044 pr_debugm("%s:%d: init_rwsem\n", __FILE__, __LINE__); \
00045 init_rwsem_orig(sem); \
00046 } while (0);
00047
00048 #define down_read(sem) \
00049 do { \
00050 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00051 down_read_orig(sem); \
00052 } while (0);
00053
00054 #define down_read_trylock(sem) \
00055 do { \
00056 pr_debugm("%s:%d: down_read_trylock\n", __FILE__, __LINE__);\
00057 down_read_orig(sem); \
00058 } while (0);
00059
00060 #define up_read(sem) \
00061 do { \
00062 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00063 up_read_orig(sem); \
00064 } while (0);
00065
00066 #define down_write(sem) \
00067 do { \
00068 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00069 down_write_orig(sem); \
00070 } while (0);
00071
00072 #define down_write_trylock(sem) \
00073 do { \
00074 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00075 down_write_trylock_orig(sem); \
00076 } while (0);
00077
00078 #define up_write(sem) \
00079 do { \
00080 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00081 up_write_orig(sem); \
00082 } while (0);
00083
00084 #define downgrade_wrte(sem) \
00085 do { \
00086 pr_debugm("%s:%d: down_read\n", __FILE__, __LINE__); \
00087 downgrade_wrte_orig(sem); \
00088 } while (0);
00089
00090 #endif