Skip to contentSkip to conversation

x86 mm/init.c

PATCH New Brian Gerst 1 participant 1 message Apr 24, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86 mm/init.c

This patch cleans up pagetable_init by
- pulling the setting of %cr4 out of the loops, only set them once.
- improve readability of the loops.
- change PAGE_KERNEL and friends to variables to avoid checking cpu_has_pge all the time.

All pageing modes (PAE/PSE) have been tested.

Signature · 1 line
						Brian Gerst
arch/i386/kernel/i386_ksyms.c +4 -0
diff -urN linux-2.5.9/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c
@@ -174,3 +174,7 @@
 
 extern int is_sony_vaio_laptop;
 EXPORT_SYMBOL(is_sony_vaio_laptop);
+
+EXPORT_SYMBOL(PAGE_KERNEL);
+EXPORT_SYMBOL(PAGE_KERNEL_RO);
+EXPORT_SYMBOL(PAGE_KERNEL_NOCACHE);
arch/i386/mm/init.c +34 -39

103 lines not on this page · raw message

include/asm-i386/pgtable.h +1 -14
diff -urN linux-2.5.9/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h
@@ -139,20 +139,7 @@
 #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 pgprot_t PAGE_KERNEL, PAGE_KERNEL_RO, PAGE_KERNEL_NOCACHE;
 
 /*
  * The i386 can't do page protection for execute, and considers that