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_LIBCFS_H__
24 #define __LIBCFS_WINNT_LIBCFS_H__
26 #ifndef __LIBCFS_LIBCFS_H__
27 #error Do not #include this file directly. #include <libcfs/libcfs.h> instead
30 /* workgroud for VC compiler */
32 #define __FUNCTION__ "generic"
35 #include <libcfs/winnt/winnt-types.h>
36 #include <libcfs/portals_utils.h>
37 #include <libcfs/winnt/winnt-time.h>
38 #include <libcfs/winnt/winnt-lock.h>
39 #include <libcfs/winnt/winnt-mem.h>
40 #include <libcfs/winnt/winnt-prim.h>
41 #include <libcfs/winnt/winnt-fs.h>
42 #include <libcfs/winnt/winnt-tcpip.h>
44 struct ptldebug_header {
56 } __attribute__((packed));
61 /* if you change this, update darwin-util.c:cfs_stack_trace_fill() */
62 CFS_STACK_TRACE_DEPTH = 16
65 struct cfs_stack_trace {
66 void *frame[CFS_STACK_TRACE_DEPTH];
69 static inline __u32 query_stack_size()
71 ULONG LowLimit, HighLimit;
73 IoGetStackLimits(&LowLimit, &HighLimit);
74 ASSERT(HighLimit > LowLimit);
76 return (__u32) (HighLimit - LowLimit);
79 static inline __u32 query_stack_size()
87 # define THREAD_SIZE query_stack_size()
90 #define LUSTRE_TRACE_SIZE (THREAD_SIZE >> 5)
94 # define CDEBUG_STACK() (THREAD_SIZE - \
95 ((ulong_ptr)__builtin_dwarf_cfa() & \
98 # define CDEBUG_STACK (IoGetRemainingStackSize())
99 # error "This doesn't seem right; CDEBUG_STACK should grow with the stack"
100 # endif /* __ia64__ */
102 #define CHECK_STACK() \
104 unsigned long _stack = CDEBUG_STACK(); \
106 if (_stack > 3*THREAD_SIZE/4 && _stack > libcfs_stack) { \
107 libcfs_stack = _stack; \
108 libcfs_debug_msg(NULL, DEBUG_SUBSYSTEM, D_WARNING, \
109 __FILE__, NULL, __LINE__, \
110 "maximum lustre stack %lu\n", _stack); \
113 #else /* !__KERNEL__ */
114 #define CHECK_STACK() do { } while(0)
115 #define CDEBUG_STACK() (0L)
116 #endif /* __KERNEL__ */
119 #define LUSTRE_LNET_PID 12345
121 #define ENTRY_NESTING_SUPPORT (0)
122 #define ENTRY_NESTING do {;} while (0)
123 #define EXIT_NESTING do {;} while (0)
124 #define __current_nesting_level() (0)
126 #endif /* _WINNT_LIBCFS_H */