/[cmucl]/src/code/lispinit.lisp
ViewVC logotype

Contents of /src/code/lispinit.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.71 - (show annotations)
Fri Sep 12 20:06:05 2003 UTC (10 years, 7 months ago) by toy
Branch: MAIN
Changes since 1.70: +3 -5 lines
Turn off the trap for floating-pointe underflow for all platforms.
1 ;;; -*- Mode: Lisp; Package: Lisp; Log: code.log -*-
2 ;;;
3 ;;; **********************************************************************
4 ;;; This code was written as part of the CMU Common Lisp project at
5 ;;; Carnegie Mellon University, and has been placed in the public domain.
6 ;;;
7 (ext:file-comment
8 "$Header: /tiger/var/lib/cvsroots/cmucl/src/code/lispinit.lisp,v 1.71 2003/09/12 20:06:05 toy Exp $")
9 ;;;
10 ;;; **********************************************************************
11 ;;;
12 ;;; Initialization stuff for CMU Common Lisp, plus some other random functions
13 ;;; that we don't have any better place for.
14 ;;;
15 ;;; Written by Skef Wholey and Rob MacLachlan.
16 ;;;
17 (in-package :lisp)
18
19 (export '(most-positive-fixnum most-negative-fixnum sleep
20 ++ +++ ** *** // ///))
21
22 (in-package :system)
23 (export '(compiler-version scrub-control-stack))
24
25 (in-package :extensions)
26 (export '(quit *prompt*))
27
28 (in-package :lisp)
29
30 ;;; Make the error system enable interrupts.
31
32 (defconstant most-positive-fixnum #.vm:target-most-positive-fixnum
33 "The fixnum closest in value to positive infinity.")
34
35 (defconstant most-negative-fixnum #.vm:target-most-negative-fixnum
36 "The fixnum closest in value to negative infinity.")
37
38
39 ;;; Random information:
40
41 (defvar *lisp-implementation-version* "4.0(?)")
42
43
44 ;;; Must be initialized in %INITIAL-FUNCTION before the DEFVAR runs...
45 (declaim
46 #-gengc
47 (special *gc-inhibit* *already-maybe-gcing*
48 *need-to-collect-garbage* *gc-verbose*
49 *before-gc-hooks* *after-gc-hooks*
50 #+x86 *pseudo-atomic-atomic*
51 #+x86 *pseudo-atomic-interrupted*
52 unix::*interrupts-enabled*
53 unix::*interrupt-pending*
54 *type-system-initialized*)
55 #+gengc
56 (special *gc-verbose* *before-gc-hooks* *after-gc-hooks*
57 *type-system-initialized*))
58
59
60 ;;;; Random magic specials.
61
62
63 ;;; These are filled in by Genesis.
64
65 #-gengc
66 (progn
67
68 (defvar *current-catch-block*)
69 (defvar *current-unwind-protect-block*)
70 (defvar *free-interrupt-context-index*)
71
72 ); #-gengc progn
73
74
75 ;;;; Random stuff that needs to be in the cold load which would otherwise be
76 ;;;; byte-compiled.
77 ;;;;
78 (defvar hi::*in-the-editor* nil)
79
80 ;;;; Called by defmacro expanders...
81
82 ;;; VERIFY-KEYWORDS -- internal
83 ;;;
84 ;;; Determine if key-list is a valid list of keyword/value pairs. Do not
85 ;;; signal the error directly, 'cause we don't know how it should be signaled.
86 ;;;
87
88 (defun verify-keywords (key-list valid-keys allow-other-keys)
89 (do ((already-processed nil)
90 (unknown-keyword nil)
91 (remaining key-list (cddr remaining)))
92 ((null remaining)
93 (if (and unknown-keyword
94 (not allow-other-keys)
95 (not (lookup-keyword :allow-other-keys key-list)))
96 (values :unknown-keyword (list unknown-keyword valid-keys))
97 (values nil nil)))
98 (cond ((not (and (consp remaining) (listp (cdr remaining))))
99 (return (values :dotted-list key-list)))
100 ((null (cdr remaining))
101 (return (values :odd-length key-list)))
102 #+nil ;; Not ANSI compliant to disallow duplicate keywords.
103 ((member (car remaining) already-processed)
104 (return (values :duplicate (car remaining))))
105 ((or (eq (car remaining) :allow-other-keys)
106 (member (car remaining) valid-keys))
107 (push (car remaining) already-processed))
108 (t
109 (setf unknown-keyword (car remaining))))))
110
111 (defun lookup-keyword (keyword key-list)
112 (do ((remaining key-list (cddr remaining)))
113 ((endp remaining))
114 (when (eq keyword (car remaining))
115 (return (cadr remaining)))))
116 ;;;
117 (defun keyword-supplied-p (keyword key-list)
118 (do ((remaining key-list (cddr remaining)))
119 ((endp remaining))
120 (when (eq keyword (car remaining))
121 (return t))))
122
123 (in-package "CONDITIONS")
124
125 (defvar *break-on-signals* nil
126 "When (typep condition *break-on-signals*) is true, then calls to SIGNAL will
127 enter the debugger prior to signalling that condition.")
128
129 (defun signal (datum &rest arguments)
130 "Invokes the signal facility on a condition formed from datum and arguments.
131 If the condition is not handled, nil is returned. If
132 (TYPEP condition *BREAK-ON-SIGNALS*) is true, the debugger is invoked before
133 any signalling is done."
134 (let ((condition (coerce-to-condition datum arguments
135 'simple-condition 'signal))
136 (*handler-clusters* *handler-clusters*))
137 (let ((obos *break-on-signals*)
138 (*break-on-signals* nil))
139 (when (typep condition obos)
140 (break "~A~%Break entered because of *break-on-signals* (now NIL.)"
141 condition)))
142 (loop
143 (unless *handler-clusters* (return))
144 (let ((cluster (pop *handler-clusters*)))
145 (dolist (handler cluster)
146 (when (typep condition (car handler))
147 (funcall (cdr handler) condition)))))
148 nil))
149
150 ;;; COERCE-TO-CONDITION is used in SIGNAL, ERROR, CERROR, WARN, and
151 ;;; INVOKE-DEBUGGER for parsing the hairy argument conventions into a single
152 ;;; argument that's directly usable by all the other routines.
153 ;;;
154 (defun coerce-to-condition (datum arguments default-type function-name)
155 (cond ((typep datum 'condition)
156 (if arguments
157 (cerror "Ignore the additional arguments."
158 'simple-type-error
159 :datum arguments
160 :expected-type 'null
161 :format-control "You may not supply additional arguments ~
162 when giving ~S to ~S."
163 :format-arguments (list datum function-name)))
164 datum)
165 ((symbolp datum) ;Roughly, (subtypep datum 'condition).
166 (apply #'make-condition datum arguments))
167 ((or (stringp datum) (functionp datum))
168 (make-condition default-type
169 :format-control datum
170 :format-arguments arguments))
171 (t
172 (error 'simple-type-error
173 :datum datum
174 :expected-type '(or symbol string)
175 :format-control "Bad argument to ~S: ~S"
176 :format-arguments (list function-name datum)))))
177
178 (defun error (datum &rest arguments)
179 "Invokes the signal facility on a condition formed from datum and arguments.
180 If the condition is not handled, the debugger is invoked."
181 (kernel:infinite-error-protect
182 (let ((condition (coerce-to-condition datum arguments
183 'simple-error 'error))
184 (debug:*stack-top-hint* debug:*stack-top-hint*))
185 (unless (and (condition-function-name condition) debug:*stack-top-hint*)
186 (multiple-value-bind
187 (name frame)
188 (kernel:find-caller-name)
189 (unless (condition-function-name condition)
190 (setf (condition-function-name condition) name))
191 (unless debug:*stack-top-hint*
192 (setf debug:*stack-top-hint* frame))))
193 (let ((debug:*stack-top-hint* nil))
194 (signal condition))
195 (invoke-debugger condition))))
196
197 ;;; CERROR must take care to not use arguments when datum is already a
198 ;;; condition object.
199 ;;;
200 (defun cerror (continue-string datum &rest arguments)
201 (kernel:infinite-error-protect
202 (with-simple-restart
203 (continue "~A" (apply #'format nil continue-string arguments))
204 (let ((condition (if (typep datum 'condition)
205 datum
206 (coerce-to-condition datum arguments
207 'simple-error 'error)))
208 (debug:*stack-top-hint* debug:*stack-top-hint*))
209 (unless (and (condition-function-name condition)
210 debug:*stack-top-hint*)
211 (multiple-value-bind
212 (name frame)
213 (kernel:find-caller-name)
214 (unless (condition-function-name condition)
215 (setf (condition-function-name condition) name))
216 (unless debug:*stack-top-hint*
217 (setf debug:*stack-top-hint* frame))))
218 (with-condition-restarts condition (list (find-restart 'continue))
219 (let ((debug:*stack-top-hint* nil))
220 (signal condition))
221 (invoke-debugger condition)))))
222 nil)
223
224 (defun break (&optional (datum "Break") &rest arguments)
225 "Prints a message and invokes the debugger without allowing any possibility
226 of condition handling occurring."
227 (kernel:infinite-error-protect
228 (with-simple-restart (continue "Return from BREAK.")
229 (let ((debug:*stack-top-hint*
230 (or debug:*stack-top-hint*
231 (nth-value 1 (kernel:find-caller-name)))))
232 (invoke-debugger
233 (coerce-to-condition datum arguments 'simple-condition 'break)))))
234 nil)
235
236 (defun warn (datum &rest arguments)
237 "Warns about a situation by signalling a condition formed by datum and
238 arguments. While the condition is being signaled, a muffle-warning restart
239 exists that causes WARN to immediately return nil."
240 (kernel:infinite-error-protect
241 (let ((condition (coerce-to-condition datum arguments
242 'simple-warning 'warn)))
243 (check-type condition warning "a warning condition")
244 (restart-case (signal condition)
245 (muffle-warning ()
246 :report "Skip warning."
247 (return-from warn nil)))
248 (format *error-output* "~&~@<Warning: ~3i~:_~A~:>~%" condition)))
249 nil)
250
251 ;;; Utility functions
252
253 (defun simple-program-error (datum &rest arguments)
254 "Invokes the signal facility on a condition formed from datum and arguments.
255 If the condition is not handled, the debugger is invoked. This function
256 is just like error, except that the condition type defaults to the type
257 simple-program-error, instead of program-error."
258 (kernel:infinite-error-protect
259 (let ((condition (coerce-to-condition datum arguments
260 'simple-program-error
261 'simple-program-error))
262 (debug:*stack-top-hint* debug:*stack-top-hint*))
263 (unless (and (condition-function-name condition) debug:*stack-top-hint*)
264 (multiple-value-bind
265 (name frame)
266 (kernel:find-caller-name)
267 (unless (condition-function-name condition)
268 (setf (condition-function-name condition) name))
269 (unless debug:*stack-top-hint*
270 (setf debug:*stack-top-hint* frame))))
271 (let ((debug:*stack-top-hint* nil))
272 (signal condition))
273 (invoke-debugger condition))))
274
275 (in-package "LISP")
276
277
278 ;;; %Initial-Function is called when a cold system starts up. First we zoom
279 ;;; down the *Lisp-Initialization-Functions* doing things that wanted to happen
280 ;;; at "load time." Then we initialize the various subsystems and call the
281 ;;; read-eval-print loop. The top-level Read-Eval-Print loop is executed until
282 ;;; someone (most likely the Quit function) throws to the tag
283 ;;; %End-Of-The-World. We quit this way so that all outstanding cleanup forms
284 ;;; in Unwind-Protects will get executed.
285
286 (declaim (special *lisp-initialization-functions*
287 *load-time-values*))
288
289 (eval-when (compile)
290 (defmacro print-and-call (name)
291 `(progn
292 (%primitive print ,(symbol-name name))
293 (,name))))
294 #+nil
295 (defun hexstr(thing)
296 (let ((addr (kernel:get-lisp-obj-address thing))
297 (str (make-string 10)))
298 (setf (char str 0) #\0
299 (char str 1) #\x)
300 (dotimes (i 8)
301 (let* ((nib (ldb (byte 4 0) addr))
302 (chr (char "0123456789abcdef" nib)))
303 (declare (type (unsigned-byte 4) nib)
304 (base-char chr))
305 (setf (char str (- 9 i)) chr
306 addr (ash addr -4))))
307 str))
308
309 (defun %initial-function ()
310 "Gives the world a shove and hopes it spins."
311 (%primitive print "In initial-function, and running.")
312 #-gengc (setf *already-maybe-gcing* t)
313 #-gengc (setf *gc-inhibit* t)
314 #-gengc (setf *need-to-collect-garbage* nil)
315 (setf *gc-verbose* #-gengc t #+gengc nil)
316 (setf *before-gc-hooks* nil)
317 (setf *after-gc-hooks* nil)
318 #-gengc (setf unix::*interrupts-enabled* t)
319 #-gengc (setf unix::*interrupt-pending* nil)
320 (setf *type-system-initialized* nil)
321 (setf *break-on-signals* nil)
322 #+gengc (setf conditions::*handler-clusters* nil)
323
324 ;; Many top-level forms call INFO, (SETF INFO).
325 (print-and-call c::globaldb-init)
326
327 ;; Set up the fdefn database.
328 (print-and-call fdefn-init)
329
330 ;; Some of the random top-level forms call Make-Array, which calls Subtypep
331 (print-and-call typedef-init)
332 (print-and-call class-init)
333 (print-and-call type-init)
334
335 (let ((funs (nreverse *lisp-initialization-functions*)))
336 (%primitive print "Calling top-level forms.")
337 (dolist (fun funs) #+nil (%primitive print (hexstr fun))
338 (typecase fun
339 (function
340 (funcall fun))
341 (cons
342 (case (car fun)
343 (:load-time-value
344 (setf (svref *load-time-values* (third fun))
345 (funcall (second fun))))
346 (:load-time-value-fixup
347 #-gengc
348 (setf (sap-ref-32 (second fun) 0)
349 (get-lisp-obj-address
350 (svref *load-time-values* (third fun))))
351 #+gengc
352 (do-load-time-value-fixup (second fun) (third fun) (fourth fun)))
353 #+(and x86 gencgc)
354 (:load-time-code-fixup
355 (vm::do-load-time-code-fixup (second fun) (third fun) (fourth fun)
356 (fifth fun)))
357 (t
358 (%primitive print
359 "Bogus fixup in *lisp-initialization-functions*")
360 (%halt))))
361 (t
362 (%primitive print
363 "Bogus function in *lisp-initialization-functions*")
364 (%halt)))))
365 (makunbound '*lisp-initialization-functions*) ; So it gets GC'ed.
366 (makunbound '*load-time-values*)
367
368 ;; Only do this after top level forms have run, 'cause thats where
369 ;; deftypes are.
370 (setf *type-system-initialized* t)
371
372 (print-and-call os-init)
373 (print-and-call filesys-init)
374
375 (print-and-call reader-init)
376 ;; Note: sharpm and backq not yet loaded, so this is not the final RT.
377 (setf *readtable* (copy-readtable std-lisp-readtable))
378
379 (print-and-call stream-init)
380 (print-and-call loader-init)
381 (print-and-call package-init)
382 (print-and-call kernel::signal-init)
383 (setf (alien:extern-alien "internal_errors_enabled" boolean) t)
384
385 (set-floating-point-modes :traps '(:overflow :invalid :divide-by-zero))
386 ;; This is necessary because some of the initial top level forms might
387 ;; have changed the compliation policy in strange ways.
388 (print-and-call c::proclaim-init)
389
390 (print-and-call kernel::class-finalize)
391
392 (%primitive print "Done initializing.")
393
394 #-gengc (setf *already-maybe-gcing* nil)
395 #+gengc (setf *gc-verbose* t)
396 (terpri)
397 (princ "CMU Common Lisp kernel core image ")
398 (princ (lisp-implementation-version))
399 (princ ".")
400 (terpri)
401 (princ "[You are in the LISP package.]")
402 (terpri)
403 (let ((wot
404 (catch '%end-of-the-world
405 (loop
406 (%top-level)
407 (write-line "You're certainly a clever child.")))))
408 (unix:unix-exit wot)))
409
410 #+gengc
411 (defun do-load-time-value-fixup (object offset index)
412 (declare (type index offset))
413 (macrolet ((lose (msg)
414 `(progn
415 (%primitive print ,msg)
416 (%halt))))
417 (let ((value (svref *load-time-values* index)))
418 (typecase object
419 (list
420 (case offset
421 (0 (setf (car object) value))
422 (1 (setf (cdr object) value))
423 (t (lose "Bogus offset in cons cell."))))
424 (instance
425 (setf (%instance-ref object (- offset vm:instance-slots-offset))
426 value))
427 (code-component
428 (setf (code-header-ref object offset) value))
429 (simple-vector
430 (setf (svref object (- offset vm:vector-data-offset)) value))
431 (t
432 (lose "Unknown kind of object for load-time-value fixup."))))))
433
434
435 ;;;; Initialization functions:
436
437 ;;; Print seems to not like x86 NPX denormal floats like
438 ;;; least-negative-single-float, so the :underflow exceptions
439 ;;; is disabled by default. Joe User can explicitly enable them
440 ;;; if desired.
441
442 (defun reinit ()
443 (without-interrupts
444 (without-gcing
445 (os-init)
446 (stream-reinit)
447 (kernel::signal-init)
448 (gc-init)
449 (setf (alien:extern-alien "internal_errors_enabled" boolean) t)
450 (set-floating-point-modes :traps
451 '(:overflow :invalid :divide-by-zero))
452 ;; Clear pseudo atomic in case this core wasn't compiled with support.
453 #+x86 (setf lisp::*pseudo-atomic-atomic* 0))))
454
455
456 ;;;; Miscellaneous external functions:
457
458 (defvar *cleanup-functions* nil
459 "Functions to be invoked during cleanup at Lisp exit.")
460
461 ;;; Quit gets us out, one way or another.
462
463 (defun quit (&optional recklessly-p)
464 "Terminates the current Lisp. Things are cleaned up unless Recklessly-P is
465 non-Nil."
466 (if recklessly-p
467 (unix:unix-exit 0)
468 (progn
469 (mapc (lambda (fn) (ignore-errors (funcall fn))) *cleanup-functions*)
470 (throw '%end-of-the-world 0))))
471
472
473 #-mp ; Multi-processing version defined in multi-proc.lisp.
474 (defun sleep (n)
475 "This function causes execution to be suspended for N seconds. N may
476 be any non-negative, non-complex number."
477 (when (or (not (realp n))
478 (minusp n))
479 (error 'simple-type-error
480 :format-control
481 "Invalid argument to SLEEP: ~S.~%~
482 Must be a non-negative, non-complex number."
483 :format-arguments (list n)
484 :datum n
485 :expected-type '(real 0)))
486 (multiple-value-bind (sec usec)
487 (if (integerp n)
488 (values n 0)
489 (multiple-value-bind (sec frac) (truncate n)
490 (values sec (truncate frac 1e-6))))
491 (unix:unix-select 0 0 0 0 sec usec))
492 nil)
493
494 ;;;; SCRUB-CONTROL-STACK
495
496 #+stack-checking
497 (alien:def-alien-routine "os_guard_control_stack" c-call:void
498 (zone c-call:int)
499 (guardp c-call:int))
500
501
502 (defconstant bytes-per-scrub-unit 2048)
503
504 ;;; Scrub-control-stack.
505 ;;;
506 #-x86
507 (defun %scrub-control-stack ()
508 "Zero the unused portion of the control stack so that old objects are not
509 kept alive because of uninitialized stack variables."
510 (declare (optimize (speed 3) (safety 0))
511 (values (unsigned-byte 20)))
512 (labels
513 ((scrub (ptr offset count)
514 (declare (type system-area-pointer ptr)
515 (type (unsigned-byte 16) offset)
516 (type (unsigned-byte 20) count)
517 (values (unsigned-byte 20)))
518 (cond ((= offset bytes-per-scrub-unit)
519 (look (sap+ ptr bytes-per-scrub-unit) 0 count))
520 (t
521 (setf (sap-ref-32 ptr offset) 0)
522 (scrub ptr (+ offset vm:word-bytes) count))))
523 (look (ptr offset count)
524 (declare (type system-area-pointer ptr)
525 (type (unsigned-byte 16) offset)
526 (type (unsigned-byte 20) count)
527 (values (unsigned-byte 20)))
528 (cond ((= offset bytes-per-scrub-unit)
529 count)
530 ((zerop (sap-ref-32 ptr offset))
531 (look ptr (+ offset vm:word-bytes) count))
532 (t
533 (scrub ptr offset (+ count vm:word-bytes))))))
534 (let* ((csp (sap-int (c::control-stack-pointer-sap)))
535 (initial-offset (logand csp (1- bytes-per-scrub-unit))))
536 (declare (type (unsigned-byte 32) csp))
537 (scrub (int-sap (- csp initial-offset))
538 (* (floor initial-offset vm:word-bytes) vm:word-bytes)
539 0))))
540
541 ;;; Scrub-control-stack.
542 ;;;
543 ;;; On the x86 port the stack grows downwards, and to support grow on
544 ;;; demand stacks the stack must be decreased as it is scrubbed.
545 ;;;
546 (defun scrub-control-stack ()
547 "Zero the unused portion of the control stack so that old objects are not
548 kept alive because of uninitialized stack variables."
549 ;;
550 ;; The guard zone of the control stack is used by Lisp sometimes,
551 ;; so I think it should be zero'd out, too.
552 #+stack-checking (os-guard-control-stack 0 0)
553 (%scrub-control-stack)
554 #+stack-checking (os-guard-control-stack 0 1))
555
556 #+x86
557 (defun %scrub-control-stack ()
558 (%scrub-control-stack))
559
560
561 ;;;; TOP-LEVEL loop.
562
563 (defvar / nil
564 "Holds a list of all the values returned by the most recent top-level EVAL.")
565 (defvar // nil "Gets the previous value of / when a new value is computed.")
566 (defvar /// nil "Gets the previous value of // when a new value is computed.")
567 (defvar * nil "Holds the value of the most recent top-level EVAL.")
568 (defvar ** nil "Gets the previous value of * when a new value is computed.")
569 (defvar *** nil "Gets the previous value of ** when a new value is computed.")
570 (defvar + nil "Holds the value of the most recent top-level READ.")
571 (defvar ++ nil "Gets the previous value of + when a new value is read.")
572 (defvar +++ nil "Gets the previous value of ++ when a new value is read.")
573 (defvar - nil "Holds the form curently being evaluated.")
574 (defvar *prompt* "* "
575 "The top-level prompt string. This also may be a function of no arguments
576 that returns a simple-string.")
577 (defvar *in-top-level-catcher* nil
578 "True if we are within the Top-Level-Catcher. This is used by interrupt
579 handlers to see whether it is o.k. to throw.")
580
581 (defun interactive-eval (form)
582 "Evaluate FORM, returning whatever it returns but adjust ***, **, *, +++, ++,
583 +, ///, //, /, and -."
584 (when (and (fboundp 'commandp) (funcall 'commandp form))
585 (return-from interactive-eval (funcall 'invoke-command-interactive form)))
586 (setf - form)
587 (let ((results (multiple-value-list (eval form))))
588 (finish-standard-output-streams)
589 (setf /// //
590 // /
591 / results
592 *** **
593 ** *
594 * (car results)))
595 (setf +++ ++
596 ++ +
597 + -)
598 (unless (boundp '*)
599 ;; The bogon returned an unbound marker.
600 (setf * nil)
601 (cerror "Go on with * set to NIL."
602 "EVAL returned an unbound marker."))
603 (values-list /))
604
605
606 (defconstant eofs-before-quit 10)
607
608 (defun %top-level ()
609 "Top-level READ-EVAL-PRINT loop. Do not call this."
610 (let ((* nil) (** nil) (*** nil)
611 (- nil) (+ nil) (++ nil) (+++ nil)
612 (/// nil) (// nil) (/ nil)
613 (magic-eof-cookie (cons :eof nil))
614 (number-of-eofs 0))
615 (loop
616 (with-simple-restart (abort "Return to Top-Level.")
617 (catch 'top-level-catcher
618 (unix:unix-sigsetmask 0)
619 (let ((*in-top-level-catcher* t))
620 (loop
621 (scrub-control-stack)
622 (fresh-line)
623 (princ (if (functionp *prompt*)
624 (funcall *prompt*)
625 *prompt*))
626 (force-output)
627 (let ((form (read *standard-input* nil magic-eof-cookie)))
628 (cond ((not (eq form magic-eof-cookie))
629 (let ((results
630 (multiple-value-list (interactive-eval form))))
631 (dolist (result results)
632 (fresh-line)
633 (prin1 result)))
634 (setf number-of-eofs 0))
635 ((eql (incf number-of-eofs) 1)
636 (if *batch-mode*
637 (quit)
638 (let ((stream (make-synonym-stream '*terminal-io*)))
639 (setf *standard-input* stream)
640 (setf *standard-output* stream)
641 (format t "~&Received EOF on *standard-input*, ~
642 switching to *terminal-io*.~%"))))
643 ((> number-of-eofs eofs-before-quit)
644 (format t "~&Received more than ~D EOFs; Aborting.~%"
645 eofs-before-quit)
646 (quit))
647 (t
648 (format t "~&Received EOF.~%")))))))))))
649
650
651 ;;; %Halt -- Interface
652 ;;;
653 ;;; A convenient way to get into the assembly level debugger.
654 ;;;
655 (defun %halt ()
656 (%primitive halt))

  ViewVC Help
Powered by ViewVC 1.1.5