.nopage 2.6.16 --> 2.6.35
how to convert this code?
I have read around that. ".nopage" and obsolete. I used to use ".fault" but how? I could help a driver and a card Tv
Can you show me a code or pseudo code?
static struct vm_operations_struct cx2388x_vm_ops = {
.nopage = cx2388x_vma_nopage,
};
static struct page *
cx2388x_vma_nopage (struct vm_area_struct *vma,
unsigned long address, int *type)
{
struct cxadc* ctd;
struct page *page;
unsigned long offset;
if(address<vma->vm_start||address>vma->vm_end)
{
return NOPAGE_SIGBUS;
}
if (type)
*type = VM_FAULT_MINOR;
offset = (address - vma->vm_start) + vma->vm_pgoff * PAGE_SIZE;
ctd=vma->vm_private_data;
page=virt_to_page(ctd->pgvec_virt[offset>>PAGE_SHIFT]);
// printk("cxadc: nopage addr=0x%x pgoff=0x%x %x %x %x pgcnt:%d\n",address,vma->vm_pgoff,vma->vm_start,vma->vm_end,offset>>PAGE_SHIFT,page->_count);
get_page(page);
return page;
}
|