Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Detect if kmem is up, and if not, ignore EX_MALLOCOK.



details:   https://anonhg.NetBSD.org/src/rev/6e56bdfdd91f
branches:  trunk
changeset: 477131:6e56bdfdd91f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Oct 11 22:57:17 1999 +0000

description:
Detect if kmem is up, and if not, ignore EX_MALLOCOK.

diffstat:

 sys/kern/subr_extent.c |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r 4de7e207c6ef -r 6e56bdfdd91f sys/kern/subr_extent.c
--- a/sys/kern/subr_extent.c    Mon Oct 11 21:22:44 1999 +0000
+++ b/sys/kern/subr_extent.c    Mon Oct 11 22:57:17 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_extent.c,v 1.28 1999/06/27 06:18:33 ross Exp $    */
+/*     $NetBSD: subr_extent.c,v 1.29 1999/10/11 22:57:17 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -49,6 +49,11 @@
 #include <sys/systm.h>
 #include <sys/proc.h>
 #include <sys/lock.h>
+
+#include <vm/vm.h>
+#include <vm/vm_kern.h>
+
+#define        KMEM_IS_RUNNING         (kmem_map != NULL)
 #elif defined(_EXTENT_TESTING)
 /*
  * user-land definitions, so it can fit into a testing harness.
@@ -70,6 +75,8 @@
 #define        panic(a)                        printf(a)
 #define        splhigh()                       (1)
 #define        splx(s)                         ((void)(s))
+
+#define        KMEM_IS_RUNNING                 (1)
 #endif
 
 static pool_handle_t expool_create __P((void));
@@ -1001,6 +1008,13 @@
        int s;
 
        /*
+        * If the kernel memory allocator is not yet running, we can't
+        * use it (obviously).
+        */
+       if (KMEM_IS_RUNNING == 0)
+               flags &= ~EX_MALLOCOK;
+
+       /*
         * XXX Make a static, create-time flags word, so we don't
         * XXX have to lock to read it!
         */



Home | Main Index | Thread Index | Old Index