From 8f4aee207b36c4cecaf326e432ba965fc1a3dd8d Mon Sep 17 00:00:00 2001 From: scw Date: Wed, 1 Jun 2005 13:01:35 +0000 Subject: [PATCH] Declare the second arg of process_write_{fp,}regs() to be const. This permits sh5 to continue to re-use those functions in cpu_setmcontext() with the recent change to Makefile.kern.inc (revision 1.62). --- sys/arch/alpha/alpha/process_machdep.c | 8 ++++---- sys/arch/amd64/amd64/process_machdep.c | 8 ++++---- sys/arch/arm/arm/process_machdep.c | 8 ++++---- sys/arch/arm/fpe-arm/armfpe.h | 6 +++--- sys/arch/arm/fpe-arm/armfpe_init.c | 8 ++++---- sys/arch/hppa/hppa/process_machdep.c | 8 ++++---- sys/arch/i386/i386/process_machdep.c | 8 ++++---- sys/arch/m68k/m68k/process_machdep.c | 8 ++++---- sys/arch/mips/mips/process_machdep.c | 8 ++++---- sys/arch/pc532/pc532/process_machdep.c | 8 ++++---- sys/arch/pdp10/pdp10/machdep.c | 4 ++-- sys/arch/powerpc/powerpc/process_machdep.c | 8 ++++---- sys/arch/sh3/sh3/process_machdep.c | 6 +++--- sys/arch/sh5/include/reg.h | 6 +++--- sys/arch/sh5/sh5/process_machdep.c | 8 ++++---- sys/arch/sh5/sh5/sig_machdep.c | 9 +++++---- sys/arch/sparc/sparc/process_machdep.c | 8 ++++---- sys/arch/sparc64/sparc64/netbsd32_machdep.c | 12 ++++++------ sys/arch/sparc64/sparc64/process_machdep.c | 12 ++++++------ sys/arch/vax/vax/machdep.c | 6 +++--- sys/sys/ptrace.h | 6 +++--- 21 files changed, 82 insertions(+), 81 deletions(-) diff --git a/sys/arch/alpha/alpha/process_machdep.c b/sys/arch/alpha/alpha/process_machdep.c index cdc0dc1f95f4..86a099ae7aaa 100644 --- a/sys/arch/alpha/alpha/process_machdep.c +++ b/sys/arch/alpha/alpha/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.21 2003/09/21 15:14:51 skd Exp $ */ +/* $NetBSD: process_machdep.c,v 1.22 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -54,7 +54,7 @@ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.21 2003/09/21 15:14:51 skd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.22 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -84,7 +84,7 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { regtoframe(regs, lwp_frame(l)); @@ -124,7 +124,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { if (l->l_addr->u_pcb.pcb_fpcpu != NULL) diff --git a/sys/arch/amd64/amd64/process_machdep.c b/sys/arch/amd64/amd64/process_machdep.c index c4338b008a31..576ce75c9495 100644 --- a/sys/arch/amd64/amd64/process_machdep.c +++ b/sys/arch/amd64/amd64/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.5 2005/05/15 21:37:46 fvdl Exp $ */ +/* $NetBSD: process_machdep.c,v 1.6 2005/06/01 13:01:36 scw Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.5 2005/05/15 21:37:46 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.6 2005/06/01 13:01:36 scw Exp $"); #include #include @@ -150,7 +150,7 @@ process_read_fpregs(l, regs) int process_write_regs(l, regp) struct lwp *l; - struct reg *regp; + const struct reg *regp; { struct trapframe *tf = process_frame(l); int error; @@ -173,7 +173,7 @@ process_write_regs(l, regp) int process_write_fpregs(l, regs) struct lwp *l; - struct fpreg *regs; + const struct fpreg *regs; { struct fxsave64 *frame = process_fpframe(l); diff --git a/sys/arch/arm/arm/process_machdep.c b/sys/arch/arm/arm/process_machdep.c index 7a6ca0f9ab31..551da87f053a 100644 --- a/sys/arch/arm/arm/process_machdep.c +++ b/sys/arch/arm/arm/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.13 2004/08/21 11:52:25 rearnsha Exp $ */ +/* $NetBSD: process_machdep.c,v 1.14 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -133,7 +133,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.13 2004/08/21 11:52:25 rearnsha Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.14 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -196,7 +196,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe *tf = process_frame(l); @@ -228,7 +228,7 @@ process_write_regs(struct lwp *l, struct reg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { #ifdef ARMFPE arm_fpe_setcontext(p, regs); diff --git a/sys/arch/arm/fpe-arm/armfpe.h b/sys/arch/arm/fpe-arm/armfpe.h index fdf73111b737..0ddd575762aa 100644 --- a/sys/arch/arm/fpe-arm/armfpe.h +++ b/sys/arch/arm/fpe-arm/armfpe.h @@ -1,4 +1,4 @@ -/* $NetBSD: armfpe.h,v 1.2 2002/03/10 15:29:54 bjh21 Exp $ */ +/* $NetBSD: armfpe.h,v 1.3 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1995 Neil A Carson. @@ -124,10 +124,10 @@ void arm_fpe_core_shutdown __P((void)); void arm_fpe_core_activatecontext __P((u_int context)); u_int arm_fpe_core_deactivatecontext __P((void)); u_int arm_fpe_core_savecontext __P((u_int context, fp_context_frame_t *savearea, int pc)); -void arm_fpe_core_loadcontext __P((u_int context, fp_context_frame_t *loadarea)); +void arm_fpe_core_loadcontext __P((u_int context, const fp_context_frame_t *loadarea)); void arm_fpe_copycontext __P((u_int c1, u_int c2)); void arm_fpe_getcontext __P((struct proc *p, struct fpreg *fpregs)); -void arm_fpe_setcontext __P((struct proc *p, struct fpreg *fpregs)); +void arm_fpe_setcontext __P((struct proc *p, const struct fpreg *fpregs)); void arm_fpe_exception_glue __P((int exception)); void arm_fpe_panic __P((void)); diff --git a/sys/arch/arm/fpe-arm/armfpe_init.c b/sys/arch/arm/fpe-arm/armfpe_init.c index 9f25ad555faf..c768bac3c111 100644 --- a/sys/arch/arm/fpe-arm/armfpe_init.c +++ b/sys/arch/arm/fpe-arm/armfpe_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: armfpe_init.c,v 1.7 2004/02/13 11:36:11 wiz Exp $ */ +/* $NetBSD: armfpe_init.c,v 1.8 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (C) 1996 Mark Brinicombe @@ -43,7 +43,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: armfpe_init.c,v 1.7 2004/02/13 11:36:11 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: armfpe_init.c,v 1.8 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -268,9 +268,9 @@ void arm_fpe_getcontext(p, fpregs) void arm_fpe_setcontext(p, fpregs) struct proc *p; - struct fpreg *fpregs; + const struct fpreg *fpregs; { - arm_fpe_core_loadcontext(FP_CONTEXT(p), (fp_context_frame_t *)fpregs); + arm_fpe_core_loadcontext(FP_CONTEXT(p), (const fp_context_frame_t *)fpregs); } /* End of armfpe_init.c */ diff --git a/sys/arch/hppa/hppa/process_machdep.c b/sys/arch/hppa/hppa/process_machdep.c index 97ee4cd18749..de767cc6e445 100644 --- a/sys/arch/hppa/hppa/process_machdep.c +++ b/sys/arch/hppa/hppa/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.5 2005/05/01 19:18:39 chs Exp $ */ +/* $NetBSD: process_machdep.c,v 1.6 2005/06/01 13:01:35 scw Exp $ */ /* $OpenBSD: process_machdep.c,v 1.3 1999/06/18 05:19:52 mickey Exp $ */ @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.5 2005/05/01 19:18:39 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.6 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -53,7 +53,7 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { bcopy(®s[1], &l->l_md.md_regs->tf_r1, sizeof(*regs) - sizeof(*regs)); @@ -71,7 +71,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *fpregs) } int -process_write_fpregs(struct lwp *l, struct fpreg *fpregs) +process_write_fpregs(struct lwp *l, const struct fpreg *fpregs) { hppa_fpu_flush(l); bcopy(fpregs, l->l_addr->u_pcb.pcb_fpregs, sizeof(*fpregs)); diff --git a/sys/arch/i386/i386/process_machdep.c b/sys/arch/i386/i386/process_machdep.c index 3d27a3200b06..92b7f45752ad 100644 --- a/sys/arch/i386/i386/process_machdep.c +++ b/sys/arch/i386/i386/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.51 2004/01/28 10:48:55 yamt Exp $ */ +/* $NetBSD: process_machdep.c,v 1.52 2005/06/01 13:01:35 scw Exp $ */ /*- * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.51 2004/01/28 10:48:55 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.52 2005/06/01 13:01:35 scw Exp $"); #include "opt_vm86.h" #include "npx.h" @@ -295,7 +295,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe *tf = process_frame(l); @@ -350,7 +350,7 @@ process_write_regs(struct lwp *l, struct reg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { union savefpu *frame = process_fpframe(l); diff --git a/sys/arch/m68k/m68k/process_machdep.c b/sys/arch/m68k/m68k/process_machdep.c index f3a67b4b815a..52cb8d7d869a 100644 --- a/sys/arch/m68k/m68k/process_machdep.c +++ b/sys/arch/m68k/m68k/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.22 2004/08/28 22:06:28 thorpej Exp $ */ +/* $NetBSD: process_machdep.c,v 1.23 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1993 Christopher G. Demetriou @@ -53,7 +53,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.22 2004/08/28 22:06:28 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.23 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -107,7 +107,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct frame *frame = process_frame(l); @@ -138,7 +138,7 @@ process_write_regs(struct lwp *l, struct reg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { struct fpframe *frame = process_fpframe(l); diff --git a/sys/arch/mips/mips/process_machdep.c b/sys/arch/mips/mips/process_machdep.c index 6618366ed320..f5bbfce298ee 100644 --- a/sys/arch/mips/mips/process_machdep.c +++ b/sys/arch/mips/mips/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.25 2005/01/01 03:25:46 simonb Exp $ */ +/* $NetBSD: process_machdep.c,v 1.26 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -76,7 +76,7 @@ */ #include /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.25 2005/01/01 03:25:46 simonb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.26 2005/06/01 13:01:35 scw Exp $"); /* * This file may seem a bit stylized, but that so that it's easier to port. @@ -117,7 +117,7 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct frame *f; mips_reg_t sr; @@ -140,7 +140,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { /* to load FPA contents next time when FP insn is executed */ diff --git a/sys/arch/pc532/pc532/process_machdep.c b/sys/arch/pc532/pc532/process_machdep.c index 7b82598fd141..b2ac3074d574 100644 --- a/sys/arch/pc532/pc532/process_machdep.c +++ b/sys/arch/pc532/pc532/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.14 2003/08/07 16:29:02 agc Exp $ */ +/* $NetBSD: process_machdep.c,v 1.15 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -93,7 +93,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.14 2003/08/07 16:29:02 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -127,7 +127,7 @@ process_read_regs(l, regs) int process_write_regs(l, regs) struct lwp *l; - struct reg *regs; + const struct reg *regs; { struct reg *pregs; @@ -161,7 +161,7 @@ process_read_fpregs(l, regs) int process_write_fpregs(l, regs) struct lwp *l; - struct fpreg *regs; + const struct fpreg *regs; { if ((l->l_flag & L_INMEM) == 0) return (EIO); diff --git a/sys/arch/pdp10/pdp10/machdep.c b/sys/arch/pdp10/pdp10/machdep.c index 8bbcd2783274..e95e51586f83 100644 --- a/sys/arch/pdp10/pdp10/machdep.c +++ b/sys/arch/pdp10/pdp10/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.6 2005/04/25 15:02:06 lukem Exp $ */ +/* $NetBSD: machdep.c,v 1.7 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se). * All rights reserved. @@ -171,7 +171,7 @@ process_sstep(struct lwp *p, int sstep) } int -process_write_regs(struct lwp *p, struct reg *regs) +process_write_regs(struct lwp *p, const struct reg *regs) { panic("process_write_regs"); } diff --git a/sys/arch/powerpc/powerpc/process_machdep.c b/sys/arch/powerpc/powerpc/process_machdep.c index 76e5b04bbf10..76399295df41 100644 --- a/sys/arch/powerpc/powerpc/process_machdep.c +++ b/sys/arch/powerpc/powerpc/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.18 2004/04/16 23:58:08 matt Exp $ */ +/* $NetBSD: process_machdep.c,v 1.19 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.18 2004/04/16 23:58:08 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.19 2005/06/01 13:01:35 scw Exp $"); #include "opt_altivec.h" @@ -68,7 +68,7 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe * const tf = trapframe(l); @@ -102,7 +102,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *fpregs) } int -process_write_fpregs(struct lwp *l, struct fpreg *fpregs) +process_write_fpregs(struct lwp *l, const struct fpreg *fpregs) { struct pcb * const pcb = &l->l_addr->u_pcb; diff --git a/sys/arch/sh3/sh3/process_machdep.c b/sys/arch/sh3/sh3/process_machdep.c index a692c6d7a63b..16fe07afd6db 100644 --- a/sys/arch/sh3/sh3/process_machdep.c +++ b/sys/arch/sh3/sh3/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.8 2003/08/07 16:29:30 agc Exp $ */ +/* $NetBSD: process_machdep.c,v 1.9 2005/06/01 13:01:35 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -99,7 +99,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.8 2003/08/07 16:29:30 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.9 2005/06/01 13:01:35 scw Exp $"); #include #include @@ -151,7 +151,7 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe *tf = process_frame(l); diff --git a/sys/arch/sh5/include/reg.h b/sys/arch/sh5/include/reg.h index 2af3c28ba70e..893e2c95adc3 100644 --- a/sys/arch/sh5/include/reg.h +++ b/sys/arch/sh5/include/reg.h @@ -1,4 +1,4 @@ -/* $NetBSD: reg.h,v 1.4 2003/01/20 20:07:53 scw Exp $ */ +/* $NetBSD: reg.h,v 1.5 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -66,8 +66,8 @@ struct fpreg { struct lwp; int process_read_regs(struct lwp *, struct reg *); -int process_write_regs(struct lwp *, struct reg *); +int process_write_regs(struct lwp *, const struct reg *); int process_read_fpregs(struct lwp *, struct fpreg *); -int process_write_fpregs(struct lwp *, struct fpreg *); +int process_write_fpregs(struct lwp *, const struct fpreg *); #endif /* _SH5_REG_H */ diff --git a/sys/arch/sh5/sh5/process_machdep.c b/sys/arch/sh5/sh5/process_machdep.c index 2b1e9d2277cf..50f3439bb9b3 100644 --- a/sys/arch/sh5/sh5/process_machdep.c +++ b/sys/arch/sh5/sh5/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.15 2004/03/17 20:22:11 scw Exp $ */ +/* $NetBSD: process_machdep.c,v 1.16 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.15 2004/03/17 20:22:11 scw Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.16 2005/06/01 13:01:36 scw Exp $"); #include #include @@ -235,7 +235,7 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe *tf = l->l_md.md_regs; @@ -329,7 +329,7 @@ process_write_regs(struct lwp *l, struct reg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { memcpy(&l->l_addr->u_pcb.pcb_ctx.sf_fpregs, regs, sizeof(*regs)); diff --git a/sys/arch/sh5/sh5/sig_machdep.c b/sys/arch/sh5/sh5/sig_machdep.c index 269bc493c645..a82adc949743 100644 --- a/sys/arch/sh5/sh5/sig_machdep.c +++ b/sys/arch/sh5/sh5/sig_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: sig_machdep.c,v 1.18 2003/10/08 00:28:42 thorpej Exp $ */ +/* $NetBSD: sig_machdep.c,v 1.19 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.18 2003/10/08 00:28:42 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.19 2005/06/01 13:01:36 scw Exp $"); #include "opt_compat_netbsd.h" @@ -226,11 +226,12 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) return (EINVAL); /* Restore register context. */ - process_write_regs(l, (struct reg *)(void *)mcp); + process_write_regs(l, (const struct reg *)(const void *)mcp); } if (flags & _UC_FPU) { - process_write_fpregs(l, (struct fpreg *)(void *)&mcp->__fpregs); + process_write_fpregs(l, + (const struct fpreg *)(const void *)&mcp->__fpregs); sh5_fprestore(tf->tf_state.sf_usr, &l->l_addr->u_pcb); } else { /* Always restore FPSCR */ diff --git a/sys/arch/sparc/sparc/process_machdep.c b/sys/arch/sparc/sparc/process_machdep.c index bf800a173855..cea6a51d3e35 100644 --- a/sys/arch/sparc/sparc/process_machdep.c +++ b/sys/arch/sparc/sparc/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.10 2003/08/07 16:29:45 agc Exp $ */ +/* $NetBSD: process_machdep.c,v 1.11 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -95,7 +95,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.10 2003/08/07 16:29:45 agc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.11 2005/06/01 13:01:36 scw Exp $"); #include #include @@ -122,7 +122,7 @@ process_read_regs(p, regs) int process_write_regs(p, regs) struct lwp *p; - struct reg *regs; + const struct reg *regs; { int psr = p->l_md.md_tf->tf_psr & ~PSR_ICC; bcopy((caddr_t)regs, p->l_md.md_tf, sizeof(struct reg)); @@ -168,7 +168,7 @@ process_read_fpregs(p, regs) int process_write_fpregs(p, regs) struct lwp *p; - struct fpreg *regs; + const struct fpreg *regs; { if (p->l_md.md_fpstate == NULL) return (EINVAL); diff --git a/sys/arch/sparc64/sparc64/netbsd32_machdep.c b/sys/arch/sparc64/sparc64/netbsd32_machdep.c index 334f6d5e315d..086531540ccb 100644 --- a/sys/arch/sparc64/sparc64/netbsd32_machdep.c +++ b/sys/arch/sparc64/sparc64/netbsd32_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.45 2005/03/26 05:12:35 fvdl Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.46 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.45 2005/03/26 05:12:35 fvdl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.46 2005/06/01 13:01:36 scw Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -541,9 +541,9 @@ netbsd32_process_read_regs(p, regs) int netbsd32_process_write_regs(p, regs) struct proc *p; - struct reg *regs; + const struct reg *regs; { - struct reg32* regp = (struct reg32*)regs; + const struct reg32* regp = (const struct reg32*)regs; struct trapframe64* tf = p->p_md.md_tf; int i; @@ -585,11 +585,11 @@ struct fpreg *regs; int netbsd32_process_write_fpregs(p, regs) struct proc *p; -struct fpreg *regs; +const struct fpreg *regs; { extern struct fpstate initfpstate; struct fpstate64 *statep = &initfpstate; - struct fpreg32 *regp = (struct fpreg32 *)regs; + const struct fpreg32 *regp = (const struct fpreg32 *)regs; int i; /* NOTE: struct fpreg == struct fpstate */ diff --git a/sys/arch/sparc64/sparc64/process_machdep.c b/sys/arch/sparc64/sparc64/process_machdep.c index b73c4ef2b614..741fd60ceac1 100644 --- a/sys/arch/sparc64/sparc64/process_machdep.c +++ b/sys/arch/sparc64/sparc64/process_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.16 2003/11/09 16:41:53 martin Exp $ */ +/* $NetBSD: process_machdep.c,v 1.17 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -95,7 +95,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.16 2003/11/09 16:41:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.17 2005/06/01 13:01:36 scw Exp $"); #include #include @@ -145,10 +145,10 @@ process_read_regs(struct lwp *l, struct reg *regs) } int -process_write_regs(struct lwp *l, struct reg *regs) +process_write_regs(struct lwp *l, const struct reg *regs) { struct trapframe64* tf = l->l_md.md_tf; - struct reg32* regp = (struct reg32*)regs; + const struct reg32* regp = (const struct reg32*)regs; int i; #ifdef __arch64__ @@ -227,12 +227,12 @@ process_read_fpregs(struct lwp *l, struct fpreg *regs) } int -process_write_fpregs(struct lwp *l, struct fpreg *regs) +process_write_fpregs(struct lwp *l, const struct fpreg *regs) { extern struct fpstate64 initfpstate; struct fpstate64 *statep = &initfpstate; - struct fpreg32 *regp = (struct fpreg32 *)regs; + const struct fpreg32 *regp = (const struct fpreg32 *)regs; int i; #ifdef __arch64__ diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index c5e5d5b0772d..b29fc5bd1d55 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.149 2005/04/25 15:02:07 lukem Exp $ */ +/* $NetBSD: machdep.c,v 1.150 2005/06/01 13:01:36 scw Exp $ */ /* * Copyright (c) 1982, 1986, 1990 The Regents of the University of California. @@ -83,7 +83,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.149 2005/04/25 15:02:07 lukem Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.150 2005/06/01 13:01:36 scw Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -490,7 +490,7 @@ process_read_regs(l, regs) int process_write_regs(l, regs) struct lwp *l; - struct reg *regs; + const struct reg *regs; { struct trapframe *tf = l->l_addr->u_pcb.framep; diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 91fccfb660e2..a2f0407d1105 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -1,4 +1,4 @@ -/* $NetBSD: ptrace.h,v 1.33 2005/02/03 19:20:02 perry Exp $ */ +/* $NetBSD: ptrace.h,v 1.34 2005/06/01 13:01:35 scw Exp $ */ /*- * Copyright (c) 1984, 1993 @@ -105,10 +105,10 @@ int process_read_regs(struct lwp *, struct reg *); int process_set_pc(struct lwp *, caddr_t); int process_sstep(struct lwp *, int); #ifdef PT_SETFPREGS -int process_write_fpregs(struct lwp *, struct fpreg *); +int process_write_fpregs(struct lwp *, const struct fpreg *); #endif #ifdef PT_SETREGS -int process_write_regs(struct lwp *, struct reg *); +int process_write_regs(struct lwp *, const struct reg *); #endif #ifdef __HAVE_PROCFS_MACHDEP