diff options
| author | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-28 08:29:59 -0400 |
|---|---|---|
| committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-28 08:29:59 -0400 |
| commit | 185a257f2f73bcd89050ad02da5bedbc28fc43fa (patch) | |
| tree | 5e32586114534ed3f2165614cba3d578f5d87307 /arch/sh/mm/init.c | |
| parent | 3f1a9aaeffd8d1cbc5ab9776c45cbd66af1c9699 (diff) | |
| parent | a77c64c1a641950626181b4857abb701d8f38ccc (diff) | |
Merge branch 'master' into gfs2
Diffstat (limited to 'arch/sh/mm/init.c')
| -rw-r--r-- | arch/sh/mm/init.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8ea27ca4b700..7154d1ce9785 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
| @@ -24,7 +24,7 @@ | |||
| 24 | #include <linux/highmem.h> | 24 | #include <linux/highmem.h> |
| 25 | #include <linux/bootmem.h> | 25 | #include <linux/bootmem.h> |
| 26 | #include <linux/pagemap.h> | 26 | #include <linux/pagemap.h> |
| 27 | 27 | #include <linux/proc_fs.h> | |
| 28 | #include <asm/processor.h> | 28 | #include <asm/processor.h> |
| 29 | #include <asm/system.h> | 29 | #include <asm/system.h> |
| 30 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
| @@ -80,6 +80,7 @@ void show_mem(void) | |||
| 80 | static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) | 80 | static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) |
| 81 | { | 81 | { |
| 82 | pgd_t *pgd; | 82 | pgd_t *pgd; |
| 83 | pud_t *pud; | ||
| 83 | pmd_t *pmd; | 84 | pmd_t *pmd; |
| 84 | pte_t *pte; | 85 | pte_t *pte; |
| 85 | 86 | ||
| @@ -89,7 +90,17 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot) | |||
| 89 | return; | 90 | return; |
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | pmd = pmd_offset(pgd, addr); | 93 | pud = pud_offset(pgd, addr); |
| 94 | if (pud_none(*pud)) { | ||
| 95 | pmd = (pmd_t *)get_zeroed_page(GFP_ATOMIC); | ||
| 96 | set_pud(pud, __pud(__pa(pmd) | _KERNPG_TABLE | _PAGE_USER)); | ||
| 97 | if (pmd != pmd_offset(pud, 0)) { | ||
| 98 | pud_ERROR(*pud); | ||
| 99 | return; | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 103 | pmd = pmd_offset(pud, addr); | ||
| 93 | if (pmd_none(*pmd)) { | 104 | if (pmd_none(*pmd)) { |
| 94 | pte = (pte_t *)get_zeroed_page(GFP_ATOMIC); | 105 | pte = (pte_t *)get_zeroed_page(GFP_ATOMIC); |
| 95 | set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER)); | 106 | set_pmd(pmd, __pmd(__pa(pte) | _KERNPG_TABLE | _PAGE_USER)); |
| @@ -212,6 +223,8 @@ void __init paging_init(void) | |||
| 212 | free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); | 223 | free_area_init_node(0, NODE_DATA(0), zones_size, __MEMORY_START >> PAGE_SHIFT, 0); |
| 213 | } | 224 | } |
| 214 | 225 | ||
| 226 | static struct kcore_list kcore_mem, kcore_vmalloc; | ||
| 227 | |||
| 215 | void __init mem_init(void) | 228 | void __init mem_init(void) |
| 216 | { | 229 | { |
| 217 | extern unsigned long empty_zero_page[1024]; | 230 | extern unsigned long empty_zero_page[1024]; |
| @@ -237,8 +250,13 @@ void __init mem_init(void) | |||
| 237 | * Setup wrappers for copy/clear_page(), these will get overridden | 250 | * Setup wrappers for copy/clear_page(), these will get overridden |
| 238 | * later in the boot process if a better method is available. | 251 | * later in the boot process if a better method is available. |
| 239 | */ | 252 | */ |
| 253 | #ifdef CONFIG_MMU | ||
| 240 | copy_page = copy_page_slow; | 254 | copy_page = copy_page_slow; |
| 241 | clear_page = clear_page_slow; | 255 | clear_page = clear_page_slow; |
| 256 | #else | ||
| 257 | copy_page = copy_page_nommu; | ||
| 258 | clear_page = clear_page_nommu; | ||
| 259 | #endif | ||
| 242 | 260 | ||
| 243 | /* this will put all low memory onto the freelists */ | 261 | /* this will put all low memory onto the freelists */ |
| 244 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); | 262 | totalram_pages += free_all_bootmem_node(NODE_DATA(0)); |
| @@ -254,7 +272,12 @@ void __init mem_init(void) | |||
| 254 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; | 272 | datasize = (unsigned long) &_edata - (unsigned long) &_etext; |
| 255 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; | 273 | initsize = (unsigned long) &__init_end - (unsigned long) &__init_begin; |
| 256 | 274 | ||
| 257 | printk("Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init)\n", | 275 | kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT); |
| 276 | kclist_add(&kcore_vmalloc, (void *)VMALLOC_START, | ||
| 277 | VMALLOC_END - VMALLOC_START); | ||
| 278 | |||
| 279 | printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, " | ||
| 280 | "%dk reserved, %dk data, %dk init)\n", | ||
| 258 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), | 281 | (unsigned long) nr_free_pages() << (PAGE_SHIFT-10), |
| 259 | max_mapnr << (PAGE_SHIFT-10), | 282 | max_mapnr << (PAGE_SHIFT-10), |
| 260 | codesize >> 10, | 283 | codesize >> 10, |
| @@ -263,6 +286,9 @@ void __init mem_init(void) | |||
| 263 | initsize >> 10); | 286 | initsize >> 10); |
| 264 | 287 | ||
| 265 | p3_cache_init(); | 288 | p3_cache_init(); |
| 289 | |||
| 290 | /* Initialize the vDSO */ | ||
| 291 | vsyscall_init(); | ||
| 266 | } | 292 | } |
| 267 | 293 | ||
| 268 | void free_initmem(void) | 294 | void free_initmem(void) |
