Re: Mapping IO memory read-write

2016-01-13 Thread Jethro Beekman
> In this case, have you tried reading and writing to the memory segment being > mmap'd from userland? > > Here's an example mmap'ing device driver if you need to see that: > https://github.com/claudioscordino/mmap_alloc That would not have worked, but your example code did give me an idea. I was

Re: Mapping IO memory read-write

2016-01-13 Thread Kenneth Adam Miller
In this case, have you tried reading and writing to the memory segment being mmap'd from userland? Here's an example mmap'ing device driver if you need to see that: https://github.com/claudioscordino/mmap_alloc On Tue, Jan 12, 2016 at 6:10 PM, Jethro Beekman wrote: > I'm writing a device driver

Mapping IO memory read-write

2016-01-12 Thread Jethro Beekman
I'm writing a device driver for a memory-mapped device on x86-64. I'm mapping the device in the kernel using ioremap_cache(). My file_operations.mmap function is as follows: static int dev_mmap(struct file *filep, struct vm_area_struct *vma) { vma->vm_page_prot.pgprot|=_PAGE_BIT_RW;