Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164764
b: refs/heads/master
c: c30bb2a
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Sep 23, 2009
1 parent bfa8c00 commit 6c1d6f8
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ef43ec772551e975a6ea7cf22b59c84955aadf9
refs/heads/master: c30bb2a25fcfde6157e6154a32c14686fb0bedbe
7 changes: 4 additions & 3 deletions trunk/arch/ia64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,10 @@ mem_init (void)

high_memory = __va(max_low_pfn * PAGE_SIZE);

kclist_add(&kcore_mem, __va(0), max_low_pfn * PAGE_SIZE);
kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_kernel, _stext, _end - _stext);
kclist_add(&kcore_mem, __va(0), max_low_pfn * PAGE_SIZE, KCORE_RAM);
kclist_add(&kcore_vmem, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);
kclist_add(&kcore_kernel, _stext, _end - _stext, KCORE_TEXT);

for_each_online_pgdat(pgdat)
if (pgdat->bdata->node_bootmem_map)
Expand Down
7 changes: 4 additions & 3 deletions trunk/arch/mips/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,12 @@ void __init mem_init(void)
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);
kclist_add(&kcore_kseg0, (void *) CKSEG0,
0x80000000 - 4, KCORE_TEXT);
#endif
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM);
kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);

printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,11 @@ static int __init setup_kcore(void)
size);
}

kclist_add(kcore_mem, __va(base), size);
kclist_add(kcore_mem, __va(base), size, KCORE_RAM);
}

kclist_add(&kcore_vmem, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);

return 0;
}
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/powerpc/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,11 @@ static int __init setup_kcore(void)
if (!kcore_mem)
panic("%s: kmalloc failed\n", __func__);

kclist_add(kcore_mem, __va(base), size);
kclist_add(kcore_mem, __va(base), size, KCORE_RAM);
}

kclist_add(&kcore_vmem, (void *)VMALLOC_START, VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_vmem, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;

kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM);
kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
VMALLOC_END - VMALLOC_START);
VMALLOC_END - VMALLOC_START, KCORE_VMALLOC);

printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, "
"%dk data, %dk init)\n",
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,9 +886,9 @@ void __init mem_init(void)
datasize = (unsigned long) &_edata - (unsigned long) &_etext;
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;

kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM);
kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);

printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, "
"%dk reserved, %dk data, %dk init, %ldk highmem)\n",
Expand Down
11 changes: 6 additions & 5 deletions trunk/arch/x86/mm/init_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,14 @@ void __init mem_init(void)
initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin;

/* Register memory areas for /proc/kcore */
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT, KCORE_RAM);
kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
VMALLOC_END-VMALLOC_START);
kclist_add(&kcore_kernel, &_stext, _end - _stext);
kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN);
VMALLOC_END-VMALLOC_START, KCORE_VMALLOC);
kclist_add(&kcore_kernel, &_stext, _end - _stext, KCORE_TEXT);
kclist_add(&kcore_modules, (void *)MODULES_VADDR, MODULES_LEN,
KCORE_OTHER);
kclist_add(&kcore_vsyscall, (void *)VSYSCALL_START,
VSYSCALL_END - VSYSCALL_START);
VSYSCALL_END - VSYSCALL_START, KCORE_OTHER);

printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
"%ldk absent, %ldk reserved, %ldk data, %ldk init)\n",
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/proc/kcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@ static LIST_HEAD(kclist_head);
static DEFINE_RWLOCK(kclist_lock);

void
kclist_add(struct kcore_list *new, void *addr, size_t size)
kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
{
new->addr = (unsigned long)addr;
new->size = size;
new->type = type;

write_lock(&kclist_lock);
list_add_tail(&new->list, &kclist_head);
Expand Down
13 changes: 11 additions & 2 deletions trunk/include/linux/proc_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,18 @@ struct proc_dir_entry {
struct list_head pde_openers; /* who did ->open, but not ->release */
};

enum kcore_type {
KCORE_TEXT,
KCORE_VMALLOC,
KCORE_RAM,
KCORE_OTHER,
};

struct kcore_list {
struct list_head list;
unsigned long addr;
size_t size;
int type;
};

struct vmcore {
Expand Down Expand Up @@ -233,11 +241,12 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm,
#endif /* CONFIG_PROC_FS */

#if !defined(CONFIG_PROC_KCORE)
static inline void kclist_add(struct kcore_list *new, void *addr, size_t size)
static inline void
kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
{
}
#else
extern void kclist_add(struct kcore_list *, void *, size_t);
extern void kclist_add(struct kcore_list *, void *, size_t, int type);
#endif

union proc_op {
Expand Down

0 comments on commit 6c1d6f8

Please sign in to comment.