patch-2.4.9 linux/drivers/char/drm/drm_vm.h
Next file: linux/drivers/char/drm/ffb_context.c
Previous file: linux/drivers/char/drm/drm_scatter.h
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
Wed Aug 15 14:21:47 2001
- Orig file:
v2.4.8/linux/drivers/char/drm/drm_vm.h
- Orig date:
Sun Aug 12 13:27:59 2001
diff -u --recursive --new-file v2.4.8/linux/drivers/char/drm/drm_vm.h linux/drivers/char/drm/drm_vm.h
@@ -86,12 +86,12 @@
#else
drm_map_t *map = (drm_map_t *)vma->vm_pte;
#endif
- unsigned long physical;
unsigned long offset;
unsigned long i;
pgd_t *pgd;
pmd_t *pmd;
pte_t *pte;
+ struct page *page;
if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */
if (!map) return NOPAGE_OOM; /* Nothing allocated */
@@ -107,14 +107,15 @@
if( !pmd_present( *pmd ) ) return NOPAGE_OOM;
pte = pte_offset( pmd, i );
if( !pte_present( *pte ) ) return NOPAGE_OOM;
- physical = (unsigned long)pte_page( *pte )->virtual;
- atomic_inc(&virt_to_page(physical)->count); /* Dec. by kernel */
- DRM_DEBUG("0x%08lx => 0x%08lx\n", address, physical);
+ page = pte_page(*pte);
+ get_page(page);
+
+ DRM_DEBUG("0x%08lx => 0x%08x\n", address, page_to_bus(page));
#if LINUX_VERSION_CODE < 0x020317
- return physical;
+ return page_address(page);
#else
- return virt_to_page(physical);
+ return page;
#endif
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)