diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2006-12-21 00:12:02 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:27:00 +0200 |
commit | bc3212cc1f9315c1189b1ffc93b1e0457bc8f11b (patch) | |
tree | 1ea88db8851421a4f6262dbb20a65ef7afda15d0 /i386/intel | |
parent | 2db1895b9e7aa3c961c6e1f1565459d4547862a7 (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/intel')
-rw-r--r-- | i386/intel/pmap.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index fef0d76..bd19613 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -80,6 +80,7 @@ #include <machine/thread.h> #include <i386/cpu_number.h> #include <i386/proc_reg.h> +#include <i386/locore.h> #ifdef ORC #define OLIVETTICACHE 1 @@ -547,6 +548,8 @@ vm_offset_t pmap_map_bd(virt, start, end, prot) register pt_entry_t *pte; template = pa_to_pte(start) | INTEL_PTE_VALID; + if (CPU_HAS_FEATURE(CPU_FEATURE_PGE)) + template |= INTEL_PTE_GLOBAL; if (prot & VM_PROT_WRITE) template |= INTEL_PTE_WRITE; @@ -627,6 +630,7 @@ void pmap_bootstrap() */ { vm_offset_t va; + pt_entry_t global = CPU_HAS_FEATURE(CPU_FEATURE_PGE) ? INTEL_PTE_GLOBAL : 0; /* * Map virtual memory for all known physical memory, 1-1, @@ -647,7 +651,7 @@ void pmap_bootstrap() /* Initialize the page directory entry. */ *pde = pa_to_pte((vm_offset_t)ptable) - | INTEL_PTE_VALID | INTEL_PTE_WRITE; + | INTEL_PTE_VALID | INTEL_PTE_WRITE | global; /* Initialize the page table. */ for (pte = ptable; (va < phys_last_addr) && (pte < ptable+NPTES); pte++) @@ -664,12 +668,12 @@ void pmap_bootstrap() && (va + INTEL_PGBYTES <= (vm_offset_t)etext)) { WRITE_PTE_FAST(pte, pa_to_pte(va) - | INTEL_PTE_VALID); + | INTEL_PTE_VALID | global); } else { WRITE_PTE_FAST(pte, pa_to_pte(va) - | INTEL_PTE_VALID | INTEL_PTE_WRITE); + | INTEL_PTE_VALID | INTEL_PTE_WRITE | global); } va += INTEL_PGBYTES; } |