From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 2 16:23:35 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC251065676 for ; Mon, 2 Feb 2009 16:23:35 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.190]) by mx1.freebsd.org (Postfix) with ESMTP id 52F0A8FC1C for ; Mon, 2 Feb 2009 16:23:34 +0000 (UTC) (envelope-from bsd.quest@googlemail.com) Received: by nf-out-0910.google.com with SMTP id h3so212654nfh.33 for ; Mon, 02 Feb 2009 08:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=mmkfc5qOOjCTNtHuvff/XVAV4I0gQNtkV59P3oE4qCo=; b=JsAGrTBbugSBvODcVvKnks4YvDkKpR2rgJoVedzBuHcqmKLlxRFZGnakX7f29rVZpv 3rfKVQ/pfJgOiFA9IOFOY8BRnJ8DNIOs8DXAY+b+iYbp9FyalgjA4GMdslEhnnHZ3k7O uagVJnMC5X4RvqmxgDbR5Z7XiiD0VpdKWqFw8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=DgLE+3ATvV5Vep4ukYvSz1o7Ge2TfIYepZx9LiAg3hRKiaWWlPNNtTDBvzLtyIUlvn T3ZHwuPJIuXE9iA0txNzAtZrunPUb/lqlkUVuGvBIelhlCDSSG4be99OQ1AgmOF71k5a bLZRW28NjPwhKXnivnj6IvhaIWQoB7N13VaEc= MIME-Version: 1.0 Received: by 10.210.43.10 with SMTP id q10mr535700ebq.58.1233591813819; Mon, 02 Feb 2009 08:23:33 -0800 (PST) In-Reply-To: <7d6fde3d0902020046o7640f217ye88336b53920a538@mail.gmail.com> References: <6699015.16785.1233539817447.JavaMail.root@vms063.mailsrvcs.net> <7d6fde3d0902020045h55255cane0d6dd9f64d23f5@mail.gmail.com> <7d6fde3d0902020046o7640f217ye88336b53920a538@mail.gmail.com> Date: Mon, 2 Feb 2009 17:23:33 +0100 Message-ID: <671bb5fc0902020823p3ee8d9edl715a074603ab97de@mail.gmail.com> From: Alexej Sokolov To: Garrett Cooper , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: bus_dma (9). What exactly means "Loading of memory allocation" ? 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: Mon, 02 Feb 2009 16:23:36 -0000 Hi, thanx for your answer. I checked the source code of the *dma() functions. If I understand it correctly, "loading of memory allocation" means the following: 1. At first memory allocation should be done: bufp = *alloc(sizeof ....) 2. then in ... _bus_dmamap_load_buffer() we get physical addres of allocated buffer: if (pmap) curaddr = pmap_extract(pmap, vaddr); else curaddr = pmap_kextract(vaddr); ... then some "magic" with bouncing 3. then physical address will passed to dmat->segments segs[seg].ds_addr = curaddr; segs[seg].ds_len = sgsize; Ok, it all means: getting of physical address of allocated buffer. If physical space not accessble for device, allocating bounce buffers. Getting of physical addresses of allocated buffers. And then put these physical addresses and sizes of buffers in dmat->segments array. <- loading of memory allocation (-: right ? Thanx, Alexej 2009/2/2 Garrett Cooper > On Mon, Feb 2, 2009 at 12:45 AM, Garrett Cooper > wrote: > > On Sun, Feb 1, 2009 at 5:56 PM, Sergey Babkin > wrote: > >> > >> If I remember correctly, loading means that the pages become mapped > >> and visible to the devices. Some buses can access only a limited > >> address space , like ISA has only a 24-bit address. When a map gets > >> loaded, for any pages outside of this range the temporary in-ramge > >> pages are allocated and the d ata gets moved through them. On some > >> machines, like I think DEC Alpha, the physicall addresses seen by > >> the devices are not the same as seen by the CPU , these need to be > >> translated. And so on. > >> I think my real old articl e had some of these explanations but now > >> the Daemonnews site seems to be re al slow: > >> http://ezine.daemonnews.org/200008/isa.html > >> -SB > >> (sorry a bout top quoting, it's the only kind the web interface of my > >> provider suppo rts) > >> Feb 1, 2009 03:38:27 PM, [1]bsd.quest@googlemail.com wrote: > >> > >> Hi, > >> at first the cut of text from man (9) bus_dma: > >> bus_dmamap_t > >> A machine-dependent opaque type describing an individual > >> mapp ing. > >> One map is used for each memory allocation that will b e loaded. > >> Maps can be reused once they have been unloaded.. . > >> Question: What exactly means "Loading of memory allocation" in thi > s context > >> ? > >> Could anyone explain it or give me some little example wi th DMA > >> functions > >> for understanding it. > > > > Unfortunately it's bad English, so that might be where some of the > > confusion is stemming from. I'll send a doc's PR request after this to > > fix it. > > -Garrett > > Ugh. Nevermind. The question was written improperly -- the manpage wasn't > ><. > -Garrett >