LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 09-28-2010, 07:09 PM   #1
pollo_61
LQ Newbie
 
Registered: Sep 2010
Posts: 1

Rep: Reputation: 0
.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;

}
 
Old 09-29-2010, 04:11 PM   #2
jf.argentino
Member
 
Registered: Apr 2008
Location: Toulon (France)
Distribution: FEDORA CORE
Posts: 493

Rep: Reputation: 50
Maybe looking there could help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 03:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration