diff options
author | nyan <nyan@FreeBSD.org> | 2002-01-31 08:35:38 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2002-01-31 08:35:38 +0000 |
commit | a5768e878f410d43c1ad135be68cb105fab64596 (patch) | |
tree | 919e7878950bba42bd2a35b764784e5b67730003 /sys | |
parent | b09c2d25909a0f1f126c5feb0c47e324f8bfb5cb (diff) | |
download | FreeBSD-src-a5768e878f410d43c1ad135be68cb105fab64596.zip FreeBSD-src-a5768e878f410d43c1ad135be68cb105fab64596.tar.gz |
MFi386: revision 1.489.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pc98/i386/machdep.c | 21 | ||||
-rw-r--r-- | sys/pc98/pc98/machdep.c | 21 |
2 files changed, 16 insertions, 26 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 0c65af4..aeb61c9 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -721,27 +721,22 @@ sigreturn(td, uap) } */ *uap; { struct proc *p = td->td_proc; + struct osigcontext *oscp; + struct osigreturn_args *ouap; struct trapframe *regs; ucontext_t *ucp; int cs, eflags; - ucp = uap->sigcntxp; #ifdef COMPAT_43 - if (!useracc((caddr_t)ucp, sizeof(struct osigcontext), VM_PROT_READ)) - return (EFAULT); - if (((struct osigcontext *)ucp)->sc_trapno == 0x01d516) - return (osigreturn(td, (struct osigreturn_args *)uap)); - /* - * Since ucp is not an osigcontext but a ucontext_t, we have to - * check again if all of it is accessible. A ucontext_t is - * much larger, so instead of just checking for the pointer - * being valid for the size of an osigcontext, now check for - * it being valid for a whole, new-style ucontext_t. - */ + ouap = (struct osigreturn_args *)uap; + oscp = ouap->sigcntxp; + if (fuword(&oscp->sc_trapno) == 0x01d516) + return (osigreturn(td, ouap)); #endif + + ucp = uap->sigcntxp; if (!useracc((caddr_t)ucp, sizeof(*ucp), VM_PROT_READ)) return (EFAULT); - regs = td->td_frame; eflags = ucp->uc_mcontext.mc_eflags; if (eflags & PSL_VM) { diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 0c65af4..aeb61c9 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -721,27 +721,22 @@ sigreturn(td, uap) } */ *uap; { struct proc *p = td->td_proc; + struct osigcontext *oscp; + struct osigreturn_args *ouap; struct trapframe *regs; ucontext_t *ucp; int cs, eflags; - ucp = uap->sigcntxp; #ifdef COMPAT_43 - if (!useracc((caddr_t)ucp, sizeof(struct osigcontext), VM_PROT_READ)) - return (EFAULT); - if (((struct osigcontext *)ucp)->sc_trapno == 0x01d516) - return (osigreturn(td, (struct osigreturn_args *)uap)); - /* - * Since ucp is not an osigcontext but a ucontext_t, we have to - * check again if all of it is accessible. A ucontext_t is - * much larger, so instead of just checking for the pointer - * being valid for the size of an osigcontext, now check for - * it being valid for a whole, new-style ucontext_t. - */ + ouap = (struct osigreturn_args *)uap; + oscp = ouap->sigcntxp; + if (fuword(&oscp->sc_trapno) == 0x01d516) + return (osigreturn(td, ouap)); #endif + + ucp = uap->sigcntxp; if (!useracc((caddr_t)ucp, sizeof(*ucp), VM_PROT_READ)) return (EFAULT); - regs = td->td_frame; eflags = ucp->uc_mcontext.mc_eflags; if (eflags & PSL_VM) { |