patch-2.3.31 linux/arch/i386/mm/ioremap.c

Next file: linux/arch/m68k/config.in
Previous file: linux/arch/i386/kernel/time.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.30/linux/arch/i386/mm/ioremap.c linux/arch/i386/mm/ioremap.c
@@ -119,8 +119,18 @@
 	/*
 	 * Don't allow anybody to remap normal RAM that we're using..
 	 */
-	if (phys_addr < virt_to_phys(high_memory))
-		return NULL;
+	if (phys_addr < virt_to_phys(high_memory)) {
+		char *t_addr, *t_end;
+		int i;
+
+		t_addr = __va(phys_addr);
+		t_end = t_addr + (size - 1);
+	   
+		for(i = MAP_NR(t_addr); i < MAP_NR(t_end); i++) {
+			if(!PageReserved(mem_map + i))
+				return NULL;
+		}
+	}
 
 	/*
 	 * Mappings have to be page-aligned

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