Update of /project/movitz/cvsroot/movitz/losp/muerte In directory common-lisp.net:/tmp/cvs-serv9358
Modified Files: more-macros.lisp Log Message: Added a macro without-interrupts.
Date: Mon Aug 23 06:49:40 2004 Author: ffjeld
Index: movitz/losp/muerte/more-macros.lisp diff -u movitz/losp/muerte/more-macros.lisp:1.17 movitz/losp/muerte/more-macros.lisp:1.18 --- movitz/losp/muerte/more-macros.lisp:1.17 Wed Jul 28 03:01:16 2004 +++ movitz/losp/muerte/more-macros.lisp Mon Aug 23 06:49:40 2004 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld frodef@acm.org ;;;; Created at: Fri Jun 7 15:05:57 2002 ;;;; -;;;; $Id: more-macros.lisp,v 1.17 2004/07/28 10:01:16 ffjeld Exp $ +;;;; $Id: more-macros.lisp,v 1.18 2004/08/23 13:49:40 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------
@@ -361,6 +361,13 @@ (:cld)) (do-case (t :multiple-values) (:compile-form (:result-mode :multiple-values) (no-macro-call read-time-stamp-counter))))) + +(defmacro without-interrupts (&body body) + (let ((var (gensym "interrupts-enabled-p-"))) + `(let ((,var (logbitp ,(position :if +eflags-map+) (eflags)))) + (unwind-protect (progn (cli) ,@body) + (when ,var (sti)))))) +
;;; Some macros that aren't implemented, and we want to give compiler errors.