diff options
author | Daniel Jacobowitz <dan@debian.org> | 2005-01-20 19:59:54 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-07 08:30:25 -0500 |
commit | 3d503753b40469b6a19dcc3511f6eb8c55f6d122 (patch) | |
tree | e4c3f167c94633e2b10dede3ed80c2c03807c6ec /arch/mips/mm/init.c | |
parent | e9feeb207e55373f718b33e0d6cb0c2f8b58f3c1 (diff) |
[MIPS] Support /proc/kcore for MIPS
I'm pretty sure that the CKSEG0 bits are wrong, but I did need to
cover that region - because the SB-1 kernel links at 0xffffffff80100000
or so, disassembly and printing static variables don't work unless the
debugger can read that region.
Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/init.c')
-rw-r--r-- | arch/mips/mm/init.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 4ee91c9a556f..0ff9a348b843 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/bootmem.h> | 24 | #include <linux/bootmem.h> |
25 | #include <linux/highmem.h> | 25 | #include <linux/highmem.h> |
26 | #include <linux/swap.h> | 26 | #include <linux/swap.h> |
27 | #include <linux/proc_fs.h> | ||
27 | 28 | ||
28 | #include <asm/bootinfo.h> | 29 | #include <asm/bootinfo.h> |
29 | #include <asm/cachectl.h> | 30 | #include <asm/cachectl.h> |
@@ -200,6 +201,11 @@ static inline int page_is_ram(unsigned long pagenr) | |||
200 | return 0; | 201 | return 0; |
201 | } | 202 | } |
202 | 203 | ||
204 | static struct kcore_list kcore_mem, kcore_vmalloc; | ||
205 | #ifdef CONFIG_64BIT | ||
206 | static struct kcore_list kcore_kseg0; | ||
207 | #endif | ||
208 | |||
203 | void __init mem_init(void) | 209 | void __init mem_init(void) |
204 | { | 210 | { |
205 | unsigned long codesize, reservedpages, datasize, initsize; | 211 | unsigned long codesize, reservedpages, datasize, initsize; |
@@ -249,6 +255,16 @@ void __init mem_init(void) | |||
249 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 255 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
250 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 256 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
251 | 257 | ||
258 | #ifdef CONFIG_64BIT | ||
259 | if ((unsigned long) &_text > (unsigned long) CKSEG0) | ||
260 | /* The -4 is a hack so that user tools don't have to handle | ||
261 | the overflow. */ | ||
262 | kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4); | ||
263 | #endif | ||
264 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); | ||
265 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
266 | VMALLOC_END-VMALLOC_START); | ||
267 | |||
252 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " | 268 | printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " |
253 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", | 269 | "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", |
254 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 270 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |