X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fppc-vm.lisp;h=1024998c21e50d699e807768d855585dc0da54cf;hb=22c1de0a40df83bb5628974010a879cb2c17ff53;hp=7b0e19919c5e602d5dacba0cef1ec30243bb41f6;hpb=581e3d62de8cb37e13ad9db63e5537c0f962be28;p=sbcl.git diff --git a/src/code/ppc-vm.lisp b/src/code/ppc-vm.lisp index 7b0e199..1024998 100644 --- a/src/code/ppc-vm.lisp +++ b/src/code/ppc-vm.lisp @@ -2,9 +2,6 @@ ;;; (in-package "SB!VM") -(defvar *number-of-signals* 64) -(defvar *bits-per-word* 32) - (define-alien-type os-context-t (struct os-context-t-struct)) @@ -14,11 +11,29 @@ "Returns a string describing the type of the local machine." "PowerPC") -(defun machine-version () - "Returns a string describing the version of the local machine." - "who-knows?") - - +;;; 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 @@ -149,12 +164,12 @@ sb!vm:vector-data-offset) (* length sb!vm:n-byte-bits)) (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))))))