summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-08-11 17:15:55 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-08-11 17:15:55 +0000
commit98b05a003a84406b2feccb22b9cd67bae0c215c7 (patch)
tree8ffc766dcda9f986475939c1e1e6747c19eb4d54 /sys/arch/i386/include
parent6900534ae3a09df07b8422e0a7e7d9f24493d9c5 (diff)
fix some stupidity in x86 bus_space_map.
right now, we do a pmap_kenter_pa(), we then get the pte (behind pmap's back) and check for the cache inhibit bit (if needed). If it isn't what we want (this is the normal case) then we change it ourselves, and do a manual tlb shootdown (i386 was a bit more stupid about it than amd64, too). Instead, make it so that like on some other archs (sparc64 comes to mind) you can pass in flags in the low bits of the physical address, pmap then does everything correctly for you. Discovered this when I had some code doing a lot of bus_space_maps(), it was incredibly slow, and profilling was dominated by pmap_tlb_shootwait(); discussed with kettenis@, miod@, toby@ and art@. ok art@
Diffstat (limited to 'sys/arch/i386/include')
-rw-r--r--sys/arch/i386/include/pmap.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/arch/i386/include/pmap.h b/sys/arch/i386/include/pmap.h
index 6b989e0f59e..c380b253d44 100644
--- a/sys/arch/i386/include/pmap.h
+++ b/sys/arch/i386/include/pmap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.h,v 1.52 2009/06/03 00:49:12 art Exp $ */
+/* $OpenBSD: pmap.h,v 1.53 2009/08/11 17:15:54 oga Exp $ */
/* $NetBSD: pmap.h,v 1.44 2000/04/24 17:18:18 thorpej Exp $ */
/*
@@ -294,7 +294,10 @@ struct pv_entry { /* locked by its list's pvh_lock */
/*
* MD flags to pmap_enter:
*/
-#define PMAP_NOCACHE PMAP_MD0
+
+/* to get just the pa from params to pmap_enter */
+#define PMAP_PA_MASK ~((paddr_t)PAGE_MASK)
+#define PMAP_NOCACHE 0x1 /* map uncached */
/*
* We keep mod/ref flags in struct vm_page->pg_flags.