Move findroot/setroot stuff from configure() to cpu_rootconf().

This commit is contained in:
gwr 1997-03-26 22:38:40 +00:00
parent 34732bad50
commit 71e43d14ab
19 changed files with 164 additions and 141 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.19 1997/02/03 19:46:55 cgd Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1997/03/26 22:38:47 gwr Exp $ */
/*
* Copyright (c) 1992, 1993
@ -89,14 +89,17 @@ configure()
if (config_rootfound("mainbus", "mainbus") == NULL)
panic("no mainbus found");
(void)spl0();
cold = 0;
}
void
cpu_rootconf()
{
if (booted_device == NULL)
printf("WARNING: can't figure what device matches \"%s\"\n",
boot_dev);
setroot(booted_device, booted_partition, alpha_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.48 1997/03/15 02:59:43 mhitch Exp $ */
/* $NetBSD: autoconf.c,v 1.49 1997/03/26 22:38:50 gwr Exp $ */
/*
* Copyright (c) 1994 Christian E. Hopps
@ -67,9 +67,8 @@ u_long boot_partition;
void
configure()
{
struct device *booted_device;
int booted_partition;
int s;
/*
* this is the real thing baby (i.e. not console init)
*/
@ -105,6 +104,14 @@ configure()
#ifdef DEBUG_KERNEL_START
printf("survived interrupt enable\n");
#endif
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
#ifdef DEBUG_KERNEL_START
@ -114,14 +121,6 @@ configure()
#ifdef DEBUG_KERNEL_START
printf("survived setroot()\n");
#endif
swapconf();
dumpconf();
if (dumplo < 0)
dumplo = 0;
#ifdef DEBUG_KERNEL_START
printf("survived swap device search\n");
#endif
cold = 0;
}
/*ARGSUSED*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.15 1997/02/23 04:09:53 mark Exp $ */
/* $NetBSD: autoconf.c,v 1.16 1997/03/26 22:38:52 gwr Exp $ */
/*
* Copyright (c) 1994-1997 Mark Brinicombe.
@ -150,12 +150,10 @@ set_root_device()
/*
* Set up the root and swap device numbers, configure the swap space and
* dump space
* Set up the root and swap devices from the boot args
*/
void
set_boot_devs()
cpu_rootconf()
{
set_root_device();
@ -163,9 +161,6 @@ set_boot_devs()
booted_device != NULL ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, arm32_nam2blk);
swapconf();
dumpconf();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.19 1997/03/26 15:49:31 leo Exp $ */
/* $NetBSD: autoconf.c,v 1.20 1997/03/26 22:38:56 gwr Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@ -65,8 +65,6 @@ struct devnametobdevmaj atari_nam2blk[] = {
void
configure()
{
struct device *booted_device;
int booted_partition;
extern int atari_realconfig;
atari_realconfig = 1;
@ -74,13 +72,17 @@ configure()
if (config_rootfound("mainbus", "mainbus") == NULL)
panic("no mainbus found");
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
setroot(booted_device, booted_partition, atari_nam2blk);
swapconf();
dumpconf();
if( dumplo < 0)
dumplo = 0;
cold = 0;
}
/*ARGSUSED*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.33 1997/02/05 20:56:29 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.34 1997/03/26 22:38:58 gwr Exp $ */
/*
* Copyright (c) 1996 Jason R. Thorpe. All rights reserved.
@ -244,10 +244,6 @@ struct devnametobdevmaj hp300_nam2blk[] = {
void
configure()
{
extern int (*mountroot) __P((void));
struct dev_data *dd;
struct device *dv;
struct vfsops *vops;
/*
* Initialize the dev_data_lists.
@ -279,6 +275,21 @@ configure()
isrprintlevels();
cold = 0;
}
/**********************************************************************
* Code to find and set the boot device
**********************************************************************/
void
cpu_rootconf()
{
extern int (*mountroot) __P((void));
struct dev_data *dd;
struct device *dv;
struct vfsops *vops;
/*
* Find boot device.
*/
@ -337,22 +348,15 @@ configure()
boothowto |= RB_ASKNAME;
setroot(dv, booted_partition, hp300_nam2blk);
swapconf();
dumpconf();
/*
* Set bootdev based on how we mounted root.
* Set bootdev based on what we found as the root.
* This is given to the boot program when we reboot.
*/
setbootdev();
cold = 0;
}
/**********************************************************************
* Code to find and set the boot device
**********************************************************************/
/*
* Register a device. We're passed the device and the arguments
* used to attach it. This is used to find the boot device.

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.23 1997/01/31 01:51:17 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.24 1997/03/26 22:39:01 gwr Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -84,8 +84,6 @@ struct devnametobdevmaj i386_nam2blk[] = {
void
configure()
{
struct device *booted_device;
int booted_partition;
startrtclock();
@ -97,6 +95,14 @@ configure()
(u_short)imask[IPL_TTY]);
spl0();
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
@ -104,14 +110,6 @@ configure()
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, i386_nam2blk);
/*
* Configure swap area and related system
* parameter based on device(s) used.
*/
swapconf();
dumpconf();
cold = 0;
}
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.40 1997/02/14 06:13:50 scottr Exp $ */
/* $NetBSD: autoconf.c,v 1.41 1997/03/26 22:39:03 gwr Exp $ */
/*
* Copyright (c) 1992, 1993
@ -102,15 +102,19 @@ configure()
if (config_rootfound("mainbus", "mainbus") == NULL)
panic("No mainbus found!");
cold = 0;
}
void
cpu_rootconf()
{
findbootdev();
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, mac68k_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.14 1997/03/18 21:21:52 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.15 1997/03/26 22:39:05 gwr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -202,14 +202,17 @@ configure()
if (config_rootfound("mainbus", NULL) == NULL)
panic("autoconfig failed, no root");
cold = 0;
}
void
cpu_rootconf()
{
printf("boot device: %s\n",
(booted_device) ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, 0, mvme68k_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.2 1997/01/31 02:04:43 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.3 1997/03/26 22:39:14 gwr Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -63,20 +63,23 @@ configure()
{
ofrootfound();
(void)spl0();
cold = 0;
}
/*
* Setup root device.
* Configure swap area.
*/
void
cpu_rootconf()
{
/*
* Setup root device.
* Configure swap area.
*/
findroot();
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, powerpc_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.27 1997/03/20 12:00:30 matthias Exp $ */
/* $NetBSD: autoconf.c,v 1.28 1997/03/26 22:39:07 gwr Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -79,7 +79,6 @@ configure()
{
extern int safepri;
int i;
int booted_partition = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
static const char *ipl_names[] = IPL_NAMES;
splhigh();
@ -96,17 +95,16 @@ configure()
safepri = imask[IPL_ZERO];
spl0();
cold = 0;
}
void
cpu_rootconf()
{
int booted_partition = (bootdev >> B_PARTITIONSHIFT) & B_PARTITIONMASK;
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, pc532_nam2blk);
/*
* Configure swap area and related system
* parameter based on device(s) used.
*/
swapconf();
dumpconf();
cold = 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.6 1997/01/31 01:58:44 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.7 1997/03/26 22:39:09 gwr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -87,13 +87,19 @@ struct devnametobdevmaj pica_nam2blk[] = {
*/
configure()
{
struct device *booted_device;
int booted_partition;
(void)splhigh(); /* To be really shure.. */
if(config_rootfound("mainbus", "mainbus") == NULL)
panic("no mainbus found");
(void)spl0();
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
@ -101,10 +107,6 @@ configure()
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, pica_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
u_long bootdev; /* should be dev_t, but not until 32 bits */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.20 1997/02/05 17:53:52 mhitch Exp $ */
/* $NetBSD: autoconf.c,v 1.21 1997/03/26 22:39:12 gwr Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -120,8 +120,7 @@ struct devnametobdevmaj pmax_nam2blk[] = {
void
configure()
{
struct device *booted_device;
int booted_partition, s;
int s;
/*
* Set CPU type for new-style config.
@ -173,16 +172,21 @@ configure()
printf("Beginning old-style SCSI device autoconfiguration\n");
configure_scsi();
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, pmax_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.2 1997/01/31 02:04:43 thorpej Exp $ */
/* $NetBSD: autoconf.c,v 1.3 1997/03/26 22:39:14 gwr Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -63,20 +63,23 @@ configure()
{
ofrootfound();
(void)spl0();
cold = 0;
}
/*
* Setup root device.
* Configure swap area.
*/
void
cpu_rootconf()
{
/*
* Setup root device.
* Configure swap area.
*/
findroot();
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, powerpc_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.68 1997/03/12 11:04:35 pk Exp $ */
/* $NetBSD: autoconf.c,v 1.69 1997/03/26 22:39:17 gwr Exp $ */
/*
* Copyright (c) 1996
@ -784,9 +784,6 @@ configure()
struct confargs oca;
register int node = 0;
register char *cp;
struct bootpath *bp;
struct device *bootdv;
int bootpartition;
/* build the bootpath */
bootpath_build();
@ -863,20 +860,21 @@ configure()
#endif
(void)spl0();
cold = 0;
}
/*
* Configure swap area and related system
* parameter based on device(s) used.
*/
void
cpu_rootconf()
{
struct bootpath *bp;
struct device *bootdv;
int bootpartition;
bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1];
bootdv = bp == NULL ? NULL : bp->dev;
bootpartition = bp == NULL ? 0 : bp->val[2];
setroot(bootdv, bootpartition, sparc_nam2blk);
swapconf();
dumpconf();
cold = 0;
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.45 1997/02/19 00:20:52 gwr Exp $ */
/* $NetBSD: autoconf.c,v 1.46 1997/03/26 22:39:20 gwr Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -86,10 +86,6 @@ configure()
*/
printf("enabling interrupts\n");
(void)spl0();
rootconf();
swapconf();
dumpconf();
cold = 0;
}
@ -211,8 +207,8 @@ static struct device * find_dev_byname __P((char *));
/*
* Choose root and swap devices.
*/
static void
rootconf()
void
cpu_rootconf()
{
MachMonBootParam *bp;
struct prom_n2f *nf;

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.25 1997/03/22 12:51:00 ragge Exp $ */
/* $NetBSD: autoconf.c,v 1.26 1997/03/26 22:39:22 gwr Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -74,12 +74,20 @@ struct devnametobdevmaj vax_nam2blk[] = {
void
configure()
{
struct device *booted_device = NULL;
int booted_partition = 0;
if (config_rootfound("backplane", NULL) == NULL)
panic("backplane not configured");
cold = 0;
mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */
}
void
cpu_rootconf()
{
struct device *booted_device = NULL;
int booted_partition = 0;
/*
* The device we booted from are looked for during autoconfig.
* There can only be one match.
@ -93,11 +101,6 @@ configure()
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, vax_nam2blk);
swapconf();
dumpconf();
cold = 0;
mtpr(GC_CCF, PR_TXDB); /* Clear cold start flag in cpu */
}
int printut __P((void *, const char *));

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.9 1997/02/03 21:08:48 oki Exp $ */
/* $NetBSD: autoconf.c,v 1.10 1997/03/26 22:39:25 gwr Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@ -62,8 +62,6 @@ struct devnametobdevmaj x68k_nam2blk[] = {
void
configure()
{
struct device *booted_device;
int booted_partition;
extern int x68k_realconfig;
x68k_realconfig = 1;
@ -71,18 +69,21 @@ configure()
if (config_rootfound("mainbus", "mainbus") == NULL)
panic("no mainbus found");
cold = 0;
}
void
cpu_rootconf()
{
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition);
printf("boot device: %s\n",
booted_device ? booted_device->dv_xname : "<unknown>");
setroot(booted_device, booted_partition, x68k_nam2blk);
swapconf();
dumpconf();
if (dumplo < 0)
dumplo = 0;
cold = 0;
}
/*ARGSUSED*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_main.c,v 1.97 1997/02/02 02:55:06 thorpej Exp $ */
/* $NetBSD: init_main.c,v 1.98 1997/03/26 22:38:45 gwr Exp $ */
/*
* Copyright (c) 1995 Christopher G. Demetriou. All rights reserved.
@ -319,6 +319,11 @@ main(framep)
roundrobin(NULL);
schedcpu(NULL);
/* Determine the root/swap/dump devices, etc. */
cpu_rootconf();
swapconf();
cpu_dumpconf();
/* Mount the root file system. */
do {
domountroothook();

View File

@ -1,4 +1,4 @@
/* $NetBSD: systm.h,v 1.64 1997/01/31 03:04:31 thorpej Exp $ */
/* $NetBSD: systm.h,v 1.65 1997/03/26 22:38:40 gwr Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@ -261,6 +261,8 @@ void longjmp __P((label_t *));
void consinit __P((void));
void cpu_startup __P((void));
void cpu_rootconf __P((void));
void cpu_dumpconf __P((void));
void cpu_set_kpc __P((struct proc *, void (*)(struct proc *)));