1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 #ifndef __LNET_LINUX_LIB_LNET_H__
5 #define __LNET_LINUX_LIB_LNET_H__
7 #ifndef __LNET_LIB_LNET_H__
8 #error Do not #include this file directly. #include <lnet/lib-lnet.h> instead
12 # include <asm/page.h>
13 # include <linux/string.h>
15 # include <libcfs/kp30.h>
18 lnet_page2phys (struct page *p)
20 /* compiler optimizer will elide unused branches */
22 switch (sizeof(typeof(page_to_phys(p)))) {
24 /* page_to_phys returns a 32 bit physical address. This must
25 * be a 32 bit machine with <= 4G memory and we must ensure we
26 * don't sign extend when converting to 64 bits. */
27 return (unsigned long)page_to_phys(p);
30 /* page_to_phys returns a 64 bit physical address :) */
31 return page_to_phys(p);
39 #else /* __KERNEL__ */
40 # include <libcfs/list.h>
42 # ifdef HAVE_LIBPTHREAD
49 #endif /* __LNET_LINUX_LIB_LNET_H__ */