0.6.12.4:
[sbcl.git] / src / runtime / runtime.c
index b572391..a170ddf 100644 (file)
  * files for more information.
  */
 
-/*
- * $Header$
- */
-
 #include <stdio.h>
 #include <sys/types.h>
 #include <stdlib.h>
@@ -36,6 +32,7 @@
 #include "interrupt.h"
 #include "arch.h"
 #include "gc.h"
+#include "interr.h"
 #include "monitor.h"
 #include "validate.h"
 #if defined GENCGC
@@ -54,7 +51,8 @@
 
 static void sigint_handler(int signal, siginfo_t *info, void *void_context)
 {
-    printf("\nSIGINT hit at 0x%08lX\n", *os_context_pc_addr(void_context));
+    printf("\nSIGINT hit at 0x%08lX\n", 
+          (unsigned long) *os_context_pc_addr(void_context));
     ldb_monitor();
 }
 
@@ -78,6 +76,7 @@ successful_malloc(size_t size)
     } else {
        return result;
     }
+    return (void *) NULL; /* dummy value: return something ... */
 }
 
 char *
@@ -114,7 +113,7 @@ int
 main(int argc, char *argv[], char *envp[])
 {
     /* the name of the core file we're to execute. Note that this is
-     * a malloc'ed string which must be freed eventually. */
+     * a malloc'ed string which should be freed eventually. */
     char *core = 0;
 
     /* other command line options */
@@ -123,7 +122,11 @@ main(int argc, char *argv[], char *envp[])
 
     lispobj initial_function;
 
+    /* KLUDGE: os_vm_page_size is set by os_init(), and on some
+     * systems (e.g. Alpha) arch_init() needs need os_vm_page_size, so
+     * it must follow os_init(). -- WHN 2000-01-26 */
     os_init();
+    arch_init();
     gc_init();
     validate();
 
@@ -188,7 +191,9 @@ main(int argc, char *argv[], char *envp[])
        char *sbcl_home = getenv("SBCL_HOME");
        if (sbcl_home) {
            char *lookhere;
-           asprintf(&lookhere, "%s/sbcl.core", sbcl_home);
+           lookhere = (char *) calloc(strlen("/sbcl.core") + strlen(sbcl_home) + 1,
+                                       sizeof(char));
+           sprintf(lookhere, "%s/sbcl.core", sbcl_home);
            core = copied_existing_filename_or_null(lookhere);
            free(lookhere);
        } else {
@@ -207,20 +212,19 @@ main(int argc, char *argv[], char *envp[])
 "This is SBCL " SBCL_VERSION_STRING ", an implementation of ANSI Common Lisp.
 
 SBCL is derived from the CMU CL system created at Carnegie Mellon University.
-Besides material created at Carnegie Mellon University, and material
-contributed by volunteers since its release into the public domain, CMU CL
-contained, and SBCL contains, material copyrighted by
-  Massachusetts Institute of Technology, 1986;
-  Symbolics, Inc., 1989, 1990, 1991, 1992; and
-  Xerox Corporation, 1985, 1986, 1987, 1988, 1989, 1990.
-More information about the origin of SBCL is available in the CREDITS file
-in the distribution.
+Besides software and documentation originally created at Carnegie Mellon
+University, SBCL contains some software originally from the Massachusetts
+Institute of Technology, Symbolics Incorporated, and Xerox Corporation, and
+material contributed by volunteers since the release of CMU CL into the
+public domain. See the CREDITS file in the distribution for more information.
 
 SBCL is a free software system, provided as is, with absolutely no warranty.
-It is mostly public domain software, but also includes some software from
-MIT, Symbolics, and Xerox, used under BSD-style licenses which allow copying
-only under certain conditions. More information about copying SBCL is
-available in the COPYING file in the distribution.
+It is mostly in the public domain, but also includes some software copyrighted
+  Massachusetts Institute of Technology, 1986;
+  Symbolics, Inc., 1989, 1990, 1991, 1992; and
+  Xerox Corporation, 1985, 1986, 1987, 1988, 1989, 1990
+used under BSD-style licenses allowing copying only under certain conditions.
+See the COPYING file in the distribution for more information.
 
 More information on SBCL is available at <http://sbcl.sourceforge.net/>.
 ");
@@ -268,7 +272,7 @@ More information on SBCL is available at <http://sbcl.sourceforge.net/>.
 #endif
 
 #ifdef BINDING_STACK_POINTER
-    SetSymbolValue(BINDING_STACK_POINTER, (lispobj)binding_stack);
+    SetSymbolValue(BINDING_STACK_POINTER, BINDING_STACK_START);
 #endif
 #if defined INTERNAL_GC_TRIGGER && !defined __i386__
     SetSymbolValue(INTERNAL_GC_TRIGGER, make_fixnum(-1));
@@ -296,4 +300,6 @@ More information on SBCL is available at <http://sbcl.sourceforge.net/>.
 
     /* initial_function() is not supposed to return. */
     lose("Lisp initial_function gave up control.");
+    return 0; /* dummy value: return something */
 }
+