Make booted_device global (and booted_parition for consitency).

Eliminate it from header files and other extern definitions.
This commit is contained in:
matt 2000-06-01 00:49:49 +00:00
parent e4c35df1c9
commit c9aff328d9
22 changed files with 62 additions and 74 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.16 1998/05/14 00:01:30 thorpej Exp $ */ /* $NetBSD: autoconf.h,v 1.17 2000/06/01 00:49:49 matt Exp $ */
/* /*
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@ -112,7 +112,6 @@ struct alpha_variation_table {
extern struct evcnt clock_intr_evcnt; extern struct evcnt clock_intr_evcnt;
#endif #endif
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
extern struct bootdev_data *bootdev_data; extern struct bootdev_data *bootdev_data;
extern struct bootinfo_kernel bootinfo; extern struct bootinfo_kernel bootinfo;

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.73 2000/05/18 15:39:22 kleink Exp $ */ /* $NetBSD: autoconf.c,v 1.74 2000/06/01 00:49:51 matt Exp $ */
/* /*
* Copyright (c) 1994 Christian E. Hopps * Copyright (c) 1994 Christian E. Hopps
@ -50,6 +50,8 @@ int mbmatch __P((struct device *, struct cfdata *, void *));
#include <sys/kernel.h> #include <sys/kernel.h>
u_long boot_partition; u_long boot_partition;
struct device *booted_device;
int booted_partition;
/* /*
* called at boot time, configure all devices on system * called at boot time, configure all devices on system
@ -110,9 +112,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
#ifdef DEBUG_KERNEL_START #ifdef DEBUG_KERNEL_START
printf("survived findroot()\n"); printf("survived findroot()\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.1 2000/05/25 22:12:01 is Exp $ */ /* $NetBSD: powerpc.h,v 1.2 2000/06/01 00:49:59 matt Exp $ */
/* /*
* Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 Wolfgang Solfrank.
@ -52,7 +52,6 @@ int dk_match __P((char *name));
void ofrootfound __P((void)); void ofrootfound __P((void));
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
#endif /* _MACHINE_POWERPC_H_ */ #endif /* _MACHINE_POWERPC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.13 2000/01/23 21:01:50 soda Exp $ */ /* $NetBSD: autoconf.c,v 1.14 2000/06/01 00:49:52 matt Exp $ */
/* $OpenBSD: autoconf.c,v 1.9 1997/05/18 13:45:20 pefo Exp $ */ /* $OpenBSD: autoconf.c,v 1.9 1997/05/18 13:45:20 pefo Exp $ */
/* /*
@ -72,6 +72,9 @@ int getpno __P((char **cp));
* the machine. * the machine.
*/ */
int cpuspeed = 150; /* approx # instr per usec. */ int cpuspeed = 150; /* approx # instr per usec. */
struct device *booted_device;
int booted_partition;
void findroot __P((struct device **, int *)); void findroot __P((struct device **, int *));
@ -97,9 +100,6 @@ int nfs_boot_rfc951 = 1;
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.32 1999/09/17 19:59:38 thorpej Exp $ */ /* $NetBSD: autoconf.c,v 1.33 2000/06/01 00:49:52 matt Exp $ */
/* /*
* Copyright (c) 1994-1998 Mark Brinicombe. * Copyright (c) 1994-1998 Mark Brinicombe.
@ -70,8 +70,8 @@ extern void startrtclock __P((void));
#include "podulebus.h" #include "podulebus.h"
static struct device *booted_device; struct device *booted_device;
static int booted_partition; int booted_partition;
extern dev_t dumpdev; extern dev_t dumpdev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.31 1999/09/17 19:59:40 thorpej Exp $ */ /* $NetBSD: autoconf.c,v 1.32 2000/06/01 00:49:53 matt Exp $ */
/* /*
* Copyright (c) 1995 Leo Weppelman * Copyright (c) 1995 Leo Weppelman
@ -47,6 +47,9 @@ void mbattach __P((struct device *, struct device *, void *));
int mbprint __P((void *, const char *)); int mbprint __P((void *, const char *));
int mbmatch __P((struct device *, struct cfdata *, void *)); int mbmatch __P((struct device *, struct cfdata *, void *));
struct device *booted_device;
int booted_partition;
int atari_realconfig; int atari_realconfig;
#include <sys/kernel.h> #include <sys/kernel.h>
@ -67,9 +70,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
setroot(booted_device, booted_partition); setroot(booted_device, booted_partition);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.5 1999/09/17 19:59:41 thorpej Exp $ */ /* $NetBSD: autoconf.c,v 1.6 2000/06/01 00:49:53 matt Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -58,6 +58,9 @@
#include <machine/pte.h> #include <machine/pte.h>
#include <machine/intr.h> #include <machine/intr.h>
struct device *booted_device;
int booted_partition;
void findroot __P((struct device **, int *)); void findroot __P((struct device **, int *));
/* /*
@ -81,9 +84,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.3 1998/08/24 01:40:29 sakamoto Exp $ */ /* $NetBSD: powerpc.h,v 1.4 2000/06/01 00:49:59 matt Exp $ */
/* /*
* Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 Wolfgang Solfrank.
@ -48,7 +48,6 @@ void mem_regions __P((struct mem_region **, struct mem_region **));
void ppc_exit __P((void)) __attribute__((__noreturn__)); void ppc_exit __P((void)) __attribute__((__noreturn__));
void ppc_boot __P((char *bootspec)) __attribute__((__noreturn__)); void ppc_boot __P((char *bootspec)) __attribute__((__noreturn__));
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
#endif /* _MACHINE_POWERPC_H_ */ #endif /* _MACHINE_POWERPC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.2 2000/03/31 14:51:49 soren Exp $ */ /* $NetBSD: autoconf.c,v 1.3 2000/06/01 00:49:54 matt Exp $ */
/* /*
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved. * Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
@ -33,6 +33,9 @@
#include <machine/cpu.h> #include <machine/cpu.h>
struct device *booted_device;
int booted_partition;
static void findroot(struct device **, int *); static void findroot(struct device **, int *);
int cpuspeed = 100; /* Until we know more precisely. */ int cpuspeed = 100; /* Until we know more precisely. */
@ -51,9 +54,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.5 2000/01/16 20:01:41 uch Exp $ */ /* $NetBSD: autoconf.c,v 1.6 2000/06/01 00:49:54 matt Exp $ */
/* /*
* Copyright (c) 1988 University of Utah. * Copyright (c) 1988 University of Utah.
@ -43,7 +43,7 @@
*/ */
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2000/01/16 20:01:41 uch Exp $"); __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.6 2000/06/01 00:49:54 matt Exp $");
/* /*
* Setup the system to run on the current machine. * Setup the system to run on the current machine.
@ -72,6 +72,9 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.5 2000/01/16 20:01:41 uch Exp $");
int cpuspeed = 7; /* approx # instr per usec. */ int cpuspeed = 7; /* approx # instr per usec. */
struct device *booted_device;
int booted_partition;
static char booted_device_name[16]; static char booted_device_name[16];
static void get_device __P((char *name, struct device **devpp, int *partp)); static void get_device __P((char *name, struct device **devpp, int *partp));
@ -103,9 +106,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
get_device(booted_device_name, &booted_device, &booted_partition); get_device(booted_device_name, &booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.47 2000/03/23 13:49:49 ad Exp $ */ /* $NetBSD: autoconf.c,v 1.48 2000/06/01 00:49:55 matt Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -87,6 +87,9 @@ extern int i386_ndisks;
#include <i386/pci/pcibios.h> #include <i386/pci/pcibios.h>
#endif #endif
struct device *booted_device;
int booted_partition;
/* /*
* Determine i/o configuration for a machine. * Determine i/o configuration for a machine.
*/ */
@ -122,9 +125,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
matchbiosdisks(); matchbiosdisks();
@ -261,7 +261,6 @@ matchbiosdisks()
#ifdef COMPAT_OLDBOOT #ifdef COMPAT_OLDBOOT
u_long bootdev = 0; /* should be dev_t, but not until 32 bits */ u_long bootdev = 0; /* should be dev_t, but not until 32 bits */
#endif #endif
struct device *booted_device;
/* /*
* helper function for "findroot()": * helper function for "findroot()":

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.2 1998/08/21 16:13:28 tsubai Exp $ */ /* $NetBSD: powerpc.h,v 1.3 2000/06/01 00:49:59 matt Exp $ */
/* /*
* Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 Wolfgang Solfrank.
@ -52,7 +52,6 @@ int dk_match __P((char *name));
void ofrootfound __P((void)); void ofrootfound __P((void));
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
#endif /* _MACHINE_POWERPC_H_ */ #endif /* _MACHINE_POWERPC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.11 1999/12/22 05:55:26 tsubai Exp $ */ /* $NetBSD: autoconf.c,v 1.12 2000/06/01 00:49:56 matt Exp $ */
/* /*
* Copyright (c) 1988 University of Utah. * Copyright (c) 1988 University of Utah.
@ -76,6 +76,9 @@
*/ */
int cpuspeed = 10; /* approx # instr per usec. */ int cpuspeed = 10; /* approx # instr per usec. */
struct device *booted_device;
int booted_partition;
void findroot __P((struct device **, int *)); void findroot __P((struct device **, int *));
/* /*
@ -117,9 +120,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_xe.c,v 1.3 1999/02/13 09:44:50 dbj Exp $ */ /* $NetBSD: if_xe.c,v 1.4 2000/06/01 00:49:51 matt Exp $ */
/* /*
* Copyright (c) 1998 Darrin B. Jewell * Copyright (c) 1998 Darrin B. Jewell
* All rights reserved. * All rights reserved.
@ -160,10 +160,7 @@ xe_attach(parent, self, aux)
isrlink_autovec(xe_rint, sc, NEXT_I_IPL(NEXT_I_ENETR), 1); isrlink_autovec(xe_rint, sc, NEXT_I_IPL(NEXT_I_ENETR), 1);
INTR_ENABLE(NEXT_I_ENETR); INTR_ENABLE(NEXT_I_ENETR);
{ booted_device = &(sc->sc_dev);
extern struct device *booted_device;
booted_device = &(sc->sc_dev);
}
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.3 1998/08/26 04:54:17 sakamoto Exp $ */ /* $NetBSD: powerpc.h,v 1.4 2000/06/01 00:50:00 matt Exp $ */
/* /*
* Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 Wolfgang Solfrank.
@ -52,7 +52,6 @@ int dk_match __P((char *name));
void ofrootfound __P((void)); void ofrootfound __P((void));
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
#endif /* _MACHINE_POWERPC_H_ */ #endif /* _MACHINE_POWERPC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.h,v 1.3 1997/07/17 02:05:15 jtk Exp $ */ /* $NetBSD: autoconf.h,v 1.4 2000/06/01 00:49:50 matt Exp $ */
/* /*
* Copyright (c) 1994 Matthias Pfaller. * Copyright (c) 1994 Matthias Pfaller.
@ -46,4 +46,3 @@ struct confargs {
#define cf_irq cf_loc[MAINBUSCF_IRQ] #define cf_irq cf_loc[MAINBUSCF_IRQ]
extern u_long bootdev; extern u_long bootdev;
extern struct device *booted_device;

View File

@ -1,4 +1,4 @@
/* $NetBSD: powerpc.h,v 1.1 2000/02/29 15:21:32 nonaka Exp $ */ /* $NetBSD: powerpc.h,v 1.2 2000/06/01 00:50:00 matt Exp $ */
/* /*
* Copyright (C) 1996 Wolfgang Solfrank. * Copyright (C) 1996 Wolfgang Solfrank.
@ -48,7 +48,6 @@ void mem_regions __P((struct mem_region **, struct mem_region **));
void ppc_exit __P((void)) __attribute__((__noreturn__)); void ppc_exit __P((void)) __attribute__((__noreturn__));
void ppc_boot __P((char *bootspec)) __attribute__((__noreturn__)); void ppc_boot __P((char *bootspec)) __attribute__((__noreturn__));
extern struct device *booted_device;
extern int booted_partition; extern int booted_partition;
#endif /* _MACHINE_POWERPC_H_ */ #endif /* _MACHINE_POWERPC_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.1 2000/02/29 15:21:47 nonaka Exp $ */ /* $NetBSD: autoconf.c,v 1.2 2000/06/01 00:49:56 matt Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -58,6 +58,9 @@
#include <machine/pte.h> #include <machine/pte.h>
#include <machine/intr.h> #include <machine/intr.h>
struct device *booted_device;
int booted_partition;
void findroot __P((struct device **, int *)); void findroot __P((struct device **, int *));
/* /*
@ -81,9 +84,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.4 1999/09/17 20:04:51 thorpej Exp $ */ /* $NetBSD: autoconf.c,v 1.5 2000/06/01 00:49:57 matt Exp $ */
/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
@ -64,6 +64,9 @@
static int match_harddisk __P((struct device *, struct btinfo_bootdisk *)); static int match_harddisk __P((struct device *, struct btinfo_bootdisk *));
struct device *booted_device;
int booted_partition;
void findroot __P((struct device **, int *)); void findroot __P((struct device **, int *));
/* /*
@ -87,9 +90,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.57 2000/05/31 23:55:51 matt Exp $ */ /* $NetBSD: autoconf.c,v 1.58 2000/06/01 00:49:57 matt Exp $ */
/* /*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden. * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@ -64,8 +64,10 @@
void gencnslask __P((void)); void gencnslask __P((void));
struct cpu_dep *dep_call; struct cpu_dep *dep_call;
int mastercpu; /* chief of the system */ int mastercpu; /* chief of the system */
struct device *booted_device; struct device *booted_device;
int booted_partition; /* defaults to 0 (aka 'a' partition */
#define MAINBUS 0 #define MAINBUS 0
@ -87,8 +89,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
int booted_partition = 0;
/* /*
* The device we booted from are looked for during autoconfig. * The device we booted from are looked for during autoconfig.
* If there has been a match, it's already been done. * If there has been a match, it's already been done.

View File

@ -1,4 +1,4 @@
/* $NetBSD: autoconf.c,v 1.22 1999/09/23 15:14:59 minoura Exp $ */ /* $NetBSD: autoconf.c,v 1.23 2000/06/01 00:49:58 matt Exp $ */
/* /*
* Copyright (c) 1995 Leo Weppelman * Copyright (c) 1995 Leo Weppelman
@ -59,7 +59,11 @@ static int simple_devprint __P((void *, const char *));
static struct device *scsi_find __P((dev_t)); static struct device *scsi_find __P((dev_t));
static struct device *find_dev_byname __P((const char *)); static struct device *find_dev_byname __P((const char *));
struct device *booted_device;
int booted_partition;
int x68k_realconfig; int x68k_realconfig;
#include <sys/kernel.h> #include <sys/kernel.h>
/* /*
@ -82,9 +86,6 @@ cpu_configure()
void void
cpu_rootconf() cpu_rootconf()
{ {
struct device *booted_device;
int booted_partition;
findroot(&booted_device, &booted_partition); findroot(&booted_device, &booted_partition);
printf("boot device: %s\n", printf("boot device: %s\n",

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_netbsdkintf.c,v 1.88 2000/05/30 03:29:49 oster Exp $ */ /* $NetBSD: rf_netbsdkintf.c,v 1.89 2000/06/01 00:50:01 matt Exp $ */
/*- /*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved. * All rights reserved.
@ -295,7 +295,6 @@ static int raidautoconfig = 0; /* Debugging, mostly. Set to 0 to not
Note that this is overridden by having Note that this is overridden by having
RAID_AUTOCONFIG as an option in the RAID_AUTOCONFIG as an option in the
kernel config file. */ kernel config file. */
extern struct device *booted_device;
void void
raidattach(num) raidattach(num)