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)
61 /* ------------------------------------------------------------------- */
63 #define PORTAL_SYMBOL_REGISTER(x) cfs_symbol_register(#x, &x)
64 #define PORTAL_SYMBOL_UNREGISTER(x) cfs_symbol_unregister(#x)
66 #define PORTAL_SYMBOL_GET(x) (cfs_symbol_get(#x))
67 #define PORTAL_SYMBOL_PUT(x) cfs_symbol_put(#x)
69 #define PORTAL_MODULE_USE do{}while(0)
70 #define PORTAL_MODULE_UNUSE do{}while(0)
72 #define printk DbgPrint
73 #define ptintf DbgPrint
75 #else /* !__KERNEL__ */
80 # include <cygwin-ioctl.h>
84 #endif /* End of !__KERNEL__ */
86 /******************************************************************************/
88 * Support for temporary event tracing with minimal Heisenberg effect. */
91 /* kernel hasn't defined this? */
100 # if BITS_PER_LONG > 32
106 # define LWT_EVENT(p1,p2,p3,p4)
109 /* ------------------------------------------------------------------ */
111 #define IOCTL_LIBCFS_TYPE long_ptr
114 # ifndef BITS_PER_LONG
115 # if (~0UL) == 0xffffffffUL
116 # define BITS_PER_LONG 32
118 # define BITS_PER_LONG 64
123 #if BITS_PER_LONG > 32
124 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
125 # define LL_POISON ((long_ptr)0x5a5a5a5a5a5a5a5a)
126 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a5a5a5a5a)
128 # define LI_POISON ((int)0x5a5a5a5a)
129 # define LL_POISON ((long_ptr)0x5a5a5a5a)
130 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a)
133 #if defined(__x86_64__)
134 # define LPU64 "%I64u"
135 # define LPD64 "%I64d"
136 # define LPX64 "%I64x"
139 #elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
140 # define LPU64 "%I64u"
141 # define LPD64 "%I64d"
142 # define LPX64 "%I64x"
145 #elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
146 # define LPU64 "%I64u"
147 # define LPD64 "%I64d"
148 # define LPX64 "%I64x"
153 # error "No word size defined"