Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Put the KMEM_GUARD code under #if defined(KMEM_GUAR...
details: https://anonhg.NetBSD.org/src/rev/e2bf9de29625
branches: trunk
changeset: 330090:e2bf9de29625
user: maxv <maxv%NetBSD.org@localhost>
date: Sun Jun 22 17:36:42 2014 +0000
description:
Put the KMEM_GUARD code under #if defined(KMEM_GUARD). No functional change.
diffstat:
sys/kern/subr_kmem.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diffs (60 lines):
diff -r 9cc4ff823c63 -r e2bf9de29625 sys/kern/subr_kmem.c
--- a/sys/kern/subr_kmem.c Sun Jun 22 17:23:34 2014 +0000
+++ b/sys/kern/subr_kmem.c Sun Jun 22 17:36:42 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_kmem.c,v 1.51 2013/10/25 16:09:29 martin Exp $ */
+/* $NetBSD: subr_kmem.c,v 1.52 2014/06/22 17:36:42 maxv Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
*/
/*
- * allocator of kernel wired memory.
+ * Allocator of kernel wired memory.
*/
/*
@@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.51 2013/10/25 16:09:29 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_kmem.c,v 1.52 2014/06/22 17:36:42 maxv Exp $");
#include <sys/param.h>
#include <sys/callback.h>
@@ -178,15 +178,7 @@
static pool_cache_t kmem_cache_big[KMEM_CACHE_BIG_COUNT] __cacheline_aligned;
static size_t kmem_cache_big_maxidx __read_mostly;
-
#if defined(DEBUG) && defined(_HARDKERNEL)
-#ifndef KMEM_GUARD_DEPTH
-#define KMEM_GUARD_DEPTH 0
-#endif
-int kmem_guard_depth = KMEM_GUARD_DEPTH;
-size_t kmem_guard_size;
-static struct uvm_kmguard kmem_guard;
-static void *kmem_freecheck;
#define KMEM_POISON
#define KMEM_REDZONE
#define KMEM_SIZE
@@ -218,6 +210,16 @@
#define kmem_size_check(p, sz) /* nothing */
#endif
+#if defined(KMEM_GUARD)
+#ifndef KMEM_GUARD_DEPTH
+#define KMEM_GUARD_DEPTH 0
+#endif
+int kmem_guard_depth = KMEM_GUARD_DEPTH;
+size_t kmem_guard_size;
+static struct uvm_kmguard kmem_guard;
+static void *kmem_freecheck;
+#endif /* defined(KMEM_GUARD) */
+
CTASSERT(KM_SLEEP == PR_WAITOK);
CTASSERT(KM_NOSLEEP == PR_NOWAIT);
Home |
Main Index |
Thread Index |
Old Index