aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/mm/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/mm/init.c')
-rw-r--r--arch/ppc/mm/init.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/arch/ppc/mm/init.c b/arch/ppc/mm/init.c
index f421a4b337f6..99b48abd3296 100644
--- a/arch/ppc/mm/init.c
+++ b/arch/ppc/mm/init.c
@@ -69,15 +69,12 @@ int init_bootmem_done;
69int boot_mapsize; 69int boot_mapsize;
70#ifdef CONFIG_PPC_PMAC 70#ifdef CONFIG_PPC_PMAC
71unsigned long agp_special_page; 71unsigned long agp_special_page;
72EXPORT_SYMBOL(agp_special_page);
72#endif 73#endif
73 74
74extern char _end[]; 75extern char _end[];
75extern char etext[], _stext[]; 76extern char etext[], _stext[];
76extern char __init_begin, __init_end; 77extern char __init_begin, __init_end;
77extern char __prep_begin, __prep_end;
78extern char __chrp_begin, __chrp_end;
79extern char __pmac_begin, __pmac_end;
80extern char __openfirmware_begin, __openfirmware_end;
81 78
82#ifdef CONFIG_HIGHMEM 79#ifdef CONFIG_HIGHMEM
83pte_t *kmap_pte; 80pte_t *kmap_pte;
@@ -167,14 +164,6 @@ void free_initmem(void)
167 164
168 printk ("Freeing unused kernel memory:"); 165 printk ("Freeing unused kernel memory:");
169 FREESEC(init); 166 FREESEC(init);
170 if (_machine != _MACH_Pmac)
171 FREESEC(pmac);
172 if (_machine != _MACH_chrp)
173 FREESEC(chrp);
174 if (_machine != _MACH_prep)
175 FREESEC(prep);
176 if (!have_of)
177 FREESEC(openfirmware);
178 printk("\n"); 167 printk("\n");
179 ppc_md.progress = NULL; 168 ppc_md.progress = NULL;
180#undef FREESEC 169#undef FREESEC
@@ -648,18 +637,16 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address,
648 */ 637 */
649int page_is_ram(unsigned long pfn) 638int page_is_ram(unsigned long pfn)
650{ 639{
651 unsigned long paddr = (pfn << PAGE_SHIFT); 640 return pfn < max_pfn;
652
653 return paddr < __pa(high_memory);
654} 641}
655 642
656pgprot_t phys_mem_access_prot(struct file *file, unsigned long addr, 643pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
657 unsigned long size, pgprot_t vma_prot) 644 unsigned long size, pgprot_t vma_prot)
658{ 645{
659 if (ppc_md.phys_mem_access_prot) 646 if (ppc_md.phys_mem_access_prot)
660 return ppc_md.phys_mem_access_prot(file, addr, size, vma_prot); 647 return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
661 648
662 if (!page_is_ram(addr >> PAGE_SHIFT)) 649 if (!page_is_ram(pfn))
663 vma_prot = __pgprot(pgprot_val(vma_prot) 650 vma_prot = __pgprot(pgprot_val(vma_prot)
664 | _PAGE_GUARDED | _PAGE_NO_CACHE); 651 | _PAGE_GUARDED | _PAGE_NO_CACHE);
665 return vma_prot; 652 return vma_prot;