-/*
- * Copyright (c) 1982,1986 Regents of the University of California.
- * All rights reserved. The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
+/*-
+ * Copyright (c) 1982, 1986 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*
- * @(#)autoconf.c 7.19 (Berkeley) %G%
+ * @(#)autoconf.c 7.20 (Berkeley) 5/9/91
*/
/*
#include "sys/conf.h"
#include "sys/dmap.h"
#include "sys/reboot.h"
-#ifdef SECSIZE
-#include "file.h"
-#include "ioctl.h"
-#include "disklabel.h"
-#endif SECSIZE
#include "../include/pte.h"
#include "../include/cpu.h"
/*
* Configure swap space and related parameters.
*/
-#ifndef SECSIZE
swapconf()
{
register struct swdevt *swp;
}
dumpconf();
}
-#else SECSIZE
-swapconf()
-{
- register struct swdevt *swp;
- register int nblks;
- register int bsize;
- struct partinfo dpart;
-
- for (swp = swdevt; swp->sw_dev; swp++)
- if ((nblks = psize(swp->sw_dev, &swp->sw_blksize,
- &swp->sw_bshift)) != -1 &&
- (swp->sw_nblks == 0 || swp->sw_nblks > nblks))
- swp->sw_nblks = nblks;
-
- if (!cold) /* In case called for addition of another drive */
- return;
- if (dumplo == 0) {
- nblks = psize(dumpdev, (int *)0, (int *)0);
- if (nblks == -1 || nblks < ctod(physmem))
- dumplo = 0;
- else
- dumplo = nblks - ctod(physmem);
- }
-}
-
-/*
- * Return size of disk partition in DEV_BSIZE units.
- * If needed, return sector size.
- */
-psize(dev, psize, pshift)
- register dev_t dev;
- int *psize, *pshift;
-{
- register int nblks, bsize, bshift;
- struct partinfo dpart;
-
- if ((*bdevsw[major(dev)].d_ioctl)(dev, DIOCGPART,
- (caddr_t)&dpart, FREAD) == 0)
- bsize = dpart.disklab->d_secsize;
- else
- bsize = DEV_BSIZE;
- if (psize)
- *psize = bsize;
- bshift = 0;
- for (nblks = DEV_BSIZE / bsize; nblks > 1; nblks >>= 1)
- bshift++;
- if (pshift)
- *pshift = bshift;
- nblks = -1;
- if (bdevsw[major(dev)].d_psize) {
- nblks = (*bdevsw[major(dev)].d_psize)(dev);
- if (nblks != -1)
- nblks >>= bshift;
- }
- return (nblks);
-}
-#endif SECSIZE
#define DOSWAP /* Change swdevt, argdev, and dumpdev too */
u_long bootdev; /* should be dev_t, but not until 32 bits */