svn commit: r215135 - head/sys/compat/ndis

Bernhard Schmidt bschmidt at FreeBSD.org
Thu Nov 11 18:43:32 UTC 2010


Author: bschmidt
Date: Thu Nov 11 18:43:31 2010
New Revision: 215135
URL: http://svn.freebsd.org/changeset/base/215135

Log:
  According to specs for MmAllocateContiguousMemorySpecifyCache() physically
  contiguous memory with requested restrictions must be allocated.
  
  Submitted by:	Paul B Mahol <onemda at gmail.com>

Modified:
  head/sys/compat/ndis/subr_ntoskrnl.c

Modified: head/sys/compat/ndis/subr_ntoskrnl.c
==============================================================================
--- head/sys/compat/ndis/subr_ntoskrnl.c	Thu Nov 11 18:41:03 2010	(r215134)
+++ head/sys/compat/ndis/subr_ntoskrnl.c	Thu Nov 11 18:43:31 2010	(r215135)
@@ -2426,12 +2426,9 @@ MmAllocateContiguousMemorySpecifyCache(s
 	uint64_t		boundary;
 	uint32_t		cachetype;
 {
-	void *addr;
-	size_t pagelength = roundup(size, PAGE_SIZE);
 
-	addr = ExAllocatePoolWithTag(NonPagedPool, pagelength, 0);
-
-	return (addr);
+	return (contigmalloc(size, M_DEVBUF, M_ZERO|M_NOWAIT, lowest,
+	    highest, PAGE_SIZE, boundary));
 }
 
 static void
@@ -2447,7 +2444,7 @@ MmFreeContiguousMemorySpecifyCache(base,
 	uint32_t		size;
 	uint32_t		cachetype;
 {
-	ExFreePool(base);
+	contigfree(base, size, M_DEVBUF);
 }
 
 static uint32_t


More information about the svn-src-all mailing list