Synchronize with sys/i386/i386/machdep.c, trapc and sys/i386/isa/npx.c

revisions 1.256, 1.105 and 1.51, respectively.
This commit is contained in:
KATO Takenori 1997-08-18 11:30:05 +00:00
parent 759bde1062
commit b2964d3a9e
4 changed files with 9 additions and 11 deletions

View File

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.49 1997/08/06 09:43:45 kato Exp $
* $Id: machdep.c,v 1.50 1997/08/09 01:56:34 kato Exp $
*/
#include "apm.h"
@ -683,7 +683,6 @@ 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.28 1997/08/10 10:53:49 kato Exp $
* $Id: trap.c,v 1.29 1997/08/13 11:00:09 kato Exp $
*/
/*
@ -226,7 +226,7 @@ trap(frame)
asm("sti");
#endif /* CPU_BUGGY_CYRIX */
if ((ISPL(frame.tf_cs) == SEL_UPL) || (frame.tf_eflags & PSL_VM)) {
if (CS_SECURE(frame.tf_cs) || (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" :
ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
CS_SECURE(frame->tf_cs) ? "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 ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) {
if (CS_SECURE(frame->tf_cs) || (frame->tf_eflags & PSL_VM)) {
ss = frame->tf_ss & 0xffff;
esp = frame->tf_esp;
} else {
@ -935,7 +935,7 @@ syscall(frame)
u_int code;
sticks = p->p_sticks;
if (ISPL(frame.tf_cs) != SEL_UPL)
if (!CS_SECURE(frame.tf_cs))
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.49 1997/08/06 09:43:45 kato Exp $
* $Id: machdep.c,v 1.50 1997/08/09 01:56:34 kato Exp $
*/
#include "apm.h"
@ -683,7 +683,6 @@ 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.24 1997/07/21 13:13:43 kato Exp $
* $Id: npx.c,v 1.25 1997/08/09 01:55:51 kato Exp $
*/
#include "npx.h"
@ -560,7 +560,7 @@ npxintr(unit)
* Pass exception to process.
*/
frame = (struct intrframe *)&unit; /* XXX */
if ((ISPL(frame->if_cs) == SEL_UPL) || (frame->if_eflags & PSL_VM)) {
if (CS_SECURE(frame->if_cs) || (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