Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/include/booke Add PRIxPTE and pte_value(pt_...



details:   https://anonhg.NetBSD.org/src/rev/11d535c15729
branches:  trunk
changeset: 808979:11d535c15729
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jun 11 08:01:50 2015 +0000

description:
Add PRIxPTE and pte_value(pt_entry_t) for printing the value of a PTE.
Add pte_zero_p(pt_entry_t) to check that a PTE has been zeroed.

diffstat:

 sys/arch/powerpc/include/booke/pte.h |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (51 lines):

diff -r 249481df6e1c -r 11d535c15729 sys/arch/powerpc/include/booke/pte.h
--- a/sys/arch/powerpc/include/booke/pte.h      Thu Jun 11 07:30:10 2015 +0000
+++ b/sys/arch/powerpc/include/booke/pte.h      Thu Jun 11 08:01:50 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pte.h,v 1.6 2011/06/30 00:52:59 matt Exp $     */
+/*     $NetBSD: pte.h,v 1.7 2015/06/11 08:01:50 matt Exp $     */
 /*-
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -41,6 +41,7 @@
 #ifndef __BSD_PT_ENTRY_T
 #define __BSD_PT_ENTRY_T       __uint32_t
 typedef __BSD_PT_ENTRY_T       pt_entry_t;
+#define PRIxPTE                        PRIx32
 #endif
 #endif
 
@@ -76,6 +77,12 @@
 #ifndef _LOCORE
 #ifdef _KERNEL
 
+static inline uint32_t
+pte_value(pt_entry_t pt_entry)
+{
+       return pt_entry;
+}
+
 static inline bool
 pte_cached_p(pt_entry_t pt_entry)
 {
@@ -95,6 +102,12 @@
 }
 
 static inline bool
+pte_zero_p(pt_entry_t pt_entry)
+{
+       return pt_entry == 0;
+}
+
+static inline bool
 pte_exec_p(pt_entry_t pt_entry)
 {
        return (pt_entry & PTE_xX) != 0;
@@ -251,6 +264,7 @@
 
        return pt_entry;
 }
+
 #endif /* _KERNEL */
 #endif /* !_LOCORE */
 



Home | Main Index | Thread Index | Old Index