Subject: RE: memory questions
To: None <>
From: Filka Michal <>
List: tech-kern
Date: 04/12/2006 12:52:49
Yes, provided you do it properly.
... it means?

  If you want to DMA directly into user memory,
you have to (a) make sure the relevant pages are locked in memory for
the duration and (b) do the correct dance to make sure caches and such
are properly handled - this is part of why bus_dma exists, so the
driver code can be insulated from the (heavily machine-specific)
details of this dance..
... No I really don't want such thing. I have allocated a buffer for DMA
access (bus_dmamem_alloc). I need to do some operations above it (namely
Rx/Tx descriptors are stored there), but sometimes it fails (page
fault). As I understand DMA in NetBSD, there are two views on same part
of memory. First view is the "physical" one which is used by device,
second one is "logical". In logical view is memory for DMA access mapped
into virtual memory space. I simplified the description a little.
However, I thought that pages forming logical view cannot be swapped out
of memory. Is it correct idea?

Michal Filka