summaryrefslogtreecommitdiffstats
path: root/sys/ofed
diff options
context:
space:
mode:
authorhselasky <hselasky@FreeBSD.org>2015-10-19 12:33:09 +0000
committerhselasky <hselasky@FreeBSD.org>2015-10-19 12:33:09 +0000
commite0d62d0664ee980174f03ca83030956c9fce272f (patch)
tree8e5240a5a596b6763cd7298140b3ae7bbe9c1039 /sys/ofed
parentfd834c513a221af10224dd38154b74cde2b57c62 (diff)
downloadFreeBSD-src-e0d62d0664ee980174f03ca83030956c9fce272f.zip
FreeBSD-src-e0d62d0664ee980174f03ca83030956c9fce272f.tar.gz
Merge LinuxKPI changes from DragonflyBSD:
- Implement more Linux kernel functions. Sponsored by: Mellanox Technologies
Diffstat (limited to 'sys/ofed')
-rw-r--r--sys/ofed/include/linux/mm.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/sys/ofed/include/linux/mm.h b/sys/ofed/include/linux/mm.h
index b1a575c..b61678d 100644
--- a/sys/ofed/include/linux/mm.h
+++ b/sys/ofed/include/linux/mm.h
@@ -2,7 +2,9 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
- * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
+ * Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
+ * Copyright (c) 2015 François Tigeot
+ * Copyright (c) 2015 Matthew Dillon <dillon@backplane.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -84,4 +86,24 @@ io_remap_pfn_range(struct vm_area_struct *vma,
return (0);
}
+static inline unsigned long
+vma_pages(struct vm_area_struct *vma)
+{
+ return ((vma->vm_end - vma->vm_start) >> PAGE_SHIFT);
+}
+
+#define offset_in_page(off) ((off) & (PAGE_SIZE - 1))
+
+static inline void
+set_page_dirty(struct vm_page *page)
+{
+ vm_page_dirty(page);
+}
+
+static inline void
+get_page(struct vm_page *page)
+{
+ vm_page_hold(page);
+}
+
#endif /* _LINUX_MM_H_ */
OpenPOWER on IntegriCloud