[lkml]   [1999]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectmmap() Failure with 2.2.7
I have a contiguous memory buffer in my driver that I have allocated by:

bufAddress = __get_dma_pages(GFP_KERNEL,order);

that I want to map to user space.

The following worked for 2.0.36-3SMP on RH 5.2 but does not
work for 2.2.7SMP on RH 6.0. It gives no error indication
but when I try to store data in the buffer and read it back,
the data is garbage (0xffffffff).

I would appreciate knowing the proper way to do this or
any suggestions about how to proceed.

Frank McGirt

2.0.36 implementation:

1. in driver reserve buffer by setting RESERVED bit so that
remap_page range() will work
paddr = bufAddress;
for( i = 0; i < max_page; i++ ) {
page = &mem_map[MAP_NR(paddr)];
paddr += PAGE_SIZE;

2. call mmap() from app as:

3. in driver mmap() implemented as:
mmap(struct file *file, struct vm_area_struct *vmarea)
remap_page_range(vmarea->vm_start, vmarea->vm_offset, vmarea->end -
vmarea->start, vmarea->vm_page_prot);
vmarea->vm_file = file;

return 0;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:51    [W:0.017 / U:6.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site