summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-14 01:14:58 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-14 01:14:58 +0100
commit8ffbe78a0db6a916de0f0dfba6f4d9dd8dcf20ab (patch)
treef06269b92f7d8603cd9d2a9ac7b9f4ec09487968
parent2700ef3ddc48b0e4e4f3033043e83b257ae87ff4 (diff)
Simplify i386at_init
* i386/i386at/model_dep.c (i386at_init): Do not copy linear into virtual kernel mapping when they are equal, and do not drop the former either. Use the function `i' variable.
-rw-r--r--i386/i386at/model_dep.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 2f78520..1fc1bf9 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -388,21 +388,20 @@ i386at_init(void)
* Also, set the WP bit so that on 486 or better processors
* page-level write protection works in kernel mode.
*/
+#if VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS
init_alloc_aligned(0, &addr);
nb_direct = (addr + NPTES * PAGE_SIZE - 1) / (NPTES * PAGE_SIZE);
for (i = 0; i < nb_direct; i++)
kernel_page_dir[lin2pdenum(VM_MIN_KERNEL_ADDRESS) + i] =
kernel_page_dir[lin2pdenum(LINEAR_MIN_KERNEL_ADDRESS) + i];
+#endif
#ifdef MACH_XEN
- {
- int i;
- for (i = 0; i < PDPNUM; i++)
- pmap_set_page_readonly_init((void*) kernel_page_dir + i * INTEL_PGBYTES);
+ for (i = 0; i < PDPNUM; i++)
+ pmap_set_page_readonly_init((void*) kernel_page_dir + i * INTEL_PGBYTES);
#if PAE
- pmap_set_page_readonly_init(kernel_pmap->pdpbase);
+ pmap_set_page_readonly_init(kernel_pmap->pdpbase);
#endif /* PAE */
- }
#endif /* MACH_XEN */
#if PAE
set_cr3((unsigned)_kvtophys(kernel_pmap->pdpbase));
@@ -442,6 +441,7 @@ i386at_init(void)
ldt_init();
ktss_init();
+#if VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS
/* Get rid of the temporary direct mapping and flush it out of the TLB. */
for (i = 0 ; i < nb_direct; i++) {
#ifdef MACH_XEN
@@ -455,6 +455,7 @@ i386at_init(void)
kernel_page_dir[lin2pdenum(VM_MIN_KERNEL_ADDRESS) + i] = 0;
#endif /* MACH_XEN */
}
+#endif
/* Not used after boot, better give it back. */
#ifdef MACH_XEN