[movitz-cvs] CVS update: movitz/losp/muerte/interrupt.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Tue Sep 21 20:46:11 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv25115

Modified Files:
	interrupt.lisp 
Log Message:
When the interrupt-trampoline restores the interruptee's register
contents, we must first restore the contents of DF in EFLAGS. Because,
if the interruptee had DF set, we'd otherwise restore illegal
(non-pointer) values which would look like pointer values should we be
interrupted.

Date: Tue Sep 21 22:46:10 2004
Author: ffjeld

Index: movitz/losp/muerte/interrupt.lisp
diff -u movitz/losp/muerte/interrupt.lisp:1.24 movitz/losp/muerte/interrupt.lisp:1.25
--- movitz/losp/muerte/interrupt.lisp:1.24	Tue Sep 21 15:06:02 2004
+++ movitz/losp/muerte/interrupt.lisp	Tue Sep 21 22:46:06 2004
@@ -10,7 +10,7 @@
 ;;;; Author:        Frode Vatvedt Fjeld <frodef at acm.org>
 ;;;; Created at:    Wed Apr  7 01:50:03 2004
 ;;;;                
-;;;; $Id: interrupt.lisp,v 1.24 2004/09/21 13:06:02 ffjeld Exp $
+;;;; $Id: interrupt.lisp,v 1.25 2004/09/21 20:46:06 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -124,20 +124,6 @@
 
 	    (:locally (:movl 0 (:edi (:edi-offset atomically-continuation))))
 	    
-;;;	    ;; See if ESP/EBP signalled a throwing situation
-;;;	    (:leal (:ebp 24) :edx)	; Interrupted ESP
-;;;	    (:cmpl :edx (:ebp))		; cmp ESP EBP
-;;;	    (:jae 'not-throwing)
-;;;	    (:movl (:edx) :edx)
-;;;	    (:movl :edx (:ebp))
-;;;	   not-throwing
-
-	    ;; rearrange stack for return
-;;;	    (:movl (:ebp 12) :eax)	; load return address
-;;;	    (:movl (:ebp 20) :ebx)	; load EFLAGS
-;;;	    (:movl :ebx (:ebp 16))	; EFLAGS at next-to-bottom of stack
-;;;	    (:movl :eax (:ebp 20))	; return address at bottom of stack
-
 	    (:xorl :eax :eax)		; Ensure safe value
 	    (:xorl :edx :edx)		; Ensure safe value
 
@@ -207,6 +193,14 @@
 	    (:locally (:movl :ecx (:edi (:edi-offset raw-scratch0))))
 	    (:movl (:ebp ,(dit-frame-offset :scratch1)) :eax)
 	    (:locally (:movl :eax (:edi (:edi-offset scratch1))))
+
+	    ;; Load the DF flag from the interruptee before we restore
+	    ;; its register contents.
+	    (:testl #x400 (:ebp ,(dit-frame-offset :eflags))) ; was DF set?
+	    (:jz 'df-not-set)
+	    (:std)
+	   df-not-set
+	    
 	    (:movl (:ebp ,(dit-frame-offset :edi)) :edi)
 	    (:movl (:ebp ,(dit-frame-offset :esi)) :esi)
 	    (:movl (:ebp ,(dit-frame-offset :ebx)) :ebx)





More information about the Movitz-cvs mailing list