aboutsummaryrefslogtreecommitdiff
path: root/i386/intel/pmap.c
diff options
context:
space:
mode:
authorMasanori Ogino <masanori.ogino@gmail.com>2020-11-08 02:27:12 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-11-08 03:12:05 +0100
commit9dbc292eed8c9971f4b9e26b30d0e3d65ef9c629 (patch)
tree07ef1fcb2da234287cfb5c933928a4f4cc066f9b /i386/intel/pmap.c
parentd0aee051a980557ded97d00e74446bddecf161cc (diff)
downloadgnumach-9dbc292eed8c9971f4b9e26b30d0e3d65ef9c629.tar.gz
gnumach-9dbc292eed8c9971f4b9e26b30d0e3d65ef9c629.tar.bz2
gnumach-9dbc292eed8c9971f4b9e26b30d0e3d65ef9c629.zip
i386 pmap: Omit pmap workaround on i486 or later.
As described in XXX comments, the workaround for memory mapping is implemented for 80386 and it is unnecessary on i486 or later. Thus, it is safe to omit that if the kernel is built for the recent (1989~) processors. Fuhito Inagawa pointed out the problem to me. * i386/i386/trap.c (kernel_trap): Disable the workaround when the kernel is built for i[456]86. * i386/intel/pmap.c (pmap_protect, pmap_enter): Ditto. * i386/intel/read_fault.c: Define intel_read_fault if and only if it is necessary.
Diffstat (limited to 'i386/intel/pmap.c')
-rw-r--r--i386/intel/pmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index 1d214401..347474a9 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -1879,17 +1879,17 @@ void pmap_protect(
return;
}
+#if !(__i486__ || __i586__ || __i686__)
/*
* If write-protecting in the kernel pmap,
* remove the mappings; the i386 ignores
* the write-permission bit in kernel mode.
- *
- * XXX should be #if'd for i386
*/
if (map == kernel_pmap) {
pmap_remove(map, s, e);
return;
}
+#endif
SPLVM(spl);
simple_lock(&map->lock);
@@ -1981,14 +1981,13 @@ void pmap_enter(
if (pmap == kernel_pmap && (v < kernel_virtual_start || v >= kernel_virtual_end))
panic("pmap_enter(%lx, %llx) falls in physical memory area!\n", v, (unsigned long long) pa);
#endif
+#if !(__i486__ || __i586__ || __i686__)
if (pmap == kernel_pmap && (prot & VM_PROT_WRITE) == 0
&& !wired /* hack for io_wire */ ) {
/*
* Because the 386 ignores write protection in kernel mode,
* we cannot enter a read-only kernel mapping, and must
* remove an existing mapping if changing it.
- *
- * XXX should be #if'd for i386
*/
PMAP_READ_LOCK(pmap, spl);
@@ -2005,6 +2004,7 @@ void pmap_enter(
PMAP_READ_UNLOCK(pmap, spl);
return;
}
+#endif
/*
* Must allocate a new pvlist entry while we're unlocked;