diff options
author | dyson <dyson@FreeBSD.org> | 1998-05-11 08:11:57 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1998-05-11 08:11:57 +0000 |
commit | 5e821e40bcda4e807fe3192ac3cd36d7399a23b4 (patch) | |
tree | efd9eca1d0d76ae5b6cd4bbac86fec87d7aac0b1 | |
parent | f2c6244512d23e45d1cc1876558c7c1f64dfc268 (diff) | |
download | FreeBSD-src-5e821e40bcda4e807fe3192ac3cd36d7399a23b4.zip FreeBSD-src-5e821e40bcda4e807fe3192ac3cd36d7399a23b4.tar.gz |
Change some tests from CPU_CLASS686 to CPU_686 as appropriate, and
also correct a serious ommision that would cause process faulures
due to forgetting an invltlb type operatino. This was just a
transcription problem.
-rw-r--r-- | sys/amd64/amd64/pmap.c | 26 | ||||
-rw-r--r-- | sys/i386/i386/pmap.c | 26 |
2 files changed, 36 insertions, 16 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 6c0260c..ee74a72 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.194 1998/05/11 01:06:08 dyson Exp $ + * $Id: pmap.c,v 1.195 1998/05/11 02:13:42 dyson Exp $ */ /* @@ -449,7 +449,7 @@ getmtrr() { int i; - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { for(i = 0; i < NPPROVMTRR; i++) { PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2); PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2); @@ -462,7 +462,7 @@ putmtrr() { int i; - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { wbinvd(); for(i = 0; i < NPPROVMTRR; i++) { wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base); @@ -474,7 +474,7 @@ putmtrr() void pmap_setvidram(void) { - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { wbinvd(); /* * Set memory between 0-640K to be WB @@ -496,7 +496,7 @@ pmap_setdevram(unsigned long long basea, vm_offset_t sizea) unsigned long long base; unsigned long long mask; - if (cpu_class != CPUCLASS_686) + if (cpu != CPU_686) return; free = -1; @@ -2773,7 +2773,7 @@ pmap_zero_page(phys) cpu_invlpg(&prv_CPAGE3); #if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) + if (cpu == CPU_686) i686_pagezero(&prv_CPAGE3); else #endif @@ -2787,10 +2787,14 @@ pmap_zero_page(phys) #endif *(int *) CMAP2 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - invltlb_1pg(CADDR2); + if (cpu_class == CPUCLASS_386) { + invltlb(); + } else { + invlpg((u_int)CADDR2); + } #if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) + if (cpu == CPU_686) i686_pagezero(CADDR2); else #endif @@ -2836,6 +2840,12 @@ pmap_copy_page(src, dst) *(int *) CMAP1 = PG_V | (src & PG_FRAME) | PG_A; *(int *) CMAP2 = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; + if (cpu_class == CPUCLASS_386) { + invltlb(); + } else { + invlpg((u_int)CADDR1); + invlpg((u_int)CADDR2); + } bcopy(CADDR1, CADDR2, PAGE_SIZE); diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 6c0260c..ee74a72 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * $Id: pmap.c,v 1.194 1998/05/11 01:06:08 dyson Exp $ + * $Id: pmap.c,v 1.195 1998/05/11 02:13:42 dyson Exp $ */ /* @@ -449,7 +449,7 @@ getmtrr() { int i; - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { for(i = 0; i < NPPROVMTRR; i++) { PPro_vmtrr[i].base = rdmsr(PPRO_VMTRRphysBase0 + i * 2); PPro_vmtrr[i].mask = rdmsr(PPRO_VMTRRphysMask0 + i * 2); @@ -462,7 +462,7 @@ putmtrr() { int i; - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { wbinvd(); for(i = 0; i < NPPROVMTRR; i++) { wrmsr(PPRO_VMTRRphysBase0 + i * 2, PPro_vmtrr[i].base); @@ -474,7 +474,7 @@ putmtrr() void pmap_setvidram(void) { - if (cpu_class == CPUCLASS_686) { + if (cpu == CPU_686) { wbinvd(); /* * Set memory between 0-640K to be WB @@ -496,7 +496,7 @@ pmap_setdevram(unsigned long long basea, vm_offset_t sizea) unsigned long long base; unsigned long long mask; - if (cpu_class != CPUCLASS_686) + if (cpu != CPU_686) return; free = -1; @@ -2773,7 +2773,7 @@ pmap_zero_page(phys) cpu_invlpg(&prv_CPAGE3); #if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) + if (cpu == CPU_686) i686_pagezero(&prv_CPAGE3); else #endif @@ -2787,10 +2787,14 @@ pmap_zero_page(phys) #endif *(int *) CMAP2 = PG_V | PG_RW | (phys & PG_FRAME) | PG_A | PG_M; - invltlb_1pg(CADDR2); + if (cpu_class == CPUCLASS_386) { + invltlb(); + } else { + invlpg((u_int)CADDR2); + } #if defined(I686_CPU) - if (cpu_class == CPUCLASS_686) + if (cpu == CPU_686) i686_pagezero(CADDR2); else #endif @@ -2836,6 +2840,12 @@ pmap_copy_page(src, dst) *(int *) CMAP1 = PG_V | (src & PG_FRAME) | PG_A; *(int *) CMAP2 = PG_V | PG_RW | (dst & PG_FRAME) | PG_A | PG_M; + if (cpu_class == CPUCLASS_386) { + invltlb(); + } else { + invlpg((u_int)CADDR1); + invlpg((u_int)CADDR2); + } bcopy(CADDR1, CADDR2, PAGE_SIZE); |