diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-01 19:25:11 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-06-01 19:25:11 +0000 |
commit | 9c5a2e4c4f28b5ccad97ba01105a6a578f413e57 (patch) | |
tree | 83a977fda25aa6268bb006b9257444599adee9b5 | |
parent | fb46e3f564238bbc25c79e1509ce9b3484d74b33 (diff) |
some architectures called setroot() from cpu_configure(), *way* before some
subsystems were enabled. others used a *md_diskconf -> diskconf() method to
make sure init_main could "do late setroot". Change all architectures to
have diskconf(), use it directly & late. tested by todd and myself on most
architectures, ok miod too
24 files changed, 186 insertions, 192 deletions
diff --git a/sys/arch/alpha/alpha/autoconf.c b/sys/arch/alpha/alpha/autoconf.c index ab9cd83d056..112f8aa12a3 100644 --- a/sys/arch/alpha/alpha/autoconf.c +++ b/sys/arch/alpha/alpha/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.30 2007/05/04 19:30:53 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.31 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.16 1996/11/13 21:13:04 cgd Exp $ */ /* @@ -76,9 +76,6 @@ int atoi(char *); void cpu_configure() { - struct device *bootdv; - int bootpartition; - parse_prom_bootdev(); softintr_init(); @@ -94,6 +91,14 @@ cpu_configure() (void)spl0(); hwrpb_restart_setup(); + cold = 0; +} + +void +diskconf(void) +{ + struct device *bootdv; + int bootpartition; if (booted_device == NULL) printf("WARNING: can't figure what device matches \"%s\"\n", @@ -103,7 +108,6 @@ cpu_configure() setroot(bootdv, bootpartition, RB_USERREQ); dumpconf(); - cold = 0; } void diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c index d17b1de6609..52782ec6943 100644 --- a/sys/arch/amd64/amd64/autoconf.c +++ b/sys/arch/amd64/amd64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.21 2007/05/15 01:56:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.22 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -81,8 +81,6 @@ #include <machine/i82489var.h> #endif -void diskconf(void); - #if 0 #include "bios32.h" #if NBIOS32 > 0 @@ -126,8 +124,6 @@ cpu_configure(void) lcr8(0); spl0(); cold = 0; - - md_diskconf = diskconf; } void diff --git a/sys/arch/armish/armish/autoconf.c b/sys/arch/armish/armish/autoconf.c index 7e9ca5b3d4c..c6ac0c495ba 100644 --- a/sys/arch/armish/armish/autoconf.c +++ b/sys/arch/armish/armish/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.8 2007/05/19 15:49:05 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.9 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ /* @@ -61,16 +61,51 @@ int booted_partition; struct device *bootdv = NULL; extern char *boot_file; -void diskconf(void); void dumpconf(void); +void +device_register(struct device *dev, void *aux) +{ +} + +/* + * void cpu_configure() + * + * Configure all the root devices + * The root devices are expected to configure their own children + */ +void +cpu_configure(void) +{ + softintr_init(); + + /* + * Since various PCI interrupts could be routed via the ICU + * (for PCI devices in the bridge) we need to set up the ICU + * now so that these interrupts can be established correctly + * i.e. This is a hack. + */ + + config_rootfound("mainbus", NULL); + + /* + * We can not know which is our root disk, defer + * until we can checksum blocks to figure it out. + */ + cold = 0; + + /* Time to start taking interrupts so lets open the flood gates .... */ + (void)spl0(); + +} + /* * Now that we are fully operational, we can checksum the * disks, and using some heuristics, hopefully are able to * always determine the correct root disk. */ void -diskconf() +diskconf(void) { dev_t tmpdev; @@ -106,44 +141,6 @@ diskconf() dumpconf(); } - -void -device_register(struct device *dev, void *aux) -{ -} - -/* - * void cpu_configure() - * - * Configure all the root devices - * The root devices are expected to configure their own children - */ -void -cpu_configure(void) -{ - softintr_init(); - - /* - * Since various PCI interrupts could be routed via the ICU - * (for PCI devices in the bridge) we need to set up the ICU - * now so that these interrupts can be established correctly - * i.e. This is a hack. - */ - - config_rootfound("mainbus", NULL); - - /* - * We can not know which is our root disk, defer - * until we can checksum blocks to figure it out. - */ - md_diskconf = diskconf; - cold = 0; - - /* Time to start taking interrupts so lets open the flood gates .... */ - (void)spl0(); - -} - struct nam2blk nam2blk[] = { { "wd", 16 }, { "sd", 24 }, diff --git a/sys/arch/aviion/aviion/autoconf.c b/sys/arch/aviion/aviion/autoconf.c index a68085097ca..481c08f3d58 100644 --- a/sys/arch/aviion/aviion/autoconf.c +++ b/sys/arch/aviion/aviion/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.3 2007/05/04 19:30:54 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.4 2007/06/01 19:25:09 deraadt Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -90,14 +90,18 @@ cpu_configure() */ set_psr(get_psr() & ~PSR_IND); spl0(); + cold = 0; +} +void +diskconf(void) +{ printf("boot device: %s\n", (bootdv) ? bootdv->dv_xname : "<unknown>"); setroot(bootdv, bootpart, RB_USERREQ); dumpconf(); - cold = 0; } /* diff --git a/sys/arch/cats/cats/autoconf.c b/sys/arch/cats/cats/autoconf.c index 61ca4d39596..eda554068bf 100644 --- a/sys/arch/cats/cats/autoconf.c +++ b/sys/arch/cats/cats/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.11 2007/05/19 15:49:05 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.12 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ /* @@ -63,33 +63,6 @@ extern char *boot_file; void isa_intr_init(void); -void diskconf(void); - -/* - * Now that we are fully operational, we can checksum the - * disks, and using some heuristics, hopefully are able to - * always determine the correct root disk. - */ -void -diskconf() -{ -#if 0 - /* - * Configure root, swap, and dump area. This is - * currently done by running the same checksum - * algorithm over all known disks, as was done in - * /boot. Then we basically fixup the *dev vars - * from the info we gleaned from this. - */ - dkcsumattach(); -#endif - - printf("boot_file: '%s'\n", boot_file); - setroot(bootdv, 0, RB_USERREQ); - dumpconf(); -} - - /* * void cpu_configure() * @@ -115,7 +88,6 @@ cpu_configure(void) * We can not know which is our root disk, defer * until we can checksum blocks to figure it out. */ - md_diskconf = diskconf; cold = 0; /* Time to start taking interrupts so lets open the flood gates .... */ @@ -123,6 +95,30 @@ cpu_configure(void) } +/* + * Now that we are fully operational, we can checksum the + * disks, and using some heuristics, hopefully are able to + * always determine the correct root disk. + */ +void +diskconf(void) +{ +#if 0 + /* + * Configure root, swap, and dump area. This is + * currently done by running the same checksum + * algorithm over all known disks, as was done in + * /boot. Then we basically fixup the *dev vars + * from the info we gleaned from this. + */ + dkcsumattach(); +#endif + + printf("boot_file: '%s'\n", boot_file); + setroot(bootdv, 0, RB_USERREQ); + dumpconf(); +} + struct nam2blk nam2blk[] = { { "wd", 16 }, { "sd", 24 }, diff --git a/sys/arch/hp300/hp300/autoconf.c b/sys/arch/hp300/hp300/autoconf.c index 10c4a999cfe..58d58bfd7ef 100644 --- a/sys/arch/hp300/hp300/autoconf.c +++ b/sys/arch/hp300/hp300/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.42 2007/05/04 19:30:54 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.43 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.45 1999/04/10 17:31:02 kleink Exp $ */ /* @@ -160,7 +160,6 @@ ddlist_t dev_data_list; /* all dev_datas */ ddlist_t dev_data_list_hpib; /* hpib controller dev_datas */ ddlist_t dev_data_list_scsi; /* scsi controller dev_datas */ -void diskconf(void); void findbootdev(void); void findbootdev_slave(ddlist_t *, int, int, int); void setbootdev(void); @@ -261,14 +260,11 @@ cpu_configure() printf("boot device: %s\n", bootdv->dv_xname); } } - - md_diskconf = diskconf; - cold = 0; } void -diskconf() +diskconf(void) { int bootpartition = 0; diff --git a/sys/arch/hppa/hppa/autoconf.c b/sys/arch/hppa/hppa/autoconf.c index 3bd841ab4ca..3993f982fae 100644 --- a/sys/arch/hppa/hppa/autoconf.c +++ b/sys/arch/hppa/hppa/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.48 2007/05/29 20:36:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.49 2007/06/01 19:25:09 deraadt Exp $ */ /* * Copyright (c) 1998-2003 Michael Shalayeff @@ -457,8 +457,6 @@ cpu_configure(void) print_devpath("bootpath", &PAGE0->mem_boot); - setroot(bootdv, 0, RB_USERREQ); - dumpconf(); if (cold_hook) (*cold_hook)(HPPA_COLD_HOT); @@ -469,6 +467,13 @@ cpu_configure(void) cold = 0; } +void +diskconf(void) +{ + setroot(bootdv, 0, RB_USERREQ); + dumpconf(); +} + struct nam2blk nam2blk[] = { { "rd", 3 }, { "sd", 4 }, diff --git a/sys/arch/hppa64/hppa64/autoconf.c b/sys/arch/hppa64/hppa64/autoconf.c index b6157615ba7..c55300d144a 100644 --- a/sys/arch/hppa64/hppa64/autoconf.c +++ b/sys/arch/hppa64/hppa64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.8 2007/05/29 20:36:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.9 2007/06/01 19:25:09 deraadt Exp $ */ /* * Copyright (c) 1998-2005 Michael Shalayeff @@ -109,9 +109,6 @@ cpu_configure(void) mtctl(0xffffffffffffffffULL, CR_EIEM); spl0(); - print_devpath("boot path", &PAGE0->mem_boot); - setroot(bootdv, 0, RB_USERREQ); - dumpconf(); if (cold_hook) (*cold_hook)(HPPA_COLD_HOT); @@ -122,6 +119,14 @@ cpu_configure(void) cold = 0; } +void +diskconf(void) +{ + print_devpath("boot path", &PAGE0->mem_boot); + setroot(bootdv, 0, RB_USERREQ); + dumpconf(); +} + #ifdef USELEDS /* * turn the heartbeat alive. diff --git a/sys/arch/i386/i386/autoconf.c b/sys/arch/i386/i386/autoconf.c index 966dbd1e75b..0177206a6e1 100644 --- a/sys/arch/i386/i386/autoconf.c +++ b/sys/arch/i386/i386/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.74 2007/05/15 01:56:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.75 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $ */ /*- @@ -76,8 +76,6 @@ #include <machine/i82093var.h> #endif -void diskconf(void); - /* * The following several variables are related to * the configuration process, and are used in initializing @@ -146,7 +144,6 @@ cpu_configure(void) * We can not know which is our root disk, defer * until we can checksum blocks to figure it out. */ - md_diskconf = diskconf; cold = 0; #ifdef I686_CPU diff --git a/sys/arch/landisk/landisk/autoconf.c b/sys/arch/landisk/landisk/autoconf.c index b78dca09dac..3a167d06c2d 100644 --- a/sys/arch/landisk/landisk/autoconf.c +++ b/sys/arch/landisk/landisk/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.8 2007/05/15 01:56:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.9 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.1 2006/09/01 21:26:18 uwe Exp $ */ /*- @@ -48,8 +48,6 @@ int cold = 1; -void diskconf(void); - void device_register(struct device *dev, void *aux) { @@ -66,11 +64,8 @@ cpu_configure(void) if (config_rootfound("mainbus", NULL) == NULL) panic("no mainbus found"); - md_diskconf = diskconf; - /* Configuration is finished, turn on interrupts. */ spl0(); - cold = 0; } diff --git a/sys/arch/luna88k/luna88k/autoconf.c b/sys/arch/luna88k/luna88k/autoconf.c index 5250c359251..b666570ed40 100644 --- a/sys/arch/luna88k/luna88k/autoconf.c +++ b/sys/arch/luna88k/luna88k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.10 2007/05/04 19:30:55 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.11 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -85,14 +85,16 @@ cpu_configure() */ set_psr(get_psr() & ~PSR_IND); spl0(); + cold = 0; +} +void +diskconf(void) +{ printf("boot device: %s\n", (bootdv) ? bootdv->dv_xname : "<unknown>"); setroot(bootdv, 0, RB_USERREQ); - dumpconf(); - - cold = 0; } /* diff --git a/sys/arch/mac68k/mac68k/autoconf.c b/sys/arch/mac68k/mac68k/autoconf.c index 4dd4dce7bd1..ff73393f931 100644 --- a/sys/arch/mac68k/mac68k/autoconf.c +++ b/sys/arch/mac68k/mac68k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.29 2007/05/17 13:06:57 martin Exp $ */ +/* $OpenBSD: autoconf.c,v 1.30 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.38 1996/12/18 05:46:09 scottr Exp $ */ /* @@ -67,7 +67,6 @@ #include <scsi/scsiconf.h> int target_to_unit(u_long, u_long, u_long); -void diskconf(void); void findbootdev(void); struct device *booted_device; @@ -118,7 +117,6 @@ cpu_configure() spl0(); findbootdev(); - md_diskconf = diskconf; cold = 0; } @@ -128,7 +126,7 @@ device_register(struct device *dev, void *aux) } void -diskconf() +diskconf(void) { setroot(booted_device, booted_partition, RB_USERREQ); dumpconf(); diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c index 97b9cdcbf62..ee165716fc1 100644 --- a/sys/arch/macppc/macppc/autoconf.c +++ b/sys/arch/macppc/macppc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.31 2007/05/26 15:24:21 drahn Exp $ */ +/* $OpenBSD: autoconf.c,v 1.32 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1996, 1997 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -37,7 +37,7 @@ * from: Utah Hdr: autoconf.c 1.31 91/01/21 * * from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: autoconf.c,v 1.31 2007/05/26 15:24:21 drahn Exp $ + * $Id: autoconf.c,v 1.32 2007/06/01 19:25:10 deraadt Exp $ */ /* @@ -71,7 +71,6 @@ struct device *getdevunit(char *, int); static struct devmap *findtype(char **); void makebootdev(char *cp); int getpno(char **); -void diskconf(void); /* * The following several variables are related to @@ -98,12 +97,6 @@ cpu_configure() if (config_rootfound("mainbus", "mainbus") == 0) panic("no mainbus found"); (void)spl0(); - - /* - * We can not know which is our root disk, defer - * until we can checksum blocks to figure it out. - */ - md_diskconf = diskconf; cold = 0; } diff --git a/sys/arch/mvme68k/mvme68k/autoconf.c b/sys/arch/mvme68k/mvme68k/autoconf.c index a93c6bac3e8..c9235e5576f 100644 --- a/sys/arch/mvme68k/mvme68k/autoconf.c +++ b/sys/arch/mvme68k/mvme68k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.38 2007/05/04 19:30:55 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.39 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -197,10 +197,14 @@ cpu_configure() printf("boot device: %s\n", (bootdv) ? bootdv->dv_xname : "<unknown>"); + cold = 0; +} +void +diskconf(void) +{ setroot(bootdv, bootpart, RB_USERREQ); dumpconf(); - cold = 0; } /* diff --git a/sys/arch/mvme88k/mvme88k/autoconf.c b/sys/arch/mvme88k/mvme88k/autoconf.c index 62c606e7aa6..670b46d89c1 100644 --- a/sys/arch/mvme88k/mvme88k/autoconf.c +++ b/sys/arch/mvme88k/mvme88k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.37 2007/05/04 19:30:55 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.38 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -85,23 +85,26 @@ cpu_configure() set_psr(get_psr() & ~PSR_IND); spl0(); - printf("boot device: %s\n", - (bootdv) ? bootdv->dv_xname : "<unknown>"); - - setroot(bootdv, bootpart, RB_USERREQ); - dumpconf(); - /* * Finally switch to the real console driver, * and say goodbye to the BUG! */ cn_tab = NULL; cninit(); - cold = 0; } void +diskconf(void) +{ + printf("boot device: %s\n", + (bootdv) ? bootdv->dv_xname : "<unknown>"); + + setroot(bootdv, bootpart, RB_USERREQ); + dumpconf(); +} + +void device_register(struct device *dev, void *aux) { if (bootpart == -1) /* ignore flag from controller driver? */ diff --git a/sys/arch/mvmeppc/mvmeppc/autoconf.c b/sys/arch/mvmeppc/mvmeppc/autoconf.c index fafb7a88d12..69d6efa1ee5 100644 --- a/sys/arch/mvmeppc/mvmeppc/autoconf.c +++ b/sys/arch/mvmeppc/mvmeppc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.17 2007/05/29 20:36:48 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.18 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1996, 1997 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -37,7 +37,7 @@ * from: Utah Hdr: autoconf.c 1.31 91/01/21 * * from: @(#)autoconf.c 8.1 (Berkeley) 6/10/93 - * $Id: autoconf.c,v 1.17 2007/05/29 20:36:48 deraadt Exp $ + * $Id: autoconf.c,v 1.18 2007/06/01 19:25:10 deraadt Exp $ */ /* @@ -61,7 +61,6 @@ extern void dumpconf(void); struct device *getdevunit(char *, int); -void diskconf(void); void calc_delayconst(void); /* clock.c */ /* @@ -94,13 +93,11 @@ cpu_configure() * as the console for now, and it requires the clock to be ticking * for proper operation (think boot -a ...) */ - md_diskconf = diskconf; - cold = 0; } void -diskconf() +diskconf(void) { printf("boot device: %s\n", (bootdv != NULL) ? bootdv->dv_xname : "<unknown>"); diff --git a/sys/arch/sgi/sgi/autoconf.c b/sys/arch/sgi/sgi/autoconf.c index 4e0d68235fb..fdf733ad4da 100644 --- a/sys/arch/sgi/sgi/autoconf.c +++ b/sys/arch/sgi/sgi/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.14 2007/05/15 01:56:47 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.15 2007/06/01 19:25:10 deraadt Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom * Copyright (c) 1995 Theo de Raadt @@ -61,7 +61,6 @@ #include <machine/autoconf.h> #include <mips64/archtype.h> -void diskconf(void); extern void dumpconf(void); struct device *getdevunit(char *, int); const struct devmap *boot_findtype(char *); @@ -101,8 +100,6 @@ cpu_configure(void) } splinit(); /* Initialized, fire up interrupt system */ - - md_diskconf = diskconf; cold = 0; } diff --git a/sys/arch/solbourne/solbourne/autoconf.c b/sys/arch/solbourne/solbourne/autoconf.c index 48a6a185a04..a77b07b3c6d 100644 --- a/sys/arch/solbourne/solbourne/autoconf.c +++ b/sys/arch/solbourne/solbourne/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.7 2007/05/04 19:30:55 deraadt Exp $ */ +/* $OpenBSD: autoconf.c,v 1.8 2007/06/01 19:25:10 deraadt Exp $ */ /* OpenBSD: autoconf.c,v 1.64 2005/03/23 17:10:24 miod Exp */ /* @@ -277,8 +277,6 @@ cpu_configure() struct confargs oca; register int node = 0; register char *cp; - struct bootpath *bp; - struct device *bootdv; int s; extern struct user *proc0paddr; @@ -305,15 +303,6 @@ cpu_configure() ((lda(GLU_ICR, ASI_PHYS_IO) >> 24) & ~GICR_DISABLE_ALL) << 24); (void)spl0(); - /* - * Configure swap area and related system - * parameter based on device(s) used. - */ - bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1]; - bootdv = (bp == NULL) ? NULL : bp->dev; - - setroot(bootdv, bp->val[2], RB_USERREQ | RB_HALT); - dumpconf(); cold = 0; /* @@ -328,6 +317,23 @@ cpu_configure() splx(s); } +void +diskconf(void) +{ + struct bootpath *bp; + struct device *bootdv; + + /* + * Configure swap area and related system + * parameter based on device(s) used. + */ + bp = nbootpath == 0 ? NULL : &bootpath[nbootpath-1]; + bootdv = (bp == NULL) ? NULL : bp->dev; + + setroot(bootdv, bp->val[2], RB_USERREQ | RB_HALT); + dumpconf(); +} + /* * Console `sync' command. SunOS just does a `panic: zero' so I guess * no one really wants anything fancy... diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index a2bbcc4f915..f6c6fe6cb02 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.79 2007/05/29 09:53:54 sobrado Exp $ */ +/* $OpenBSD: autoconf.c,v 1.80 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.73 1997/07/29 09:41:53 fair Exp $ */ /* @@ -749,8 +749,6 @@ cpu_configure() struct confargs oca; register int node = 0; register char *cp; - struct bootpath *bp; - struct device *bootdv; int s; extern struct user *proc0paddr; @@ -838,6 +836,25 @@ cpu_configure() (void)spl0(); /* + * Re-zero proc0's user area, to nullify the effect of the + * stack running into it during auto-configuration. + * XXX - should fix stack usage. + */ + s = splhigh(); + bzero(proc0paddr, sizeof(struct user)); + + pmap_redzone(); + splx(s); + cold = 0; +} + +void +diskconf(void) +{ + struct bootpath *bp; + struct device *bootdv; + + /* * Configure swap area and related system * parameter based on device(s) used. */ @@ -848,18 +865,6 @@ cpu_configure() setroot(bootdv, bp->val[2], RB_USERREQ | RB_HALT); dumpconf(); - cold = 0; - - /* - * Re-zero proc0's user area, to nullify the effect of the - * stack running into it during auto-configuration. - * XXX - should fix stack usage. - */ - s = splhigh(); - bzero(proc0paddr, sizeof(struct user)); - - pmap_redzone(); - splx(s); } /* diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 00b3000f4dd..428e45c3eaf 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.66 2007/05/13 09:16:05 kettenis Exp $ */ +/* $OpenBSD: autoconf.c,v 1.67 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -111,7 +111,6 @@ static int mbprint(void *, const char *); void sync_crash(void); int mainbus_match(struct device *, void *, void *); static void mainbus_attach(struct device *, struct device *, void *); -void diskconf(void); struct device *booted_device; struct bootpath bootpath[8]; @@ -496,8 +495,6 @@ cpu_configure() #endif (void)spl0(); - - md_diskconf = diskconf; cold = 0; } diff --git a/sys/arch/vax/vax/autoconf.c b/sys/arch/vax/vax/autoconf.c index 90566830a9a..0d0e43da7ea 100644 --- a/sys/arch/vax/vax/autoconf.c +++ b/sys/arch/vax/vax/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.28 2007/06/01 17:10:00 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.29 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.45 1999/10/23 14:56:05 ragge Exp $ */ /* @@ -65,7 +65,6 @@ void dumpconf(void); /* machdep.c */ void gencnslask(void); -void diskconf(void); struct cpu_dep *dep_call; @@ -80,22 +79,25 @@ cpu_configure() if (config_rootfound("mainbus", NULL) == NULL) panic("mainbus not configured"); - printf("boot device: %s\n", - bootdv ? bootdv->dv_xname : "<unknown>"); - - setroot(bootdv, booted_partition, RB_USERREQ); - dumpconf(); - /* * We're ready to start up. Clear CPU cold start flag. */ - cold = 0; if (dep_call->cpu_clrf) (*dep_call->cpu_clrf)(); } +void +diskconf(void) +{ + printf("boot device: %s\n", + bootdv ? bootdv->dv_xname : "<unknown>"); + + setroot(bootdv, booted_partition, RB_USERREQ); + dumpconf(); +} + int mainbus_print(void *, const char *); int mainbus_match(struct device *, struct cfdata *, void *); void mainbus_attach(struct device *, struct device *, void *); diff --git a/sys/arch/zaurus/zaurus/autoconf.c b/sys/arch/zaurus/zaurus/autoconf.c index dc9cd7c330c..257f0b105ed 100644 --- a/sys/arch/zaurus/zaurus/autoconf.c +++ b/sys/arch/zaurus/zaurus/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.11 2007/05/19 15:49:06 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.12 2007/06/01 19:25:10 deraadt Exp $ */ /* $NetBSD: autoconf.c,v 1.2 2001/09/05 16:17:36 matt Exp $ */ /* @@ -61,7 +61,6 @@ int booted_partition; struct device *bootdv = NULL; extern char *boot_file; -void diskconf(void); void dumpconf(void); /* @@ -133,7 +132,6 @@ cpu_configure(void) * We can not know which is our root disk, defer * until we can checksum blocks to figure it out. */ - md_diskconf = diskconf; cold = 0; /* Time to start taking interrupts so lets open the flood gates .... */ diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 91069c58232..e6f95b17957 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.141 2007/05/31 18:16:59 dlg Exp $ */ +/* $OpenBSD: init_main.c,v 1.142 2007/06/01 19:25:09 deraadt Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -119,7 +119,6 @@ struct proc *initproc; int cmask = CMASK; extern struct user *proc0paddr; -void (*md_diskconf)(void) = NULL; struct vnode *rootvp, *swapdev_vp; int boothowto; struct timeval boottime; @@ -446,8 +445,7 @@ main(void *framep) #endif /* Configure root/swap devices */ - if (md_diskconf) - (*md_diskconf)(); + diskconf(); /* Mount the root file system. */ if (vfs_mountroot()) diff --git a/sys/sys/systm.h b/sys/sys/systm.h index a2a0da9aadb..2e36c9997cc 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: systm.h,v 1.71 2007/05/11 10:06:56 pedro Exp $ */ +/* $OpenBSD: systm.h,v 1.72 2007/06/01 19:25:08 deraadt Exp $ */ /* $NetBSD: systm.h,v 1.50 1996/06/09 04:55:09 briggs Exp $ */ /*- @@ -289,8 +289,7 @@ void consinit(void); void cpu_startup(void); void cpu_configure(void); -extern void (*md_diskconf)(void); - +void diskconf(void); #ifdef GPROF void kmstartup(void); |