summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorJustin T. Gibbs <gibbs@FreeBSD.org>1998-05-06 19:10:59 +0000
committerJustin T. Gibbs <gibbs@FreeBSD.org>1998-05-06 19:10:59 +0000
commit15c7e8bf523fedb89345a96b9e373833dd5b092f (patch)
treead07a304afd592c053408583cbb40c4c321d77e1 /sys/kern
parent186af8fda4faa2c6d0d82ba6a6e414e093bab588 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/init_main.c14
-rw-r--r--sys/kern/kern_shutdown.c12
-rw-r--r--sys/kern/subr_autoconf.c82
-rw-r--r--sys/kern/vfs_bio.c46
4 files changed, 109 insertions, 45 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index fe55fe251204..333d677d94af 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
- * $Id: init_main.c,v 1.51.2.5 1997/07/10 11:48:59 davidn Exp $
+ * $Id: init_main.c,v 1.51.2.6 1998/01/04 18:00:53 wosch Exp $
*/
#include "opt_rlimit.h"
@@ -467,6 +467,16 @@ sched_setup(dummy)
}
SYSINIT(sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL)
+/* ARGSUSED */
+static void root_conf __P((void *dummy));
+static void
+root_conf(dummy)
+ void *dummy;
+{
+ cpu_rootconf();
+}
+SYSINIT(root_conf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, root_conf, NULL)
+
/* ARGSUSED*/
static void xxx_vfs_mountroot __P((void *dummy));
#ifdef BOOTP
@@ -484,7 +494,7 @@ xxx_vfs_mountroot(dummy)
if ((*mountroot)(mountrootvfsops))
panic("cannot mount root");
}
-SYSINIT(mountroot, SI_SUB_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot, NULL)
+SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot, NULL)
/* ARGSUSED*/
static void xxx_vfs_root_fdtab __P((void *dummy));
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 5ee17fa1e6de..c16d4aa87911 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_shutdown.c,v 1.10 1996/10/31 00:57:28 julian Exp $
+ * $Id: kern_shutdown.c,v 1.10.2.1 1997/08/11 02:04:14 julian Exp $
*/
#include "opt_ddb.h"
@@ -310,6 +310,16 @@ static int dumpsize = 0; /* also for savecore */
static int dodump = 1;
SYSCTL_INT(_machdep, OID_AUTO, do_dump, CTLFLAG_RW, &dodump, 0, "");
+/* ARGSUSED */
+static void dump_conf __P((void *dummy));
+static void
+dump_conf(dummy)
+ void *dummy;
+{
+ cpu_dumpconf();
+}
+SYSINIT(dump_conf, SI_SUB_DUMP_CONF, SI_ORDER_FIRST, dump_conf, NULL)
+
/*
* Doadump comes here after turning off memory management and
* getting on the dump stack, either when called above, or by
diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c
index f48ce99f0a37..b6df4ebc86ff 100644
--- a/sys/kern/subr_autoconf.c
+++ b/sys/kern/subr_autoconf.c
@@ -41,17 +41,22 @@
*
* @(#)subr_autoconf.c 8.1 (Berkeley) 6/10/93
*
- * $Id$
+ * $Id: subr_autoconf.c,v 1.6 1997/11/18 12:43:41 bde Exp $
*/
#include <sys/param.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
#include <sys/device.h>
+#ifdef UNUSED
#include <sys/malloc.h>
+#endif
/*
* Autoconfiguration subroutines.
*/
+#ifdef UNUSED
/*
* ioconf.c exports exactly two names: cfdata and cfroots. All system
* devices and drivers are found via these tables.
@@ -340,3 +345,78 @@ evcnt_attach(dev, name, ev)
*nextp = ev;
nextp = &ev->ev_next;
}
+
+#endif
+
+/*
+ * "Interrupt driven config" functions.
+ */
+static TAILQ_HEAD(, intr_config_hook) intr_config_hook_list =
+ TAILQ_HEAD_INITIALIZER(intr_config_hook_list);
+
+
+/* ARGSUSED */
+static void run_interrupt_driven_config_hooks __P((void *dummy));
+static void
+run_interrupt_driven_config_hooks(dummy)
+ void *dummy;
+{
+ struct intr_config_hook *hook;
+
+ for (hook = intr_config_hook_list.tqh_first; hook != NULL;
+ hook = hook->ich_links.tqe_next) {
+ (*hook->ich_func)(hook->ich_arg);
+ }
+
+ while (intr_config_hook_list.tqh_first != NULL) {
+ tsleep(&intr_config_hook_list, PCONFIG, "conifhk", 0);
+ }
+}
+SYSINIT(intr_config_hooks, SI_SUB_INT_CONFIG_HOOKS, SI_ORDER_FIRST,
+ run_interrupt_driven_config_hooks, NULL)
+
+/*
+ * Register a hook that will be called after "cold"
+ * autoconfiguration is complete and interrupts can
+ * be used to complete initialization.
+ */
+int
+config_intrhook_establish(hook)
+ struct intr_config_hook *hook;
+{
+ struct intr_config_hook *hook_entry;
+
+ for (hook_entry = intr_config_hook_list.tqh_first; hook_entry != NULL;
+ hook_entry = hook_entry->ich_links.tqe_next)
+ if (hook_entry == hook)
+ break;
+ if (hook_entry != NULL) {
+ printf("config_intrhook_establish: establishing an "
+ "already established hook.\n");
+ return (1);
+ }
+ TAILQ_INSERT_TAIL(&intr_config_hook_list, hook, ich_links);
+ if (cold == 0)
+ /* XXX Sufficient for LKMs loaded after initial config??? */
+ run_interrupt_driven_config_hooks(NULL);
+ return (0);
+}
+
+void
+config_intrhook_disestablish(hook)
+ struct intr_config_hook *hook;
+{
+ struct intr_config_hook *hook_entry;
+
+ for (hook_entry = intr_config_hook_list.tqh_first; hook_entry != NULL;
+ hook_entry = hook_entry->ich_links.tqe_next)
+ if (hook_entry == hook)
+ break;
+ if (hook_entry == NULL)
+ panic("config_intrhook_disestablish: disestablishing an "
+ "unestablished hook");
+
+ TAILQ_REMOVE(&intr_config_hook_list, hook, ich_links);
+ /* Wakeup anyone watching the list */
+ wakeup(&intr_config_hook_list);
+}
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index d9e123c1efe6..7cef2a011b45 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -18,7 +18,7 @@
* 5. Modifications may be freely made to this file if the above conditions
* are met.
*
- * $Id: vfs_bio.c,v 1.104.2.7 1997/09/01 23:23:08 tegge Exp $
+ * $Id: vfs_bio.c,v 1.104.2.8 1998/03/05 12:20:08 dg Exp $
*/
/*
@@ -333,40 +333,6 @@ bwrite(struct buf * bp)
curproc->p_stats->p_ru.ru_oublock++;
VOP_STRATEGY(bp);
- /*
- * Handle ordered writes here.
- * If the write was originally flagged as ordered,
- * then we check to see if it was converted to async.
- * If it was converted to async, and is done now, then
- * we release the buffer. Otherwise we clear the
- * ordered flag because it is not needed anymore.
- *
- * Note that biodone has been modified so that it does
- * not release ordered buffers. This allows us to have
- * a chance to determine whether or not the driver
- * has set the async flag in the strategy routine. Otherwise
- * if biodone was not modified, then the buffer may have been
- * reused before we have had a chance to check the flag.
- */
-
- if ((oldflags & B_ORDERED) == B_ORDERED) {
- int s;
- s = splbio();
- if (bp->b_flags & B_ASYNC) {
- if ((bp->b_flags & B_DONE)) {
- if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_RELBUF)) != 0)
- brelse(bp);
- else
- bqrelse(bp);
- }
- splx(s);
- return (0);
- } else {
- bp->b_flags &= ~B_ORDERED;
- }
- splx(s);
- }
-
if ((oldflags & B_ASYNC) == 0) {
int rtval = biowait(bp);
@@ -1680,12 +1646,10 @@ biodone(register struct buf * bp)
*/
if (bp->b_flags & B_ASYNC) {
- if ((bp->b_flags & B_ORDERED) == 0) {
- if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_RELBUF)) != 0)
- brelse(bp);
- else
- bqrelse(bp);
- }
+ if ((bp->b_flags & (B_NOCACHE | B_INVAL | B_ERROR | B_RELBUF)) != 0)
+ brelse(bp);
+ else
+ bqrelse(bp);
} else {
bp->b_flags &= ~B_WANTED;
wakeup(bp);