summaryrefslogtreecommitdiffstats
path: root/include/asm-mips64/pgtable.h
diff options
context:
space:
mode:
authorKanoj Sarcar <kanoj@engr.sgi.com>2000-06-27 02:05:08 +0000
committerKanoj Sarcar <kanoj@engr.sgi.com>2000-06-27 02:05:08 +0000
commit8a6a74d2e0311629141438e64319fad5d657f5ac (patch)
tree3225f9a86374a4c4922e8bc126772d9f10ed5251 /include/asm-mips64/pgtable.h
parentfef84721fc04db3ce781aacf1c6e247acc7ba04b (diff)
Explain pgd/pmd allocation failure strategies. Create a global bad-pmd-table,
distinct from invalid-pmd-table for use during pmd allocation failure (so as to differentiate pgd_bad and pgd_none). The bad page table must have invalid pte entries to catch any user references to the range of virtual addresses it covers.
Diffstat (limited to 'include/asm-mips64/pgtable.h')
-rw-r--r--include/asm-mips64/pgtable.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/include/asm-mips64/pgtable.h b/include/asm-mips64/pgtable.h
index 9ba68add9..3d25fcf43 100644
--- a/include/asm-mips64/pgtable.h
+++ b/include/asm-mips64/pgtable.h
@@ -53,7 +53,12 @@ extern void (*_flush_page_to_ram)(struct page * page);
* page tables. Each page table is a single 4K page, giving 512 (==
* PTRS_PER_PTE) 8 byte ptes. Each pgde is initialized to point to
* invalid_pmd_table, each pmde is initialized to point to
- * invalid_pte_table, each pte is initialized to 0.
+ * invalid_pte_table, each pte is initialized to 0. When memory is low,
+ * and a pmd table or a page table allocation fails, empty_bad_pmd_table
+ * and empty_bad_page_table is returned back to higher layer code, so
+ * that the failure is recognized later on. Linux does not seem to
+ * handle these failures very well though. The empty_bad_page_table has
+ * invalid pte entries in it, to force page faults.
*/
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
@@ -275,13 +280,7 @@ extern inline int pmd_none(pmd_t pmd)
extern inline int pmd_bad(pmd_t pmd)
{
- return ((pmd_page(pmd) > (unsigned long) high_memory) ||
- (pmd_page(pmd) < PAGE_OFFSET));
-}
-
-extern inline int pmd_present(pmd_t pmd)
-{
- return pmd_val(pmd) != (unsigned long) invalid_pte_table;
+ return pmd_val(pmd) == (unsigned long) empty_bad_page_table;
}
extern inline void pmd_clear(pmd_t *pmdp)
@@ -299,13 +298,7 @@ extern inline int pgd_none(pgd_t pgd)
extern inline int pgd_bad(pgd_t pgd)
{
- return ((pgd_page(pgd) > (unsigned long) high_memory) ||
- (pgd_page(pgd) < PAGE_OFFSET));
-}
-
-extern inline int pgd_present(pgd_t pgd)
-{
- return pgd_val(pgd) != (unsigned long) invalid_pmd_table;
+ return pgd_val(pgd) == (unsigned long) empty_bad_pmd_table;
}
extern inline void pgd_clear(pgd_t *pgdp)
@@ -470,7 +463,7 @@ extern inline pte_t *pte_offset(pmd_t * dir, unsigned long address)
* Initialize a new pgd / pmd table with invalid pointers.
*/
extern void pgd_init(unsigned long page);
-extern void pmd_init(unsigned long page);
+extern void pmd_init(unsigned long page, unsigned long pagetable);
extern pgd_t swapper_pg_dir[1024];
extern void paging_init(void);