From 745ad09fd4ab0130dd78099315537057c5083041 Mon Sep 17 00:00:00 2001 From: he Date: Sun, 5 Jun 2005 15:43:30 +0000 Subject: [PATCH] Adapt to building with -Wcast-qual. Regrettably we have to use __UNCONST() in one sysctl_lookup() invocation (for now). --- sys/arch/mmeye/include/autoconf.h | 4 ++-- sys/arch/mmeye/mmeye/machdep.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sys/arch/mmeye/include/autoconf.h b/sys/arch/mmeye/include/autoconf.h index 2fb4fe8c9f2a..7eccc96b2c6e 100644 --- a/sys/arch/mmeye/include/autoconf.h +++ b/sys/arch/mmeye/include/autoconf.h @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.h,v 1.1 2002/03/24 18:28:13 uch Exp $ */ +/* $NetBSD: autoconf.h,v 1.2 2005/06/05 15:43:30 he Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include struct mainbus_attach_args { - char *ma_name; + const char *ma_name; bus_addr_t ma_addr1; bus_addr_t ma_addr2; int ma_irq1; diff --git a/sys/arch/mmeye/mmeye/machdep.c b/sys/arch/mmeye/mmeye/machdep.c index d283c9084bfe..87e7d81025e0 100644 --- a/sys/arch/mmeye/mmeye/machdep.c +++ b/sys/arch/mmeye/mmeye/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.35 2004/03/24 15:34:50 atatat Exp $ */ +/* $NetBSD: machdep.c,v 1.36 2005/06/05 15:43:31 he Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2004/03/24 15:34:50 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.36 2005/06/05 15:43:31 he Exp $"); #include "opt_ddb.h" #include "opt_memsize.h" @@ -110,7 +110,7 @@ char machine[] = MACHINE; /* mmeye */ char machine_arch[] = MACHINE_ARCH; /* sh3eb */ void initSH3 __P((void *)); -void LoadAndReset __P((char *)); +void LoadAndReset __P((const char *)); void XLoadAndReset __P((char *)); void consinit __P((void)); void sh3_cache_on __P((void)); @@ -139,14 +139,14 @@ cpu_startup() static int sysctl_machdep_loadandreset(SYSCTLFN_ARGS) { - char *osimage; + const char *osimage; int error; - error = sysctl_lookup(SYSCTLFN_CALL(rnode)); + error = sysctl_lookup(SYSCTLFN_CALL(__UNCONST(rnode))); if (error || newp == NULL) return (error); - osimage = (char *)(*(u_long *)newp); + osimage = (const char *)(*(const u_long *)newp); LoadAndReset(osimage); /* not reach here */ return (0); @@ -444,11 +444,11 @@ sh3_cache_on(void) void LoadAndReset(osimage) - char *osimage; + const char *osimage; { void *buf_addr; u_long size; - u_long *src; + const u_long *src; u_long *dest; u_long csum = 0; u_long csum2 = 0; @@ -459,8 +459,8 @@ LoadAndReset(osimage) printf("LoadAndReset: copy start\n"); buf_addr = (void *)OSIMAGE_BUF_ADDR; - size = *(u_long *)osimage; - src = (u_long *)osimage; + size = *(const u_long *)osimage; + src = (const u_long *)osimage; dest = buf_addr; size = (size + sizeof(u_long) * 2 + 3) >> 2;