treated by SLOT-BOUNDP, SLOT-VALUE, (SETF SLOT-VALUE) and
SLOT-MAKUNBOUND in the specified fashion.
-changes in sbcl-0.8.1 relative to sbcl-0.8.0:
+changes in sbcl-0.8.2 relative to sbcl-0.8.1:
* fixed bug 148: failure to inline-expand a local function left
garbage, confusing the compiler.
* fixed bugs 3cd: structure slot readers perform type check if the
* bug fix: the compiler now traps array references to elements off
the end of an array; previously, the bounds checking in some
circumstances could go off-by-one.
+ * improved MACHINE-VERSION, especially on Linux (thanks to Lars
+ Brinkhoff)
planned incompatible changes in 0.8.x:
* (not done yet, but planned:) When the profiling interface settles
"GENERALIZED-BOOLEAN"
"GET-CLOSURE-LENGTH"
"GET-HEADER-DATA"
- "GET-LISP-OBJ-ADDRESS" "LOWTAG-OF"
- "WIDETAG-OF"
+ "GET-LISP-OBJ-ADDRESS" "LOWTAG-OF" "WIDETAG-OF"
+ "GET-MACHINE-VERSION"
"HAIRY-DATA-VECTOR-REF" "HAIRY-DATA-VECTOR-SET" "HAIRY-TYPE"
"HAIRY-TYPE-CHECK-TEMPLATE-NAME" "HAIRY-TYPE-SPECIFIER"
"HANDLE-CIRCULARITY" "HOST" "IGNORE-IT"
(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")
+
+;;; support for CL:MACHINE-VERSION defined OAOO elsewhere
+(defun get-machine-version ()
+ nil)
\f
(defun fixup-code-object (code offset value kind)
(unless (zerop (rem offset n-word-bytes))
"Returns a string describing the type of the local machine."
"HPPA")
-(defun machine-version ()
- "Returns a string describing the version of the local machine."
- "HPPA")
-
+;;; support for CL:MACHINE-VERSION defined OAOO elsewhere
+(defun get-machine-version ()
+ nil)
\f
;;;; FIXUP-CODE-OBJECT
"Returns a string describing the type of the local machine."
"MIPS")
-(defun machine-version ()
- "Returns a string describing the version of the local machine."
+;;; support for CL:MACHINE-VERSION defined OAOO elsewhere
+(defun get-machine-version ()
#!+little-endian "little-endian"
#!-little-endian "big-endian")
-
\f
;;;; FIXUP-CODE-OBJECT
"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)
\f
;;;; FIXUP-CODE-OBJECT
;;;; provided with absolutely no warranty. See the COPYING and CREDITS
;;;; files for more information.
(in-package "SB!VM")
-
\f
-
;;; 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
"Returns a string describing the type of the local machine."
"SPARC")
-(defun machine-version ()
- "Returns a string describing the version of the local machine."
- "SPARC")
-
+;;; support for CL:MACHINE-VERSION defined OAOO elsewhere
+(defun get-machine-version ()
+ nil)
\f
(defun fixup-code-object (code offset fixup kind)
(declare (type index offset))
"Return a string giving the name of the local machine."
(sb!unix:unix-gethostname))
+(defvar *machine-version*)
+
+(defun machine-version ()
+ #!+sb-doc
+ "Return a string describing the version of the computer hardware we
+are running on, or NIL if we can't find any useful information."
+ (unless (boundp '*machine-version*)
+ (setf *machine-version* (get-machine-version)))
+ *machine-version*)
+
;;; FIXME: Don't forget to set these in a sample site-init file.
;;; FIXME: Perhaps the functions could be SETFable instead of having the
;;; interface be through special variables? As far as I can tell
"Return a string describing the type of the local machine."
"X86")
-(defun machine-version ()
- #!+sb-doc
- "Return a string describing the version of the local machine."
- "X86")
+;;; arch-specific support for CL:MACHINE-VERSION, defined OAOO elsewhere
+(defun get-machine-version ()
+ #!+linux
+ (with-open-file (stream "/proc/cpuinfo"
+ ;; Even on Linux it's an option to build
+ ;; kernels without /proc filesystems, so
+ ;; degrade gracefully.
+ :if-does-not-exist nil)
+ (loop with line while (setf line (read-line stream nil))
+ ;; The field "model name" exists on kernel 2.4.21-rc6-ac1
+ ;; anyway, with values e.g.
+ ;; "AMD Athlon(TM) XP 2000+"
+ ;; "Intel(R) Pentium(R) M processor 1300MHz"
+ ;; which seem comparable to the information in the example
+ ;; in the MACHINE-VERSION page of the ANSI spec.
+ when (eql (search "model name" line) 0)
+ return (string-trim " " (subseq line (1+ (position #\: line))))))
+ #!-linux
+ nil)
\f
;;;; :CODE-OBJECT fixups
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.1.6"
+"0.8.1.7"