Commit 80d504c8 authored by Russell King's avatar Russell King Committed by Kai Germaschewski

[PATCH] 2.4 and 2.5: fix /proc/kcore

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.
parent f9deb9e6
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment