From 98fc96ea406fd1c26313a6adb820b5bcc123a9b1 Mon Sep 17 00:00:00 2001 From: mycroft Date: Sun, 15 Jan 1995 01:15:04 +0000 Subject: [PATCH] Add some commentary on the previous. --- sys/arch/i386/i386/trap.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sys/arch/i386/i386/trap.c b/sys/arch/i386/i386/trap.c index 0841eb854867..c5fa9d251ca2 100644 --- a/sys/arch/i386/i386/trap.c +++ b/sys/arch/i386/i386/trap.c @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.65 1995/01/15 00:55:25 mycroft Exp $ */ +/* $NetBSD: trap.c,v 1.66 1995/01/15 01:15:04 mycroft Exp $ */ #undef DEBUG #define DEBUG @@ -214,7 +214,21 @@ trap(frame) return; } - /* Check for failure during return to user mode. */ + /* + * Check for failure during return to user mode. + * + * We do this by looking at the instruction we faulted on. The + * specific instructions we recognize only happen when + * returning from a trap, syscall, or interrupt. + * + * XXX + * The heuristic used here will currently fail for the case of + * one of the 2 pop instructions faulting when returning from a + * a fast interrupt. This should not be possible. It can be + * fixed by rearranging the trap frame so that the stack format + * at this point is the same as on exit from a `slow' + * interrupt. + */ switch (*(u_char *)frame.tf_eip) { case 0xcf: /* iret */ vframe = (void *)(frame.tf_esp - 44);