Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/arch/mips/mips/cpu_subr.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/arch/mips/mips/cpu_subr.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.14.8.1 retrieving revision 1.15 diff -u -p -r1.14.8.1 -r1.15 --- src/sys/arch/mips/mips/cpu_subr.c 2012/05/21 15:25:56 1.14.8.1 +++ src/sys/arch/mips/mips/cpu_subr.c 2012/02/19 21:06:16 1.15 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_subr.c,v 1.14.8.1 2012/05/21 15:25:56 riz Exp $ */ +/* $NetBSD: cpu_subr.c,v 1.15 2012/02/19 21:06:16 rmind Exp $ */ /*- * Copyright (c) 2010 The NetBSD Foundation, Inc. @@ -30,11 +30,10 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.14.8.1 2012/05/21 15:25:56 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.15 2012/02/19 21:06:16 rmind Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" -#include "opt_sa.h" #include #include @@ -47,10 +46,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v #include #include #include -#ifdef KERN_SA -#include -#include -#endif #include @@ -315,75 +310,6 @@ cpu_startup_common(void) printf("avail memory = %s\n", pbuf); } -#ifdef KERN_SA -/* - * XXX This is a terrible name. - */ -void -upcallret(struct lwp *l) -{ - userret(l); -} - -void -cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, - void *sas, void *ap, void *sp, sa_upcall_t upcall) -{ - struct trapframe *tf = l->l_md.md_utf; - struct saframe frame; -#ifdef COMPAT_NETBSD32 - struct saframe32 frame32; -#endif - void *ksf, *usf; - size_t sfsz; - -#if 0 /* First 4 args in regs (see below). */ - frame.sa_type = type; - frame.sa_sas = sas; - frame.sa_events = nevents; - frame.sa_interrupted = ninterrupted; -#endif -#ifdef COMPAT_NETBSD32 - switch (l->l_proc->p_md.md_abi) { - case _MIPS_BSD_API_O32: - case _MIPS_BSD_API_N32: - NETBSD32PTR32(frame32.sa_arg, ap); - NETBSD32PTR32(frame32.sa_upcall, upcall); - ksf = &frame32; - usf = (struct saframe32 *)sp - 1; - sfsz = sizeof(frame32); - break; - default: -#endif - frame.sa_arg = ap; - frame.sa_upcall = upcall; - ksf = &frame; - usf = (struct saframe *)sp - 1; - sfsz = sizeof(frame); -#ifdef COMPAT_NETBSD32 - break; - } -#endif - - if (copyout(ksf, usf, sfsz) != 0) { - /* Copying onto the stack didn't work. Die. */ - mutex_enter(l->l_proc->p_lock); - sigexit(l, SIGILL); - /* NOTREACHED */ - } - - tf->tf_regs[_R_PC] = (intptr_t)upcall; - tf->tf_regs[_R_SP] = (intptr_t)usf; - tf->tf_regs[_R_A0] = type; - tf->tf_regs[_R_A1] = (intptr_t)sas; - tf->tf_regs[_R_A2] = nevents; - tf->tf_regs[_R_A3] = ninterrupted; - tf->tf_regs[_R_S8] = 0; - tf->tf_regs[_R_RA] = 0; - tf->tf_regs[_R_T9] = (intptr_t)upcall; /* t9=Upcall function*/ -} -#endif /* KERN_SA */ - void cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags) { @@ -437,28 +363,16 @@ cpu_getmcontext(struct lwp *l, mcontext_ } int -cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp) -{ - /* XXX: Do we validate the addresses?? */ - return 0; -} - -int cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags) { struct trapframe *tf = l->l_md.md_utf; struct proc *p = l->l_proc; const __greg_t *gr = mcp->__gregs; - int error; /* Restore register context, if any. */ if (flags & _UC_CPU) { - error = cpu_mcontext_validate(l, mcp); - if (error) - return error; - /* Save register context. */ - + /* XXX: Do we validate the addresses?? */ #ifdef __mips_n32 CTASSERT(_R_AST == _REG_AT); if (__predict_false(p->p_md.md_abi == _MIPS_BSD_API_O32)) {