Re: kmalloc of dma-memory

Albert Cahalan (albert@ccs.neu.edu)
Sun, 17 Mar 1996 01:30:30 -0500 (EST)


> The problem is MAX_DMA_ADDRESS which is used by kmalloc to determine
> what memory area can be allocated as DMA'able memory. For instance on
> the Amiga, the DMA-area depends on the actual device and therefore it
> would be better to specify a DMA-mask as an optional parameter to
> kmalloc instead of letting kmalloc use a static value as it does now.
>
> As an example, I have an SCSI controller on the motherboard in my
> Amiga 3000 which is able to do DMA to the entire memory-area, but I
> also have a controller that is only capable of doing DMA to the lower
> 16MB area. As I don't have any free memory available below the 16MB
> boundary, setting MAX_DMA_ADDRESS to 0x00ffffff will force both
> controllers to use programmed I/O which of course undesired.
>
> My suggestion is that an extra, optional, parameter is added to
> kmalloc so it is possible to specify the dma-boundary when calling
> kmalloc, and then let kmalloc use this boundary to allocate DMA'able
> memory when the parameter is added to the kmalloc call and let it rely
> on the old method when it is not.

Do what the PC does with ISA (16MB max) and PCI (4GB max).
#define MAX_DMA_ADDRESS 0x1000000
(BTW, isn't that off by one? Maybe 0xffffff.)

For your good card use something else, maybe this:
__get_free_pages(priority, gfporder, max_addr)

It looks like you get a 2^gfporder page chunk of memory that is
at a location under max_addr.