Skip to contentSkip to conversation

rt_heaps and PCI adress space

Xenomai-help Rus V. Brushkoff 1 participant 2 messages Dec 13, 2008 – Dec 17, 2008

lore
Share & tools
lore
#0 lore raw
	Hi,

I'm using Xenomai-svn on x86, have two questions :

- Can I supply to hardware (RT_HEAP_INFO).phys_addr after creating heap
with H_DMA flag as I suplly it from pci_alloc_consistent() call ? Is it will be PCI bus addr ?

- Someone created H_SHARED heap between kernel and user space - all is
working perfect. Is it possible to supply to rt_heap_alloc() address of already allocated block ? For example - there is some block allocated/mapped from PCI hardware by ioremap(). So is it possible to write some kind of rt_heap_alloc_fixed(RT_HEAP *heap, size_t size, RTIME timeout, void *existing_buffer) that all the writes from userspace to this heap will write to kernel space at existing_buffer addr, and reads from userspace will read from this existing_buffer ? Please comment if 'not' - why, if 'yes' - how ? ;)

Rus

#1 lore raw

On Sat, 13 Dec 2008, Rus V. Brushkoff wrote:

Replying to myself:

: - Can I supply to hardware (RT_HEAP_INFO).phys_addr after creating heap with :H_DMA flag as I suplly it from pci_alloc_consistent() call ? Is it will be PCI :bus addr ?

Seems like this value need to be passed to pci_map_single/dma_map_single

: - Someone created H_SHARED heap between kernel and user space - all is working :perfect. Is it possible to supply to rt_heap_alloc() address of already :allocated block ? For example - there is some block allocated/mapped from PCI :hardware by ioremap(). So is it possible to write some kind of :rt_heap_alloc_fixed(RT_HEAP *heap, size_t size, RTIME timeout, void :*existing_buffer) that all the writes from userspace to this heap will write to :kernel space at existing_buffer addr, and reads from userspace will read from :this existing_buffer ? Please comment if 'not' - why, if 'yes' - how ? ;)

No it is impossible, as rt_heap_alloc use special data structures for
heaps, where buffers (pages) are only part of them. May be with special allocator written - where headers and page maps allocated in one region memory and pages located in another - it will be possible.

:
:

Rus