Module Name: src
Committed By: matt
Date: Thu Jun 11 08:01:50 UTC 2015
Modified Files:
src/sys/arch/powerpc/include/booke: pte.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/include/booke/pte.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/powerpc/include/booke/pte.h
diff -u src/sys/arch/powerpc/include/booke/pte.h:1.6 src/sys/arch/powerpc/include/booke/pte.h:1.7
--- src/sys/arch/powerpc/include/booke/pte.h:1.6 Thu Jun 30 00:52:59 2011
+++ src/sys/arch/powerpc/include/booke/pte.h Thu Jun 11 08:01:50 2015
@@ -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 @@ typedef __BSD_PT_ENTRY_T pt_entry_t;
#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 @@ pte_valid_p(pt_entry_t pt_entry)
}
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 @@ pte_make_kenter_pa(paddr_t pa, struct vm
return pt_entry;
}
+
#endif /* _KERNEL */
#endif /* !_LOCORE */