summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-14 03:00:10 +0000
committerdg <dg@FreeBSD.org>1995-05-14 03:00:10 +0000
commitb649d7b9c7fc4e854447610d77a8f589d6d879df (patch)
treee3f8adb9c567dce966929b13f5ef9bc8016008d6 /sys/amd64
parent8f5311b61712fdd904658b7a56c5832f71bffcab (diff)
downloadFreeBSD-src-b649d7b9c7fc4e854447610d77a8f589d6d879df.zip
FreeBSD-src-b649d7b9c7fc4e854447610d77a8f589d6d879df.tar.gz
Changed swap partition handling/allocation so that it doesn't
require specific partitions be mentioned in the kernel config file ("swap on foo" is now obsolete). From Poul-Henning: The visible effect is this: As default, unless options "NSWAPDEV=23" is in your config, you will have four swap-devices. You can swapon(2) any block device you feel like, it doesn't have to be in the kernel config. There is a performance/resource win available by getting the NSWAPDEV right (but only if you have just one swap-device ??), but using that as default would be too restrictive. The invisible effect is that: Swap-handling disappears from the $arch part of the kernel. It gets a lot simpler (-145 lines) and cleaner. Reviewed by: John Dyson, David Greenman Submitted by: Poul-Henning Kamp, with minor changes by me.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/autoconf.c59
-rw-r--r--sys/amd64/conf/GENERIC4
2 files changed, 3 insertions, 60 deletions
diff --git a/sys/amd64/amd64/autoconf.c b/sys/amd64/amd64/autoconf.c
index 8761799..aae1850 100644
--- a/sys/amd64/amd64/autoconf.c
+++ b/sys/amd64/amd64/autoconf.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
- * $Id: autoconf.c,v 1.29 1995/05/11 19:26:07 rgrimes Exp $
+ * $Id: autoconf.c,v 1.30 1995/05/12 19:17:11 wollman Exp $
*/
/*
@@ -57,7 +57,6 @@
#include <machine/md_var.h>
#include <machine/pte.h>
-static void swapconf(void);
static void setroot(void);
/*
@@ -209,43 +208,9 @@ configure()
* parameter based on device(s) used.
*/
setconf();
- swapconf();
cold = 0;
}
-/*
- * Configure swap space and related parameters.
- */
-static void
-swapconf()
-{
- register struct swdevt *swp;
- register int nblks;
-
- for (swp = swdevt; swp->sw_dev > 0; swp++)
- {
- unsigned d = major(swp->sw_dev);
-
- if (d > nblkdev) break;
- if (bdevsw[d].d_psize) {
- nblks = (*bdevsw[d].d_psize)(swp->sw_dev);
- if (nblks > 0 &&
- (swp->sw_nblks == 0 || swp->sw_nblks > nblks))
- swp->sw_nblks = nblks;
- else
- swp->sw_nblks = 0;
- }
- swp->sw_nblks = ctod(dtoc(swp->sw_nblks));
- }
- if (dumpdev != NODEV) {
- if (dumplo == 0 && bdevsw[major(dumpdev)].d_psize)
- dumplo = (*bdevsw[major(dumpdev)].d_psize)(dumpdev) -
- Maxmem*NBPG/512;
- if (dumplo < 0)
- dumplo = 0;
- }
-}
-
int
setdumpdev(dev_t dev)
{
@@ -267,7 +232,6 @@ setdumpdev(dev_t dev)
/*NOTREACHED*/
}
-#define DOSWAP /* change swdevt and dumpdev */
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */
static char devname[][2] = {
@@ -325,25 +289,4 @@ setroot()
devname[majdev][0], devname[majdev][1],
mindev >> (majdev == FDMAJOR ? FDUNITSHIFT : PARTITIONSHIFT),
part + 'a');
-#ifdef DOSWAP
- mindev &= ~PARTITIONMASK;
- for (swp = swdevt; swp->sw_dev; swp++) {
- if (majdev == major(swp->sw_dev) &&
- mindev == (minor(swp->sw_dev) & ~PARTITIONMASK)) {
-
- temp = swdevt[0].sw_dev;
- swdevt[0].sw_dev = swp->sw_dev;
- swp->sw_dev = temp;
- break;
- }
- }
- if (swp->sw_dev == 0)
- return;
- /*
- * If dumpdev was the same as the old primary swap
- * device, move it to the new primary swap device.
- */
- if (temp == dumpdev)
- dumpdev = swdevt[0].sw_dev;
-#endif
}
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index 2514f78..675c405 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -1,7 +1,7 @@
#
# GENERIC -- Generic machine with WD/AHx/NCR/BTx family disks
#
-# $Id: GENERIC,v 1.43 1995/04/24 05:33:58 phk Exp $
+# $Id: GENERIC,v 1.44 1995/05/02 04:40:06 phk Exp $
#
machine "i386"
@@ -23,7 +23,7 @@ options "SCSI_DELAY=15" #Be pessimistic about Joe SCSI device
options BOUNCE_BUFFERS #include support for DMA bounce buffers
options UCONSOLE #Allow users to grab the console
-config kernel root on wd0 swap on wd0 and wd1 and wd2 and wd3 and sd0 and sd1 and vn0 dumps on wd0
+config kernel root on wd0
controller isa0
controller pci0
OpenPOWER on IntegriCloud