Commit 3d503753 authored by Daniel Jacobowitz's avatar Daniel Jacobowitz Committed by Ralf Baechle

[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: default avatarDaniel Jacobowitz <dan@codesourcery.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent e9feeb20
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/bootmem.h> #include <linux/bootmem.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <linux/swap.h> #include <linux/swap.h>
#include <linux/proc_fs.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/cachectl.h> #include <asm/cachectl.h>
...@@ -200,6 +201,11 @@ static inline int page_is_ram(unsigned long pagenr) ...@@ -200,6 +201,11 @@ static inline int page_is_ram(unsigned long pagenr)
return 0; return 0;
} }
static struct kcore_list kcore_mem, kcore_vmalloc;
#ifdef CONFIG_64BIT
static struct kcore_list kcore_kseg0;
#endif
void __init mem_init(void) void __init mem_init(void)
{ {
unsigned long codesize, reservedpages, datasize, initsize; unsigned long codesize, reservedpages, datasize, initsize;
...@@ -249,6 +255,16 @@ void __init mem_init(void) ...@@ -249,6 +255,16 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext; datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;
#ifdef CONFIG_64BIT
if ((unsigned long) &_text > (unsigned long) CKSEG0)
/* The -4 is a hack so that user tools don't have to handle
the overflow. */
kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);
#endif
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, " printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n", "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
(unsigned long) nr_free_pages() << (PAGE_SHIFT-10), (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
......
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