Synchronize with sys/i386/i386/machdep.c, trap.c and

sys/i386/isa/npx.c revisions 1.257, 1.107 and 1.52, respectively.
This commit is contained in:
KATO Takenori 1997-08-21 10:13:12 +00:00
parent 4604167e0a
commit 3b17d7f08b
4 changed files with 11 additions and 9 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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