Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/sys add another QUEUEDEBUG check: in TAILQ_REMOVE(), if...
details: https://anonhg.NetBSD.org/src/rev/126110410343
branches: trunk
changeset: 538530:126110410343
user: chs <chs%NetBSD.org@localhost>
date: Tue Oct 22 04:50:38 2002 +0000
description:
add another QUEUEDEBUG check: in TAILQ_REMOVE(), if the element we're
removing has no next element, verify that the queue head agrees that
the current element is the last one. (this is how I found the recent
ppc pmap bugs).
diffstat:
sys/sys/queue.h | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (37 lines):
diff -r 49304303ed92 -r 126110410343 sys/sys/queue.h
--- a/sys/sys/queue.h Tue Oct 22 04:34:13 2002 +0000
+++ b/sys/sys/queue.h Tue Oct 22 04:50:38 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: queue.h,v 1.31 2002/06/01 23:51:05 lukem Exp $ */
+/* $NetBSD: queue.h,v 1.32 2002/10/22 04:50:38 chs Exp $ */
/*
* Copyright (c) 1991, 1993
@@ -343,6 +343,11 @@
panic("TAILQ_* forw %p %s:%d", (elm), __FILE__, __LINE__);\
if (*(elm)->field.tqe_prev != (elm)) \
panic("TAILQ_* back %p %s:%d", (elm), __FILE__, __LINE__);
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \
+ if ((elm)->field.tqe_next == NULL && \
+ (head)->tqh_last != &(elm)->field.tqe_next) \
+ panic("TAILQ_PREREMOVE head %p elm %p %s:%d", \
+ (head), (elm), __FILE__, __LINE__);
#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \
(elm)->field.tqe_next = (void *)1L; \
(elm)->field.tqe_prev = (void *)1L;
@@ -350,6 +355,7 @@
#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field)
#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field)
#define QUEUEDEBUG_TAILQ_OP(elm, field)
+#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field)
#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field)
#endif
@@ -397,6 +403,7 @@
} while (/*CONSTCOND*/0)
#define TAILQ_REMOVE(head, elm, field) do { \
+ QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \
QUEUEDEBUG_TAILQ_OP((elm), field) \
if (((elm)->field.tqe_next) != NULL) \
(elm)->field.tqe_next->field.tqe_prev = \
Home |
Main Index |
Thread Index |
Old Index