From 502b27f3cedecf3300893ad91536d5ccd6f4ade5 Mon Sep 17 00:00:00 2001 From: he Date: Wed, 20 Jul 2005 17:48:17 +0000 Subject: [PATCH] Fixes to make GENERIC.MP build again. Several changes: o Rename global variable "tramp" to "vax_mp_tramp" to avoid warning with -Wshadow when compiling the signal code. o Rename a macro-local variable _s to __s in __cpu_simple_lock() to avoid -Wshadow warning when MALLOC() is used (also declares _s). o Follow up -Wcast-qual by making a number of function arguments const char* where string literals are used. --- sys/arch/vax/include/cpu.h | 4 ++-- sys/arch/vax/include/lock.h | 14 +++++++------- sys/arch/vax/vax/db_machdep.c | 6 +++--- sys/arch/vax/vax/ka6400.c | 14 +++++++------- sys/arch/vax/vax/ka820.c | 14 +++++++------- sys/arch/vax/vax/ka88.c | 14 +++++++------- sys/arch/vax/vax/subr.S | 6 +++--- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index a768deab8a3d..13b337e78750 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.70 2004/09/22 11:32:03 yamt Exp $ */ +/* $NetBSD: cpu.h,v 1.71 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden @@ -183,7 +183,7 @@ struct cpu_mp_softc { ci = SIMPLEQ_NEXT(ci, ci_next) extern SIMPLEQ_HEAD(cpu_info_qh, cpu_info) cpus; -extern char tramp; +extern char vax_mp_tramp; #endif /* diff --git a/sys/arch/vax/include/lock.h b/sys/arch/vax/include/lock.h index 38f3a84b6c13..496c34d86a09 100644 --- a/sys/arch/vax/include/lock.h +++ b/sys/arch/vax/include/lock.h @@ -1,4 +1,4 @@ -/* $NetBSD: lock.h,v 1.16 2004/05/19 23:15:43 he Exp $ */ +/* $NetBSD: lock.h,v 1.17 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. @@ -84,12 +84,12 @@ do { \ struct cpu_info *__ci = curcpu(); \ \ while (__cpu_simple_lock_try(alp) == 0) { \ - int __s; \ + int ___s; \ \ if (__ci->ci_ipimsgs & VAX_LOCK_CHECKS) { \ - __s = splipi(); \ + ___s = splipi(); \ cpu_handle_ipi(); \ - splx(__s); \ + splx(___s); \ } \ } \ } while (0) @@ -163,14 +163,14 @@ __cpu_simple_unlock(__cpu_simple_lock_t *alp) #define SPINLOCK_SPIN_HOOK \ do { \ struct cpu_info *__ci = curcpu(); \ - int __s; \ + int ___s; \ \ if (__ci->ci_ipimsgs != 0) { \ /* printf("CPU %lu has IPIs pending\n", \ __ci->ci_cpuid); */ \ - __s = splipi(); \ + ___s = splipi(); \ cpu_handle_ipi(); \ - splx(__s); \ + splx(___s); \ } \ } while (0) #endif /* MULTIPROCESSOR */ diff --git a/sys/arch/vax/vax/db_machdep.c b/sys/arch/vax/vax/db_machdep.c index 0f0352a57bb4..eb16712d5238 100644 --- a/sys/arch/vax/vax/db_machdep.c +++ b/sys/arch/vax/vax/db_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.39 2005/06/27 11:03:25 ragge Exp $ */ +/* $NetBSD: db_machdep.c,v 1.40 2005/07/20 17:48:17 he Exp $ */ /* * :set tabs=4 @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.39 2005/06/27 11:03:25 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.40 2005/07/20 17:48:17 he Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -630,7 +630,7 @@ kdbrint(tkn) #ifdef MULTIPROCESSOR static void -db_mach_cpu(db_expr_t addr, int have_addr, db_expr_t count, char *modif) +db_mach_cpu(db_expr_t addr, int have_addr, db_expr_t count, const char *modif) { struct cpu_mp_softc *sc; struct cpu_info *ci; diff --git a/sys/arch/vax/vax/ka6400.c b/sys/arch/vax/vax/ka6400.c index 4451b66dd89d..e09207e786a1 100644 --- a/sys/arch/vax/vax/ka6400.c +++ b/sys/arch/vax/vax/ka6400.c @@ -1,4 +1,4 @@ -/* $NetBSD: ka6400.c,v 1.5 2003/07/15 02:15:04 lukem Exp $ */ +/* $NetBSD: ka6400.c,v 1.6 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.5 2003/07/15 02:15:04 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.6 2005/07/20 17:48:17 he Exp $"); #include "opt_multiprocessor.h" @@ -79,8 +79,8 @@ static int ka6400_mchk(caddr_t); static void ka6400_steal_pages(void); #if defined(MULTIPROCESSOR) static void ka6400_startslave(struct device *, struct cpu_info *); -static void ka6400_txrx(int, char *, int); -static void ka6400_sendstr(int, char *); +static void ka6400_txrx(int, const char *, int); +static void ka6400_sendstr(int, const char *); static void ka6400_sergeant(int); static int rxchar(void); static void ka6400_putc(int); @@ -353,7 +353,7 @@ ka6400_startslave(struct device *dev, struct cpu_info *ci) ka6400_txrx(id, "D/I 10 %x\r", (int)ci->ci_pcb); /* PCB for idle proc */ ka6400_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */ ka6400_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */ - ka6400_txrx(id, "S %x\r", (int)&tramp); /* Start! */ + ka6400_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */ expect = 0; for (i = 0; i < 10000; i++) if ((volatile)ci->ci_flags & CI_RUNNING) @@ -364,7 +364,7 @@ ka6400_startslave(struct device *dev, struct cpu_info *ci) } void -ka6400_txrx(int id, char *fmt, int arg) +ka6400_txrx(int id, const char *fmt, int arg) { char buf[20]; @@ -374,7 +374,7 @@ ka6400_txrx(int id, char *fmt, int arg) } void -ka6400_sendstr(int id, char *buf) +ka6400_sendstr(int id, const char *buf) { register u_int utchr; /* Ends up in R11 with PCC */ int ch, i; diff --git a/sys/arch/vax/vax/ka820.c b/sys/arch/vax/vax/ka820.c index 316231d595a1..4c44a0a2d0ce 100644 --- a/sys/arch/vax/vax/ka820.c +++ b/sys/arch/vax/vax/ka820.c @@ -1,4 +1,4 @@ -/* $NetBSD: ka820.c,v 1.41 2005/06/27 11:03:25 ragge Exp $ */ +/* $NetBSD: ka820.c,v 1.42 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.41 2005/06/27 11:03:25 ragge Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.42 2005/07/20 17:48:17 he Exp $"); #include "opt_multiprocessor.h" @@ -90,8 +90,8 @@ static void vaxbierr(void *); #if defined(MULTIPROCESSOR) static void ka820_startslave(struct device *, struct cpu_info *); static void ka820_send_ipi(struct device *); -static void ka820_txrx(int, char *, int); -static void ka820_sendstr(int, char *); +static void ka820_txrx(int, const char *, int); +static void ka820_sendstr(int, const char *); static void ka820_sergeant(int); static int rxchar(void); static void ka820_putc(int); @@ -563,7 +563,7 @@ ka820_startslave(struct device *dev, struct cpu_info *ci) ka820_txrx(id, "D/I 10 %x\r", (int)ci->ci_pcb); /* PCB for idle proc */ ka820_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */ ka820_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */ - ka820_txrx(id, "S %x\r", (int)&tramp); /* Start! */ + ka820_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */ expect = 0; for (i = 0; i < 10000; i++) if ((volatile int)ci->ci_flags & CI_RUNNING) @@ -574,7 +574,7 @@ ka820_startslave(struct device *dev, struct cpu_info *ci) } void -ka820_txrx(int id, char *fmt, int arg) +ka820_txrx(int id, const char *fmt, int arg) { char buf[20]; @@ -594,7 +594,7 @@ ka820_sendchr(int chr) } void -ka820_sendstr(int id, char *buf) +ka820_sendstr(int id, const char *buf) { u_int utchr; int ch, i; diff --git a/sys/arch/vax/vax/ka88.c b/sys/arch/vax/vax/ka88.c index f3b1a1b8474f..4ddec22a6cc9 100644 --- a/sys/arch/vax/vax/ka88.c +++ b/sys/arch/vax/vax/ka88.c @@ -1,4 +1,4 @@ -/* $NetBSD: ka88.c,v 1.6 2003/07/15 02:15:04 lukem Exp $ */ +/* $NetBSD: ka88.c,v 1.7 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.6 2003/07/15 02:15:04 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.7 2005/07/20 17:48:17 he Exp $"); #include "opt_multiprocessor.h" @@ -74,8 +74,8 @@ static void ka88_clkwrite(void); static void ka88_badaddr(void); #if defined(MULTIPROCESSOR) static void ka88_startslave(struct device *, struct cpu_info *); -static void ka88_txrx(int, char *, int); -static void ka88_sendstr(int, char *); +static void ka88_txrx(int, const char *, int); +static void ka88_sendstr(int, const char *); static void ka88_sergeant(int); static int rxchar(void); static void ka88_putc(int); @@ -376,7 +376,7 @@ ka88_startslave(struct device *dev, struct cpu_info *ci) ka88_txrx(id, "D/I 10 %x\r", (int)ci->ci_pcb); /* PCB for idle proc */ ka88_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */ ka88_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */ - ka88_txrx(id, "S %x\r", (int)&tramp); /* Start! */ + ka88_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */ expect = 0; for (i = 0; i < 10000; i++) if ((volatile)ci->ci_flags & CI_RUNNING) @@ -387,7 +387,7 @@ ka88_startslave(struct device *dev, struct cpu_info *ci) } void -ka88_txrx(int id, char *fmt, int arg) +ka88_txrx(int id, const char *fmt, int arg) { char buf[20]; @@ -397,7 +397,7 @@ ka88_txrx(int id, char *fmt, int arg) } void -ka88_sendstr(int id, char *buf) +ka88_sendstr(int id, const char *buf) { register u_int utchr; /* Ends up in R11 with PCC */ int ch, i; diff --git a/sys/arch/vax/vax/subr.S b/sys/arch/vax/vax/subr.S index cb2ee935b09b..d7eae7f6776d 100644 --- a/sys/arch/vax/vax/subr.S +++ b/sys/arch/vax/vax/subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: subr.S,v 1.11 2005/04/09 20:44:56 matt Exp $ */ +/* $NetBSD: subr.S,v 1.12 2005/07/20 17:48:17 he Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -403,8 +403,8 @@ lp: ffs $0,$32,_C_LABEL(sched_whichqs),%r3 # Search for bit set #if defined(MULTIPROCESSOR) .align 2 - .globl _C_LABEL(tramp) # used to kick off multiprocessor systems. -_C_LABEL(tramp): + .globl _C_LABEL(vax_mp_tramp) # used to kick off multiprocessor systems. +_C_LABEL(vax_mp_tramp): ldpctx rei #endif