Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha/include Implement PMAP_DIRECT / pmap_direct_p...



details:   https://anonhg.NetBSD.org/src/rev/775aef51501e
branches:  trunk
changeset: 361959:775aef51501e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat May 19 20:04:41 2018 +0000

description:
Implement PMAP_DIRECT / pmap_direct_process() in support of experimental
UBC optimizations.

diffstat:

 sys/arch/alpha/include/pmap.h |  19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r d0052a00f98b -r 775aef51501e sys/arch/alpha/include/pmap.h
--- a/sys/arch/alpha/include/pmap.h     Sat May 19 19:47:47 2018 +0000
+++ b/sys/arch/alpha/include/pmap.h     Sat May 19 20:04:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.79 2014/01/01 16:09:04 matt Exp $ */
+/* $NetBSD: pmap.h,v 1.80 2018/05/19 20:04:41 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -228,11 +228,24 @@
 #define        PMAP_STEAL_MEMORY               /* enable pmap_steal_memory() */
 #define        PMAP_GROWKERNEL                 /* enable pmap_growkernel() */
 
+#define        PMAP_DIRECT
+#define        PMAP_DIRECT_MAP(pa)             ALPHA_PHYS_TO_K0SEG((pa))
+#define        PMAP_DIRECT_UNMAP(va)           ALPHA_K0SEG_TO_PHYS((va))
+
+static __inline int
+pmap_direct_process(paddr_t pa, voff_t pgoff, size_t len,
+    int (*process)(void *, size_t, void *), void *arg)
+{
+       vaddr_t va = PMAP_DIRECT_MAP(pa);
+
+       return process((void *)(va + pgoff), len, arg);
+}
+
 /*
  * Alternate mapping hooks for pool pages.  Avoids thrashing the TLB.
  */
-#define        PMAP_MAP_POOLPAGE(pa)           ALPHA_PHYS_TO_K0SEG((pa))
-#define        PMAP_UNMAP_POOLPAGE(va)         ALPHA_K0SEG_TO_PHYS((va))
+#define        PMAP_MAP_POOLPAGE(pa)           PMAP_DIRECT_MAP(pa)
+#define        PMAP_UNMAP_POOLPAGE(va)         PMAP_DIRECT_UNMAP(va)
 
 /*
  * Other hooks for the pool allocator.



Home | Main Index | Thread Index | Old Index