]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] 2.4 and 2.5: fix /proc/kcore
authorRussell King <rmk@arm.linux.org.uk>
Fri, 15 Mar 2002 06:44:26 +0000 (22:44 -0800)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Fri, 15 Mar 2002 06:44:26 +0000 (22:44 -0800)
As mentioned on May 11 on LKML, here is a patch to fix /proc/kcore for
architectures which do not have RAM located at physical address 0.

fs/proc/kcore.c

index 26366a908ddcc48cb2993ae4745a0721fabfea4b..f17b3fcd53572d4310db07430198419c9da66ef6 100644 (file)
@@ -381,8 +381,13 @@ static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t
                        return tsz;
        }
 #endif
-       /* fill the remainder of the buffer from kernel VM space */
-       start = (unsigned long)__va(*fpos - elf_buflen);
+       
+       /*
+        * Fill the remainder of the buffer from kernel VM space.
+        * We said in the ELF header that the data which starts
+        * at 'elf_buflen' is virtual address PAGE_OFFSET. --rmk
+        */
+       start = PAGE_OFFSET + (*fpos - elf_buflen);
        if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
                tsz = buflen;