Whamcloud - gitweb
Land b1_2_smallfix onto b1_2 (20040616_1009)
[fs/lustre-release.git] / lnet / include / linux / libcfs.h
index c2a15f4..6772e82 100644 (file)
@@ -2,47 +2,12 @@
  * vim:expandtab:shiftwidth=8:tabstop=8:
  */
 #ifndef _LIBCFS_H
-
+#define _LIBCFS_H
 
 #define PORTAL_DEBUG
 
-/* I think this beast is just trying to get cycles_t and get_cycles().
- * this should be in its own header. */
-#ifdef __linux__
-# include <asm/types.h>
-# if defined(__powerpc__) && !defined(__KERNEL__)
-#  define __KERNEL__
-#  include <asm/timex.h>
-#  undef __KERNEL__
-# else
-#  if defined(__KERNEL__)
-#   include <asm/timex.h>
-#  else
-#   include <sys/time.h>
-#   define cycles_t unsigned long
-static inline cycles_t get_cycles(void) 
-{
-        struct timeval tv;
-        gettimeofday(&tv, NULL);
-        return (tv.tv_sec * 100000) + tv.tv_usec;
-}
-#  endif
-# endif
-#else
-# include <sys/types.h>
-typedef u_int32_t __u32;
-typedef u_int64_t __u64;
-#endif
-
-#ifdef __KERNEL__
-# include <linux/time.h>
-#else
-# include <sys/time.h>
-# define do_gettimeofday(tv) gettimeofday(tv, NULL);
-#endif
-
 #ifndef offsetof
-# define offsetof(typ,memb)     ((unsigned long)((char *)&(((typ *)0)->memb)))
+# define offsetof(typ,memb)     ((int)((char *)&(((typ *)0)->memb)))
 #endif
 
 #define LOWEST_BIT_SET(x)       ((x) & ~((x) - 1))
@@ -79,9 +44,7 @@ extern unsigned int portal_cerror;
 #define S_PTLROUTER   0x00100000
 #define S_COBD        0x00200000
 #define S_IBNAL       0x00400000
-#define S_LMV         0x00800000
-#define S_SM          0x01000000
-#define S_CMOBD       0x02000000
+
 /* If you change these values, please keep portals/utils/debug.c
  * up to date! */
 
@@ -235,11 +198,6 @@ do {                                                    \
                                                         \
 } while (0)
 
-typedef int (nal_cmd_handler_fn)(struct portals_cfg *, void *);
-int libcfs_nal_cmd_register(int nal, nal_cmd_handler_fn *handler, void *arg);
-int libcfs_nal_cmd(struct portals_cfg *pcfg);
-void libcfs_nal_cmd_unregister(int nal);
-
 struct portal_ioctl_data {
         __u32 ioc_len;
         __u32 ioc_version;
@@ -272,7 +230,6 @@ struct portal_ioctl_data {
         char ioc_bulk[0];
 };
 
-
 #ifdef __KERNEL__
 
 #include <linux/list.h>