X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ftoplevel.lisp;h=d218fd58d91e453ae9661470ace454610f06b1ca;hb=72db452798256d266d5909bd330d9eb5b31c6f1e;hp=d3b3271f9f493cc2fed7ca41b6d8df230b11b4ed;hpb=c07dbfb642a88f20a1dd0d163308ba4a28b67ef3;p=sbcl.git diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index d3b3271..d218fd5 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -145,6 +145,7 @@ steppers to maintain contextual information.") :format-arguments (list n) :datum n :expected-type '(real 0))) + #!-win32 (multiple-value-bind (sec nsec) (if (integerp n) (values n 0) @@ -152,6 +153,8 @@ steppers to maintain contextual information.") (truncate n) (values sec (truncate frac 1e-9)))) (sb!unix:nanosleep sec nsec)) + #!+win32 + (sb!win32:millisleep (truncate (* n 1000))) nil) ;;;; SCRUB-CONTROL-STACK @@ -182,7 +185,7 @@ steppers to maintain contextual information.") (let* ((csp (sap-int (sb!c::control-stack-pointer-sap))) (initial-offset (logand csp (1- bytes-per-scrub-unit))) (end-of-stack - (- (sb!vm:fixnumize sb!vm:*control-stack-end*) + (- (sap-int (sb!di::descriptor-sap sb!vm:*control-stack-end*)) sb!c:*backend-page-size*))) (labels ((scrub (ptr offset count) @@ -215,7 +218,7 @@ steppers to maintain contextual information.") #!+stack-grows-downward-not-upward (let* ((csp (sap-int (sb!c::control-stack-pointer-sap))) - (end-of-stack (+ (sb!vm:fixnumize sb!vm:*control-stack-start*) + (end-of-stack (+ (sap-int (sb!di::descriptor-sap sb!vm:*control-stack-start*)) sb!c:*backend-page-size*)) (initial-offset (logand csp (1- bytes-per-scrub-unit)))) (labels @@ -357,8 +360,12 @@ steppers to maintain contextual information.") (/show0 "entering TOPLEVEL-INIT") (let (;; value of --sysinit option (sysinit nil) + ;; t if --no-sysinit option given + (no-sysinit nil) ;; value of --userinit option (userinit nil) + ;; t if --no-userinit option given + (no-userinit nil) ;; values of --eval options, in reverse order; and also any ;; other options (like --load) which're translated into --eval ;; @@ -409,11 +416,17 @@ steppers to maintain contextual information.") (if sysinit (startup-error "multiple --sysinit options") (setf sysinit (pop-option)))) + ((string= option "--no-sysinit") + (pop-option) + (setf no-sysinit t)) ((string= option "--userinit") (pop-option) (if userinit (startup-error "multiple --userinit options") (setf userinit (pop-option)))) + ((string= option "--no-userinit") + (pop-option) + (setf no-userinit t)) ((string= option "--eval") (pop-option) (push (pop-option) reversed-evals)) @@ -476,10 +489,20 @@ steppers to maintain contextual information.") #!-win32 (probe-init-files sysinit (init-file-name (posix-getenv "SBCL_HOME") "sbclrc") - "/etc/sbclrc")) + "/etc/sbclrc") + #!+win32 (probe-init-files sysinit + (init-file-name (posix-getenv "SBCL_HOME") + "sbclrc") + (concatenate 'string + (sb!win32::get-folder-path 35) ;;SB-WIN32::CSIDL_COMMON_APPDATA + "\\sbcl\\sbclrc"))) + (userinit-truename #!-win32 (probe-init-files userinit (init-file-name (posix-getenv "HOME") + ".sbclrc")) + #!+win32 (probe-init-files userinit + (init-file-name (namestring (user-homedir-pathname)) ".sbclrc")))) ;; This CATCH is needed for the debugger command TOPLEVEL to @@ -499,8 +522,8 @@ steppers to maintain contextual information.") ;; figure out what's going on.) (restart-case (progn - (process-init-file sysinit-truename) - (process-init-file userinit-truename) + (unless no-sysinit (process-init-file sysinit-truename)) + (unless no-userinit (process-init-file userinit-truename)) (process-eval-options (reverse reversed-evals))) (abort () :report "Skip to toplevel READ/EVAL/PRINT loop." @@ -565,6 +588,7 @@ steppers to maintain contextual information.") ;; In the event of a control-stack-exhausted-error, we ;; should have unwound enough stack by the time we get ;; here that this is now possible. + #!-win32 (sb!kernel::protect-control-stack-guard-page 1) (funcall repl-fun noprint) (critically-unreachable "after REPL"))))))))))