diff options
| author | rin <rin@NetBSD.org> | 2020-05-31 23:34:34 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2020-05-31 23:34:34 +0000 |
| commit | c87120348dd16b938cc840cb2a25ea4e6df18e94 (patch) | |
| tree | 08515656d0e70d267440be0f58e67e48fd5f50c1 /sys/ddb/db_kernel.c | |
| parent | effb645011da9518b63bda9822dd10a28d44008b (diff) | |
Switch from kmem_intr_alloc(sz, KM_NOSLEEP) to kmem_alloc(sz, KM_SLEEP).
Clearly document these functions are *not* for DDB session, but for
permanent data storage when initializing DDB.
Diffstat (limited to 'sys/ddb/db_kernel.c')
| -rw-r--r-- | sys/ddb/db_kernel.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/sys/ddb/db_kernel.c b/sys/ddb/db_kernel.c index acfba24f992..721e5b1ed8f 100644 --- a/sys/ddb/db_kernel.c +++ b/sys/ddb/db_kernel.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_kernel.c,v 1.3 2020/05/31 09:42:46 rin Exp $ */ +/* $NetBSD: db_kernel.c,v 1.4 2020/05/31 23:34:34 rin Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_kernel.c,v 1.3 2020/05/31 09:42:46 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_kernel.c,v 1.4 2020/05/31 23:34:34 rin Exp $"); #include <sys/param.h> #include <sys/kmem.h> @@ -39,28 +39,33 @@ __KERNEL_RCSID(0, "$NetBSD: db_kernel.c,v 1.3 2020/05/31 09:42:46 rin Exp $"); /* * XXX - * DDB can be running in the interrupt context, e.g., when activated from - * console. Therefore, we use kmem_intr_alloc(9) and friends here to avoid - * assertion failure. + * These routines are *not* intended for a DDB session: + * + * - It disturbes on-going debugged kernel datastructures. + * + * - DDB can be running in the interrupt context, e.g., when activated from + * console. This results in assertion failures in the allocator. + * + * Use these only for permanent data storage when initializing DDB. */ void * db_alloc(size_t sz) { - return kmem_intr_alloc(sz, KM_NOSLEEP); + return kmem_alloc(sz, KM_SLEEP); } void * db_zalloc(size_t sz) { - return kmem_intr_zalloc(sz, KM_NOSLEEP); + return kmem_zalloc(sz, KM_SLEEP); } void db_free(void *p, size_t sz) { - kmem_intr_free(p, sz); + kmem_free(p, sz); } |
