From dac9c438870e6377db586d814787a524c179aa76 Mon Sep 17 00:00:00 2001 From: alc Date: Thu, 4 Apr 2002 06:59:18 +0000 Subject: o Kill the MD grow_stack(). Call the MI vm_map_growstack() in its place. o Eliminate the use of useracc() and grow_stack() from sendsig(). Reviewed by: peter --- sys/ia64/ia64/machdep.c | 34 ++++++++++++++++------------------ sys/ia64/ia64/trap.c | 6 +++--- sys/ia64/ia64/vm_machdep.c | 14 -------------- 3 files changed, 19 insertions(+), 35 deletions(-) (limited to 'sys') diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index d0b588a..412d6dc 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -864,16 +864,29 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) sfp = (struct sigframe *)(frame->tf_r[FRAME_SP] - rndfsize); PROC_UNLOCK(p); - (void)grow_stack(p, (u_long)sfp); #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) printf("sendsig(%d): sig %d ssp %p usp %p\n", p->p_pid, sig, &sf, sfp); #endif - if (!useracc((caddr_t)sfp, sizeof(sf), VM_PROT_WRITE)) { + +#if 0 + /* save the floating-point state, if necessary, then copy it. */ + ia64_fpstate_save(td, 1); + sf.sf_uc.uc_mcontext.mc_ownedfp = td->td_md.md_flags & MDP_FPUSED; + bcopy(&td->td_pcb->pcb_fp, + (struct fpreg *)sf.sf_uc.uc_mcontext.mc_fpregs, + sizeof(struct fpreg)); + sf.sf_uc.uc_mcontext.mc_fp_control = td->td_pcb.pcb_fp_control; +#endif + + /* + * copy the frame out to userland. + */ + if (copyout((caddr_t)&sf, (caddr_t)sfp, sizeof(sf)) != 0) { #ifdef DEBUG if ((sigdebug & SDB_KSTACK) && p->p_pid == sigpid) - printf("sendsig(%d): useracc failed on sig %d\n", + printf("sendsig(%d): copyout failed on sig %d\n", p->p_pid, sig); #endif /* @@ -888,21 +901,6 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) psignal(p, SIGILL); return; } - -#if 0 - /* save the floating-point state, if necessary, then copy it. */ - ia64_fpstate_save(td, 1); - sf.sf_uc.uc_mcontext.mc_ownedfp = td->td_md.md_flags & MDP_FPUSED; - bcopy(&td->td_pcb->pcb_fp, - (struct fpreg *)sf.sf_uc.uc_mcontext.mc_fpregs, - sizeof(struct fpreg)); - sf.sf_uc.uc_mcontext.mc_fp_control = td->td_pcb.pcb_fp_control; -#endif - - /* - * copy the frame out to userland. - */ - (void) copyout((caddr_t)&sf, (caddr_t)sfp, sizeof(sf)); #ifdef DEBUG if (sigdebug & SDB_FOLLOW) printf("sendsig(%d): sig %d sfp %p code %lx\n", p->p_pid, sig, diff --git a/sys/ia64/ia64/trap.c b/sys/ia64/ia64/trap.c index 060dcb5..9a1cb5e 100644 --- a/sys/ia64/ia64/trap.c +++ b/sys/ia64/ia64/trap.c @@ -587,13 +587,13 @@ trap(int vector, int imm, struct trapframe *framep) /* * Grow the stack if necessary */ - /* grow_stack returns false only if va falls into + /* vm_map_growstack fails only if va falls into * a growable stack region and the stack growth - * fails. It returns true if va was not within + * fails. It succeeds if va was not within * a growable stack region, or if the stack * growth succeeded. */ - if (!grow_stack (p, va)) + if (vm_map_growstack(p, va) != KERN_SUCCESS) rv = KERN_FAILURE; else /* Fault in the user page: */ diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 7773647..d5007dc 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -418,20 +418,6 @@ cpu_reset() cpu_boot(0); } -int -grow_stack(p, sp) - struct proc *p; - size_t sp; -{ - int rv; - - rv = vm_map_growstack (p, sp); - if (rv != KERN_SUCCESS) - return (0); - - return (1); -} - /* * Software interrupt handler for queued VM system processing. */ -- cgit v1.1