From owner-svn-src-head@FreeBSD.ORG Fri Nov 12 06:58:05 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B86F91065670; Fri, 12 Nov 2010 06:58:05 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id 714CD8FC0C; Fri, 12 Nov 2010 06:58:05 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 7D43128F7A7; Fri, 12 Nov 2010 00:58:04 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 84bL43tidDJq; Fri, 12 Nov 2010 00:58:04 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id E9B6D28F7AA; Fri, 12 Nov 2010 00:58:03 -0600 (CST) Message-ID: <4CDCE57B.3000602@rice.edu> Date: Fri, 12 Nov 2010 00:58:03 -0600 From: Alan Cox User-Agent: Thunderbird 2.0.0.24 (X11/20100725) MIME-Version: 1.0 To: Bernhard Schmidt References: <201011111843.oABIhV9d080688@svn.freebsd.org> In-Reply-To: <201011111843.oABIhV9d080688@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r215135 - head/sys/compat/ndis X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Nov 2010 06:58:05 -0000 Bernhard Schmidt wrote: > 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. > > It appears to me that these functions should be using kmem_alloc_contig() and kmem_free() instead of contigmalloc() and contigfree(). Then, the "cachetype" parameter could be correctly implemented rather than ignored. It just requires mapping the cachetype values to their corresponding vm_memattr_t values. Regards, Alan > Submitted by: Paul B Mahol > > 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 > >