]> err.no Git - linux-2.6/blobdiff - arch/s390/mm/init.c
Merge branch 'virtex-for-2.6.25' of git://git.secretlab.ca/git/linux-2.6-virtex into...
[linux-2.6] / arch / s390 / mm / init.c
index b234bb4a6da7545d5ab8b5ed7387fb7b3c25b994..983ec6ec0e7cc6c85800eea42068196a5fbdbc28 100644 (file)
@@ -167,6 +167,33 @@ void __init mem_init(void)
               PFN_ALIGN((unsigned long)&_eshared) - 1);
 }
 
+#ifdef CONFIG_DEBUG_PAGEALLOC
+void kernel_map_pages(struct page *page, int numpages, int enable)
+{
+       pgd_t *pgd;
+       pud_t *pud;
+       pmd_t *pmd;
+       pte_t *pte;
+       unsigned long address;
+       int i;
+
+       for (i = 0; i < numpages; i++) {
+               address = page_to_phys(page + i);
+               pgd = pgd_offset_k(address);
+               pud = pud_offset(pgd, address);
+               pmd = pmd_offset(pud, address);
+               pte = pte_offset_kernel(pmd, address);
+               if (!enable) {
+                       ptep_invalidate(address, pte);
+                       continue;
+               }
+               *pte = mk_pte_phys(address, __pgprot(_PAGE_TYPE_RW));
+               /* Flush cpu write queue. */
+               mb();
+       }
+}
+#endif
+
 void free_initmem(void)
 {
         unsigned long addr;