aboutsummaryrefslogtreecommitdiff
path: root/sys/ofed/include
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-10-19 12:33:09 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-10-19 12:33:09 +0000
commite490164bee07d8ff2638d62d121ecc6ec316d738 (patch)
tree8e5240a5a596b6763cd7298140b3ae7bbe9c1039 /sys/ofed/include
parentf556cede8a28b82b59b4f598d0fb3d04a2160934 (diff)
downloadsrc-e490164bee07d8ff2638d62d121ecc6ec316d738.tar.gz
src-e490164bee07d8ff2638d62d121ecc6ec316d738.zip
Merge LinuxKPI changes from DragonflyBSD:
- Implement more Linux kernel functions. Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=289579
Diffstat (limited to 'sys/ofed/include')
-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 b1a575c145fa..b61678dd2fcf 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_ */