* 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))
#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! */
\
} 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;
char ioc_bulk[0];
};
-
#ifdef __KERNEL__
#include <linux/list.h>