aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-08-15 19:23:33 +0000
committerBruce Evans <bde@FreeBSD.org>1995-08-15 19:23:33 +0000
commita722b904d7291701b49c992d12d445486dfb5dd5 (patch)
tree971c2acb9ffabc8078c02bc03881c5aea469391f /sys
parentd897bfb95069b38dfb23386ab9eb82f4f396c13d (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/exception.S14
-rw-r--r--sys/amd64/amd64/exception.s14
-rw-r--r--sys/i386/i386/exception.s14
3 files changed, 39 insertions, 3 deletions
diff --git a/sys/amd64/amd64/exception.S b/sys/amd64/amd64/exception.S
index be6cfb3d3e5c..e0e7b3c68631 100644
--- a/sys/amd64/amd64/exception.S
+++ b/sys/amd64/amd64/exception.S
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $
+ * $Id: exception.s,v 1.9 1995/06/11 19:31:13 rgrimes Exp $
*/
#include "npx.h" /* NNPX */
@@ -175,7 +175,19 @@ calltrap:
FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */
incl _cnt+V_TRAP
orl $SWI_AST_MASK,_cpl
+
+ /*
+ * Fake a call frame: point %ebp at a 2 element array consisting
+ * of { trappee's %ebp, trappee's %eip }. The stack frame is in
+ * the wrong order for this, but the trappee's %ebp is fortunately
+ * followed by junk which we can overwrite with the trappee's %eip.
+ */
+ movl TF_EIP(%esp),%eax
+ movl %eax,TF_ISP(%esp)
+ lea TF_EBP(%esp),%ebp
+
call _trap
+
/*
* There was no place to save the cpl so we have to recover it
* indirectly. For traps from user mode it was 0, and for traps
diff --git a/sys/amd64/amd64/exception.s b/sys/amd64/amd64/exception.s
index be6cfb3d3e5c..e0e7b3c68631 100644
--- a/sys/amd64/amd64/exception.s
+++ b/sys/amd64/amd64/exception.s
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $
+ * $Id: exception.s,v 1.9 1995/06/11 19:31:13 rgrimes Exp $
*/
#include "npx.h" /* NNPX */
@@ -175,7 +175,19 @@ calltrap:
FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */
incl _cnt+V_TRAP
orl $SWI_AST_MASK,_cpl
+
+ /*
+ * Fake a call frame: point %ebp at a 2 element array consisting
+ * of { trappee's %ebp, trappee's %eip }. The stack frame is in
+ * the wrong order for this, but the trappee's %ebp is fortunately
+ * followed by junk which we can overwrite with the trappee's %eip.
+ */
+ movl TF_EIP(%esp),%eax
+ movl %eax,TF_ISP(%esp)
+ lea TF_EBP(%esp),%ebp
+
call _trap
+
/*
* There was no place to save the cpl so we have to recover it
* indirectly. For traps from user mode it was 0, and for traps
diff --git a/sys/i386/i386/exception.s b/sys/i386/i386/exception.s
index be6cfb3d3e5c..e0e7b3c68631 100644
--- a/sys/i386/i386/exception.s
+++ b/sys/i386/i386/exception.s
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: exception.s,v 1.8.2.1 1995/06/05 00:22:02 davidg Exp $
+ * $Id: exception.s,v 1.9 1995/06/11 19:31:13 rgrimes Exp $
*/
#include "npx.h" /* NNPX */
@@ -175,7 +175,19 @@ calltrap:
FAKE_MCOUNT(_btrap) /* init "from" _btrap -> calltrap */
incl _cnt+V_TRAP
orl $SWI_AST_MASK,_cpl
+
+ /*
+ * Fake a call frame: point %ebp at a 2 element array consisting
+ * of { trappee's %ebp, trappee's %eip }. The stack frame is in
+ * the wrong order for this, but the trappee's %ebp is fortunately
+ * followed by junk which we can overwrite with the trappee's %eip.
+ */
+ movl TF_EIP(%esp),%eax
+ movl %eax,TF_ISP(%esp)
+ lea TF_EBP(%esp),%ebp
+
call _trap
+
/*
* There was no place to save the cpl so we have to recover it
* indirectly. For traps from user mode it was 0, and for traps