Adapt to building with -Wcast-qual. Regrettably we have to use
__UNCONST() in one sysctl_lookup() invocation (for now).
This commit is contained in:
parent
78fc2f2db7
commit
745ad09fd4
|
@ -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 <machine/bus.h>
|
||||
|
||||
struct mainbus_attach_args {
|
||||
char *ma_name;
|
||||
const char *ma_name;
|
||||
bus_addr_t ma_addr1;
|
||||
bus_addr_t ma_addr2;
|
||||
int ma_irq1;
|
||||
|
|
|
@ -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 <sys/cdefs.h>
|
||||
__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;
|
||||
|
|
Loading…
Reference in New Issue