patch-2.4.0-test6 linux/drivers/char/drm/memory.c

Next file: linux/drivers/char/drm/mga_context.c
Previous file: linux/drivers/char/drm/i810_drv.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test5/linux/drivers/char/drm/memory.c linux/drivers/char/drm/memory.c
@@ -30,7 +30,9 @@
  */
 
 #define __NO_VERSION__
+#include <linux/config.h>
 #include "drmP.h"
+#include <linux/wrapper.h>
 
 typedef struct drm_mem_stats {
 	const char	  *name;
@@ -245,7 +247,12 @@
 	for (addr = address, sz = bytes;
 	     sz > 0;
 	     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
+#if LINUX_VERSION_CODE >= 0x020400
+				/* Argument type changed in 2.4.0-test6/pre8 */
+		mem_map_reserve(virt_to_page(addr));
+#else
 		mem_map_reserve(MAP_NR(addr));
+#endif
 	}
 	
 	return address;
@@ -266,7 +273,12 @@
 		for (addr = address, sz = bytes;
 		     sz > 0;
 		     addr += PAGE_SIZE, sz -= PAGE_SIZE) {
+#if LINUX_VERSION_CODE >= 0x020400
+				/* Argument type changed in 2.4.0-test6/pre8 */
+			mem_map_unreserve(virt_to_page(addr));
+#else
 			mem_map_unreserve(MAP_NR(addr));
+#endif
 		}
 		free_pages(address, order);
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)