aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNick Piggin <nickpiggin@yahoo.com.au>2004-12-31 22:01:24 -0800
committerLinus Torvalds <torvalds@evo.osdl.org>2004-12-31 22:01:24 -0800
commitf1b32486abadc26b78180d205a2eae4178905d4a (patch)
tree93fdf967e86860ed8886271bf29a108a6031a355 /mm
parent31382a8d8303ce517d768117cce7317e6198fe54 (diff)
downloadhistory-f1b32486abadc26b78180d205a2eae4178905d4a.tar.gz
[PATCH] introduce fallback header
Add a temporary "fallback" header so architectures can run with the 4level patgetables patch without modification. All architectures should be converted to use the folding headers (include/asm-generic/pgtable-nop?d.h) as soon as possible, and the fallback header removed. Make all architectures include the fallback header, except i386, because that architecture has earlier been converted to use pgtable-nopmd.h under the 3 level system, which is not compatible with the fallback header. Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 9ee13e2713717c..281a7bdd3dd49b 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1940,6 +1940,7 @@ int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct * vma,
return VM_FAULT_OOM;
}
+#ifndef __ARCH_HAS_4LEVEL_HACK
#if (PTRS_PER_PGD > 1)
/*
* Allocate page upper directory.
@@ -2007,6 +2008,30 @@ out:
return pmd_offset(pud, address);
}
#endif
+#else
+pmd_t fastcall *__pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
+{
+ pmd_t *new;
+
+ spin_unlock(&mm->page_table_lock);
+ new = pmd_alloc_one(mm, address);
+ spin_lock(&mm->page_table_lock);
+ if (!new)
+ return NULL;
+
+ /*
+ * Because we dropped the lock, we should re-check the
+ * entry, as somebody else could have populated it..
+ */
+ if (pgd_present(*pud)) {
+ pmd_free(new);
+ goto out;
+ }
+ pgd_populate(mm, pud, new);
+out:
+ return pmd_offset(pud, address);
+}
+#endif
int make_pages_present(unsigned long addr, unsigned long end)
{