isa DMA buffer question

good day :slight_smile:
I’ve got my RTP system up and running and now I’m trying
to port some old code to handle to support our hardware pieces there.
So, I’ve done the following:

/* get some memory for DMA transfers */
buffer=mmap(0,sizeof(dma_buffer_t),
PROT_READ|PROT_WRITE|
PROT_NOCACHE,
MAP_PHYS|MAP_ANON|MAP_BELOW16M|MAP_NOX64K,
NOFD,0);

If I’m not mistaken “buffer” now contains the virtual address of the
buffer I can use to access from inside the code.

Attention, question!
How can I determine the physical address of this region needed
to for my card’s isa-master DMA transfers?

vadik likholetov <vadik@sensi.org> wrote:

good day > :slight_smile:
I’ve got my RTP system up and running and now I’m trying
to port some old code to handle to support our hardware pieces there.
So, I’ve done the following:

/* get some memory for DMA transfers */
buffer=mmap(0,sizeof(dma_buffer_t),
PROT_READ|PROT_WRITE|
PROT_NOCACHE,
MAP_PHYS|MAP_ANON|MAP_BELOW16M|MAP_NOX64K,
NOFD,0);

If I’m not mistaken “buffer” now contains the virtual address of the
buffer I can use to access from inside the code.

Attention, question!
How can I determine the physical address of this region needed
to for my card’s isa-master DMA transfers?

See the mem_offset() function, it should help you out.

Thomas

Thomas Fletcher <thomasf@qnx.com> wrote:

vadik likholetov <> vadik@sensi.org> > wrote:

good day > :slight_smile:
I’ve got my RTP system up and running and now I’m trying
to port some old code to handle to support our hardware pieces there.
So, I’ve done the following:

/* get some memory for DMA transfers */
buffer=mmap(0,sizeof(dma_buffer_t),
PROT_READ|PROT_WRITE|
PROT_NOCACHE,
MAP_PHYS|MAP_ANON|MAP_BELOW16M|MAP_NOX64K,
NOFD,0);

If I’m not mistaken “buffer” now contains the virtual address of the
buffer I can use to access from inside the code.

Attention, question!
How can I determine the physical address of this region needed
to for my card’s isa-master DMA transfers?

See the mem_offset() function, it should help you out.

Thomas
I found it, thank you, but I’m getting it’s strange

behavior. May be you can give me an example?


vadik likholetov

vadik likholetov <vadik@qnx.com> wrote:

Thomas Fletcher <> thomasf@qnx.com> > wrote:
vadik likholetov <> vadik@sensi.org> > wrote:

good day > :slight_smile:
I’ve got my RTP system up and running and now I’m trying
to port some old code to handle to support our hardware pieces there.
So, I’ve done the following:

/* get some memory for DMA transfers */
buffer=mmap(0,sizeof(dma_buffer_t),
PROT_READ|PROT_WRITE|
PROT_NOCACHE,
MAP_PHYS|MAP_ANON|MAP_BELOW16M|MAP_NOX64K,
NOFD,0);

If I’m not mistaken “buffer” now contains the virtual address of the
buffer I can use to access from inside the code.

Attention, question!
How can I determine the physical address of this region needed
to for my card’s isa-master DMA transfers?

See the mem_offset() function, it should help you out.

Thomas
I found it, thank you, but I’m getting it’s strange
behavior. May be you can give me an example?

I’m trying… I’m trying :frowning:
it gives me ENOSYS :frowning:
QNXRTP version QNX alpha 6.00 2000/10/17-14:59:25edt x86pc x86

off_t phys;


/* get some memory for DMA transfers */
buffer=mmap(0,sizeof(ct_buf_t),PROT_READ|PROT_WRITE|PROT_NOCACHE,
MAP_PHYS|MAP_ANON|MAP_BELOW16M|MAP_NOX64K,
NOFD,0);

if(buffer ==MAP_FAILED)
{
printf(“buffer allocation failed – %s\n”,strerror(errno));
goto out;
}

if(posix_mem_offset(buffer,1, &phys,0, NULL)<0)
{
printf(“memory mapping failed – %s\n”, strerror(errno));
goto out;
}

\

vadik likholetov