;;;; files for more information.
(in-package "SB!VM")
-\f
-(defvar *number-of-signals* 64)
-(defvar *bits-per-word* 64)
;;; See x86-vm.lisp for a description of this.
(define-alien-type os-context-t (struct os-context-t-struct))
\f
-;;;; MACHINE-TYPE and MACHINE-VERSION
+;;;; MACHINE-TYPE
(defun machine-type ()
"Return a string describing the type of the local machine."
"Alpha")
-(defun machine-version ()
- "Return a string describing the version of the local machine."
- "Alpha")
\f
(defun fixup-code-object (code offset value kind)
(unless (zerop (rem offset n-word-bytes))
(error "Unaligned instruction? offset=#x~X." offset))
(sb!sys:without-gcing
- (let ((sap (truly-the system-area-pointer
- (%primitive code-instructions code))))
+ (let ((sap (%primitive code-instructions code)))
(ecase kind
(:jmp-hint
- (assert (zerop (ldb (byte 2 0) value)))
- #+nil
- (setf (sap-ref-16 sap offset)
- (logior (sap-ref-16 sap offset)
- (ldb (byte 14 0) (ash value -2)))))
+ (aver (zerop (ldb (byte 2 0) value)))
+ #+nil
+ (setf (sap-ref-16 sap offset)
+ (logior (sap-ref-16 sap offset)
+ (ldb (byte 14 0) (ash value -2)))))
(:bits-63-48
- (let* ((value (if (logbitp 15 value) (+ value (ash 1 16)) value))
- (value (if (logbitp 31 value) (+ value (ash 1 32)) value))
- (value (if (logbitp 47 value) (+ value (ash 1 48)) value)))
- (setf (sap-ref-8 sap offset) (ldb (byte 8 48) value))
- (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 56) value))))
+ (let* ((value (if (logbitp 15 value) (+ value (ash 1 16)) value))
+ (value (if (logbitp 31 value) (+ value (ash 1 32)) value))
+ (value (if (logbitp 47 value) (+ value (ash 1 48)) value)))
+ (setf (sap-ref-8 sap offset) (ldb (byte 8 48) value))
+ (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 56) value))))
(:bits-47-32
- (let* ((value (if (logbitp 15 value) (+ value (ash 1 16)) value))
- (value (if (logbitp 31 value) (+ value (ash 1 32)) value)))
- (setf (sap-ref-8 sap offset) (ldb (byte 8 32) value))
- (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 40) value))))
+ (let* ((value (if (logbitp 15 value) (+ value (ash 1 16)) value))
+ (value (if (logbitp 31 value) (+ value (ash 1 32)) value)))
+ (setf (sap-ref-8 sap offset) (ldb (byte 8 32) value))
+ (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 40) value))))
(:ldah
- (let ((value (if (logbitp 15 value) (+ value (ash 1 16)) value)))
- (setf (sap-ref-8 sap offset) (ldb (byte 8 16) value))
- (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 24) value))))
+ (let ((value (if (logbitp 15 value) (+ value (ash 1 16)) value)))
+ (setf (sap-ref-8 sap offset) (ldb (byte 8 16) value))
+ (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 24) value))))
(:lda
- (setf (sap-ref-8 sap offset) (ldb (byte 8 0) value))
- (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 8) value)))))))
+ (setf (sap-ref-8 sap offset) (ldb (byte 8 0) value))
+ (setf (sap-ref-8 sap (1+ offset)) (ldb (byte 8 8) value)))))))
\f
;;;; "sigcontext" access functions, cut & pasted from x86-vm.lisp then
;;;; hacked for types.
(defun context-register (context index)
(declare (type (alien (* os-context-t)) context))
(deref (the (alien (* unsigned-long))
- (context-register-addr context index))))
+ (context-register-addr context index))))
(defun %set-context-register (context index new)
(declare (type (alien (* os-context-t)) context))
(setf (deref (the (alien (* unsigned-long))
- (context-register-addr context index)))
- new))
+ (context-register-addr context index)))
+ new))
;;; This is like CONTEXT-REGISTER, but returns the value of a float
;;; register. FORMAT is the type of float to return.
;;; FIXME: Whether COERCE actually knows how to make a float out of a
;;; long is another question. This stuff still needs testing.
(define-alien-routine ("os_context_float_register_addr"
- context-float-register-addr)
+ context-float-register-addr)
(* long)
(context (* os-context-t))
(index int))
;;; Given a (POSIX) signal context, extract the internal error
;;; arguments from the instruction stream. This is e.g.
-;;; 4 23 254 240 2 0 0 0
+;;; 4 23 254 240 2 0 0 0
;;; | ~~~~~~~~~~~~~~~~~~~~~~~~~
;;; length data (everything is an octet)
;;; (pc)
(vector (make-array length :element-type '(unsigned-byte 8))))
(declare (type (unsigned-byte 8) length)
(type (simple-array (unsigned-byte 8) (*)) vector))
- (copy-from-system-area pc (* n-byte-bits 5)
- vector (* n-word-bits vector-data-offset)
- (* length n-byte-bits))
+ (copy-ub8-from-system-area pc 5 vector 0 length)
(let* ((index 0)
- (error-number (sb!c::read-var-integer vector index)))
+ (error-number (sb!c:read-var-integer vector index)))
(collect ((sc-offsets))
(loop
(when (>= index length)
(return))
- (sc-offsets (sb!c::read-var-integer vector index)))
+ (sc-offsets (sb!c:read-var-integer vector index)))
(values error-number (sc-offsets)))))))
-\f
-;;; The loader uses this to convert alien names to the form they
-;;; occure in the symbol table (for example, prepending an
-;;; underscore).
-(defun extern-alien-name (name)
- (declare (type simple-base-string name))
- ;; On the Alpha we don't do anything.
- name)
-\f
-;;;; Do whatever is necessary to make the given code component
-;;;; executable.
-;;;;
-;;;; XXX do we really not have to flush caches or something here? I
-;;;; need an architecture manual
-(defun sanctify-for-execution (component)
- (declare (ignore component))
- nil)
+