1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-19 10:53:58 +00:00

invlpg() does not work too well on i386 cpus. Add token i386 support

back in to the pmap_zero_page* stuff.
This commit is contained in:
Peter Wemm 2002-07-13 21:03:08 +00:00
parent 006490441d
commit 96fd5002b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=99930
2 changed files with 24 additions and 2 deletions

View File

@ -2724,10 +2724,14 @@ pmap_zero_page(vm_page_t m)
if (*CMAP2) if (*CMAP2)
panic("pmap_zero_page: CMAP2 busy"); panic("pmap_zero_page: CMAP2 busy");
*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin2; curthread->td_switchin = pmap_zpi_switchin2;
#endif #endif
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686) if (cpu_class == CPUCLASS_686)
i686_pagezero(CADDR2); i686_pagezero(CADDR2);
@ -2755,10 +2759,14 @@ pmap_zero_page_area(vm_page_t m, int off, int size)
if (*CMAP2) if (*CMAP2)
panic("pmap_zero_page: CMAP2 busy"); panic("pmap_zero_page: CMAP2 busy");
*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin2; curthread->td_switchin = pmap_zpi_switchin2;
#endif #endif
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE) if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE)
i686_pagezero(CADDR2); i686_pagezero(CADDR2);
@ -2786,10 +2794,14 @@ pmap_zero_page_idle(vm_page_t m)
if (*CMAP3) if (*CMAP3)
panic("pmap_zero_page: CMAP3 busy"); panic("pmap_zero_page: CMAP3 busy");
*CMAP3 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP3 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin3; curthread->td_switchin = pmap_zpi_switchin3;
#endif #endif
invlpg((u_int)CADDR3); invlpg((u_int)CADDR3);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686) if (cpu_class == CPUCLASS_686)
i686_pagezero(CADDR3); i686_pagezero(CADDR3);
@ -2828,7 +2840,6 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif #endif
bcopy(CADDR1, CADDR2, PAGE_SIZE); bcopy(CADDR1, CADDR2, PAGE_SIZE);
#ifdef SMP #ifdef SMP
curthread->td_switchin = NULL; curthread->td_switchin = NULL;
#endif #endif

View File

@ -2724,10 +2724,14 @@ pmap_zero_page(vm_page_t m)
if (*CMAP2) if (*CMAP2)
panic("pmap_zero_page: CMAP2 busy"); panic("pmap_zero_page: CMAP2 busy");
*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin2; curthread->td_switchin = pmap_zpi_switchin2;
#endif #endif
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686) if (cpu_class == CPUCLASS_686)
i686_pagezero(CADDR2); i686_pagezero(CADDR2);
@ -2755,10 +2759,14 @@ pmap_zero_page_area(vm_page_t m, int off, int size)
if (*CMAP2) if (*CMAP2)
panic("pmap_zero_page: CMAP2 busy"); panic("pmap_zero_page: CMAP2 busy");
*CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP2 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin2; curthread->td_switchin = pmap_zpi_switchin2;
#endif #endif
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE) if (cpu_class == CPUCLASS_686 && off == 0 && size == PAGE_SIZE)
i686_pagezero(CADDR2); i686_pagezero(CADDR2);
@ -2786,10 +2794,14 @@ pmap_zero_page_idle(vm_page_t m)
if (*CMAP3) if (*CMAP3)
panic("pmap_zero_page: CMAP3 busy"); panic("pmap_zero_page: CMAP3 busy");
*CMAP3 = PG_V | PG_RW | phys | PG_A | PG_M; *CMAP3 = PG_V | PG_RW | phys | PG_A | PG_M;
#ifdef I386_CPU
invltlb();
#else
#ifdef SMP #ifdef SMP
curthread->td_switchin = pmap_zpi_switchin3; curthread->td_switchin = pmap_zpi_switchin3;
#endif #endif
invlpg((u_int)CADDR3); invlpg((u_int)CADDR3);
#endif
#if defined(I686_CPU) #if defined(I686_CPU)
if (cpu_class == CPUCLASS_686) if (cpu_class == CPUCLASS_686)
i686_pagezero(CADDR3); i686_pagezero(CADDR3);
@ -2828,7 +2840,6 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
invlpg((u_int)CADDR2); invlpg((u_int)CADDR2);
#endif #endif
bcopy(CADDR1, CADDR2, PAGE_SIZE); bcopy(CADDR1, CADDR2, PAGE_SIZE);
#ifdef SMP #ifdef SMP
curthread->td_switchin = NULL; curthread->td_switchin = NULL;
#endif #endif