Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15135/src/code
Modified Files:
bsd-os.lisp early-impl.lisp linux-os.lisp osf1-os.lisp
sunos-os.lisp win32-os.lisp
Added Files:
common-os.lisp
Log Message:
0.9.10.39:
Implement and document SB-EXT:*CORE-PATHNAME*.
... communicate from runtime via SB-INT:*CORE-STRING*, rather
than constructing a pathname in C.
Related refactoring.
... since OS-COLD-INIT-OR-REINIT has exactly the same
functionality on all currently supported platforms,
move it into a common file;
... define common *common-static-symbols* and
*c-callable-static-symbols* for use in constructing
the per-backend *static-symbols* list, and to remove
the need for maintaining a separate list of callable
symbols in genesis.
--- NEW FILE: common-os.lisp ---
;;;; OS interface functions for SBCL common to all target OSes
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
;;;;
;;;; This software is derived from the CMU CL system, which was
;;;; written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no warranty. See the COPYING and CREDITS
;;;; files for more information.
(in-package "SB!SYS")
(defvar *software-version* nil)
(defvar *core-pathname* nil
#!+sb-doc
"The absolute pathname of the running SBCL core.")
;;; if something ever needs to be done differently for one OS, then
;;; split out the different part into per-os functions.
(defun os-cold-init-or-reinit ()
(/show0 "entering OS-COLD-INIT-OR-REINIT")
(setf *software-version* nil)
(/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
(setf *default-pathname-defaults*
;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
;; we call it below:)
(make-trivial-default-pathname)
*default-pathname-defaults*
;; (final value, constructed using #'NATIVE-PATHNAME:)
(native-pathname (sb!unix:posix-getcwd/)))
(/show0 "setting *CORE-PATHNAME*")
(setf *core-pathname*
(merge-pathnames (native-pathname *core-string*)))
(/show0 "leaving OS-COLD-INIT-OR-REINIT"))
Index: bsd-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/bsd-os.lisp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- bsd-os.lisp 16 Dec 2005 15:06:12 -0000 1.11
+++ bsd-os.lisp 16 Mar 2006 12:01:07 -0000 1.12
@@ -1,4 +1,4 @@
-;;;; OS interface functions for CMU CL under BSD Unix.
+;;;; OS interface functions for SBCL under BSD Unix.
;;;; This code was written as part of the CMU Common Lisp project at
;;;; Carnegie Mellon University, and has been placed in the public
@@ -8,8 +8,9 @@
;;;; Check that target machine features are set up consistently with
;;;; this file.
-#!-bsd (eval-when (:compile-toplevel :load-toplevel :execute)
- (error "The :BSD feature is missing, we shouldn't be doing this code."))
+#!-bsd
+(eval-when (:compile-toplevel :load-toplevel :execute)
+ (error "The :BSD feature is missing, we shouldn't be doing this code."))
(defun software-type ()
#!+sb-doc
@@ -20,8 +21,6 @@
#!+NetBSD "NetBSD"
#!+Darwin "Darwin"))
-(defvar *software-version* nil)
-
(defun software-version ()
#!+sb-doc
"Return a string describing version of the supporting software, or NIL
@@ -33,16 +32,6 @@
(sb!ext:run-program "/usr/bin/uname" `("-r")
:output stream))))))
-(defun os-cold-init-or-reinit ()
- (setf *software-version* nil)
- (setf *default-pathname-defaults*
- ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
- ;; we call it below:)
- (make-trivial-default-pathname)
- *default-pathname-defaults*
- ;; (final value, constructed using #'NATIVE-PATHNAME:)
- (native-pathname (sb!unix:posix-getcwd/))))
-
;;; Return system time, user time and number of page faults.
(defun get-system-info ()
(multiple-value-bind (err? utime stime maxrss ixrss idrss
Index: early-impl.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/early-impl.lisp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- early-impl.lisp 14 Jul 2005 16:30:32 -0000 1.15
+++ early-impl.lisp 16 Mar 2006 12:01:07 -0000 1.16
@@ -16,6 +16,7 @@
;;; listed here and then listed separately (and by now, 2001-06-06,
;;; slightly differently) elsewhere.
(declaim (special *posix-argv*
+ *core-string*
*read-only-space-free-pointer*
sb!vm:*static-space-free-pointer*
sb!vm:*initial-dynamic-space-free-pointer*
Index: linux-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/linux-os.lisp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- linux-os.lisp 16 Dec 2005 15:06:12 -0000 1.11
+++ linux-os.lisp 16 Mar 2006 12:01:07 -0000 1.12
@@ -1,4 +1,4 @@
-;;;; OS interface functions for CMU CL under Linux
+;;;; OS interface functions for SBCL under Linux
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
@@ -20,8 +20,6 @@
"Return a string describing the supporting software."
(values "Linux"))
-(defvar *software-version* nil)
-
;;; FIXME: More duplicated logic here vrt. other oses. Abstract into
;;; uname-software-version?
(defun software-version ()
@@ -35,21 +33,6 @@
(sb!ext:run-program "/bin/uname" `("-r")
:output stream))))))
-;;; FIXME: This logic is duplicated in other backends:
-;;; abstract, abstract. OS-COMMON-COLD-INIT-OR-REINIT, mayhaps?
-(defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
- (/show0 "entering linux-os.lisp OS-COLD-INIT-OR-REINIT")
- (setf *software-version* nil)
- (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
- (setf *default-pathname-defaults*
- ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up
- ;; when we call it below:)
- (make-trivial-default-pathname)
- *default-pathname-defaults*
- ;; (final value, constructed using #'NATIVE-PATHNAME:)
- (native-pathname (sb!unix:posix-getcwd/)))
- (/show0 "leaving linux-os.lisp OS-COLD-INIT-OR-REINIT"))
-
;;; Return system time, user time and number of page faults.
(defun get-system-info ()
(multiple-value-bind
Index: osf1-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/osf1-os.lisp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- osf1-os.lisp 16 Dec 2005 15:06:12 -0000 1.3
+++ osf1-os.lisp 16 Mar 2006 12:01:07 -0000 1.4
@@ -20,8 +20,6 @@
"Return a string describing the supporting software."
(values "OSF/1"))
-(defvar *software-version* nil)
-
(defun software-version ()
#!+sb-doc
"Return a string describing version of the supporting software, or NIL
@@ -33,19 +31,6 @@
(sb!ext:run-program "/bin/uname" `("-r")
:output stream))))))
-(defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
- (/show "entering osf1-os.lisp OS-COLD-INIT-OR-REINIT")
- (setf *software-version* nil)
- (/show "setting *DEFAULT-PATHNAME-DEFAULTS*")
- (setf *default-pathname-defaults*
- ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up
- ;; when we call it below:)
- (make-trivial-default-pathname)
- *default-pathname-defaults*
- ;; (final value, constructed using #'NATIVE-PATHNAME:)
- (native-pathname (sb!unix:posix-getcwd/)))
- (/show "leaving osf1-os.lisp OS-COLD-INIT-OR-REINIT"))
-
;;; Return system time, user time and number of page faults.
(defun get-system-info ()
(multiple-value-bind
Index: sunos-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/sunos-os.lisp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- sunos-os.lisp 16 Dec 2005 15:06:12 -0000 1.5
+++ sunos-os.lisp 16 Mar 2006 12:01:07 -0000 1.6
@@ -1,4 +1,4 @@
-;;;; OS interface functions for CMU CL under Solaris (FIXME: SunOS?)
+;;;; OS interface functions for SBCL under SunOS
;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
@@ -20,8 +20,6 @@
"Return a string describing the supporting software."
(values "SunOS"))
-(defvar *software-version* nil)
-
(defun software-version ()
#!+sb-doc
"Return a string describing version of the supporting software, or NIL
@@ -33,19 +31,6 @@
(sb!ext:run-program "/bin/uname" `("-r")
:output stream))))))
-(defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
- (/show "entering sunos-os.lisp OS-COLD-INIT-OR-REINIT")
- (setf *software-version* nil)
- (/show "setting *DEFAULT-PATHNAME-DEFAULTS*")
- (setf *default-pathname-defaults*
- ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
- ;; we call it below:)
- (make-trivial-default-pathname)
- *default-pathname-defaults*
- ;; (final value, constructed using #'NATIVE-PATHNAME:)
- (native-pathname (sb!unix:posix-getcwd/)))
- (/show "leaving sunos-os.lisp OS-COLD-INIT-OR-REINIT"))
-
;;; Return system time, user time and number of page faults.
(defun get-system-info ()
(multiple-value-bind
Index: win32-os.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/win32-os.lisp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- win32-os.lisp 3 Jan 2006 09:52:38 -0000 1.1
+++ win32-os.lisp 16 Mar 2006 12:01:07 -0000 1.2
@@ -20,8 +20,6 @@
"Return a string describing the supporting software."
(values "Win32"))
-(defvar *software-version* nil)
-
(defun software-version ()
#!+sb-doc
"Return a string describing version of the supporting software, or NIL
@@ -34,19 +32,6 @@
(sb!ext:run-program "/bin/uname" `("-r")
:output stream))))))
-(defun os-cold-init-or-reinit () ; KLUDGE: don't know what to do here
- (/show0 "entering win32-os.lisp OS-COLD-INIT-OR-REINIT")
- (setf *software-version* nil)
- (/show0 "setting *DEFAULT-PATHNAME-DEFAULTS*")
- (setf *default-pathname-defaults*
- ;; (temporary value, so that #'NATIVE-PATHNAME won't blow up when
- ;; we call it below:)
- (make-trivial-default-pathname)
- *default-pathname-defaults*
- ;; (final value, constructed using #'NATIVE-PATHNAME:)
- (native-pathname (sb!unix:posix-getcwd/)))
- (/show0 "leaving linux-os.lisp OS-COLD-INIT-OR-REINIT"))
-
;;; Return system time, user time and number of page faults.
(defun get-system-info ()
#+nil (multiple-value-bind
|