From d235c7e18b86a3ca2f77f6bc30ec7094fcc0f63e Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Tue, 24 Nov 1992 01:12:26 +0000 Subject: [PATCH] Close interrupt window in disk-restore: The continuation dumped must have no interrupts enabled until after it resets the fixed objects vector (containing the interrupt-handlers vector). --- v7/src/runtime/savres.scm | 41 ++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/v7/src/runtime/savres.scm b/v7/src/runtime/savres.scm index f7d0a80f7..a2edafd00 100644 --- a/v7/src/runtime/savres.scm +++ b/v7/src/runtime/savres.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: savres.scm,v 14.26 1992/11/12 03:25:40 gjr Exp $ +$Id: savres.scm,v 14.27 1992/11/24 01:12:26 gjr Exp $ Copyright (c) 1988-1992 Massachusetts Institute of Technology @@ -88,25 +88,34 @@ MIT in each case. |# true))))))) (define (disk-save/kernel filename after-suspend after-restore) - ((without-interrupts - (lambda () - (call-with-current-continuation - (lambda (continuation) - (let ((fixed-objects (get-fixed-objects-vector)) - (filename (->namestring (merge-pathnames filename)))) - ((ucode-primitive call-with-current-continuation) - (lambda (restart) - (gc-flip) - (do () (((ucode-primitive dump-band) restart filename)) - (with-simple-restart 'RETRY "Try again." - (lambda () - (error "Disk save failed:" filename)))) - (continuation after-suspend))) - ((ucode-primitive set-fixed-objects-vector!) fixed-objects) + (let ((filename (->namestring (merge-pathnames filename)))) + ((without-interrupts + (lambda () + (call-with-current-continuation + (lambda (continuation) + ;; GC cannot be allowed before the fixed-objects-vector + ;; is reset after restoring. + (with-absolutely-no-interrupts + (lambda () + (let ((fixed-objects (get-fixed-objects-vector))) + ((ucode-primitive call-with-current-continuation) + (lambda (restart) + (without-interrupts + (lambda () + (gc-flip) + (do () + (((ucode-primitive dump-band) restart filename)) + (with-simple-restart 'RETRY "Try again." + (lambda () + (error "Disk save failed:" filename)))) + (continuation after-suspend))))) + ((ucode-primitive set-fixed-objects-vector!) + fixed-objects)))) (re-read-microcode-tables!) after-restore))))))) (define (dump-world/kernel filename after-suspend after-restore) + (gc-flip) ((with-absolutely-no-interrupts (lambda () (if ((ucode-primitive dump-world 1) filename) -- 2.25.1