Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/include/arm32 Add some KASSERTs to catch simila...
details: https://anonhg.NetBSD.org/src/rev/7fb374a5a17c
branches: trunk
changeset: 338142:7fb374a5a17c
user: skrll <skrll%NetBSD.org@localhost>
date: Tue May 12 07:07:16 2015 +0000
description:
Add some KASSERTs to catch similar bugs to the cnptes/nptes one
diffstat:
sys/arch/arm/include/arm32/pmap.h | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r be45c46dc894 -r 7fb374a5a17c sys/arch/arm/include/arm32/pmap.h
--- a/sys/arch/arm/include/arm32/pmap.h Tue May 12 05:19:20 2015 +0000
+++ b/sys/arch/arm/include/arm32/pmap.h Tue May 12 07:07:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.h,v 1.138 2015/02/25 13:52:42 joerg Exp $ */
+/* $NetBSD: pmap.h,v 1.139 2015/05/12 07:07:16 skrll Exp $ */
/*
* Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -567,10 +567,12 @@
l2pte_set(pt_entry_t *ptep, pt_entry_t pte, pt_entry_t opte)
{
if (l1pte_lpage_p(pte)) {
+ KASSERTMSG((((uintptr_t)ptep / sizeof(pte)) & (L2_L_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
for (size_t k = 0; k < L2_L_SIZE / L2_S_SIZE; k++) {
*ptep++ = pte;
}
} else {
+ KASSERTMSG((((uintptr_t)ptep / sizeof(pte)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
for (size_t k = 0; k < PAGE_SIZE / L2_S_SIZE; k++) {
KASSERTMSG(*ptep == opte, "%#x [*%p] != %#x", *ptep, ptep, opte);
*ptep++ = pte;
@@ -584,6 +586,7 @@
static inline void
l2pte_reset(pt_entry_t *ptep)
{
+ KASSERTMSG((((uintptr_t)ptep / sizeof(*ptep)) & (PAGE_SIZE / L2_S_SIZE - 1)) == 0, "%p", ptep);
*ptep = 0;
for (vsize_t k = 1; k < PAGE_SIZE / L2_S_SIZE; k++) {
ptep[k] = 0;
Home |
Main Index |
Thread Index |
Old Index