X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fhppa-vm.lisp;h=70f0bbc2752b2c2205467f4eb62cd00244d8607e;hb=0f3a5f2e8886d18d0b4f6485c38a42be629422ae;hp=dee7b040b2a82a4c9d266b690ada668bf4cb6c0f;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/hppa-vm.lisp b/src/code/hppa-vm.lisp index dee7b04..70f0bbc 100644 --- a/src/code/hppa-vm.lisp +++ b/src/code/hppa-vm.lisp @@ -2,34 +2,38 @@ (define-alien-type os-context-t (struct os-context-t-struct)) -;;;; MACHINE-TYPE and MACHINE-VERSION +;;;; MACHINE-TYPE (defun machine-type () "Returns a string describing the type of the local machine." "HPPA") - -;;; support for CL:MACHINE-VERSION defined OAOO elsewhere -(defun get-machine-version () - nil) ;;;; FIXUP-CODE-OBJECT - +;FIX-lav: unify code with genesis.lisp fixup (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 sb!kernel::code-instructions code))) + (let* ((sap (%primitive sb!kernel::code-instructions code)) (inst (sap-ref-32 sap offset))) (setf (sap-ref-32 sap offset) (ecase kind (:load - (logior (ash (ldb (byte 11 0) value) 1) - (logand inst #xffffc000))) + (logior (mask-field (byte 18 14) value) + (if (< value 0) + (1+ (ash (ldb (byte 13 0) value) 1)) + (ash (ldb (byte 13 0) value) 1)))) + (:load11u + (logior (if (< value 0) + (1+ (ash (ldb (byte 10 0) value) 1)) + (ash (ldb (byte 11 0) value) 1)) + (mask-field (byte 18 14) inst))) (:load-short (let ((low-bits (ldb (byte 11 0) value))) (aver (<= 0 low-bits (1- (ash 1 4)))) - (logior (ash low-bits 17) + (logior (ash (dpb (ldb (byte 4 0) value) + (byte 4 1) + (ldb (byte 1 4) value)) 17) (logand inst #xffe0ffff)))) (:hi (logior (ash (ldb (byte 5 13) value) 16) @@ -42,7 +46,9 @@ (let ((bits (ldb (byte 9 2) value))) (aver (zerop (ldb (byte 2 0) value))) (logior (ash bits 3) - (logand inst #xffe0e002))))))))) + (mask-field (byte 1 1) inst) + (mask-field (byte 3 13) inst) + (mask-field (byte 11 21) inst))))))))) (define-alien-routine ("os_context_pc_addr" context-pc-addr) (* unsigned-int) (context (* os-context-t)))