Skip to contentSkip to conversation

Reserving a fixed physical address page of RAM.

DISCUSSION Jon Ringle 1 participant 1 message Nov 28, 2006

lore
Share & tools
lore

Jon Ringle

author
#0 lore raw
Quoted 27 lines · Robert Hancock
Quoted 6 lines · Jon Ringle
Quoted 5 lines · Robert Hancock
Quoted 4 lines · Jon Ringle

Hi,

I need to reserve a page of memory at a specific area of RAM that will be used as a "shared memory" with another processor

over PCI.

Quoted 1 line
Quoted 1 line
Quoted 1 line

How can I ensure that the this area of RAM gets reseved

so that the

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Linux's memory management (kmalloc() and friends) don't use it?

Some things that I've considered are iotable_init() and ioremap(). However, I've seen these used for memory mapped IO

devices which are

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

outside of the RAM memory. Can I use them for reseving RAM too?

I appreciate any advice in this regard.

Sounds to me like dma_alloc_coherent is what you want..

It looks promising, however, I need to reserve a physical

address area

Quoted 4 lines

that is well known (so that the code running on the other processor knows where in PCI memory to write to). It appears that dma_alloc_coherent returns the address that it allocated. Instead I need something where I can tell it what physical address

Quoted 8 lines

and range I

Quoted 1 line

want to use.

I don't think this is possible in the general case, as there's no mechanism for moving things out of the way if they might be in use. Your best solution is likely to use dma_alloc_coherent and pass the bus address returned into the other processor to tell it where to write..

I can't do that because my mechanism to talk to the other processor is exactly what I'm trying to setup. Catch-22 :)