Rename ncpu to ncpus (as other ports call it), to avoid shadow warnings.
Sprinkle some const.
This commit is contained in:
parent
296114a214
commit
a3c4cc0039
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpu.h,v 1.68 2004/05/02 11:22:06 pk Exp $ */
|
||||
/* $NetBSD: cpu.h,v 1.69 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -157,7 +157,7 @@ void *softnet_cookie;
|
|||
extern int cpu_arch;
|
||||
|
||||
/* Number of CPUs in the system */
|
||||
extern int ncpu;
|
||||
extern int ncpus;
|
||||
|
||||
/*
|
||||
* Interrupt handler chains. Interrupt handlers should return 0 for
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: autoconf.c,v 1.208 2004/10/23 17:12:23 thorpej Exp $ */
|
||||
/* $NetBSD: autoconf.c,v 1.209 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -48,7 +48,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.208 2004/10/23 17:12:23 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.209 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -123,9 +123,9 @@ extern void *bootinfo;
|
|||
void bootinfo_relocate(void *);
|
||||
#endif
|
||||
|
||||
static char *str2hex __P((char *, int *));
|
||||
static const char *str2hex __P((const char *, int *));
|
||||
static int mbprint __P((void *, const char *));
|
||||
static void crazymap __P((char *, int *));
|
||||
static void crazymap __P((const char *, int *));
|
||||
int st_crazymap __P((int));
|
||||
int sd_crazymap __P((int));
|
||||
void sync_crash __P((void));
|
||||
|
@ -135,7 +135,7 @@ static void mainbus_attach __P((struct device *, struct device *, void *));
|
|||
struct bootpath bootpath[8];
|
||||
int nbootpath;
|
||||
static void bootpath_build __P((void));
|
||||
static void bootpath_fake __P((struct bootpath *, char *));
|
||||
static void bootpath_fake __P((struct bootpath *, const char *));
|
||||
static void bootpath_print __P((struct bootpath *));
|
||||
static struct bootpath *bootpath_store __P((int, struct bootpath *));
|
||||
int find_cpus __P((void));
|
||||
|
@ -224,15 +224,15 @@ find_cpus()
|
|||
* Convert hex ASCII string to a value. Returns updated pointer.
|
||||
* Depends on ASCII order (this *is* machine-dependent code, you know).
|
||||
*/
|
||||
static char *
|
||||
static const char *
|
||||
str2hex(str, vp)
|
||||
char *str;
|
||||
const char *str;
|
||||
int *vp;
|
||||
{
|
||||
int v, c;
|
||||
|
||||
for (v = 0;; v = v * 16 + c, str++) {
|
||||
c = *(u_char *)str;
|
||||
c = (u_char)*str;
|
||||
if (c <= '9') {
|
||||
if ((c -= '0') < 0)
|
||||
break;
|
||||
|
@ -276,7 +276,7 @@ bootstrap()
|
|||
prom_init();
|
||||
|
||||
/* Find the number of CPUs as early as possible */
|
||||
ncpu = find_cpus();
|
||||
ncpus = find_cpus();
|
||||
|
||||
/* Attach user structure to proc0 */
|
||||
lwp0.l_addr = proc0paddr;
|
||||
|
@ -508,7 +508,8 @@ bootstrapIIep()
|
|||
static void
|
||||
bootpath_build()
|
||||
{
|
||||
char *cp, *pp;
|
||||
const char *cp;
|
||||
char *pp;
|
||||
struct bootpath *bp;
|
||||
int fl;
|
||||
|
||||
|
@ -633,9 +634,9 @@ bootpath_build()
|
|||
static void
|
||||
bootpath_fake(bp, cp)
|
||||
struct bootpath *bp;
|
||||
char *cp;
|
||||
const char *cp;
|
||||
{
|
||||
char *pp;
|
||||
const char *pp;
|
||||
int v0val[3];
|
||||
|
||||
#define BP_APPEND(BP,N,V0,V1,V2) { \
|
||||
|
@ -856,7 +857,7 @@ bootpath_store(storep, bp)
|
|||
*/
|
||||
static void
|
||||
crazymap(prop, map)
|
||||
char *prop;
|
||||
const char *prop;
|
||||
int *map;
|
||||
{
|
||||
int i;
|
||||
|
@ -1509,7 +1510,7 @@ romgetcursoraddr(rowp, colp)
|
|||
*/
|
||||
struct device *
|
||||
getdevunit(name, unit)
|
||||
char *name;
|
||||
const char *name;
|
||||
int unit;
|
||||
{
|
||||
struct device *dev = alldevs.tqh_first;
|
||||
|
@ -1553,12 +1554,12 @@ getdevunit(name, unit)
|
|||
#define BUSCLASS_PCI 10
|
||||
|
||||
static int bus_class __P((struct device *));
|
||||
static char *bus_compatible __P((char *));
|
||||
static const char *bus_compatible __P((const char *));
|
||||
static int instance_match __P((struct device *, void *, struct bootpath *));
|
||||
static void nail_bootdev __P((struct device *, struct bootpath *));
|
||||
|
||||
static struct {
|
||||
char *name;
|
||||
const char *name;
|
||||
int class;
|
||||
} bus_class_tab[] = {
|
||||
{ "mainbus", BUSCLASS_MAINBUS },
|
||||
|
@ -1587,8 +1588,8 @@ static struct {
|
|||
* device names.
|
||||
*/
|
||||
static struct {
|
||||
char *bpname;
|
||||
char *cfname;
|
||||
const char *bpname;
|
||||
const char *cfname;
|
||||
} dev_compat_tab[] = {
|
||||
{ "espdma", "dma" },
|
||||
{ "SUNW,fas", "esp" },
|
||||
|
@ -1600,9 +1601,9 @@ static struct {
|
|||
{ "SUNW,hme", "hme" },
|
||||
};
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
bus_compatible(bpname)
|
||||
char *bpname;
|
||||
const char *bpname;
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -1771,8 +1772,7 @@ device_register(dev, aux)
|
|||
void *aux;
|
||||
{
|
||||
struct bootpath *bp = bootpath_store(0, NULL);
|
||||
const char *dvname;
|
||||
char *bpname;
|
||||
const char *dvname, *bpname;
|
||||
|
||||
/*
|
||||
* If device name does not match current bootpath component
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cache.c,v 1.91 2005/02/06 20:22:15 pk Exp $ */
|
||||
/* $NetBSD: cache.c,v 1.92 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -59,7 +59,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.91 2005/02/06 20:22:15 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cache.c,v 1.92 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
#include "opt_sparc_arch.h"
|
||||
|
@ -247,7 +247,7 @@ hypersparc_cache_enable()
|
|||
* Enable instruction cache and, on single-processor machines,
|
||||
* disable `Unimplemented Flush Traps'.
|
||||
*/
|
||||
v = HYPERSPARC_ICCR_ICE | (ncpu <= 1 ? HYPERSPARC_ICCR_FTD : 0);
|
||||
v = HYPERSPARC_ICCR_ICE | (ncpus <= 1 ? HYPERSPARC_ICCR_FTD : 0);
|
||||
wrasr(v, HYPERSPARC_ASRNUM_ICCR);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpu.c,v 1.189 2005/04/11 05:56:11 perseant Exp $ */
|
||||
/* $NetBSD: cpu.c,v 1.190 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -52,7 +52,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.189 2005/04/11 05:56:11 perseant Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.190 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
#include "opt_lockdebug.h"
|
||||
|
@ -101,7 +101,7 @@ int cpu_arch; /* sparc architecture version */
|
|||
char cpu_model[100]; /* machine model (primary CPU) */
|
||||
extern char machine_model[];
|
||||
|
||||
int ncpu; /* # of CPUs detected by PROM */
|
||||
int ncpus; /* # of CPUs detected by PROM */
|
||||
struct cpu_info **cpus;
|
||||
u_int cpu_ready_mask; /* the set of CPUs marked as READY */
|
||||
static int cpu_instance; /* current # of CPUs wired by us */
|
||||
|
@ -124,7 +124,7 @@ CFATTACH_DECL(cpu_cpuunit, sizeof(struct cpu_softc),
|
|||
|
||||
static void cpu_attach(struct cpu_softc *, int, int);
|
||||
|
||||
static char *fsrtoname __P((int, int, int));
|
||||
static const char *fsrtoname __P((int, int, int));
|
||||
void cache_print __P((struct cpu_softc *));
|
||||
void cpu_setup __P((void));
|
||||
void fpu_init __P((struct cpu_info *));
|
||||
|
@ -427,8 +427,8 @@ cpu_attach(struct cpu_softc *sc, int node, int mid)
|
|||
if (cpus == NULL) {
|
||||
extern struct pcb idle_u[];
|
||||
|
||||
cpus = malloc(ncpu * sizeof(cpi), M_DEVBUF, M_NOWAIT);
|
||||
bzero(cpus, ncpu * sizeof(cpi));
|
||||
cpus = malloc(ncpus * sizeof(cpi), M_DEVBUF, M_NOWAIT);
|
||||
bzero(cpus, ncpus * sizeof(cpi));
|
||||
|
||||
getcpuinfo(&cpuinfo, node);
|
||||
|
||||
|
@ -492,7 +492,7 @@ cpu_attach(struct cpu_softc *sc, int node, int mid)
|
|||
cpi->mid = mid;
|
||||
cpi->node = node;
|
||||
|
||||
if (ncpu > 1) {
|
||||
if (ncpus > 1) {
|
||||
printf(": mid %d", mid);
|
||||
if (mid == 0 && !CPU_ISSUN4D)
|
||||
printf(" [WARNING: mid should not be 0]");
|
||||
|
@ -524,13 +524,13 @@ cpu_attach(struct cpu_softc *sc, int node, int mid)
|
|||
|
||||
cache_print(sc);
|
||||
|
||||
if (ncpu > 1 && cpu_instance == ncpu) {
|
||||
if (ncpus > 1 && cpu_instance == ncpus) {
|
||||
int n;
|
||||
/*
|
||||
* Install MP cache flush functions, unless the
|
||||
* single-processor versions are no-ops.
|
||||
*/
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
if (cpi == NULL)
|
||||
continue;
|
||||
|
@ -554,14 +554,14 @@ cpu_boot_secondary_processors()
|
|||
{
|
||||
int n;
|
||||
|
||||
if (cpu_instance != ncpu) {
|
||||
if (cpu_instance != ncpus) {
|
||||
printf("NOTICE: only %d out of %d CPUs were configured\n",
|
||||
cpu_instance, ncpu);
|
||||
cpu_instance, ncpus);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("cpu0: booting secondary processors:");
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL || cpuinfo.mid == cpi->mid ||
|
||||
|
@ -708,7 +708,7 @@ xcall(func, trap, arg0, arg1, arg2, cpuset)
|
|||
* finished by the time we start looking.
|
||||
*/
|
||||
fasttrap = trap != NULL ? 1 : 0;
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
/* Note: n == cpi->ci_cpuid */
|
||||
|
@ -748,7 +748,7 @@ xcall(func, trap, arg0, arg1, arg2, cpuset)
|
|||
}
|
||||
|
||||
done = 1;
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if ((cpuset & (1 << n)) == 0)
|
||||
|
@ -782,7 +782,7 @@ mp_pause_cpus()
|
|||
if (cpus == NULL)
|
||||
return;
|
||||
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL || cpuinfo.mid == cpi->mid)
|
||||
|
@ -809,7 +809,7 @@ mp_resume_cpus()
|
|||
if (cpus == NULL)
|
||||
return;
|
||||
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL || cpuinfo.mid == cpi->mid)
|
||||
|
@ -835,7 +835,7 @@ mp_halt_cpus()
|
|||
if (cpus == NULL)
|
||||
return;
|
||||
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
int r;
|
||||
|
||||
|
@ -862,7 +862,7 @@ mp_pause_cpus_ddb()
|
|||
if (cpus == NULL)
|
||||
return;
|
||||
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL || cpi->mid == cpuinfo.mid)
|
||||
|
@ -881,7 +881,7 @@ mp_resume_cpus_ddb()
|
|||
if (cpus == NULL)
|
||||
return;
|
||||
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL || cpuinfo.mid == cpi->mid)
|
||||
|
@ -947,7 +947,7 @@ cache_print(sc)
|
|||
}
|
||||
|
||||
if (ci->c_split) {
|
||||
char *sep = "";
|
||||
const char *sep = "";
|
||||
|
||||
printf("%s", (ci->c_physical ? "physical " : ""));
|
||||
if (ci->ic_totalsize > 0) {
|
||||
|
@ -1787,7 +1787,7 @@ viking_module_error(void)
|
|||
int n, fatal = 0;
|
||||
|
||||
/* Report on MXCC error registers in each module */
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
struct cpu_info *cpi = cpus[n];
|
||||
|
||||
if (cpi == NULL)
|
||||
|
@ -1908,7 +1908,7 @@ struct cpu_conf {
|
|||
int cpu_vers;
|
||||
int mmu_impl;
|
||||
int mmu_vers;
|
||||
char *name;
|
||||
const char *name;
|
||||
struct module_info *minfo;
|
||||
} cpu_conf[] = {
|
||||
#if defined(SUN4)
|
||||
|
@ -2112,7 +2112,7 @@ struct info {
|
|||
int iu_impl;
|
||||
int iu_vers;
|
||||
int fpu_vers;
|
||||
char *name;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/* XXX trim this table on a per-ARCH basis */
|
||||
|
@ -2163,7 +2163,7 @@ static struct info fpu_types[] = {
|
|||
{ 0 }
|
||||
};
|
||||
|
||||
static char *
|
||||
static const char *
|
||||
fsrtoname(impl, vers, fver)
|
||||
int impl, vers, fver;
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: cpuvar.h,v 1.63 2004/09/22 11:32:03 yamt Exp $ */
|
||||
/* $NetBSD: cpuvar.h,v 1.64 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
|
@ -274,7 +274,7 @@ struct cpu_info {
|
|||
int mid; /* Module ID for MP systems */
|
||||
int mbus; /* 1 if CPU is on MBus */
|
||||
int mxcc; /* 1 if a MBus-level MXCC is present */
|
||||
char *cpu_name; /* CPU model */
|
||||
const char *cpu_name; /* CPU model */
|
||||
int cpu_impl; /* CPU implementation code */
|
||||
int cpu_vers; /* CPU version code */
|
||||
int mmu_impl; /* MMU implementation code */
|
||||
|
@ -299,7 +299,7 @@ struct cpu_info {
|
|||
/* FPU information */
|
||||
int fpupresent; /* true if FPU is present */
|
||||
int fpuvers; /* FPU revision */
|
||||
char *fpu_name; /* FPU model */
|
||||
const char *fpu_name; /* FPU model */
|
||||
char fpu_namebuf[32];/* Buffer for FPU name, if necessary */
|
||||
|
||||
/* XXX */
|
||||
|
@ -419,7 +419,7 @@ struct cpu_info {
|
|||
|
||||
|
||||
#define CPU_INFO_ITERATOR int
|
||||
#define CPU_INFO_FOREACH(cii, ci) cii = 0; ci = cpus[cii], cii < ncpu; cii++
|
||||
#define CPU_INFO_FOREACH(cii, ci) cii = 0; ci = cpus[cii], cii < ncpus; cii++
|
||||
|
||||
/*
|
||||
* Useful macros.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: db_interface.c,v 1.61 2004/05/13 09:36:44 pk Exp $ */
|
||||
/* $NetBSD: db_interface.c,v 1.62 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Mach Operating System
|
||||
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.61 2004/05/13 09:36:44 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.62 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -94,7 +94,7 @@ void
|
|||
db_write_bytes(addr, size, data)
|
||||
vaddr_t addr;
|
||||
size_t size;
|
||||
char *data;
|
||||
const char *data;
|
||||
{
|
||||
extern char etext[];
|
||||
char *dst;
|
||||
|
@ -201,16 +201,16 @@ int db_active = 0;
|
|||
extern char *trap_type[];
|
||||
|
||||
void kdb_kbd_trap __P((struct trapframe *));
|
||||
void db_prom_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_proc_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_dump_pcb __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_lock_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_simple_lock_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_uvmhistdump __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_prom_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
void db_proc_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
void db_dump_pcb __P((db_expr_t, int, db_expr_t, const char *));
|
||||
void db_lock_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
void db_simple_lock_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
void db_uvmhistdump __P((db_expr_t, int, db_expr_t, const char *));
|
||||
#ifdef MULTIPROCESSOR
|
||||
void db_cpu_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_cpu_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
#endif
|
||||
void db_page_cmd __P((db_expr_t, int, db_expr_t, char *));
|
||||
void db_page_cmd __P((db_expr_t, int, db_expr_t, const char *));
|
||||
|
||||
/*
|
||||
* Received keyboard interrupt sequence.
|
||||
|
@ -359,7 +359,7 @@ db_proc_cmd(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
struct lwp *l;
|
||||
struct proc *p;
|
||||
|
@ -400,7 +400,7 @@ db_dump_pcb(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
struct pcb *pcb;
|
||||
char bits[64];
|
||||
|
@ -447,7 +447,7 @@ db_prom_cmd(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
|
||||
prom_abort();
|
||||
|
@ -458,7 +458,7 @@ db_page_cmd(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
|
||||
if (!have_addr) {
|
||||
|
@ -475,7 +475,7 @@ db_lock_cmd(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
struct lock *l;
|
||||
|
||||
|
@ -497,7 +497,7 @@ db_simple_lock_cmd(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
struct simplelock *l;
|
||||
|
||||
|
@ -533,7 +533,7 @@ db_cpu_cmd(addr, have_addr, count, modif)
|
|||
return;
|
||||
}
|
||||
|
||||
if ((addr < 0) || (addr >= ncpu)) {
|
||||
if ((addr < 0) || (addr >= ncpus)) {
|
||||
db_printf("%ld: CPU out of range\n", addr);
|
||||
return;
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ db_uvmhistdump(addr, have_addr, count, modif)
|
|||
db_expr_t addr;
|
||||
int have_addr;
|
||||
db_expr_t count;
|
||||
char *modif;
|
||||
const char *modif;
|
||||
{
|
||||
|
||||
uvmhist_dump(uvm_histories.lh_first);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: intr.c,v 1.85 2004/04/17 22:34:14 pk Exp $ */
|
||||
/* $NetBSD: intr.c,v 1.86 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.85 2004/04/17 22:34:14 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.86 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_multiprocessor.h"
|
||||
#include "opt_sparc_arch.h"
|
||||
|
@ -144,7 +144,7 @@ getitr()
|
|||
#if defined(MULTIPROCESSOR)
|
||||
u_int v;
|
||||
|
||||
if (!CPU_ISSUN4M || ncpu <= 1)
|
||||
if (!CPU_ISSUN4M || ncpus <= 1)
|
||||
return (0);
|
||||
|
||||
v = *((u_int *)ICR_ITR);
|
||||
|
@ -164,7 +164,7 @@ setitr(u_int mid)
|
|||
#if defined(MULTIPROCESSOR)
|
||||
u_int v;
|
||||
|
||||
if (!CPU_ISSUN4M || ncpu <= 1)
|
||||
if (!CPU_ISSUN4M || ncpus <= 1)
|
||||
return (0);
|
||||
|
||||
v = *((u_int *)ICR_ITR);
|
||||
|
@ -253,7 +253,7 @@ nmi_hard()
|
|||
} else {
|
||||
int n = 100000;
|
||||
|
||||
while (nmi_hard_wait < ncpu) {
|
||||
while (nmi_hard_wait < ncpus) {
|
||||
DELAY(1);
|
||||
if (n-- > 0)
|
||||
continue;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.255 2005/04/25 15:02:07 lukem Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.256 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -78,7 +78,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.255 2005/04/25 15:02:07 lukem Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.256 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_compat_netbsd.h"
|
||||
#include "opt_compat_sunos.h"
|
||||
|
@ -420,7 +420,7 @@ sysctl_machdep_boot(SYSCTLFN_ARGS)
|
|||
{
|
||||
struct sysctlnode node = *rnode;
|
||||
struct btinfo_kernelfile *bi_file;
|
||||
char *cp;
|
||||
const char *cp;
|
||||
|
||||
|
||||
switch (node.sysctl_num) {
|
||||
|
@ -445,7 +445,7 @@ sysctl_machdep_boot(SYSCTLFN_ARGS)
|
|||
if (cp == NULL || cp[0] == '\0')
|
||||
return (ENOENT);
|
||||
|
||||
node.sysctl_data = cp;
|
||||
node.sysctl_data = __UNCONST(cp);
|
||||
node.sysctl_size = strlen(cp) + 1;
|
||||
return (sysctl_lookup(SYSCTLFN_CALL(&node)));
|
||||
}
|
||||
|
@ -1080,7 +1080,7 @@ cpu_reboot(howto, user_boot_string)
|
|||
}
|
||||
|
||||
/* Disable interrupts. But still allow IPI on MP systems */
|
||||
if (ncpu > 1)
|
||||
if (ncpus > 1)
|
||||
(void)splsched();
|
||||
else
|
||||
(void)splhigh();
|
||||
|
@ -1469,7 +1469,7 @@ wcopy(vb1, vb2, l)
|
|||
{
|
||||
const u_char *b1e, *b1 = vb1;
|
||||
u_char *b2 = vb2;
|
||||
u_short *sp;
|
||||
const u_short *sp;
|
||||
int bstore = 0;
|
||||
|
||||
if (l == 0)
|
||||
|
@ -1482,13 +1482,13 @@ wcopy(vb1, vb2, l)
|
|||
}
|
||||
|
||||
/* middle, */
|
||||
sp = (u_short *)b1;
|
||||
sp = (const u_short *)b1;
|
||||
b1e = b1 + l;
|
||||
if (l & 1)
|
||||
b1e--;
|
||||
bstore = (u_long)b2 & 1;
|
||||
|
||||
while (sp < (u_short *)b1e) {
|
||||
while (sp < (const u_short *)b1e) {
|
||||
if (bstore) {
|
||||
b2[1] = *sp & 0xff;
|
||||
b2[0] = *sp >> 8;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: pmap.c,v 1.299 2005/05/29 15:56:59 chs Exp $ */
|
||||
/* $NetBSD: pmap.c,v 1.300 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996
|
||||
|
@ -56,7 +56,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.299 2005/05/29 15:56:59 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.300 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -2282,7 +2282,7 @@ ctx_alloc(pm)
|
|||
*/
|
||||
simple_lock(&pm->pm_lock);
|
||||
#if defined(MULTIPROCESSOR)
|
||||
for (i = 0; i < ncpu; i++)
|
||||
for (i = 0; i < ncpus; i++)
|
||||
#else
|
||||
i = 0;
|
||||
#endif
|
||||
|
@ -2336,7 +2336,7 @@ ctx_free(pm)
|
|||
cache_flush_context(ctx);
|
||||
tlb_flush_context(ctx, PMAP_CPUSET(pm));
|
||||
#if defined(MULTIPROCESSOR)
|
||||
for (i = 0; i < ncpu; i++)
|
||||
for (i = 0; i < ncpus; i++)
|
||||
#else
|
||||
i = 0;
|
||||
#endif
|
||||
|
@ -3652,11 +3652,11 @@ pmap_bootstrap4m(top)
|
|||
|
||||
/* Allocate kernel region pointer tables */
|
||||
pmap_kernel()->pm_reg_ptps = (int **)(q = p);
|
||||
p += ncpu * sizeof(int **);
|
||||
p += ncpus * sizeof(int **);
|
||||
bzero((void *)q, (u_int)p - (u_int)q);
|
||||
|
||||
pmap_kernel()->pm_reg_ptps_pa = (int *)(q = p);
|
||||
p += ncpu * sizeof(int *);
|
||||
p += ncpus * sizeof(int *);
|
||||
bzero((void *)q, (u_int)p - (u_int)q);
|
||||
|
||||
/* Allocate context administration */
|
||||
|
@ -4115,8 +4115,8 @@ pmap_init()
|
|||
*/
|
||||
sz = ALIGN(sizeof(struct pmap)) +
|
||||
ALIGN(NUREG * sizeof(struct regmap)) +
|
||||
ncpu * sizeof(int *) + /* pm_reg_ptps */
|
||||
ncpu * sizeof(int); /* pm_reg_ptps_pa */
|
||||
ncpus * sizeof(int *) + /* pm_reg_ptps */
|
||||
ncpus * sizeof(int); /* pm_reg_ptps_pa */
|
||||
pool_init(&pmap_pmap_pool, sz, 0, 0, 0, "pmappl",
|
||||
&pool_allocator_nointr);
|
||||
pool_cache_init(&pmap_pmap_pool_cache, &pmap_pmap_pool,
|
||||
|
@ -4199,7 +4199,7 @@ pmap_quiet_check(struct pmap *pm)
|
|||
if (CPU_HAS_SRMMU) {
|
||||
int n;
|
||||
#if defined(MULTIPROCESSOR)
|
||||
for (n = 0; n < ncpu; n++)
|
||||
for (n = 0; n < ncpus; n++)
|
||||
#else
|
||||
n = 0;
|
||||
#endif
|
||||
|
@ -4281,7 +4281,7 @@ pmap_pmap_pool_ctor(void *arg, void *object, int flags)
|
|||
pm->pm_regmap = (void *)addr;
|
||||
addr += ALIGN(NUREG * sizeof(struct regmap));
|
||||
pm->pm_reg_ptps = (int **)addr;
|
||||
addr += ncpu * sizeof(int *);
|
||||
addr += ncpus * sizeof(int *);
|
||||
pm->pm_reg_ptps_pa = (int *)addr;
|
||||
|
||||
qzero((caddr_t)pm->pm_regmap, NUREG * sizeof(struct regmap));
|
||||
|
@ -4311,7 +4311,7 @@ pmap_pmap_pool_ctor(void *arg, void *object, int flags)
|
|||
* this user context.
|
||||
*/
|
||||
#if defined(MULTIPROCESSOR)
|
||||
for (n = 0; n < ncpu; n++)
|
||||
for (n = 0; n < ncpus; n++)
|
||||
#else
|
||||
n = 0;
|
||||
#endif
|
||||
|
@ -4363,7 +4363,7 @@ pmap_pmap_pool_dtor(void *arg, void *object)
|
|||
int n;
|
||||
|
||||
#if defined(MULTIPROCESSOR)
|
||||
for (n = 0; n < ncpu; n++)
|
||||
for (n = 0; n < ncpus; n++)
|
||||
#else
|
||||
n = 0;
|
||||
#endif
|
||||
|
@ -4550,7 +4550,7 @@ pgt_lvl23_remove4m(struct pmap *pm, struct regmap *rp, struct segmap *sp,
|
|||
PMAP_CPUSET(pm));
|
||||
#ifdef MULTIPROCESSOR
|
||||
/* Invalidate level 1 PTP entries on all CPUs */
|
||||
for (; n < ncpu; n++)
|
||||
for (; n < ncpus; n++)
|
||||
#endif
|
||||
setpgt4m(&pm->pm_reg_ptps[n][vr], SRMMU_TEINVALID);
|
||||
|
||||
|
@ -6452,7 +6452,7 @@ pmap_enu4m(pm, va, prot, flags, pg, pteproto)
|
|||
|
||||
/* Replicate segment allocation in each CPU's region table */
|
||||
#ifdef MULTIPROCESSOR
|
||||
for (i = 0; i < ncpu; i++)
|
||||
for (i = 0; i < ncpus; i++)
|
||||
#else
|
||||
i = 0;
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: timer_sun4m.c,v 1.11 2004/07/01 10:23:41 pk Exp $ */
|
||||
/* $NetBSD: timer_sun4m.c,v 1.12 2005/06/03 22:15:48 martin Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993
|
||||
|
@ -58,7 +58,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: timer_sun4m.c,v 1.11 2004/07/01 10:23:41 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: timer_sun4m.c,v 1.12 2005/06/03 22:15:48 martin Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
|
@ -89,7 +89,7 @@ timer_init_4m(void)
|
|||
int n;
|
||||
|
||||
timerreg4m->t_limit = tmr_ustolim4m(tick);
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
if ((cpi = cpus[n]) == NULL)
|
||||
continue;
|
||||
cpi->counterreg_4m->t_limit = tmr_ustolim4m(statint);
|
||||
|
@ -192,10 +192,10 @@ timerattach_obio_4m(struct device *parent, struct device *self, void *aux)
|
|||
* register is installed.
|
||||
*/
|
||||
cpi = NULL;
|
||||
for (n = 0; n < ncpu; n++) {
|
||||
for (n = 0; n < ncpus; n++) {
|
||||
if ((cpi = cpus[n]) == NULL)
|
||||
continue;
|
||||
if ((i == 0 && ncpu == 1) || cpi->mid == i + 8) {
|
||||
if ((i == 0 && ncpus == 1) || cpi->mid == i + 8) {
|
||||
/* We got a corresponding MID. */
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue