1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=4:tabstop=4:
4 * Copyright (C) 2004 Cluster File Systems, Inc.
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or modify it under the
9 * terms of version 2 of the GNU General Public License as published by the
10 * Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful, but WITHOUT ANY
13 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17 * You should have received a copy of the GNU General Public License along
18 * with Lustre; if not, write to the Free Software Foundation, Inc., 675 Mass
19 * Ave, Cambridge, MA 02139, USA.
23 #ifndef __LIBCFS_WINNT_KP30_H__
24 #define __LIBCFS_WINNT_KP30_H__
26 #ifndef __LIBCFS_KP30_H__
27 #error Do not #include this file directly. #include <libcfs/kp30.h> instead
30 #include <libcfs/winnt/portals_compat25.h>
31 #include <lnet/types.h>
35 /* Module parameter support */
36 #define CFS_MODULE_PARM(name, t, type, perm, desc)
38 #define CFS_SYSFS_MODULE_PARM 0 /* no sysfs access to module parameters */
41 static inline void our_cond_resched()
43 schedule_timeout(1i64);
47 #define LASSERT_SPIN_LOCKED(lock) do {} while(0) /* XXX */
49 #define LASSERT_SPIN_LOCKED(lock) do {} while(0)
52 #error Need a winnt version of panic()
53 #define LIBCFS_PANIC(msg) KeBugCheckEx(msg, (ULONG_PTR)NULL, (ULONG_PTR)NULL, (ULONG_PTR)NULL, (ULONG_PTR)NULL)
54 #error libcfs_register_panic_notifier() missing
55 #error libcfs_unregister_panic_notifier() missing
57 #define cfs_work_struct_t WORK_QUEUE_ITEM
58 #define cfs_prepare_work(tq, routine, contex)
59 #define cfs_schedule_work(tq)
60 #define cfs_get_work_data(type,field,data) (data)
62 /* ------------------------------------------------------------------- */
64 #define PORTAL_SYMBOL_REGISTER(x) cfs_symbol_register(#x, &x)
65 #define PORTAL_SYMBOL_UNREGISTER(x) cfs_symbol_unregister(#x)
67 #define PORTAL_SYMBOL_GET(x) (cfs_symbol_get(#x))
68 #define PORTAL_SYMBOL_PUT(x) cfs_symbol_put(#x)
70 #define PORTAL_MODULE_USE do{}while(0)
71 #define PORTAL_MODULE_UNUSE do{}while(0)
73 #define printk DbgPrint
74 #define ptintf DbgPrint
76 #else /* !__KERNEL__ */
81 # include <cygwin-ioctl.h>
85 #endif /* End of !__KERNEL__ */
87 /******************************************************************************/
89 * Support for temporary event tracing with minimal Heisenberg effect. */
92 /* kernel hasn't defined this? */
101 # if BITS_PER_LONG > 32
107 # define LWT_EVENT(p1,p2,p3,p4)
110 /* ------------------------------------------------------------------ */
112 #define IOCTL_LIBCFS_TYPE long_ptr
115 # ifndef BITS_PER_LONG
116 # if (~0UL) == 0xffffffffUL
117 # define BITS_PER_LONG 32
119 # define BITS_PER_LONG 64
124 #if BITS_PER_LONG > 32
125 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
126 # define LL_POISON ((long_ptr)0x5a5a5a5a5a5a5a5a)
127 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a5a5a5a5a)
129 # define LI_POISON ((int)0x5a5a5a5a)
130 # define LL_POISON ((long_ptr)0x5a5a5a5a)
131 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a)
134 #if defined(__x86_64__)
135 # define LPU64 "%I64u"
136 # define LPD64 "%I64d"
137 # define LPX64 "%I64x"
140 #elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
141 # define LPU64 "%I64u"
142 # define LPD64 "%I64d"
143 # define LPX64 "%I64x"
146 #elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
147 # define LPU64 "%I64u"
148 # define LPD64 "%I64d"
149 # define LPX64 "%I64x"
154 # error "No word size defined"