aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/init.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2008-02-05 10:50:37 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-02-05 10:50:54 -0500
commit2485579bf5d3ea30d39b251defa1620ad77168bd (patch)
treeef07e9e793f7f73d69b21c539ad96d5346787182 /arch/s390/mm/init.c
parent01bc8ad165490458a8feb744c8f401c1a7098e3a (diff)
[S390] DEBUG_PAGEALLOC support for s390.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/init.c')
-rw-r--r--arch/s390/mm/init.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index b234bb4a6da7..983ec6ec0e7c 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -167,6 +167,33 @@ void __init mem_init(void)
167 PFN_ALIGN((unsigned long)&_eshared) - 1); 167 PFN_ALIGN((unsigned long)&_eshared) - 1);
168} 168}
169 169
170#ifdef CONFIG_DEBUG_PAGEALLOC
171void kernel_map_pages(struct page *page, int numpages, int enable)
172{
173 pgd_t *pgd;
174 pud_t *pud;
175 pmd_t *pmd;
176 pte_t *pte;
177 unsigned long address;
178 int i;
179
180 for (i = 0; i < numpages; i++) {
181 address = page_to_phys(page + i);
182 pgd = pgd_offset_k(address);
183 pud = pud_offset(pgd, address);
184 pmd = pmd_offset(pud, address);
185 pte = pte_offset_kernel(pmd, address);
186 if (!enable) {
187 ptep_invalidate(address, pte);
188 continue;
189 }
190 *pte = mk_pte_phys(address, __pgprot(_PAGE_TYPE_RW));
191 /* Flush cpu write queue. */
192 mb();
193 }
194}
195#endif
196
170void free_initmem(void) 197void free_initmem(void)
171{ 198{
172 unsigned long addr; 199 unsigned long addr;