Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 02 Jul 2006 22:03:47 +0100
From:      Ian Dowse <iedowse@iedowse.com>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        David Malone <dwmalone@maths.tcd.ie>, freebsd-hackers@freebsd.org
Subject:   Re: contiguous memory allocation problem 
Message-ID:  <200607022203.aa83223@nowhere.iedowse.com>
In-Reply-To: Your message of "Sun, 02 Jul 2006 21:06:21 %2B0200." <200607022106.22935.hselasky@c2i.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200607022106.22935.hselasky@c2i.net>, Hans Petter Selasky writes:
>Ok. So the solution to my problem is to use scatter and gather. I will see 
>about updating my USB system to do it like that.
>
>But there is one thing I do not understand yet. When you load a page that 
>physically resides above 4GB, because a computer has more than 4GB of memory, 
>how does "bus_dmamap_load()" move that page down below 4GB, so that the 
>32-bit USB host controllers can reach it?

What should happen is that bus_dma allocates a bounce buffer and
performs copies as required from within the bus_dmamap_sync() calls.
This is something I haven't been able to verify yet with the USB
code though, so there could easily be bugs there.

BTW, as far as I know bus_dma is also missing support for multi-segment
allocations, so for example if you ask it to allocate 16k in at
most 4 segments below the 4GB mark, it will actually attempt a
physically contiguous allocation. If this was fixed it could be
used by usbd_alloc_buffer() to give directly usable buffers without
contiguous allocations.

Ian



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