On Fri, 2005-09-16 at 20:33 +0200, Martin Drab wrote: > Hi, > > can anyone explain me why it is not possible to mmap(2) a buffer > allocated in kernel by pci_alloc_consistent() to userspace on a 2.4 > kernel? > > In kernel PCI device initialization function I do something like: > > ... > kladdr = pci_alloc_consistent (dev, BUFSIZE, &baddr); > ... > > Then I send the physical address (i.e. the value of phaddr = __pa(kladdr)) > to the userspace application, and then when in the userspace I do > something like > > ... > fd = fopen ("/dev/mem", O_RDWR); > buf = mmap (NULL, BUFSIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, phaddr); > ... yuch. why don't you make your device have an mmap operation instead? (the device node that you use to get your physical address to userspace in the first place)
Attachment:
signature.asc
Description: This is a digitally signed message part
- Follow-Ups:
- References:
- Prev by Date: Re: Lost keyboard on Inspiron 8200 at 2.6.13
- Next by Date: Reboot & ACPI suspend Laptop display initialization
- Previous by thread: mmap(2)ping of pci_alloc_consistent() allocated buffers on 2.4 kernels question/help
- Next by thread: Re: mmap(2)ping of pci_alloc_consistent() allocated buffers on 2.4 kernels question/help
- Index(es):