use pseudo-device initialization table instead of #if; minor KNF
authorChris Torek <torek@ucbvax.Berkeley.EDU>
Sun, 18 Apr 1993 09:52:35 +0000 (01:52 -0800)
committerChris Torek <torek@ucbvax.Berkeley.EDU>
Sun, 18 Apr 1993 09:52:35 +0000 (01:52 -0800)
SCCS-vsn: sys/kern/init_main.c 7.58

usr/src/sys/kern/init_main.c

index 102f6cf..52729dd 100644 (file)
@@ -4,7 +4,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)init_main.c 7.57 (Berkeley) %G%
+ *     @(#)init_main.c 7.58 (Berkeley) %G%
  */
 
 #include <sys/param.h>
  */
 
 #include <sys/param.h>
@@ -20,6 +20,7 @@
 #include <sys/conf.h>
 #include <sys/buf.h>
 #include <sys/clist.h>
 #include <sys/conf.h>
 #include <sys/buf.h>
 #include <sys/clist.h>
+#include <sys/device.h>
 #include <sys/protosw.h>
 #include <sys/reboot.h>
 #include <sys/user.h>
 #include <sys/protosw.h>
 #include <sys/reboot.h>
 #include <sys/user.h>
@@ -72,7 +73,9 @@ main()
        register int i;
        register struct proc *p;
        register struct filedesc0 *fdp;
        register int i;
        register struct proc *p;
        register struct filedesc0 *fdp;
+       register struct pdevinit *pdev;
        int s, rval[2];
        int s, rval[2];
+       extern struct pdevinit pdevinit[];
        extern void roundrobin __P((void *));
        extern void schedcpu __P((void *));
 
        extern void roundrobin __P((void *));
        extern void schedcpu __P((void *));
 
@@ -170,41 +173,29 @@ main()
 
        rqinit();
 
 
        rqinit();
 
-       /*
-        * configure virtual memory system,
-        * set vm rlimits
-        */
+       /* Configure virtual memory system, set vm rlimits. */
        vm_init_limits(p);
 
        vm_init_limits(p);
 
-       /*
-        * Initialize the file systems.
-        */
+       /* Initialize the file systems. */
        vfsinit();
 
        vfsinit();
 
-       /*
-        * Start real time and statistics clocks.
-        */
+       /* Start real time and statistics clocks. */
        initclocks();
 
        initclocks();
 
-       /*
-        * Initialize tables, protocols, and set up well-known inodes.
-        */
+       /* Initialize tables. */
        mbinit();
        cinit();
 #ifdef SYSVSHM
        shminit();
 #endif
        mbinit();
        cinit();
 #ifdef SYSVSHM
        shminit();
 #endif
-#include "sl.h"
-#if NSL > 0
-       slattach();                     /* XXX */
-#endif
-#include "loop.h"
-#if NLOOP > 0
-       loattach();                     /* XXX */
-#endif
+
+       /* Attach pseudo-devices. */
+       for (pdev = pdevinit; pdev->pdev_attach != NULL; pdev++)
+               (*pdev->pdev_attach)(pdev->pdev_count);
+
        /*
        /*
-        * Block reception of incoming packets
-        * until protocols have been initialized.
+        * Initialize protocols.  Block reception of incoming packets
+        * until everything is ready.
         */
        s = splimp();
        ifinit();
         */
        s = splimp();
        ifinit();