Does anybody know the prototype and its arguments of remap_page_range
function in kernel 2.6.9-5.0.5.EL-i686 please? It looks like the
remap_pfn_range function doesn't exist in the version. I try to map the pci
device memory to the user space in the device driver but have no luck so
far.

 

The code is pretty simple in the driver.

 

static int my_mmap(struct file *filp, struct vm_area_struct *vma)

{

if (remap_page_range(vma, vma->vm_start, vm->vm_pgoff,

vma->vm_end - vma->vm_start,

vma->vm_page_prot))

return -EAGAIN;

return 0;

}

 

And the user space call looks like this:

 

char* data;

  int fd = open("/dev/my_dev", O_RDWR);

  data = mmap(0, 0x1000, PROT_READ | PROT_WRITE, MAP_SHARED, fd,
0xE2E00000);

 

It always returns me the same data= 0x9c3de3 and accessing it gets nothing
meaningful.

 

Any ideas?

 

Best regards,

 

Jim Chen

Hytec Electronics Ltd.
Tel: +44 (0) 118 975 7770
Fax: +44 (0) 118 975 7566
Web:  <http://www.hytec-electronics.co.uk> www.hytec-electronics.co.uk

Incorporated in England No 1246940

VAT NO GB 285 2479 27

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

Reply via email to