summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorJon Smirl <jonsmirl@yahoo.com>2004-09-12 03:23:50 +0000
committerJon Smirl <jonsmirl@yahoo.com>2004-09-12 03:23:50 +0000
commit36050cc958596ca81d667d8a51e124e9ea9eb866 (patch)
treece3138523ba7c8e91646bd9f530386a1a9ed7f6d /linux
parente6d468ad7f398a72e8be227564f3a450de873cc6 (diff)
Fix DRM to compile cleanly with recent kernel changes in PCI IO and
DRM_COPY_FROM_USER. PCI IO changes in 2.6.9-rc1 bk currently.
Diffstat (limited to 'linux')
-rw-r--r--linux/drm_os_linux.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h
index ab16d7b3..7e53e0d5 100644
--- a/linux/drm_os_linux.h
+++ b/linux/drm_os_linux.h
@@ -15,6 +15,7 @@
/** Current process ID */
#define DRM_CURRENTPID current->pid
#define DRM_UDELAY(d) udelay(d)
+#if LINUX_VERSION_CODE <= 0x020608 /* KERNEL_VERSION(2,4,14) */
/** 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 */
@@ -27,6 +28,20 @@
#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))
+#else
+/** Read a byte from a MMIO region */
+#define DRM_READ8(map, offset) readb((map)->handle + (offset))
+/** Read a word from a MMIO region */
+#define DRM_READ16(map, offset) readw((map)->handle + (offset))
+/** Read a dword from a MMIO region */
+#define DRM_READ32(map, offset) readl((map)->handle + (offset))
+/** Write a byte into a MMIO region */
+#define DRM_WRITE8(map, offset, val) writeb(val, (map)->handle + (offset))
+/** Write a word into a MMIO region */
+#define DRM_WRITE16(map, offset, val) writew(val, (map)->handle + (offset))
+/** Write a dword into a MMIO region */
+#define DRM_WRITE32(map, offset, val) writel(val, (map)->handle + (offset))
+#endif
/** Read memory barrier */
#define DRM_READMEMORYBARRIER() rmb()
/** Write memory barrier */