summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Delgass <ldelgass@users.sourceforge.net>2002-08-22 18:43:39 +0000
committerLeif Delgass <ldelgass@users.sourceforge.net>2002-08-22 18:43:39 +0000
commit2febcafd66adfe0728f93e4b9b2954d793f71459 (patch)
tree45b5666f22b267d8a698374e4fad7ce57fec1c48
parent18d3fac990b9f3b5820306129feb5563b5d207f4 (diff)
SetPageLocked only defined in 2.5.x (x=?), use LockPage for 2.4.x (x>=9).
Also apply build fixes from i810_dma.c to i830_dma.c
-rw-r--r--linux-core/i810_dma.c4
-rw-r--r--linux-core/i830_dma.c8
-rw-r--r--linux/i810_dma.c4
-rw-r--r--linux/i830_dma.c8
4 files changed, 20 insertions, 4 deletions
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index 79ea3baf..f4eef3a3 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -276,8 +276,12 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index 34a9c2e3..643259fc 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -303,20 +303,24 @@ static unsigned long i830_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
static void i830_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index 79ea3baf..f4eef3a3 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -276,8 +276,12 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
diff --git a/linux/i830_dma.c b/linux/i830_dma.c
index 34a9c2e3..643259fc 100644
--- a/linux/i830_dma.c
+++ b/linux/i830_dma.c
@@ -303,20 +303,24 @@ static unsigned long i830_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_inc(&virt_to_page(address)->count);
set_bit(PG_locked, &virt_to_page(address)->flags);
#else
get_page(virt_to_page(address));
+#if LINUX_VERSION_CODE < 0x020500
+ LockPage(virt_to_page(address));
+#else
SetPageLocked(virt_to_page(address));
#endif
+#endif
return address;
}
static void i830_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
-#if LINUX_VERSION_CODE < 0x020500
+#if LINUX_VERSION_CODE < 0x020409
atomic_dec(&virt_to_page(page)->count);
clear_bit(PG_locked, &virt_to_page(page)->flags);
wake_up(&virt_to_page(page)->wait);