I was accidentally using.
- we're still #including kernel headers in userspace (sigh), 2.5 needs to
play along. It would be great to clean up these includes.
EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
-HOSTCFLAGS := $(EXTRA_CFLAGS)
+# portals/utils/debug.c wants <linux/version.h> from userspace. sigh.
+HOSTCFLAGS := -I@LINUX@/include $(EXTRA_CFLAGS)
LIBREADLINE := @LIBREADLINE@
# 2.5's makefiles aren't nice to cross dir libraries in host programs
PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
# include <linux/sched.h> /* THREAD_SIZE */
#ifdef __ia64__
-#define CDEBUG_STACK() ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1))
+#define CDEBUG_STACK ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1))
#else
-#define CDEBUG_STACK() (THREAD_SIZE - \
+#define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_frame_address(0) & \
(THREAD_SIZE - 1)))
#endif
} while (0)
#else
#define CHECK_STACK(stack) do{}while(0)
-#define CDEBUG_STACK(var) (0L)
+#define CDEBUG_STACK (0L)
#endif
#if 1
#define CDEBUG(mask, format, a...) \
do { \
- CHECK_STACK(CDEBUG_STACK()); \
+ CHECK_STACK(CDEBUG_STACK); \
if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \
(portal_debug & (mask) && \
portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \
portals_debug_msg(DEBUG_SUBSYSTEM, mask, \
__FILE__, __FUNCTION__, __LINE__, \
- CDEBUG_STACK(), format , ## a); \
+ CDEBUG_STACK, format , ## a); \
} while (0)
#define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a)
void kportal_assertion_failed(char *expr, char *file, const char *func,
const int line)
{
- portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(),
+ portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK,
"ASSERTION(%s) failed\n", expr);
LBUG_WITH_LOC(file, func, line);
}
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
-#include <asm/byteorder.h>
+#include <asm/byteorder.h> /* sigh. for __cpu_to_* */
#include <syslog.h>
#include <errno.h>
EXTRA_CFLAGS := -Ifs/lustre/include -Ifs/lustre/portals/include
-HOSTCFLAGS := $(EXTRA_CFLAGS)
+# portals/utils/debug.c wants <linux/version.h> from userspace. sigh.
+HOSTCFLAGS := -I@LINUX@/include $(EXTRA_CFLAGS)
LIBREADLINE := @LIBREADLINE@
# 2.5's makefiles aren't nice to cross dir libraries in host programs
PTLCTLOBJS := debug.o l_ioctl.o parser.o portals.o
# include <linux/sched.h> /* THREAD_SIZE */
#ifdef __ia64__
-#define CDEBUG_STACK() ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1))
+#define CDEBUG_STACK ((unsigned long)__builtin_dwarf_cfa()&(THREAD_SIZE - 1))
#else
-#define CDEBUG_STACK() (THREAD_SIZE - \
+#define CDEBUG_STACK (THREAD_SIZE - \
((unsigned long)__builtin_frame_address(0) & \
(THREAD_SIZE - 1)))
#endif
} while (0)
#else
#define CHECK_STACK(stack) do{}while(0)
-#define CDEBUG_STACK(var) (0L)
+#define CDEBUG_STACK (0L)
#endif
#if 1
#define CDEBUG(mask, format, a...) \
do { \
- CHECK_STACK(CDEBUG_STACK()); \
+ CHECK_STACK(CDEBUG_STACK); \
if (!(mask) || ((mask) & (D_ERROR | D_EMERG)) || \
(portal_debug & (mask) && \
portal_subsystem_debug & (1 << (DEBUG_SUBSYSTEM >> 24)))) \
portals_debug_msg(DEBUG_SUBSYSTEM, mask, \
__FILE__, __FUNCTION__, __LINE__, \
- CDEBUG_STACK(), format , ## a); \
+ CDEBUG_STACK, format , ## a); \
} while (0)
#define CWARN(format, a...) CDEBUG(D_WARNING, format, ## a)
void kportal_assertion_failed(char *expr, char *file, const char *func,
const int line)
{
- portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK(),
+ portals_debug_msg(0, D_EMERG, file, func, line, CDEBUG_STACK,
"ASSERTION(%s) failed\n", expr);
LBUG_WITH_LOC(file, func, line);
}
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
-#include <asm/byteorder.h>
+#include <asm/byteorder.h> /* sigh. for __cpu_to_* */
#include <syslog.h>
#include <errno.h>