1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
6 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 only,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License version 2 for more details (a copy is included
16 * in the LICENSE file that accompanied this code).
18 * You should have received a copy of the GNU General Public License
19 * version 2 along with this program; If not, see
20 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
29 * Copyright 2008 Sun Microsystems, Inc. All rights reserved
30 * Use is subject to license terms.
33 * This file is part of Lustre, http://www.lustre.org/
34 * Lustre is a trademark of Sun Microsystems, Inc.
37 #ifndef __LIBCFS_WINNT_KP30_H__
38 #define __LIBCFS_WINNT_KP30_H__
40 #include <libcfs/winnt/portals_compat25.h>
41 #include <lnet/types.h>
45 /* Module parameter support */
46 #define CFS_MODULE_PARM(name, t, type, perm, desc)
48 #define CFS_SYSFS_MODULE_PARM 0 /* no sysfs access to module parameters */
51 static inline void our_cond_resched()
53 schedule_timeout(1i64);
57 #define LASSERT_SPIN_LOCKED(lock) do {} while(0) /* XXX */
59 #define LASSERT_SPIN_LOCKED(lock) do {} while(0)
62 #error Need a winnt version of panic()
63 #define LIBCFS_PANIC(msg) KeBugCheckEx(msg, (ULONG_PTR)NULL, (ULONG_PTR)NULL, (ULONG_PTR)NULL, (ULONG_PTR)NULL)
64 #error libcfs_register_panic_notifier() missing
65 #error libcfs_unregister_panic_notifier() missing
67 #define cfs_work_struct_t WORK_QUEUE_ITEM
68 #define cfs_prepare_work(tq, routine, contex)
69 #define cfs_schedule_work(tq)
70 #define cfs_get_work_data(type,field,data) (data)
72 /* ------------------------------------------------------------------- */
74 #define PORTAL_SYMBOL_REGISTER(x) cfs_symbol_register(#x, &x)
75 #define PORTAL_SYMBOL_UNREGISTER(x) cfs_symbol_unregister(#x)
77 #define PORTAL_SYMBOL_GET(x) (cfs_symbol_get(#x))
78 #define PORTAL_SYMBOL_PUT(x) cfs_symbol_put(#x)
80 #define PORTAL_MODULE_USE do{}while(0)
81 #define PORTAL_MODULE_UNUSE do{}while(0)
83 #define printk DbgPrint
84 #define ptintf DbgPrint
86 #else /* !__KERNEL__ */
91 # include <cygwin-ioctl.h>
95 #endif /* End of !__KERNEL__ */
97 /******************************************************************************/
99 * Support for temporary event tracing with minimal Heisenberg effect. */
100 #define LWT_SUPPORT 0
102 /* kernel hasn't defined this? */
111 # if BITS_PER_LONG > 32
117 # define LWT_EVENT(p1,p2,p3,p4)
120 /* ------------------------------------------------------------------ */
122 #define IOCTL_LIBCFS_TYPE long_ptr
125 # ifndef BITS_PER_LONG
126 # if (~0UL) == 0xffffffffUL
127 # define BITS_PER_LONG 32
129 # define BITS_PER_LONG 64
134 #if BITS_PER_LONG > 32
135 # define LI_POISON ((int)0x5a5a5a5a5a5a5a5a)
136 # define LL_POISON ((long_ptr)0x5a5a5a5a5a5a5a5a)
137 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a5a5a5a5a)
139 # define LI_POISON ((int)0x5a5a5a5a)
140 # define LL_POISON ((long_ptr)0x5a5a5a5a)
141 # define LP_POISON ((char *)(long_ptr)0x5a5a5a5a)
144 #if defined(__x86_64__)
145 # define LPU64 "%I64u"
146 # define LPD64 "%I64d"
147 # define LPX64 "%I64x"
150 #elif (BITS_PER_LONG == 32 || __WORDSIZE == 32)
151 # define LPU64 "%I64u"
152 # define LPD64 "%I64d"
153 # define LPX64 "%I64x"
156 #elif (BITS_PER_LONG == 64 || __WORDSIZE == 64)
157 # define LPU64 "%I64u"
158 # define LPD64 "%I64d"
159 # define LPX64 "%I64x"
164 # error "No word size defined"