On Sun, 2004-10-17 at 12:00 -0700, William Lee Irwin III wrote: > On Sun, 2004-10-17 at 02:30 -0700, William Lee Irwin III wrote: > >> You need to right shift the argument by PAGE_SHIFT. > > On Sun, Oct 17, 2004 at 08:35:31PM +0200, Martin Schlemmer [c] wrote: > > I am trying to get vesafb-tng to work with rc4-mm1, but are not sure > > when to shift the argument by PAGE_SHIFT, and when not to. The patches > > from you in rc4-mm1 sometimes shifts the second arg, other times the > > third, and other times not at all. Is there a easy way for a mostly > > clueless person to figure out when to shift what argument and when not? > > Please point out where these inconsistencies occur and I will repair > them. > > Only the third argument changed, from a physical address to a pfn. > Its the vesafb-tng patch (http://dev.gentoo.org/~spock/projects/vesafb-tng/) Relevant part: ---- vma.vm_mm = current->active_mm; vma.vm_page_prot.pgprot = PROT_READ | PROT_EXEC | PROT_WRITE; ret = remap_page_range(&vma, 0x000000, __pa(mem), REAL_MEM_SIZE, vma.vm_page_prot); ret += remap_page_range(&vma, 0x0a0000, 0x0a0000, 0x100000 - 0x0a0000, vma.vm_page_prot); ---- I did it as: ---- vma.vm_mm = current->active_mm; vma.vm_page_prot.pgprot = PROT_READ | PROT_EXEC | PROT_WRITE; ret = remap_pfn_range(&vma, 0x000000, __pa(mem) >> PAGE_SHIFT, REAL_MEM_SIZE, vma.vm_page_prot); ret += remap_pfn_range(&vma, 0x0a0000, 0x0a0000, 0x100000 - 0x0a0000, vma.vm_page_prot); ---- Thanks, -- Martin Schlemmer