/home/hillier_g/checkout/most4linux/most-kernel/rwsem-debug.h

00001 /*
00002  *  Copyright(c) Siemens AG, Muenchen, Germany, 2005, 2006, 2007
00003  *                           Bernhard Walle <bernhard.walle@gmx.de>
00004  *                           Gernot Hillier <gernot.hillier@siemens.com>
00005  *
00006  * ----------------------------------------------------------------------------
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 2 as 
00009  * published by the Free Software Foundation;
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* RWSEM_DEBUG_H */

Generated on Fri Mar 9 14:48:58 2007 for MOST Linux Drivers (Linux and RTAI) by  doxygen 1.5.0