summaryrefslogtreecommitdiff
path: root/i386/i386at
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2006-12-21 00:12:02 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:00 +0200
commitbc3212cc1f9315c1189b1ffc93b1e0457bc8f11b (patch)
tree1ea88db8851421a4f6262dbb20a65ef7afda15d0 /i386/i386at
parent2db1895b9e7aa3c961c6e1f1565459d4547862a7 (diff)
2006-12-19 Samuel Thibault <samuel.thibault@ens-lyon.org>
Add support for global pages. * i386/i386at/model_dep.c: Include <i386/locore.h>. (i386at_init): Set CR4_PGE if available. (c_boot_entry): Call discover_x86_cpu_type() before i386at_init(). * i386/intel/pmap.c: Include <i386/locore.h>. (pmap_map_bd): Use INTEL_PTE_GLOBAL if available. (pmap_bootstrap): Likewise.
Diffstat (limited to 'i386/i386at')
-rw-r--r--i386/i386at/model_dep.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 9f0a1c7..9d6b030 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -50,6 +50,7 @@
#include <i386/machspl.h>
#include <i386/pmap.h>
#include <i386/proc_reg.h>
+#include <i386/locore.h>
/* Location of the kernel's symbol table.
Both of these are 0 if none is available. */
@@ -264,6 +265,8 @@ i386at_init()
kernel_page_dir[lin2pdenum(0)] =
kernel_page_dir[lin2pdenum(LINEAR_MIN_KERNEL_ADDRESS)];
set_cr3((unsigned)kernel_page_dir);
+ if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))
+ set_cr4(get_cr4() | CR4_PGE);
set_cr0(get_cr0() | CR0_PG | CR0_WP);
flush_instr_queue();
@@ -301,6 +304,7 @@ void c_boot_entry(vm_offset_t bi)
{
/* Stash the boot_image_info pointer. */
boot_info = *(struct multiboot_info*)phystokv(bi);
+ int cpu_type;
/* XXX we currently assume phys_mem_va is always 0 here -
if it isn't, we must tweak the pointers in the boot_info. */
@@ -337,6 +341,8 @@ void c_boot_entry(vm_offset_t bi)
}
#endif /* MACH_KDB */
+ cpu_type = discover_x86_cpu_type ();
+
/*
* Do basic VM initialization
*/
@@ -367,7 +373,7 @@ void c_boot_entry(vm_offset_t bi)
machine_slot[0].running = TRUE;
machine_slot[0].cpu_subtype = CPU_SUBTYPE_AT386;
- switch (discover_x86_cpu_type ())
+ switch (cpu_type)
{
case 3:
default: