diff --git a/sys/arch/algor/algor/machdep.c b/sys/arch/algor/algor/machdep.c index 333237910994..9b80c61cd571 100644 --- a/sys/arch/algor/algor/machdep.c +++ b/sys/arch/algor/algor/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.14 2001/11/22 03:08:01 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.15 2002/08/04 01:41:31 gmcgarry Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -98,7 +98,6 @@ #include #include #include -#include #include #include @@ -152,9 +151,7 @@ struct p6032_config p6032_configuration; #endif /* The following are used externally (sysctl_hw). */ -char machine[] = MACHINE; /* from */ -char machine_arch[] = MACHINE_ARCH; /* from */ -char cpu_model[64]; +extern char cpu_model[]; struct user *proc0paddr; @@ -709,33 +706,6 @@ cpu_startup(void) bufinit(); } -/* - * Machine-dependent system variables. - */ -int -cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, - void *newp, size_t newlen, struct proc *p) -{ - dev_t consdev; - - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); /* overloaded */ - - switch (name[0]) { - case CPU_CONSDEV: - if (cn_tab != NULL) - consdev = cn_tab->cn_dev; - else - consdev = NODEV; - return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev, - sizeof consdev)); - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - int waittime = -1; struct user dumppcb; /* Actually, struct pcb would do. */ diff --git a/sys/arch/evbmips/malta/machdep.c b/sys/arch/evbmips/malta/machdep.c index e8ebe74165c5..21af93049e30 100644 --- a/sys/arch/evbmips/malta/machdep.c +++ b/sys/arch/evbmips/malta/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.4 2002/07/12 00:40:00 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.5 2002/08/04 01:41:31 gmcgarry Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -89,7 +89,6 @@ #include #include #include -#include #include #include @@ -122,10 +121,8 @@ int comcnrate = 38400; /* XXX should be config option */ struct malta_config malta_configuration; -/* For sysctl. */ -char machine[] = MACHINE; -char machine_arch[] = MACHINE_ARCH; -char cpu_model[] = "MIPS Malta Evaluation Board"; +/* For sysctl_hw. */ +exterm char cpu_model[]; /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -235,6 +232,8 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize) mem_clusters[0].size = ctob(physmem); mem_cluster_cnt = 1; + strcpy(cpu_model, "MIPS Malta Evaluation Board"); + /* * XXX: check argv[0] - do something if "gdb"??? */ @@ -416,26 +415,6 @@ cpu_startup() bufinit(); } -int -cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; - struct proc *p; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return ENOTDIR; - - switch (name[0]) { - default: - return EOPNOTSUPP; - } -} - int waittime = -1; void diff --git a/sys/arch/hpcmips/hpcmips/machdep.c b/sys/arch/hpcmips/hpcmips/machdep.c index 531892c9f4c5..062d3f5d4a2d 100644 --- a/sys/arch/hpcmips/hpcmips/machdep.c +++ b/sys/arch/hpcmips/hpcmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.74 2002/04/27 23:24:55 shin Exp $ */ +/* $NetBSD: machdep.c,v 1.75 2002/08/04 01:41:23 gmcgarry Exp $ */ /*- * Copyright (c) 1999 Shin Takemura, All rights reserved. @@ -73,7 +73,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2002/04/27 23:24:55 shin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2002/08/04 01:41:23 gmcgarry Exp $"); #include "opt_vr41xx.h" #include "opt_tx39xx.h" @@ -97,7 +97,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2002/04/27 23:24:55 shin Exp $"); #include #include #include -#include #include #include /* mfs_initminiroot() */ @@ -151,10 +150,9 @@ static int __bicons_enable; #endif /* the following is used externally (sysctl_hw) */ -char machine[] = MACHINE; /* from */ -char machine_arch[] = MACHINE_ARCH; /* from */ -char cpu_model[128]; +extern cpu_model[128]; char cpu_name[40]; /* set cpu depend xx_init() */ + struct cpu_info cpu_info_store; /* only one cpu */ int cpuspeed = 1; /* approx # instr per usec. */ diff --git a/sys/arch/mips/mips/mips_machdep.c b/sys/arch/mips/mips/mips_machdep.c index f5834cad9993..2427e40f597d 100644 --- a/sys/arch/mips/mips/mips_machdep.c +++ b/sys/arch/mips/mips/mips_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.136 2002/07/26 00:43:55 simonb Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.137 2002/08/04 01:41:25 gmcgarry Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -120,7 +120,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.136 2002/07/26 00:43:55 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.137 2002/08/04 01:41:25 gmcgarry Exp $"); #include "opt_cputype.h" #include "opt_compat_netbsd.h" @@ -137,22 +137,29 @@ __KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.136 2002/07/26 00:43:55 simonb Ex #include #include #include +#include #include #include #include #include #include #include - #include +#include + #include #include + #include #include #include #include +#ifdef __pmax__ +#include /* XXX pmax only so far */ +#endif + #if defined(MIPS32) || defined(MIPS64) #include /* MIPS32/MIPS64 registers */ #endif @@ -210,6 +217,11 @@ caddr_t msgbufaddr; int default_pg_mask = 0x00001800; #endif +/* the following is used externally (sysctl_hw) */ +char machine[] = MACHINE; /* from */ +char machine_arch[] = MACHINE_ARCH; /* from */ +char cpu_model[128]; + struct pridtab { int cpu_cid; int cpu_pid; @@ -1082,6 +1094,52 @@ setregs(p, pack, stack) p->p_md.md_ss_addr = 0; } +/* + * Machine dependent system variables. + */ +int +cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) + int *name; + u_int namelen; + void *oldp; + size_t *oldlenp; + void *newp; + size_t newlen; + struct proc *p; +{ +#if defined(__pmax__) + struct btinfo_bootpath *bibp; +#endif + dev_t consdev; + + /* all sysctl names at this level are terminal */ + if (namelen != 1) + return (ENOTDIR); /* overloaded */ + + switch (name[0]) { + case CPU_CONSDEV: + if (cn_tab != NULL) + consdev = cn_tab->cn_dev; + else + consdev = NODEV; + return (sysctl_rdstruct(oldp, oldlenp, newp, &consdev, + sizeof consdev)); +#if defined(__pmax__) + case CPU_BOOTED_KERNEL: + bibp = lookup_bootinfo(BTINFO_BOOTPATH); + if(!bibp) + return (ENOENT); /* ??? */ + return (sysctl_rdstring(oldp, oldlenp, newp, bibp->bootpath)); +#endif + case CPU_ROOT_DEVICE: + default: + return (EOPNOTSUPP); + } + /* NOTREACHED */ +} + + + struct sigframe { struct sigcontext sf_sc; /* actual context */ }; diff --git a/sys/arch/mipsco/mipsco/machdep.c b/sys/arch/mipsco/mipsco/machdep.c index 45e5167c6fe2..2a1db54037a8 100644 --- a/sys/arch/mipsco/mipsco/machdep.c +++ b/sys/arch/mipsco/mipsco/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.30 2001/09/15 01:19:38 wdk Exp $ */ +/* $NetBSD: machdep.c,v 1.31 2002/08/04 01:41:30 gmcgarry Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -43,7 +43,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.30 2001/09/15 01:19:38 wdk Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.31 2002/08/04 01:41:30 gmcgarry Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -67,7 +67,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.30 2001/09/15 01:19:38 wdk Exp $"); #include #include #include -#include #include #include #include @@ -105,9 +104,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.30 2001/09/15 01:19:38 wdk Exp $"); #include "com.h" /* XXX */ /* the following is used externally (sysctl_hw) */ -char machine[] = MACHINE; /* from */ -char machine_arch[] = MACHINE_ARCH; -char cpu_model[40]; +extern char cpu_model[]; /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -482,30 +479,6 @@ cpu_startup() bufinit(); } -/* - * machine dependent system variables. - */ -int -cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; - struct proc *p; -{ - /* all sysctl names at this level are terminal */ - if (namelen != 1) - return (ENOTDIR); /* overloaded */ - - switch (name[0]) { - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - /* * Look up information in bootinfo of boot loader. */ diff --git a/sys/arch/newsmips/newsmips/machdep.c b/sys/arch/newsmips/newsmips/machdep.c index 4b67318223ea..f836f9142ba6 100644 --- a/sys/arch/newsmips/newsmips/machdep.c +++ b/sys/arch/newsmips/newsmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.61 2002/03/05 16:13:57 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.62 2002/08/04 01:41:27 gmcgarry Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -43,7 +43,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2002/03/05 16:13:57 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.62 2002/08/04 01:41:27 gmcgarry Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -73,7 +73,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2002/03/05 16:13:57 simonb Exp $"); #include #include -#include #include /* mfs_initminiroot() */ @@ -107,9 +106,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.61 2002/03/05 16:13:57 simonb Exp $"); #include /* the following is used externally (sysctl_hw) */ -char machine[] = MACHINE; /* from */ -char machine_arch[] = MACHINE_ARCH; -char cpu_model[30]; +extern char cpu_model[]; /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -514,32 +511,6 @@ cpu_startup() bufinit(); } - -/* - * machine dependent system variables. - */ -int -cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; - struct proc *p; -{ - /* all sysctl names at this level are terminal */ - if (namelen != 1) - return (ENOTDIR); /* overloaded */ - - switch (name[0]) { - - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - /* * lookup_bootinfo: * Look up information in bootinfo of boot loader. diff --git a/sys/arch/playstation2/playstation2/machdep.c b/sys/arch/playstation2/playstation2/machdep.c index f07a93291e89..dd2510d0fb92 100644 --- a/sys/arch/playstation2/playstation2/machdep.c +++ b/sys/arch/playstation2/playstation2/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.3 2002/01/31 16:25:56 uch Exp $ */ +/* $NetBSD: machdep.c,v 1.4 2002/08/04 01:41:32 gmcgarry Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -68,10 +67,8 @@ #include #endif -/* For sysctl. */ -char machine[] = MACHINE; -char machine_arch[] = MACHINE_ARCH; -char cpu_model[] = "SONY PlayStation 2"; +/* For sysctl_hw */ +extern char cpu_model[]; struct cpu_info cpu_info_store; @@ -146,6 +143,8 @@ mach_init() uvm_page_physload(atop(start), atop(start + size), atop(start), atop(start + size), VM_FREELIST_DEFAULT); + strcpy(cpu_model, "SONY PlayStation 2"); + /* * Initialize error message buffer (at end of core). */ @@ -271,27 +270,6 @@ cpu_startup() bufinit(); } -/* - * Machine dependent system variables. - */ -int -cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, - size_t newlen, struct proc *p) -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return (ENOTDIR); - - switch (name[0]) { - case CPU_CONSDEV: - return (sysctl_rdstruct(oldp, oldlenp, newp, &cn_tab->cn_dev, - sizeof cn_tab->cn_dev)); - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - void cpu_reboot(int howto, char *bootstr) { diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c index e59311c7fed8..53932283a4f9 100644 --- a/sys/arch/pmax/pmax/machdep.c +++ b/sys/arch/pmax/pmax/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.199 2002/03/05 16:14:28 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.200 2002/08/04 01:41:28 gmcgarry Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -43,7 +43,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2002/03/05 16:14:28 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.200 2002/08/04 01:41:28 gmcgarry Exp $"); #include "fs_mfs.h" #include "opt_ddb.h" @@ -60,8 +60,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2002/03/05 16:14:28 simonb Exp $") #include -#include - #include #include /* mfs_initminiroot() */ @@ -89,9 +87,8 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.199 2002/03/05 16:14:28 simonb Exp $") #include "opt_dec_3maxplus.h" /* the following is used externally (sysctl_hw) */ -char machine[] = MACHINE; /* from */ -char machine_arch[] = MACHINE_ARCH; /* from */ -char cpu_model[40]; +extern char cpu_model[]; + unsigned ssir; /* simulated interrupt register */ /* Our exported CPU info; we can have only one. */ @@ -515,40 +512,6 @@ cpu_startup() bufinit(); } -/* - * Machine dependent system variables. - */ -int -cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; - struct proc *p; -{ - struct btinfo_bootpath *bibp; - - /* all sysctl names at this level are terminal */ - if (namelen != 1) - return (ENOTDIR); /* overloaded */ - - switch (name[0]) { - case CPU_CONSDEV: - return (sysctl_rdstruct(oldp, oldlenp, newp, &cn_tab->cn_dev, - sizeof cn_tab->cn_dev)); - case CPU_BOOTED_KERNEL: - bibp = lookup_bootinfo(BTINFO_BOOTPATH); - if(!bibp) - return (ENOENT); /* ??? */ - return (sysctl_rdstring(oldp, oldlenp, newp, bibp->bootpath)); - default: - return (EOPNOTSUPP); - } - /* NOTREACHED */ -} - /* * Look up information in bootinfo of boot loader. */ diff --git a/sys/arch/sbmips/sbmips/machdep.c b/sys/arch/sbmips/sbmips/machdep.c index f7271c5a84cd..a7f22001b8b0 100644 --- a/sys/arch/sbmips/sbmips/machdep.c +++ b/sys/arch/sbmips/sbmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.7 2002/06/07 01:34:03 simonb Exp $ */ +/* $NetBSD: machdep.c,v 1.8 2002/08/04 01:41:33 gmcgarry Exp $ */ /* * Copyright 2000, 2001 @@ -76,7 +76,6 @@ #include #include #include -#include #include #include #include @@ -118,10 +117,8 @@ #include #endif -/* For sysctl. */ -char machine[] = MACHINE; -char machine_arch[] = MACHINE_ARCH; -char cpu_model[] = "sb1250"; +/* For sysctl_hw. */ +extern char cpu_model[]; /* Our exported CPU info. Only one for now */ struct cpu_info cpu_info_store; @@ -232,6 +229,8 @@ mach_init(long fwhandle, long magic, long bootdata, long reserved) (u_int)fwhandle, (u_int)magic, (u_int)bootdata, (u_int)reserved); #endif + strcpy(cpu_model, "sb1250"); + if (magic == BOOTINFO_MAGIC) { int idx; int added; @@ -460,21 +459,6 @@ cpu_startup(void) bufinit(); } -int -cpu_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, - size_t newlen, struct proc *p) -{ - - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return ENOTDIR; - - switch (name[0]) { - default: - return EOPNOTSUPP; - } -} - int waittime = -1; void diff --git a/sys/arch/sgimips/sgimips/machdep.c b/sys/arch/sgimips/sgimips/machdep.c index faf88e94fbab..8a0a9cde0259 100644 --- a/sys/arch/sgimips/sgimips/machdep.c +++ b/sys/arch/sgimips/sgimips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.37 2002/05/03 01:49:22 rafal Exp $ */ +/* $NetBSD: machdep.c,v 1.38 2002/08/04 01:41:29 gmcgarry Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang @@ -59,7 +59,6 @@ #include #include -#include #include #include @@ -89,10 +88,8 @@ #include -/* For sysctl(3). */ -char machine[] = MACHINE; -char machine_arch[] = MACHINE_ARCH; -char cpu_model[64 + 1]; /* sizeof(arcbios_system_identifier) */ +/* For sysctl_hw. */ +extern char cpu_model[]; struct sgimips_intrhand intrtab[NINTR]; @@ -629,26 +626,6 @@ cpu_startup() bufinit(); } -int -cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) - int *name; - u_int namelen; - void *oldp; - size_t *oldlenp; - void *newp; - size_t newlen; - struct proc *p; -{ - /* All sysctl names at this level are terminal. */ - if (namelen != 1) - return ENOTDIR; - - switch (name[0]) { - default: - return EOPNOTSUPP; - } -} - int waittime = -1; void