Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Aug 2010 02:08:33 +0000 (UTC)
From:      Jeff Roberson <jeff@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r210988 - projects/ofed/head/sys/ofed/include/linux
Message-ID:  <201008070208.o7728XCn099249@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jeff
Date: Sat Aug  7 02:08:33 2010
New Revision: 210988
URL: http://svn.freebsd.org/changeset/base/210988

Log:
   - Implement enough of vm_area_struct to support mmap.
   - Define a few page protection types.
  
  Sponsored by:	Isilon Systems, iX Systems, and Panasas.

Modified:
  projects/ofed/head/sys/ofed/include/linux/mm.h
  projects/ofed/head/sys/ofed/include/linux/page.h

Modified: projects/ofed/head/sys/ofed/include/linux/mm.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/linux/mm.h	Sat Aug  7 02:07:40 2010	(r210987)
+++ projects/ofed/head/sys/ofed/include/linux/mm.h	Sat Aug  7 02:08:33 2010	(r210988)
@@ -35,6 +35,11 @@
 #define	PAGE_ALIGN(x)	ALIGN(x, PAGE_SIZE)
 
 struct vm_area_struct {
+	vm_offset_t	vm_start;
+	vm_offset_t	vm_end;
+	vm_offset_t	vm_pgoff;
+	vm_paddr_t	vm_pfn;		/* PFN For mmap. */
+	vm_memattr_t	vm_page_prot;
 };
 
 /*
@@ -62,4 +67,18 @@ lowmem_page_address(struct page *page)
 	return page_address(page);
 }
 
+/*
+ * This only works via mmap ops.
+ */
+static inline int
+io_remap_pfn_range(struct vm_area_struct *vma,
+    unsigned long addr, unsigned long pfn, unsigned long size,
+    vm_memattr_t prot)
+{
+	vma->vm_page_prot = prot;
+	vma->vm_pfn = pfn;
+
+	return (0);
+}
+
 #endif	/* _LINUX_MM_H_ */

Modified: projects/ofed/head/sys/ofed/include/linux/page.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/linux/page.h	Sat Aug  7 02:07:40 2010	(r210987)
+++ projects/ofed/head/sys/ofed/include/linux/page.h	Sat Aug  7 02:08:33 2010	(r210988)
@@ -40,6 +40,8 @@
 #define	virt_to_page(x)	PHYS_TO_VM_PAGE(vtophys((x)))
 
 #define	clear_page(page)	memset((page), 0, PAGE_SIZE)
+#define	pgprot_noncached(prot)	VM_MEMATTR_UNCACHED
+#define	pgprot_wc(prot)		VM_MEMATTR_WRITE_COMBINING
 
 #undef	PAGE_MASK
 #define	PAGE_MASK	(~(PAGE_SIZE-1))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008070208.o7728XCn099249>