Centralise the declarations of cpu_model, machine, machine_arch,

osrelease, and ostype and remove "extern char foo[];" (for hostname
and domainname too).

Also delete redunctant decl of boottime in kern_info_43.c.
This commit is contained in:
simonb 2000-03-28 23:57:24 +00:00
parent 52bb6db3ff
commit 2f1fef39b3
31 changed files with 40 additions and 88 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.149 2000/03/26 07:52:58 is Exp $ */
/* $NetBSD: machdep.c,v 1.150 2000/03/28 23:57:24 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -439,7 +439,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[120];
extern char version[];
#if defined(M68060)
int m68060_pcr_init = 0x21; /* make this patchable */

View File

@ -1,4 +1,4 @@
/* $NetBSD: atari_init.c,v 1.47 2000/02/07 14:36:42 leo Exp $ */
/* $NetBSD: atari_init.c,v 1.48 2000/03/28 23:57:25 simonb Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@ -803,7 +803,6 @@ u_long kbase;
cpu_kcore_hdr_t *h = &cpu_kcore_hdr;
struct m68k_kcore_hdr *m = &h->un._m68k;
extern char end[];
extern char machine[];
int i;
bzero(&cpu_kcore_hdr, sizeof(cpu_kcore_hdr));

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.92 2000/02/21 20:38:47 erh Exp $ */
/* $NetBSD: machdep.c,v 1.93 2000/03/28 23:57:25 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -348,7 +348,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[120];
extern char version[];
static void
identifycpu()
@ -989,4 +988,3 @@ cpu_exec_aout_makecmds(p, epp)
#endif
return(error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.13 2000/03/25 03:07:29 msaitoh Exp $ */
/* $NetBSD: machdep.c,v 1.14 2000/03/28 23:57:26 simonb Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -216,11 +216,6 @@ cpu_startup()
#endif
}
/*
* Info for CTL_HW
*/
extern char version[];
#define CPUDEBUG
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.137 2000/03/23 06:37:24 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.138 2000/03/28 23:57:26 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -463,7 +463,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[120];
extern char version[];
struct hp300_model {
int id;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.h,v 1.2 2000/02/10 02:15:01 sato Exp $ */
/* $NetBSD: machdep.h,v 1.3 2000/03/28 23:57:27 simonb Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@ -30,10 +30,5 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* the following is used externally (sysctl_hw) */
extern char machine[];
extern char cpu_model[];
/* others.. */
extern char cpu_name[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.377 2000/03/22 20:58:27 ws Exp $ */
/* $NetBSD: machdep.c,v 1.378 2000/03/28 23:57:27 simonb Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -445,7 +445,6 @@ i386_bufinit()
* Info for CTL_HW
*/
char cpu_model[120];
extern char version[];
/*
* Note: these are just the ones that may not have a cpuid instruction.

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.5 2000/03/26 20:42:28 kleink Exp $ */
/* $NetBSD: machdep.c,v 1.6 2000/03/28 23:57:28 simonb Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2000/03/26 20:42:28 kleink Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2000/03/28 23:57:28 simonb Exp $");
#include "opt_ddb.h"
@ -97,7 +97,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.5 2000/03/26 20:42:28 kleink Exp $");
*/
char machine[] = MACHINE;
char cpu_model[60];
extern char version[];
extern char kernel_text[];
extern char etext[];

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.64 2000/03/26 20:42:31 kleink Exp $ */
/* $NetBSD: machdep.c,v 1.65 2000/03/28 23:57:29 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -575,7 +575,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[124];
extern char version[];
void
identifycpu()

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.5 2000/03/10 19:06:43 tsutsui Exp $ */
/* $NetBSD: machdep.c,v 1.6 2000/03/28 23:57:29 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -384,7 +384,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[124];
extern char version[];
int news_machine_id;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.30 2000/03/26 20:42:33 kleink Exp $ */
/* $NetBSD: machdep.c,v 1.31 2000/03/28 23:57:29 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -471,7 +471,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[124];
extern char version[];
void
identifycpu()

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.h,v 1.7 2000/01/09 03:56:02 simonb Exp $ */
/* $NetBSD: machdep.h,v 1.8 2000/03/28 23:57:30 simonb Exp $ */
/*
* Copyright (c) 1998 Jonathan Stone. All rights reserved.
@ -30,8 +30,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* the following is used externally (sysctl_hw) */
extern char machine[], machine_arch[], cpu_model[];
/* max memory for a model */
extern int physmem_boardmax; /* {model,simm}-specific bound on physmem */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka780.c,v 1.14 1999/08/07 10:36:49 ragge Exp $ */
/* $NetBSD: ka780.c,v 1.15 2000/03/28 23:57:30 simonb Exp $ */
/*-
* Copyright (c) 1982, 1986, 1988 The Regents of the University of California.
* All rights reserved.
@ -355,7 +355,6 @@ struct ka78x {
void
ka780_conf()
{
extern char cpu_model[];
struct ka78x *ka78 = (void *)&vax_cpudata;
/* Enable cache */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ka820.c,v 1.19 2000/03/26 11:40:31 ragge Exp $ */
/* $NetBSD: ka820.c,v 1.20 2000/03/28 23:57:30 simonb Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@ -129,10 +129,9 @@ ka820_attach(parent, self, aux)
struct bi_attach_args *ba = aux;
register int csr;
u_short rev;
extern char cpu_model[];
rev = bus_space_read_4(ba->ba_iot, ba->ba_ioh, BIREG_DTYPE) >> 16;
strcpy(cpu_model,"VAX 8200");
strcpy(cpu_model, "VAX 8200");
cpu_model[6] = rev & 0x8000 ? '5' : '0';
printf(": ka82%c (%s) cpu rev %d, u patch rev %d, sec patch %d\n",
cpu_model[6], mastercpu == ba->ba_nodenr ? "master" : "slave",

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.c,v 1.43 2000/03/26 11:39:45 ragge Exp $ */
/* $NetBSD: locore.c,v 1.44 2000/03/28 23:57:30 simonb Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -97,7 +97,6 @@ extern struct cpu_dep ka670_calls;
void
start()
{
extern char cpu_model[];
extern void *scratch;
struct pte *pt;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.96 2000/03/19 14:56:53 ragge Exp $ */
/* $NetBSD: machdep.c,v 1.97 2000/03/28 23:57:31 simonb Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
@ -152,7 +152,6 @@ void
cpu_startup()
{
caddr_t v;
extern char version[];
int base, residual, i, sz;
vaddr_t minaddr, maxaddr;
vsize_t size;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.78 2000/03/23 06:47:33 thorpej Exp $ */
/* $NetBSD: machdep.c,v 1.79 2000/03/28 23:57:31 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -397,7 +397,6 @@ setregs(p, pack, stack)
* Info for CTL_HW
*/
char cpu_model[96]; /* max 85 chars */
extern char version[];
static char *fpu_descr[] = {
#ifdef FPU_EMULATE
", emulator FPU", /* 0 */

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_info_09.c,v 1.5 1996/02/21 00:10:59 cgd Exp $ */
/* $NetBSD: kern_info_09.c,v 1.6 2000/03/28 23:57:31 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1991, 1993
@ -109,7 +109,6 @@ compat_09_sys_uname(p, v, retval)
} */ *uap = v;
struct outsname outsname;
char *cp, *dp, *ep;
extern char ostype[], osrelease[];
strncpy(outsname.sysname, ostype, sizeof(outsname.sysname));
strncpy(outsname.nodename, hostname, sizeof(outsname.nodename));

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_info_43.c,v 1.9 1999/03/24 05:51:19 mrg Exp $ */
/* $NetBSD: kern_info_43.c,v 1.10 2000/03/28 23:57:31 simonb Exp $ */
/*
* Copyright (c) 1982, 1986, 1991, 1993
@ -223,9 +223,6 @@ compat_43_sys_getkerninfo(p, v, retval)
(struct bsdi_si *) SCARG(uap, where);
struct bsdi_si ksi;
char *us = (char *) &usi[1];
extern struct timeval boottime;
extern char ostype[], osrelease[], machine[],
hostname[], cpu_model[], version[];
if (usi == NULL) {
size = sizeof(ksi) +

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpux_compat.c,v 1.47 2000/03/25 20:23:05 frueauf Exp $ */
/* $NetBSD: hpux_compat.c,v 1.48 2000/03/28 23:57:32 simonb Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@ -404,8 +404,6 @@ hpux_sys_utssys(p, v, retval)
int i;
int error;
struct hpux_utsname ut;
extern char ostype[], hostname[], osrelease[], version[];
extern char machine[];
switch (SCARG(uap, request)) {
/* uname */

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_misc.c,v 1.45 2000/03/26 20:42:41 kleink Exp $ */
/* $NetBSD: ibcs2_misc.c,v 1.46 2000/03/28 23:57:32 simonb Exp $ */
/*
* Copyright (c) 1994, 1995, 1998 Scott Bartram
@ -1587,7 +1587,6 @@ ibcs2_sys_scoinfo(p, v, retval)
caddr_t sg = stackgap_init(p->p_emul);
struct scoutsname *utsp = stackgap_alloc(&sg,
sizeof(struct scoutsname));
extern char ostype[], machine[], osrelease[];
memset(utsp, 0, sizeof(struct scoutsname));
strncpy(utsp->sysname, ostype, 8);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ibcs2_stat.c,v 1.12 1999/05/05 20:01:03 thorpej Exp $ */
/* $NetBSD: ibcs2_stat.c,v 1.13 2000/03/28 23:57:33 simonb Exp $ */
/*
* Copyright (c) 1995, 1998 Scott Bartram
* All rights reserved.
@ -344,7 +344,6 @@ ibcs2_sys_utssys(p, v, retval)
case 0: /* uname(struct utsname *) */
{
struct ibcs2_utsname sut;
extern char ostype[], machine[], osrelease[];
memset(&sut, 0, ibcs2_utsname_len);
memcpy(sut.sysname, ostype, sizeof(sut.sysname) - 1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_misc.c,v 1.67 2000/03/18 22:23:13 erh Exp $ */
/* $NetBSD: linux_misc.c,v 1.68 2000/03/28 23:57:33 simonb Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@ -353,8 +353,6 @@ linux_sys_uname(p, v, retval)
struct linux_sys_uname_args /* {
syscallarg(struct linux_utsname *) up;
} */ *uap = v;
extern char ostype[], hostname[], osrelease[], version[], machine[],
domainname[];
struct linux_utsname luts;
int len;
char *cp;
@ -1157,4 +1155,3 @@ linux_sys_reboot(struct proc *p, void *v, register_t *retval)
return(sys_reboot(p, &sra, retval));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_oldolduname.c,v 1.51 2000/03/13 23:52:35 soren Exp $ */
/* $NetBSD: linux_oldolduname.c,v 1.52 2000/03/28 23:57:33 simonb Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -38,6 +38,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
@ -64,7 +65,6 @@ linux_sys_oldolduname(p, v, retval)
struct linux_sys_uname_args /* {
syscallarg(struct linux_oldoldutsname *) up;
} */ *uap = v;
extern char ostype[], hostname[], osrelease[], version[], machine[];
struct linux_oldoldutsname luts;
int len;
char *cp;
@ -88,4 +88,3 @@ linux_sys_oldolduname(p, v, retval)
return copyout(&luts, SCARG(uap, up), sizeof(luts));
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: linux_olduname.c,v 1.52 2000/03/13 23:52:35 soren Exp $ */
/* $NetBSD: linux_olduname.c,v 1.53 2000/03/28 23:57:33 simonb Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@ -68,7 +68,6 @@ linux_sys_olduname(p, v, retval)
struct linux_sys_uname_args /* {
syscallarg(struct linux_oldutsname *) up;
} */ *uap = v;
extern char ostype[], hostname[], osrelease[], version[], machine[];
struct linux_oldutsname luts;
int len;
char *cp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: osf1_misc.c,v 1.52 1999/05/10 02:55:57 cgd Exp $ */
/* $NetBSD: osf1_misc.c,v 1.53 2000/03/28 23:57:33 simonb Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@ -168,7 +168,6 @@ osf1_sys_sysinfo(p, v, retval)
struct osf1_sys_sysinfo_args *uap = v;
const char *string;
int error;
extern char ostype[], osrelease[];
error = 0;
switch (SCARG(uap, cmd)) {
@ -240,7 +239,6 @@ osf1_sys_uname(p, v, retval)
struct osf1_sys_uname_args *uap = v;
struct osf1_utsname u;
char *cp, *dp, *ep;
extern char ostype[], osrelease[];
/* XXX would use stackgap, but our struct utsname is too big! */

View File

@ -1,4 +1,4 @@
/* $NetBSD: sunos_misc.c,v 1.102 2000/03/26 20:42:42 kleink Exp $ */
/* $NetBSD: sunos_misc.c,v 1.103 2000/03/28 23:57:34 simonb Exp $ */
/*
* Copyright (c) 1992, 1993
@ -752,7 +752,6 @@ sunos_sys_uname(p, v, retval)
{
struct sunos_sys_uname_args *uap = v;
struct sunos_utsname sut;
extern char ostype[], machine[], osrelease[];
memset(&sut, 0, sizeof(sut));

View File

@ -1,4 +1,4 @@
/* $NetBSD: svr4_stat.c,v 1.34 1999/09/07 18:20:19 christos Exp $ */
/* $NetBSD: svr4_stat.c,v 1.35 2000/03/28 23:57:34 simonb Exp $ */
/*-
* Copyright (c) 1994 The NetBSD Foundation, Inc.
@ -540,8 +540,6 @@ svr4_sys_uname(p, v, retval)
{
struct svr4_sys_uname_args *uap = v;
struct svr4_utsname sut;
extern char ostype[], hostname[], osrelease[], version[], machine[];
memset(&sut, 0, sizeof(sut));
@ -577,9 +575,6 @@ svr4_sys_systeminfo(p, v, retval)
int error;
size_t len;
char buf[256];
extern char ostype[], hostname[], osrelease[],
version[], machine[], machine_arch[],
domainname[];
u_int rlen = SCARG(uap, len);

View File

@ -1,4 +1,4 @@
/* $NetBSD: ultrix_misc.c,v 1.54 2000/03/26 20:42:43 kleink Exp $ */
/* $NetBSD: ultrix_misc.c,v 1.55 2000/03/28 23:57:35 simonb Exp $ */
/*
* Copyright (c) 1995, 1997 Jonathan Stone (hereinafter referred to as the author)
@ -100,8 +100,6 @@
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/filedesc.h>
/*#include <sys/stat.h>*/
/*#include <sys/ioctl.h>*/
#include <sys/kernel.h>
#include <sys/exec.h>
#include <sys/malloc.h>
@ -446,7 +444,6 @@ ultrix_sys_uname(p, v, retval)
{
struct ultrix_sys_uname_args *uap = v;
struct ultrix_utsname sut;
extern char ostype[], machine[], osrelease[];
memset(&sut, 0, sizeof(sut));

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_sysctl.c,v 1.58 2000/02/27 06:13:40 itojun Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.59 2000/03/28 23:57:35 simonb Exp $ */
/*-
* Copyright (c) 1982, 1986, 1989, 1993
@ -251,7 +251,6 @@ kern_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
int error, level, inthostid;
int old_autonicetime;
int old_vnodes;
extern char ostype[], osrelease[], version[];
/* All sysctl names at this level, except for a few, are terminal. */
switch (name[0]) {
@ -444,7 +443,6 @@ hw_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
size_t newlen;
struct proc *p;
{
extern char machine[], machine_arch[], cpu_model[];
/* all sysctl names at this level are terminal */
if (namelen != 1)

View File

@ -1,4 +1,4 @@
/* $NetBSD: systm.h,v 1.105 2000/03/23 06:31:52 thorpej Exp $ */
/* $NetBSD: systm.h,v 1.106 2000/03/28 23:57:36 simonb Exp $ */
/*-
* Copyright (c) 1982, 1988, 1991, 1993
@ -83,8 +83,13 @@ struct vnode;
extern int securelevel; /* system security level */
extern const char *panicstr; /* panic message */
extern char version[]; /* system version */
extern char copyright[]; /* system copyright */
extern char cpu_model[]; /* machine/cpu model name */
extern char machine[]; /* machine type */
extern char machine_arch[]; /* machine architecture */
extern char ostype[]; /* system type */
extern char osrelease[]; /* short system version */
extern char version[]; /* system version */
extern int autonicetime; /* time (in seconds) before autoniceval */
extern int autoniceval; /* proc priority after autonicetime */