summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/pmap.c22
-rw-r--r--sys/i386/i386/pmap.c22
2 files changed, 36 insertions, 8 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index b41b11f..5912074 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -767,12 +767,26 @@ pmap_qenter(va, m, count)
vm_page_t *m;
int count;
{
- int i;
+ vm_offset_t end_va;
+
+ end_va = va + count * PAGE_SIZE;
+
+ while (va < end_va) {
+ unsigned *pte;
- for (i = 0; i < count; i++) {
- vm_offset_t tva = va + i * PAGE_SIZE;
- pmap_kenter(tva, VM_PAGE_TO_PHYS(m[i]));
+ pte = (unsigned *)vtopte(va);
+ *pte = VM_PAGE_TO_PHYS(*m) | PG_RW | PG_V | pgeflag;
+#ifdef SMP
+ cpu_invlpg((void *)va);
+#else
+ invltlb_1pg(va);
+#endif
+ va += PAGE_SIZE;
+ m++;
}
+#ifdef SMP
+ smp_invltlb();
+#endif
}
/*
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index b41b11f..5912074 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -767,12 +767,26 @@ pmap_qenter(va, m, count)
vm_page_t *m;
int count;
{
- int i;
+ vm_offset_t end_va;
+
+ end_va = va + count * PAGE_SIZE;
+
+ while (va < end_va) {
+ unsigned *pte;
- for (i = 0; i < count; i++) {
- vm_offset_t tva = va + i * PAGE_SIZE;
- pmap_kenter(tva, VM_PAGE_TO_PHYS(m[i]));
+ pte = (unsigned *)vtopte(va);
+ *pte = VM_PAGE_TO_PHYS(*m) | PG_RW | PG_V | pgeflag;
+#ifdef SMP
+ cpu_invlpg((void *)va);
+#else
+ invltlb_1pg(va);
+#endif
+ va += PAGE_SIZE;
+ m++;
}
+#ifdef SMP
+ smp_invltlb();
+#endif
}
/*
OpenPOWER on IntegriCloud