#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uerror.scm,v 14.16 1990/10/03 21:53:53 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/uerror.scm,v 14.17 1991/01/26 03:23:51 cph Exp $
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(define (make-error-translator alist error-type)
(lambda (error-code interrupt-enables)
- error-code
(set-interrupt-enables! interrupt-enables)
(with-proceed-point proceed-value-filter
(lambda ()
(cdar translators)
(loop (cdr translators)))))))))))
(if translator
- (translator error-type frame)
+ (translator error-type frame error-code)
(make-error-condition error-type
'()
repl-environment)))))))))
(signal-error
(make-error-condition
error-type:anomalous
- (list (or (microcode-error/code->name error-code) error-code))
+ (list (or (and (exact-nonnegative-integer? error-code)
+ (microcode-error/code->name error-code))
+ error-code))
repl-environment)))))
\f
;;;; Frame Decomposition
\f
;;;; Special Handlers
-(define (wrong-number-of-arguments-error condition-type frame)
+(define (wrong-number-of-arguments-error condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(let ((operator (internal-apply-frame/operator frame)))
(cdr arity))))
repl-environment))
-(define (file-error condition-type frame)
- condition-type frame
+(define (file-error condition-type frame error-code)
+ condition-type frame error-code
(make-error-condition error-type:file '() repl-environment))
-(define (open-file-error condition-type frame)
- condition-type
+(define (open-file-error condition-type frame error-code)
+ condition-type error-code
(make-error-condition error-type:open-file
(list (internal-apply-frame/operand frame 0))
repl-environment))
-(define (out-of-file-handles-error condition-type frame)
+(define (out-of-file-handles-error condition-type frame error-code)
+ error-code
(make-error-condition condition-type
(list (internal-apply-frame/operand frame 0))
repl-environment))
(make-condition-type (list error-type:file)
"Channel write terminated prematurely"))
(set! error-type:anomalous
- (make-internal-type "Anomalous microcode error")))
+ (make-internal-type "Anomalous microcode error"))
+ unspecific)
(define (make-base-type message)
(make-condition-type (list condition-type:error) message))
(INAPPLICABLE-CONTINUATION
,(make-internal-type "Inapplicable continuation"))
(IO-ERROR ,(make-condition-type (list error-type:file) "I/O error"))
+ (SYSTEM-CALL ,(make-internal-type "Error in system call"))
(OUT-OF-FILE-HANDLES
,(make-condition-type (list error-type:open-file)
"Too many open files"))
(define (define-standard-frame-handler error-type frame-type frame-filter
irritant)
(define-error-handler error-type frame-type frame-filter
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (irritant (standard-frame/expression frame)))
(define (define-expression-frame-handler error-type frame-type frame-filter
irritant)
(define-error-handler error-type frame-type frame-filter
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (irritant (expression-only-frame/expression frame)))
(lambda (return-address)
(define-error-handler error-type return-address
(apply internal-apply-frame/operator-filter operators)
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (internal-apply-frame/select frame irritant))
(define-apply-handler
(lambda (return-address)
(define-error-handler error-type return-address true
- (lambda (condition-type frame)
- (make-error-condition condition-type
- (list (internal-apply-frame/operator frame))
- repl-environment))))))
+ (lambda (condition-type frame error-code)
+ error-code
+ (make-error-condition
+ condition-type
+ (list (internal-apply-frame/operator frame))
+ repl-environment))))))
(define (define-operand-handler error-type irritant #!optional filter)
(define-apply-handler
(lambda (return-address)
(define-error-handler error-type return-address
(if (default-object? filter) true filter)
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (internal-apply-frame/select frame irritant)
(define (define-reference-trap-handler error-type frame-type)
(define-error-handler error-type frame-type true
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (stack-frame/ref frame 2))
(define-error-handler 'EXTERNAL-RETURN return-address
(internal-apply-frame/operator-filter
(ucode-primitive file-length)
- ;; (ucode-primitive file-read-char) ; -gone.
- (ucode-primitive file-write-char)
- (ucode-primitive file-write-string)
(ucode-primitive file-copy)
(ucode-primitive file-rename)
(ucode-primitive file-remove)
'COMPILER-ERROR-RESTART
(lambda (frame)
(primitive-procedure? (stack-frame/ref frame 2)))
- (lambda (condition-type frame)
+ (lambda (condition-type frame error-code)
+ error-code
(make-error-condition
condition-type
(list (error-irritant/noise ": inappropriate arguments to open-coded")
#| -*-Scheme-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/utabs.scm,v 14.4 1989/09/24 14:51:41 cph Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/utabs.scm,v 14.5 1991/01/26 03:23:56 cph Exp $
-Copyright (c) 1988, 1989 Massachusetts Institute of Technology
+Copyright (c) 1988-91 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(fixed-object/name->code 'MICROCODE-TERMINATIONS-VECTOR))
(set! types-slot (fixed-object/name->code 'MICROCODE-TYPES-VECTOR))
(set! non-object-slot (fixed-object/name->code 'NON-OBJECT))
+ (set! system-call-names-slot (fixed-object/name->code 'SYSTEM-CALL-NAMES))
+ (set! system-call-errors-slot (fixed-object/name->code 'SYSTEM-CALL-ERRORS))
(set! microcode-id/version
(microcode-identification-item 'MICROCODE-VERSION))
(set! microcode-id/modification
(let ((string (microcode-identification-item 'STACK-TYPE-STRING)))
(cond ((string? string) (intern string))
((not string) 'STANDARD)
- (else (error "illegal stack type" string))))))
+ (else (error "illegal stack type" string)))))
+ unspecific)
(define microcode-tables-identification)
(define microcode-id/version)
(define (microcode-identification-item name)
(vector-ref identification-vector
- (microcode-identification-vector-slot name)))
\ No newline at end of file
+ (microcode-identification-vector-slot name)))
+
+(define system-call-names-slot)
+
+(define (microcode-system-call/name->code name)
+ (microcode-table-search system-call-names-slot name))
+
+(define (microcode-system-call/code->name code)
+ (microcode-table-ref system-call-names-slot code))
+
+(define system-call-errors-slot)
+
+(define (microcode-system-call-error/name->code name)
+ (microcode-table-search system-call-errors-slot name))
+
+(define (microcode-system-call-error/code->name code)
+ (microcode-table-ref system-call-errors-slot code))
\ No newline at end of file