aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/kcore.c
diff options
context:
space:
mode:
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>2009-09-22 19:45:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:41 -0400
commit9492587cf35d370db33ef4b38375dfb35a105b61 (patch)
tree59daaf91e847d3c5cd6f542626da75db5814b06d /fs/proc/kcore.c
parenta0614da88b67ffa3dbcc0d40b817e682c7c4a0ee (diff)
kcore: register text area in generic way
Some 64bit arch has special segment for mapping kernel text. It should be entried to /proc/kcore in addtion to direct-linear-map, vmalloc area. This patch unifies KCORE_TEXT entry scattered under x86 and ia64. I'm not familiar with other archs (mips has its own even after this patch) but range of [_stext ..._end) is a valid area of text and it's not in direct-map area, defining CONFIG_ARCH_PROC_KCORE_TEXT is only a necessary thing to do. Note: I left mips as it is now. Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/kcore.c')
-rw-r--r--fs/proc/kcore.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index e10d360110bd..fdde1cc78392 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -21,6 +21,7 @@
21#include <asm/uaccess.h> 21#include <asm/uaccess.h>
22#include <asm/io.h> 22#include <asm/io.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <asm/sections.h>
24 25
25#define CORE_STR "CORE" 26#define CORE_STR "CORE"
26 27
@@ -374,10 +375,26 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
374 375
375static struct kcore_list kcore_vmalloc; 376static struct kcore_list kcore_vmalloc;
376 377
378#ifdef CONFIG_ARCH_PROC_KCORE_TEXT
379static struct kcore_list kcore_text;
380/*
381 * If defined, special segment is used for mapping kernel text instead of
382 * direct-map area. We need to create special TEXT section.
383 */
384static void __init proc_kcore_text_init(void)
385{
386 kclist_add(&kcore_text, _stext, _end - _stext, KCORE_TEXT);
387}
388#else
389static void __init proc_kcore_text_init(void)
390{
391}
392#endif
393
377static int __init proc_kcore_init(void) 394static int __init proc_kcore_init(void)
378{ 395{
379 proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); 396 proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations);
380 397 proc_kcore_text_init();
381 kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, 398 kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
382 VMALLOC_END - VMALLOC_START, KCORE_VMALLOC); 399 VMALLOC_END - VMALLOC_START, KCORE_VMALLOC);
383 return 0; 400 return 0;