From 3b17d7f08b1dcd9835ef1fe263b1feb5fecb87e4 Mon Sep 17 00:00:00 2001 From: KATO Takenori Date: Thu, 21 Aug 1997 10:13:12 +0000 Subject: [PATCH] Synchronize with sys/i386/i386/machdep.c, trap.c and sys/i386/isa/npx.c revisions 1.257, 1.107 and 1.52, respectively. --- sys/pc98/i386/machdep.c | 3 ++- sys/pc98/i386/trap.c | 10 +++++----- sys/pc98/pc98/machdep.c | 3 ++- sys/pc98/pc98/npx.c | 4 ++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 4e5f055b1991..36981aa86e47 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.50 1997/08/09 01:56:34 kato Exp $ + * $Id: machdep.c,v 1.51 1997/08/18 11:29:57 kato Exp $ */ #include "apm.h" @@ -683,6 +683,7 @@ sigreturn(p, uap, retval) * hardware check for invalid selectors, excess privilege in * other selectors, invalid %eip's and invalid %esp's. */ +#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) if (!CS_SECURE(scp->sc_cs)) { #ifdef DEBUG printf("sigreturn: cs = 0x%x\n", scp->sc_cs); diff --git a/sys/pc98/i386/trap.c b/sys/pc98/i386/trap.c index 7d4df49366a2..1206b760f8ba 100644 --- a/sys/pc98/i386/trap.c +++ b/sys/pc98/i386/trap.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 - * $Id: trap.c,v 1.30 1997/08/18 11:29:58 kato Exp $ + * $Id: trap.c,v 1.31 1997/08/20 10:24:56 kato Exp $ */ /* @@ -226,7 +226,7 @@ trap(frame) asm("sti"); #endif /* CPU_BUGGY_CYRIX */ - if (CS_SECURE(frame.tf_cs) || (frame.tf_eflags & PSL_VM)) { + if ((ISPL(frame.tf_cs) == SEL_UPL) || (frame.tf_eflags & PSL_VM)) { /* user trap */ sticks = p->p_sticks; @@ -772,7 +772,7 @@ trap_fatal(frame) printf("\n\nFatal trap %d: %s while in %s mode\n", type, trap_msg[type], frame->tf_eflags & PSL_VM ? "vm86" : - CS_SECURE(frame->tf_cs) ? "user" : "kernel"); + ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); #ifdef SMP printf("cpuid = %d\n", cpuid); #endif @@ -785,7 +785,7 @@ trap_fatal(frame) } printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); - if (CS_SECURE(frame->tf_cs) || (frame->tf_eflags & PSL_VM)) { + if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) { ss = frame->tf_ss & 0xffff; esp = frame->tf_esp; } else { @@ -943,7 +943,7 @@ syscall(frame) u_int code; sticks = p->p_sticks; - if (!CS_SECURE(frame.tf_cs)) + if (ISPL(frame.tf_cs) != SEL_UPL) panic("syscall"); p->p_md.md_regs = &frame; diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 4e5f055b1991..36981aa86e47 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.50 1997/08/09 01:56:34 kato Exp $ + * $Id: machdep.c,v 1.51 1997/08/18 11:29:57 kato Exp $ */ #include "apm.h" @@ -683,6 +683,7 @@ sigreturn(p, uap, retval) * hardware check for invalid selectors, excess privilege in * other selectors, invalid %eip's and invalid %esp's. */ +#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) if (!CS_SECURE(scp->sc_cs)) { #ifdef DEBUG printf("sigreturn: cs = 0x%x\n", scp->sc_cs); diff --git a/sys/pc98/pc98/npx.c b/sys/pc98/pc98/npx.c index 6c6a7df19b88..16200c21d307 100644 --- a/sys/pc98/pc98/npx.c +++ b/sys/pc98/pc98/npx.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 - * $Id: npx.c,v 1.25 1997/08/09 01:55:51 kato Exp $ + * $Id: npx.c,v 1.26 1997/08/18 11:30:05 kato Exp $ */ #include "npx.h" @@ -560,7 +560,7 @@ npxintr(unit) * Pass exception to process. */ frame = (struct intrframe *)&unit; /* XXX */ - if (CS_SECURE(frame->if_cs) || (frame->if_eflags & PSL_VM)) { + if ((ISPL(frame->if_cs) == SEL_UPL) || (frame->if_eflags & PSL_VM)) { /* * Interrupt is essentially a trap, so we can afford to call * the SIGFPE handler (if any) as soon as the interrupt