summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBrian Gerst <bgerst@didntduck.org>2002-05-28 08:02:27 -0700
committerPatrick Mochel <mochel@osdl.org>2002-05-28 08:02:27 -0700
commit131ca9c01cb0a5f92fba696172b383a732ec4999 (patch)
tree357cdaaca5c95bc188c03afbfad8c8b4674a6cd4 /include
parent81d3703c91362e807fe9c2add426f8329f4e0c5d (diff)
[PATCH] i386 mm init cleanup part 1
This revised patch starts untangling the mess in arch/i386/mm/init.c - Pull setting bits in cr4 out of the loop - Make __PAGE_KERNEL a variable and cache the global bit there. - New pfn_pmd() for large pages.
Diffstat (limited to 'include')
-rw-r--r--include/asm-i386/pgtable-2level.h1
-rw-r--r--include/asm-i386/pgtable-3level.h5
-rw-r--r--include/asm-i386/pgtable.h31
3 files changed, 17 insertions, 20 deletions
diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-i386/pgtable-2level.h
index 3b59d04f9d36..e22db0cc6824 100644
--- a/include/asm-i386/pgtable-2level.h
+++ b/include/asm-i386/pgtable-2level.h
@@ -60,5 +60,6 @@ static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
#define pte_none(x) (!(x).pte_low)
#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT)))
#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
+#define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
#endif /* _I386_PGTABLE_2LEVEL_H */
diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-i386/pgtable-3level.h
index c396e7454930..bb2eaea63fde 100644
--- a/include/asm-i386/pgtable-3level.h
+++ b/include/asm-i386/pgtable-3level.h
@@ -99,4 +99,9 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot)
return pte;
}
+static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
+{
+ return __pmd(((unsigned long long)page_nr << PAGE_SHIFT) | pgprot_val(pgprot));
+}
+
#endif /* _I386_PGTABLE_3LEVEL_H */
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index 42dd1a33d618..8785225614da 100644
--- a/include/asm-i386/pgtable.h
+++ b/include/asm-i386/pgtable.h
@@ -132,27 +132,18 @@ extern void pgtable_cache_init(void);
#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
-#define __PAGE_KERNEL \
+#define _PAGE_KERNEL \
(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
-#define __PAGE_KERNEL_NOCACHE \
- (_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_PCD | _PAGE_ACCESSED)
-#define __PAGE_KERNEL_RO \
- (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED)
-
-# define MAKE_GLOBAL(x) \
- ({ \
- pgprot_t __ret; \
- \
- if (cpu_has_pge) \
- __ret = __pgprot((x) | _PAGE_GLOBAL); \
- else \
- __ret = __pgprot(x); \
- __ret; \
- })
-
-#define PAGE_KERNEL MAKE_GLOBAL(__PAGE_KERNEL)
-#define PAGE_KERNEL_RO MAKE_GLOBAL(__PAGE_KERNEL_RO)
-#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
+
+extern unsigned long __PAGE_KERNEL;
+#define __PAGE_KERNEL_RO (__PAGE_KERNEL & ~_PAGE_RW)
+#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD)
+#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
+
+#define PAGE_KERNEL __pgprot(__PAGE_KERNEL)
+#define PAGE_KERNEL_RO __pgprot(__PAGE_KERNEL_RO)
+#define PAGE_KERNEL_NOCACHE __pgprot(__PAGE_KERNEL_NOCACHE)
+#define PAGE_KERNEL_LARGE __pgprot(__PAGE_KERNEL_LARGE)
/*
* The i386 can't do page protection for execute, and considers that