Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm32 Update PTE_SYNC_CURRENT to add a dsb for ...



details:   https://anonhg.NetBSD.org/src/rev/2aed2bfd069e
branches:  trunk
changeset: 333594:2aed2bfd069e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Nov 10 15:46:33 2014 +0000

description:
Update PTE_SYNC_CURRENT to add a dsb for armv7 - part of the
break-before-make fix.

diffstat:

 sys/arch/arm/arm32/pmap.c |  22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 54433d83611a -r 2aed2bfd069e sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Mon Nov 10 14:37:14 2014 +0000
+++ b/sys/arch/arm/arm32/pmap.c Mon Nov 10 15:46:33 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.315 2014/11/10 14:37:14 skrll Exp $ */
+/*     $NetBSD: pmap.c,v 1.316 2014/11/10 15:46:33 skrll Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -215,7 +215,7 @@
 
 #include <arm/locore.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.315 2014/11/10 14:37:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.316 2014/11/10 15:46:33 skrll Exp $");
 
 //#define PMAP_DEBUG
 #ifdef PMAP_DEBUG
@@ -946,13 +946,19 @@
  *       - There is no pmap active in the cache/tlb.
  *       - The specified pmap is 'active' in the cache/tlb.
  */
+
+static inline void
+pmap_pte_sync_current(pmap_t pm, pt_entry_t *ptep)
+{
+       if (PMAP_NEEDS_PTE_SYNC && pmap_is_cached(pm))
+               PTE_SYNC(ptep);
+#if ARM_MMU_V7 > 0
+       __asm("dsb":::"memory");
+#endif
+}
+
 #ifdef PMAP_INCLUDE_PTE_SYNC
-#define        PTE_SYNC_CURRENT(pm, ptep)      \
-do {                                   \
-       if (PMAP_NEEDS_PTE_SYNC &&      \
-           pmap_is_cached(pm))         \
-               PTE_SYNC(ptep);         \
-} while (/*CONSTCOND*/0)
+#define        PTE_SYNC_CURRENT(pm, ptep)      pmap_pte_sync_current(pm, ptep)
 #else
 #define        PTE_SYNC_CURRENT(pm, ptep)      /* nothing */
 #endif



Home | Main Index | Thread Index | Old Index