Re: Should /dev/kmem support above 0x80000000 area?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ralf Baechle wrote:
> 
> Send me the patch and I'll comment.
> 
>   Ralf

Here is my patch.  I think it should be safe for mips64.  Please double check
it.

Jun
diff -Nru linux/drivers/char/mem.c.orig linux/drivers/char/mem.c
--- linux/drivers/char/mem.c.orig	Mon Dec 11 22:07:19 2000
+++ linux/drivers/char/mem.c	Mon Dec 11 22:38:11 2000
@@ -258,6 +258,14 @@
 		count -= read;
 	}
 
+#if defined(__mips__)
+        if (KSEGX(p)) {
+		if (copy_to_user(buf, (char*)p, count))
+			return -EFAULT;
+		return count+read;
+	}
+#endif
+
 	kbuf = (char *)__get_free_page(GFP_KERNEL);
 	if (!kbuf)
 		return -ENOMEM;
@@ -288,6 +296,12 @@
 			  size_t count, loff_t *ppos)
 {
 	unsigned long p = *ppos;
+
+#if defined(__mips__)
+        if (KSEGX(p)) {
+		return do_write_mem(file, (void*)p, p, buf, count, ppos);
+	}
+#endif
 
 	if (p >= (unsigned long) high_memory)
 		return 0;

[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux