From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 25 18:48:32 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B426916A41F for ; Tue, 25 Oct 2005 18:48:32 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 530BF43D48 for ; Tue, 25 Oct 2005 18:48:30 +0000 (GMT) (envelope-from dinesh@alphaque.com) Received: (qmail 65281 invoked by uid 0); 25 Oct 2005 18:48:28 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 25 Oct 2005 18:48:28 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by prophet.alphaque.com (8.13.4/8.13.4) with ESMTP id j9PIka1E000561; Wed, 26 Oct 2005 02:46:36 +0800 (MYT) (envelope-from dinesh@alphaque.com) Message-ID: <435E7D8C.90401@alphaque.com> Date: Wed, 26 Oct 2005 02:46:36 +0800 From: Dinesh Nair User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.8b) Gecko/20050915 MIME-Version: 1.0 To: John Baldwin References: <435E3003.4050609@alphaque.com> <200510251327.59965.jhb@freebsd.org> In-Reply-To: <200510251327.59965.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: correct use of bus_dmamap_sync X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Oct 2005 18:48:32 -0000 On 10/26/05 01:27 John Baldwin said the following: > On Tuesday 25 October 2005 09:15 am, Dinesh Nair wrote: >>(must i malloc space for them before passing them into those functions, or >>will the call to bus_dmamem_alloc do it for me ?) > > bus_dmamem_alloc() will do it for you. thanx. > Probably not as the sync()'s don't really do anything with memory allocated > via bus_dmamem_alloc(). The operations are named from the CPU's perspective, however, the man page at http://www.freebsd.org/cgi/man.cgi?query=bus_dmamap_sync&apropos=0&sektion=0&manpath=FreeBSD+5.4-stable&format=html says, "Although no explicit loading is required to access the memory referenced by the returned map, the synchronization requirements as described in the bus_dmamap_sync() section still apply." also, is bus_dmamap_load() required, since the same man page section above says it isnt ? have things changed between freebsd 4.x (which i'm using) and freebsd 5.x ? > thus when you send data to your device, that is a WRITE operation (even > though your device is doing a DMA to read data), and when you get data back > from your device, that is a READ operation (even though your device is doing > a DMA to write the data into the buffer). thanx, the verbiage on the man page is slightly confusing with it's use of CPU, giving the opposite impression. -- Regards, /\_/\ "All dogs go to heaven." dinesh@alphaque.com (0 0) http://www.alphaque.com/ +==========================----oOO--(_)--OOo----==========================+ | for a in past present future; do | | for b in clients employers associates relatives neighbours pets; do | | echo "The opinions here in no way reflect the opinions of my $a $b." | | done; done | +=========================================================================+