diff options
-rw-r--r-- | linux-core/drm_memory.h | 6 | ||||
-rw-r--r-- | linux-core/drm_os_linux.h | 4 | ||||
-rw-r--r-- | linux-core/drm_vm.c | 3 | ||||
-rw-r--r-- | linux/drm_memory.h | 6 | ||||
-rw-r--r-- | linux/drm_os_linux.h | 4 | ||||
-rw-r--r-- | linux/drm_vm.h | 3 |
6 files changed, 26 insertions, 0 deletions
diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h index 98ea89d8..c6ea1fcc 100644 --- a/linux-core/drm_memory.h +++ b/linux-core/drm_memory.h @@ -61,10 +61,16 @@ #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#ifndef pte_offset_kernel # define pte_offset_kernel(dir, address) pte_offset(dir, address) +#endif +#ifndef pte_pfn # define pte_pfn(pte) (pte_page(pte) - mem_map) +#endif +#ifndef pfn_to_page # define pfn_to_page(pfn) (mem_map + (pfn)) #endif +#endif /* * Find the drm_map that covers the range [offset, offset+size). diff --git a/linux-core/drm_os_linux.h b/linux-core/drm_os_linux.h index c26a4108..6d2d0710 100644 --- a/linux-core/drm_os_linux.h +++ b/linux-core/drm_os_linux.h @@ -18,10 +18,14 @@ #define DRM_UDELAY(d) udelay(d) /** Read a byte from a MMIO region */ #define DRM_READ8(map, offset) readb(((unsigned long)(map)->handle) + (offset)) +/** Read a word from a MMIO region */ +#define DRM_READ16(map, offset) readw(((unsigned long)(map)->handle) + (offset)) /** Read a dword from a MMIO region */ #define DRM_READ32(map, offset) readl(((unsigned long)(map)->handle) + (offset)) /** Write a byte into a MMIO region */ #define DRM_WRITE8(map, offset, val) writeb(val, ((unsigned long)(map)->handle) + (offset)) +/** Write a word into a MMIO region */ +#define DRM_WRITE16(map, offset, val) writew(val, ((unsigned long)(map)->handle) + (offset)) /** Write a dword into a MMIO region */ #define DRM_WRITE32(map, offset, val) writel(val, ((unsigned long)(map)->handle) + (offset)) /** Read memory barrier */ diff --git a/linux-core/drm_vm.c b/linux-core/drm_vm.c index a495884d..c661d203 100644 --- a/linux-core/drm_vm.c +++ b/linux-core/drm_vm.c @@ -101,9 +101,12 @@ static __inline__ struct page *DRM(do_vm_nopage)(struct vm_area_struct *vma, page = virt_to_page(__va(agpmem->memory->memory[offset])); get_page(page); +#if 0 + /* page_count() not defined everywhere */ DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n", baddr, __va(agpmem->memory->memory[offset]), offset, page_count(page)); +#endif return page; } diff --git a/linux/drm_memory.h b/linux/drm_memory.h index 98ea89d8..c6ea1fcc 100644 --- a/linux/drm_memory.h +++ b/linux/drm_memory.h @@ -61,10 +61,16 @@ #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) +#ifndef pte_offset_kernel # define pte_offset_kernel(dir, address) pte_offset(dir, address) +#endif +#ifndef pte_pfn # define pte_pfn(pte) (pte_page(pte) - mem_map) +#endif +#ifndef pfn_to_page # define pfn_to_page(pfn) (mem_map + (pfn)) #endif +#endif /* * Find the drm_map that covers the range [offset, offset+size). diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h index c26a4108..6d2d0710 100644 --- a/linux/drm_os_linux.h +++ b/linux/drm_os_linux.h @@ -18,10 +18,14 @@ #define DRM_UDELAY(d) udelay(d) /** Read a byte from a MMIO region */ #define DRM_READ8(map, offset) readb(((unsigned long)(map)->handle) + (offset)) +/** Read a word from a MMIO region */ +#define DRM_READ16(map, offset) readw(((unsigned long)(map)->handle) + (offset)) /** Read a dword from a MMIO region */ #define DRM_READ32(map, offset) readl(((unsigned long)(map)->handle) + (offset)) /** Write a byte into a MMIO region */ #define DRM_WRITE8(map, offset, val) writeb(val, ((unsigned long)(map)->handle) + (offset)) +/** Write a word into a MMIO region */ +#define DRM_WRITE16(map, offset, val) writew(val, ((unsigned long)(map)->handle) + (offset)) /** Write a dword into a MMIO region */ #define DRM_WRITE32(map, offset, val) writel(val, ((unsigned long)(map)->handle) + (offset)) /** Read memory barrier */ diff --git a/linux/drm_vm.h b/linux/drm_vm.h index a495884d..c661d203 100644 --- a/linux/drm_vm.h +++ b/linux/drm_vm.h @@ -101,9 +101,12 @@ static __inline__ struct page *DRM(do_vm_nopage)(struct vm_area_struct *vma, page = virt_to_page(__va(agpmem->memory->memory[offset])); get_page(page); +#if 0 + /* page_count() not defined everywhere */ DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx, count=%d\n", baddr, __va(agpmem->memory->memory[offset]), offset, page_count(page)); +#endif return page; } |