summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2003-10-01 05:56:46 +0000
committerjeff <jeff@FreeBSD.org>2003-10-01 05:56:46 +0000
commitd259685f66e7899908461ceecf1c643f28b13511 (patch)
tree78329d0d777d80b13d7a9355345d2cecc8d2aebe /sys/i386
parent002709d3859e8bc7368ccae5a8eb48b71f267a49 (diff)
downloadFreeBSD-src-d259685f66e7899908461ceecf1c643f28b13511.zip
FreeBSD-src-d259685f66e7899908461ceecf1c643f28b13511.tar.gz
- Hide more #ifdef logic in a new invlcaddr inline. This function flushes
the full tlb if you're on an I386or does an invlpg otherwise. Glanced at by: peter
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/pmap.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 7668356..7851489 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -2526,6 +2526,16 @@ pagezero(void *page)
bzero(page, PAGE_SIZE);
}
+static __inline void
+invlcaddr(void *caddr)
+{
+#ifdef I386_CPU
+ invltlb();
+#else
+ invlpg((u_int)caddr);
+#endif
+}
+
/*
* pmap_zero_page zeros the specified hardware page by mapping
* the page into KVM and using bzero to clear its contents.
@@ -2543,11 +2553,7 @@ pmap_zero_page(vm_page_t m)
*CMAP2 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M;
pagezero(CADDR2);
*CMAP2 = 0;
-#ifdef I386_CPU
- invltlb();
-#else
- invlpg((u_int)CADDR2);
-#endif
+ invlcaddr(CADDR2);
#ifdef SMP
curthread->td_pcb->pcb_switchout = NULL;
#endif
@@ -2576,11 +2582,7 @@ pmap_zero_page_area(vm_page_t m, int off, int size)
else
bzero((char *)CADDR2 + off, size);
*CMAP2 = 0;
-#ifdef I386_CPU
- invltlb();
-#else
- invlpg((u_int)CADDR2);
-#endif
+ invlcaddr(CADDR2);
#ifdef SMP
curthread->td_pcb->pcb_switchout = NULL;
#endif
@@ -2605,11 +2607,7 @@ pmap_zero_page_idle(vm_page_t m)
*CMAP3 = PG_V | PG_RW | VM_PAGE_TO_PHYS(m) | PG_A | PG_M;
pagezero(CADDR3);
*CMAP3 = 0;
-#ifdef I386_CPU
- invltlb();
-#else
- invlpg((u_int)CADDR3);
-#endif
+ invlcaddr(CADDR3);
#ifdef SMP
curthread->td_pcb->pcb_switchout = NULL;
#endif
OpenPOWER on IntegriCloud