summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-08-21 06:33:04 +0000
committercharnier <charnier@FreeBSD.org>1997-08-21 06:33:04 +0000
commitec0491b457704b183e5677671c5f9c091b706bad (patch)
tree97135bfb08c05cabc164f0bca66b668fa0244b79 /sys/amd64
parent7511b8f464a83d4d3fcab8607f7c224a08b65a74 (diff)
downloadFreeBSD-src-ec0491b457704b183e5677671c5f9c091b706bad.zip
FreeBSD-src-ec0491b457704b183e5677671c5f9c091b706bad.tar.gz
Revert my previous commit about using CS_SECURE macro.
Requested by: Bruce.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/db_trace.c4
-rw-r--r--sys/amd64/amd64/fpu.c4
-rw-r--r--sys/amd64/amd64/machdep.c3
-rw-r--r--sys/amd64/amd64/trap.c10
-rw-r--r--sys/amd64/include/cpu.h4
-rw-r--r--sys/amd64/include/segments.h4
-rw-r--r--sys/amd64/isa/npx.c4
7 files changed, 16 insertions, 17 deletions
diff --git a/sys/amd64/amd64/db_trace.c b/sys/amd64/amd64/db_trace.c
index 19a8d00..d16b92d 100644
--- a/sys/amd64/amd64/db_trace.c
+++ b/sys/amd64/amd64/db_trace.c
@@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: db_trace.c,v 1.23 1997/07/20 08:37:17 bde Exp $
+ * $Id: db_trace.c,v 1.24 1997/08/18 06:58:06 charnier Exp $
*/
#include <sys/param.h>
@@ -187,7 +187,7 @@ db_nextframe(fp, ip)
*/
tf = (struct trapframe *) ((int)*fp + 8);
- esp = CS_SECURE(tf->tf_cs) ? tf->tf_esp : (int)&tf->tf_esp;
+ esp = (ISPL(tf->tf_cs) == SEL_UPL) ? tf->tf_esp : (int)&tf->tf_esp;
switch (frame_type) {
case TRAP:
if (INKERNEL((int) tf)) {
diff --git a/sys/amd64/amd64/fpu.c b/sys/amd64/amd64/fpu.c
index bfd2f8a..8e2416d 100644
--- a/sys/amd64/amd64/fpu.c
+++ b/sys/amd64/amd64/fpu.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.50 1997/08/09 00:03:39 dyson Exp $
+ * $Id: npx.c,v 1.51 1997/08/18 06:58:44 charnier Exp $
*/
#include "npx.h"
@@ -515,7 +515,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
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index ae70bfc..7376267 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.255 1997/08/09 00:02:40 dyson Exp $
+ * $Id: machdep.c,v 1.256 1997/08/18 06:58:09 charnier Exp $
*/
#include "apm.h"
@@ -672,6 +672,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/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index de901c0..ac139d5 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)trap.c 7.4 (Berkeley) 5/13/91
- * $Id: trap.c,v 1.1 1997/08/19 20:26:01 smp Exp smp $
+ * $Id: trap.c,v 1.106 1997/08/20 05:25:48 fsmp Exp $
*/
/*
@@ -206,7 +206,7 @@ trap(frame)
type = frame.tf_trapno;
code = frame.tf_err;
- 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;
@@ -722,7 +722,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
@@ -735,7 +735,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 {
@@ -893,7 +893,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/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index 8f07480..12b7ef7 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
- * $Id: cpu.h,v 1.30 1997/08/09 00:03:09 dyson Exp $
+ * $Id: cpu.h,v 1.31 1997/08/18 06:58:29 charnier Exp $
*/
#ifndef _MACHINE_CPU_H_
@@ -59,7 +59,7 @@
#define cpu_set_init_frame(p, fp) ((p)->p_md.md_regs = (fp))
#define CLKF_USERMODE(framep) \
- (CS_SECURE((framep)->cf_cs) || (framep->cf_eflags & PSL_VM))
+ ((ISPL((framep)->cf_cs) == SEL_UPL) || (framep->cf_eflags & PSL_VM))
#define CLKF_INTR(framep) (intr_nesting_level >= 2)
#if 0
diff --git a/sys/amd64/include/segments.h b/sys/amd64/include/segments.h
index b97c42e..894e6c5 100644
--- a/sys/amd64/include/segments.h
+++ b/sys/amd64/include/segments.h
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)segments.h 7.1 (Berkeley) 5/9/91
- * $Id: segments.h,v 1.15 1997/07/19 02:24:37 fsmp Exp $
+ * $Id: segments.h,v 1.16 1997/08/18 06:58:31 charnier Exp $
*/
#ifndef _MACHINE_SEGMENTS_H_
@@ -59,8 +59,6 @@
#define LSEL(s,r) (((s)<<3) | SEL_LDT | r) /* a local selector */
#define GSEL(s,r) (((s)<<3) | r) /* a global selector */
-#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL)
-
/*
* Memory and System segment descriptors
*/
diff --git a/sys/amd64/isa/npx.c b/sys/amd64/isa/npx.c
index bfd2f8a..8e2416d 100644
--- a/sys/amd64/isa/npx.c
+++ b/sys/amd64/isa/npx.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)npx.c 7.2 (Berkeley) 5/12/91
- * $Id: npx.c,v 1.50 1997/08/09 00:03:39 dyson Exp $
+ * $Id: npx.c,v 1.51 1997/08/18 06:58:44 charnier Exp $
*/
#include "npx.h"
@@ -515,7 +515,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
OpenPOWER on IntegriCloud