Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc Rename ncpu to ncpus (as other ports call it)...
details: https://anonhg.NetBSD.org/src/rev/3ade40680285
branches: trunk
changeset: 581702:3ade40680285
user: martin <martin%NetBSD.org@localhost>
date: Fri Jun 03 22:15:48 2005 +0000
description:
Rename ncpu to ncpus (as other ports call it), to avoid shadow warnings.
Sprinkle some const.
diffstat:
sys/arch/sparc/include/cpu.h | 4 +-
sys/arch/sparc/sparc/autoconf.c | 44 ++++++++++++++++----------------
sys/arch/sparc/sparc/cache.c | 6 ++--
sys/arch/sparc/sparc/cpu.c | 48 ++++++++++++++++++------------------
sys/arch/sparc/sparc/cpuvar.h | 8 +++---
sys/arch/sparc/sparc/db_interface.c | 38 ++++++++++++++--------------
sys/arch/sparc/sparc/intr.c | 10 +++---
sys/arch/sparc/sparc/machdep.c | 16 ++++++------
sys/arch/sparc/sparc/pmap.c | 28 ++++++++++----------
sys/arch/sparc/sparc/timer_sun4m.c | 10 +++---
10 files changed, 106 insertions(+), 106 deletions(-)
diffs (truncated from 828 to 300 lines):
diff -r f2548bc91e9d -r 3ade40680285 sys/arch/sparc/include/cpu.h
--- a/sys/arch/sparc/include/cpu.h Fri Jun 03 22:06:24 2005 +0000
+++ b/sys/arch/sparc/include/cpu.h Fri Jun 03 22:15:48 2005 +0000
@@ -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 @@
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
diff -r f2548bc91e9d -r 3ade40680285 sys/arch/sparc/sparc/autoconf.c
--- a/sys/arch/sparc/sparc/autoconf.c Fri Jun 03 22:06:24 2005 +0000
+++ b/sys/arch/sparc/sparc/autoconf.c Fri Jun 03 22:15:48 2005 +0000
@@ -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 @@
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 @@
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 @@
* 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 @@
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 @@
static void
bootpath_build()
{
- char *cp, *pp;
+ const char *cp;
+ char *pp;
struct bootpath *bp;
int fl;
@@ -633,9 +634,9 @@
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 @@
*/
static void
crazymap(prop, map)
- char *prop;
+ const char *prop;
int *map;
{
int i;
@@ -1509,7 +1510,7 @@
*/
struct device *
getdevunit(name, unit)
- char *name;
+ const char *name;
int unit;
{
struct device *dev = alldevs.tqh_first;
@@ -1553,12 +1554,12 @@
#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 @@
* 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 @@
{ "SUNW,hme", "hme" },
};
-static char *
+static const char *
bus_compatible(bpname)
- char *bpname;
+ const char *bpname;
{
int i;
@@ -1771,8 +1772,7 @@
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
diff -r f2548bc91e9d -r 3ade40680285 sys/arch/sparc/sparc/cache.c
--- a/sys/arch/sparc/sparc/cache.c Fri Jun 03 22:06:24 2005 +0000
+++ b/sys/arch/sparc/sparc/cache.c Fri Jun 03 22:15:48 2005 +0000
@@ -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 @@
* 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);
}
diff -r f2548bc91e9d -r 3ade40680285 sys/arch/sparc/sparc/cpu.c
--- a/sys/arch/sparc/sparc/cpu.c Fri Jun 03 22:06:24 2005 +0000
+++ b/sys/arch/sparc/sparc/cpu.c Fri Jun 03 22:15:48 2005 +0000
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
{
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 @@
* 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 @@
Home |
Main Index |
Thread Index |
Old Index