Shift a few SYSINT() calls around.

this results in a few functions becoming static, and
the SYSINITs being close to the code they are related to.
setting up the dump device is with dumpsys() and
kicking off the scheduler is with the scheduler.
Mounting root is with the code that does it.

Reviewed by: phk
This commit is contained in:
Julian Elischer 1997-11-25 07:07:48 +00:00
parent 09bb0da60c
commit 95802bf803
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31403
7 changed files with 78 additions and 55 deletions

View File

@ -39,7 +39,7 @@
* SUCH DAMAGE.
*
* @(#)init_main.c 8.9 (Berkeley) 1/21/94
* $Id: init_main.c,v 1.74 1997/11/07 08:52:53 phk Exp $
* $Id: init_main.c,v 1.75 1997/11/24 18:35:04 bde Exp $
*/
#include "opt_devfs.h"
@ -457,17 +457,6 @@ SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL)
****
***************************************************************************
*/
/* ARGSUSED */
static void sched_setup __P((void *dummy));
static void
sched_setup(dummy)
void *dummy;
{
/* Kick off timeout driven events by calling first time. */
roundrobin(NULL);
schedcpu(NULL);
}
SYSINIT(sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL)
/* ARGSUSED */
static void root_conf __P((void *dummy));
@ -479,36 +468,6 @@ root_conf(dummy)
}
SYSINIT(root_conf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, root_conf, NULL)
/* 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)
/* ARGSUSED*/
static void xxx_vfs_mountroot __P((void *fsnamep));
#ifdef BOOTP
extern void bootpc_init __P((void));
#endif
static void
xxx_vfs_mountroot(fsnamep)
void *fsnamep;
{
/* XXX Add a separate SYSINIT entry */
#ifdef BOOTP
bootpc_init();
#endif
/* Mount the root file system. */
if (vfs_mountrootfs(*((char **) fsnamep)))
panic("cannot mount root");
}
SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot,
&mountrootfsname)
/* ARGSUSED*/
static void xxx_vfs_root_fdtab __P((void *dummy));
static void

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
* $Id: kern_shutdown.c,v 1.25 1997/11/06 19:29:13 phk Exp $
* $Id: kern_shutdown.c,v 1.26 1997/11/18 15:16:43 bde Exp $
*/
#include "opt_ddb.h"
@ -329,6 +329,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

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_synch.c 8.9 (Berkeley) 5/19/95
* $Id: kern_synch.c,v 1.40 1997/11/21 11:36:56 bde Exp $
* $Id: kern_synch.c,v 1.41 1997/11/22 08:35:38 bde Exp $
*/
#include "opt_ktrace.h"
@ -98,7 +98,7 @@ SYSCTL_PROC(_kern, OID_AUTO, quantum, CTLTYPE_INT|CTLFLAG_RW,
* Force switch among equal priority processes every 100ms.
*/
/* ARGSUSED */
void
static void
roundrobin(arg)
void *arg;
{
@ -196,7 +196,7 @@ static fixpt_t ccpu = 0.95122942450071400909 * FSCALE; /* exp(-1/20) */
* Recompute process priorities, every hz ticks.
*/
/* ARGSUSED */
void
static void
schedcpu(arg)
void *arg;
{
@ -715,3 +715,16 @@ resetpriority(p)
need_resched();
}
}
/* ARGSUSED */
static void sched_setup __P((void *dummy));
static void
sched_setup(dummy)
void *dummy;
{
/* Kick off timeout driven events by calling first time. */
roundrobin(NULL);
schedcpu(NULL);
}
SYSINIT(sched_setup, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST, sched_setup, NULL)

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
* $Id: vfs_conf.c,v 1.16 1997/10/16 07:32:14 julian Exp $
* $Id: vfs_conf.c,v 1.17 1997/11/07 08:53:10 phk Exp $
*/
/*
@ -52,6 +52,7 @@
* on SMP reentrancy
*/
#include <sys/param.h> /* dev_t (types.h)*/
#include <sys/kernel.h>
#include <sys/systm.h> /* rootvp*/
#include <sys/proc.h> /* curproc*/
#include <sys/vnode.h> /* NULLVP*/
@ -105,7 +106,7 @@ struct vfsconf *vfsconf;
* the FFS file system type. This is a matter of
* fixing the other file systems, not this code!
*/
int
static int
vfs_mountrootfs(fsname)
char *fsname;
{
@ -151,3 +152,24 @@ vfs_mountrootfs(fsname)
success:
return( err);
}
/* ARGSUSED*/
static void xxx_vfs_mountroot __P((void *fsnamep));
#ifdef BOOTP
extern void bootpc_init __P((void));
#endif
static void
xxx_vfs_mountroot(fsnamep)
void *fsnamep;
{
/* XXX Add a separate SYSINIT entry */
#ifdef BOOTP
bootpc_init();
#endif
/* Mount the root file system. */
if (vfs_mountrootfs(*((char **) fsnamep)))
panic("cannot mount root");
}
SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot,
&mountrootfsname)

View File

@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_conf.c 8.8 (Berkeley) 3/31/94
* $Id: vfs_conf.c,v 1.16 1997/10/16 07:32:14 julian Exp $
* $Id: vfs_conf.c,v 1.17 1997/11/07 08:53:10 phk Exp $
*/
/*
@ -52,6 +52,7 @@
* on SMP reentrancy
*/
#include <sys/param.h> /* dev_t (types.h)*/
#include <sys/kernel.h>
#include <sys/systm.h> /* rootvp*/
#include <sys/proc.h> /* curproc*/
#include <sys/vnode.h> /* NULLVP*/
@ -105,7 +106,7 @@ struct vfsconf *vfsconf;
* the FFS file system type. This is a matter of
* fixing the other file systems, not this code!
*/
int
static int
vfs_mountrootfs(fsname)
char *fsname;
{
@ -151,3 +152,24 @@ vfs_mountrootfs(fsname)
success:
return( err);
}
/* ARGSUSED*/
static void xxx_vfs_mountroot __P((void *fsnamep));
#ifdef BOOTP
extern void bootpc_init __P((void));
#endif
static void
xxx_vfs_mountroot(fsnamep)
void *fsnamep;
{
/* XXX Add a separate SYSINIT entry */
#ifdef BOOTP
bootpc_init();
#endif
/* Mount the root file system. */
if (vfs_mountrootfs(*((char **) fsnamep)))
panic("cannot mount root");
}
SYSINIT(mountroot, SI_SUB_MOUNT_ROOT, SI_ORDER_FIRST, xxx_vfs_mountroot,
&mountrootfsname)

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)mount.h 8.21 (Berkeley) 5/20/95
* $Id: mount.h,v 1.50 1997/11/13 00:28:51 julian Exp $
* $Id: mount.h,v 1.51 1997/11/22 06:18:54 bde Exp $
*/
#ifndef _SYS_MOUNT_H_
@ -445,7 +445,6 @@ struct netcred *vfs_export_lookup /* lookup host in fs export list */
void vfs_getnewfsid __P((struct mount *));
struct mount *vfs_getvfs __P((fsid_t *)); /* return vfs given fsid */
int vfs_mountedon __P((struct vnode *)); /* is a vfs mounted on vp */
int vfs_mountrootfs __P((char *));
int vfs_rootmountalloc __P((char *, char *, struct mount **));
void vfs_unbusy __P((struct mount *, struct proc *));
void vfs_unmountall __P((void));

View File

@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)proc.h 8.15 (Berkeley) 5/19/95
* $Id: proc.h,v 1.47 1997/11/21 11:37:02 bde Exp $
* $Id: proc.h,v 1.48 1997/11/24 15:15:20 bde Exp $
*/
#ifndef _SYS_PROC_H_
@ -318,8 +318,6 @@ int leavepgrp __P((struct proc *p));
void mi_switch __P((void));
void procinit __P((void));
void resetpriority __P((struct proc *));
void roundrobin __P((void *));
void schedcpu __P((void *));
void setrunnable __P((struct proc *));
void setrunqueue __P((struct proc *));
void sleepinit __P((void));