X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fppc-vm.lisp;h=c3fdc16849ab0a4daa0226a5ed520230154e47a5;hb=a6a12ed609d5467ec43b411283e5b3568fee81df;hp=ce7835518da0ce5460c44b057fde7b8f74a6139e;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/ppc-vm.lisp b/src/code/ppc-vm.lisp index ce78355..c3fdc16 100644 --- a/src/code/ppc-vm.lisp +++ b/src/code/ppc-vm.lisp @@ -5,35 +5,11 @@ (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." "PowerPC") - -;;; support for CL:MACHINE-VERSION defined OAOO elsewhere -(defun get-machine-version () - #!+linux - (with-open-file (stream "/proc/cpuinfo" - ;; /proc is optional even in Linux, so - ;; fail gracefully. - :if-does-not-exist nil) - (loop with line while (setf line (read-line stream nil)) - ;; hoping "cpu" exists and gives something useful in - ;; all relevant Linuxen... - ;; - ;; from Lars Brinkhoff sbcl-devel 26 Jun 2003: - ;; I examined different versions of Linux/PPC at - ;; http://lxr.linux.no/ (the file that outputs - ;; /proc/cpuinfo is arch/ppc/kernel/setup.c, if - ;; you want to check), and all except 2.0.x - ;; seemed to do the same thing as far as the - ;; "cpu" field is concerned, i.e. it always - ;; starts with the (C-syntax) string "cpu\t\t: ". - when (eql (search "cpu" line) 0) - return (string-trim " " (subseq line (1+ (position #\: line)))))) - #!-linux - nil) ;;;; FIXUP-CODE-OBJECT @@ -42,8 +18,7 @@ (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))) (ecase kind (:b (error "Can't deal with CALL fixups, yet.")) @@ -120,8 +95,9 @@ ;;; Given a signal context, return the floating point modes word in ;;; the same format as returned by FLOATING-POINT-MODES. ;;; -;;; FIXME: surely this must be accessible somewhere under Darwin? -#!-darwin +;;; FIXME: surely this must be accessible somewhere under Darwin? Or +;;; under NetBSD? +#!+linux (define-alien-routine ("os_context_fp_control" context-floating-point-modes) (sb!alien:unsigned 32) (context (* os-context-t))) @@ -179,5 +155,3 @@ (sc-offsets (sb!c:read-var-integer vector index))) (values error-number (sc-offsets)))))) - -