How can i alloc a big phys mem for DMA?

How can i alloc a big phys mem for DMA?

Post by p.. » Mon, 01 May 2000 04:00:00



My question is  to allocate a block of continuous physical memory from
the kernel for my driver's DMA.
I've heard that there is a way in patching the kernel, but I failed to
find it in internet by myself. Could anybody help me?
And whether there's a normal way (by kernel API) to solve it?
Any suggestion is welcome.
                               pubb

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. driver DMA mem alloc question

I have a problem:
I need to allocate some memory in my driver, that can be mapped to physical
addresses for DMA (well, AGP actually), but can be addressed normally by
user-level programs after mmapping.

Normally, I would think of using ddi_dma_buf_bind_handle(), except that
the user is not passing in a struct buf with a userland memory
address; I have to allocate the memory in my driver.

So the fallback I know of is ddi_dma_mem_alloc() ....
except that the manpage says "
     The data access handle is returned in  handlep.  handlep  is
     opaque - drivers may not attempt to interpret its value.  To
     access the data content, the driver must invoke ddi_get8(9F)
     or   ddi_put8(9F) (depending on the data transfer direction)
     with the data access handle."

That implies to me that I'm not supposed to mmap it and let the user
read/write to it "directly".

Am I being overly paranoid, and mmaping is still allowed?
Or should I be using a different alloc strategy altogether?

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]

The word of the day is mispergitude

2. nvidia settings

3. IO Mem Phys Addr for NIC w/ 1MB

4. 2.5.44: lkcd (0/9): general description and diffstat

5. Can I limit phys mem of process in SunOS 4.1.1?

6. aliases, arguments and & in bash

7. phys to virt and virt to phys help please

8. Dial Up Networking

9. Meaning of: "panic: dup mem alloc" ???

10. Big IDE- fdisk 'different phys/log...'

11. Mem alloc fails-while lots of swap available

12. physically cont. mem. alloc/mapping

13. Cant alloc big buffer in scsi generic driver any more.