Module Name: src Committed By: matt Date: Fri Aug 21 17:40:22 UTC 2009
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: process_machdep.c sig_machdep.c Log Message: Stop casting l_md.md_regs. Add a CTASSERT that struct reg is the same size struct frame member f_regs To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.62.1 src/sys/arch/mips/mips/process_machdep.c cvs rdiff -u -r1.16.14.1 -r1.16.14.2 src/sys/arch/mips/mips/sig_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/mips/process_machdep.c diff -u src/sys/arch/mips/mips/process_machdep.c:1.29 src/sys/arch/mips/mips/process_machdep.c:1.29.62.1 --- src/sys/arch/mips/mips/process_machdep.c:1.29 Sun Mar 4 06:00:12 2007 +++ src/sys/arch/mips/mips/process_machdep.c Fri Aug 21 17:40:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: process_machdep.c,v 1.29 2007/03/04 06:00:12 christos Exp $ */ +/* $NetBSD: process_machdep.c,v 1.29.62.1 2009/08/21 17:40:22 matt Exp $ */ /* * Copyright (c) 1993 The Regents of the University of California. @@ -76,7 +76,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.29 2007/03/04 06:00:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.29.62.1 2009/08/21 17:40:22 matt Exp $"); /* * This file may seem a bit stylized, but that so that it's easier to port. @@ -108,21 +108,22 @@ #include <mips/reg.h> #include <mips/regnum.h> /* symbolic register indices */ +CTASSERT(sizeof(struct reg) == sizeof(((struct frame *)0)->f_regs)); + int process_read_regs(struct lwp *l, struct reg *regs) { - memcpy(regs, l->l_md.md_regs, sizeof(struct reg)); + memcpy(regs, l->l_md.md_regs->f_regs, sizeof(struct reg)); return 0; } int process_write_regs(struct lwp *l, const struct reg *regs) { - struct frame *f; + struct frame *f = l->l_md.md_regs; mips_reg_t sr; - f = (struct frame *) l->l_md.md_regs; sr = f->f_regs[_R_SR]; memcpy(l->l_md.md_regs, regs, sizeof(struct reg)); f->f_regs[_R_SR] = sr; Index: src/sys/arch/mips/mips/sig_machdep.c diff -u src/sys/arch/mips/mips/sig_machdep.c:1.16.14.1 src/sys/arch/mips/mips/sig_machdep.c:1.16.14.2 --- src/sys/arch/mips/mips/sig_machdep.c:1.16.14.1 Wed Aug 19 07:36:56 2009 +++ src/sys/arch/mips/mips/sig_machdep.c Fri Aug 21 17:40:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sig_machdep.c,v 1.16.14.1 2009/08/19 07:36:56 matt Exp $ */ +/* $NetBSD: sig_machdep.c,v 1.16.14.2 2009/08/21 17:40:22 matt Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.16.14.1 2009/08/19 07:36:56 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.16.14.2 2009/08/21 17:40:22 matt Exp $"); #include "opt_cputype.h" #include "opt_compat_netbsd.h" @@ -88,7 +88,7 @@ size_t ucsz; sig_t catcher = SIGACTION(p, sig).sa_handler; - tf = (struct frame *)l->l_md.md_regs; + tf = l->l_md.md_regs; fp--; /* Build stack frame for signal trampoline. */