Re: DMA question

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 22 Jan 1997 20:24:29 +0000 (GMT)


> I have a device that does DMA. The area involved is mmapped by
> several user processes. The hardware does not allow user program
> access while the DMA is in progress.
> What Linux primitives can be used to prevent such access?
>
> So, is there a reasonable way to put processes to sleep when they
> try to access a prespecified range of memory, so that the driver
> can wake them up when DMA has finished?

Assuming you have to ensure this doesn't occur, then you can ummap
before the DMA and remap them at the end. Modify the fault handler to
sleep the process if it faults on the device.

Alan