Skip to content
Snippets Groups Projects
Commit b8c47fb1 authored by ram's avatar ram
Browse files

Split off body of foreign-symbol-address so that we can call it in

fop-foreign-fixup instead of duplicating code (erroneously in the case of
Solaris.)
parent 13073422
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.57 1994/10/31 04:11:27 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/load.lisp,v 1.58 1994/11/04 06:02:31 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -1136,15 +1136,19 @@ ...@@ -1136,15 +1136,19 @@
(makunbound '*initial-assembler-routines*) (makunbound '*initial-assembler-routines*)
(makunbound '*initial-foreign-symbols*)) (makunbound '*initial-foreign-symbols*))
(defun foreign-symbol-address (symbol) (defun foreign-symbol-address-aux (symbol)
(multiple-value-bind (multiple-value-bind
(value found) (value found)
(gethash (vm:extern-alien-name symbol) *foreign-symbols* 0) (gethash symbol *foreign-symbols* 0)
(unless found (if found
(setq value (system:alternate-get-global-address symbol)) value
(when (zerop value) (let ((value (system:alternate-get-global-address symbol)))
(error "Unknown foreign symbol: ~S" symbol))) (when (zerop value)
(int-sap value))) (error "Unknown foreign symbol: ~S" symbol))
value))))
(defun foreign-symbol-address (symbol)
(int-sap (foreign-symbol-address-aux (vm:extern-alien-name symbol))))
(define-fop (fop-foreign-fixup 147) (define-fop (fop-foreign-fixup 147)
(let* ((kind (pop-stack)) (let* ((kind (pop-stack))
...@@ -1152,12 +1156,9 @@ ...@@ -1152,12 +1156,9 @@
(len (read-arg 1)) (len (read-arg 1))
(sym (make-string len))) (sym (make-string len)))
(read-n-bytes *fasl-file* sym 0 len) (read-n-bytes *fasl-file* sym 0 len)
(multiple-value-bind (vm:fixup-code-object code-object (read-arg 4)
(value found) (foreign-symbol-address-aux sym)
(gethash sym *foreign-symbols* 0) kind)
(unless found
(error "Unknown foreign symbol: ~S" sym))
(vm:fixup-code-object code-object (read-arg 4) value kind))
code-object)) code-object))
(define-fop (fop-assembler-code 144) (define-fop (fop-assembler-code 144)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment