"UNIX-LSTAT" "UNIX-MKDIR" "UNIX-OPEN" "UNIX-PATHNAME" "UNIX-PID"
"UNIX-PIPE" "UNIX-READ" "UNIX-READLINK" "UNIX-RECV" "UNIX-RENAME"
"UNIX-RMDIR" "UNIX-SELECT" "UNIX-SEND" "UNIX-SETPGRP"
- "UNIX-SETREGID" "UNIX-SETREUID" "UNIX-SOCKET" "UNIX-STAT"
- "UNIX-SYMLINK" "UNIX-SYNC"
+ "UNIX-SOCKET" "UNIX-STAT" "UNIX-SYMLINK" "UNIX-SYNC"
"UNIX-TIMES" "UNIX-TRUNCATE" "UNIX-TTYNAME"
"UNIX-UID" "UNIX-UNLINK" "UNIX-UTIMES" "UNIX-WRITE" "WINSIZE"
"WRITEGRP" "WRITEOTH" "WRITEOWN" "WS-COL" "WS-ROW" "WS-XPIXEL"
;;; take effect. If the compiler is loaded, we make the
;;; compiler-policy local to LOAD by binding it to itself.
;;;
-;;; FIXME: ANSI specifies a &KEY :EXTERNAL-FORMAT argument.
-;;;
;;; FIXME: Daniel Barlow's ilsb.tar ILISP-for-SBCL patches contain an
;;; implementation of "DEFUN SOURCE-FILE" which claims, in a comment, that CMU
;;; CL does not correctly record source file information when LOADing a
&key
(verbose *load-verbose*)
(print *load-print*)
- (if-does-not-exist t))
+ (if-does-not-exist t)
+ (external-format :default))
#!+sb-doc
- "Loads the file given by FILESPEC into the Lisp environment, returning
- T on success. These options are defined:
-
- :IF-DOES-NOT-EXIST
- What should we do if the file can't be located? If true (the
- default), signal an error. If NIL, simply return NIL.
-
- :VERBOSE
- If true, print a line describing each file loaded. The default
- is *LOAD-VERBOSE*.
-
- :PRINT
- If true, print information about loaded values. When loading the
- source, the result of evaluating each top-level form is printed.
- The default is *LOAD-PRINT*."
+ "Load the file given by FILESPEC into the Lisp environment, returning
+ T on success."
+ (unless (eq external-format :default)
+ (error "Non-:DEFAULT EXTERNAL-FORMAT values are not supported."))
(let ((*load-depth* (1+ *load-depth*))
;; KLUDGE: I can't find in the ANSI spec where it says that
(:verbose t)
(:print t)
(:if-does-not-exist (member :error :create nil))
- ;; FIXME: ANSI specifies an :EXTERNAL-FORMAT keyword too.
- )
+ (:external-format (member :default)))
t)
(defknown directory (pathname-designator &key
;;; stomping on an address range that the dynamic libraries want to use.
;;; (They want to use this address range even if we try to reserve it
;;; with a call to validate() as the first operation in main().)
-
#!+linux
(progn
sbcl
sbcl.h
sbcl.nm
+trymap
return ret;
}
-/* On the 386, closures hold a pointer to the raw address instead of the
- function object, so we can use CALL [$FDEFN+const] to invoke the function
- without loading it into a register. Given that code objects don't move,
- we don't need to update anything, but we do have to figure out that the
- function is still live. */
-#ifdef i386
+/* On the 386, closures hold a pointer to the raw address instead of
+ * the function object, so we can use CALL [$FDEFN+const] to invoke
+ * the function without loading it into a register. Given that code
+ * objects don't move, we don't need to update anything, but we do
+ * have to figure out that the function is still live. */
+#ifdef __i386__
static
scav_closure_header(where, object)
lispobj *where, object;
scavtab[type_FunctionHeader] = scav_function_header;
scavtab[type_ClosureFunctionHeader] = scav_function_header;
scavtab[type_ReturnPcHeader] = scav_return_pc_header;
-#ifdef i386
+#ifdef __i386__
scavtab[type_ClosureHeader] = scav_closure_header;
scavtab[type_FuncallableInstanceHeader] = scav_closure_header;
scavtab[type_ByteCodeFunction] = scav_closure_header;
}
}
-/* Install a special low-level handler for signal; or if handler is
- * SIG_DFL, remove any special handling for signal.
+/* Undoably install a special low-level handler for signal; or if
+ * handler is SIG_DFL, remove any special handling for signal.
*
- * The "undoably_" part is because we also arrange with atexit() for
- * the handler to be restored to its old value. This is for tidiness,
- * though it shouldn't really matter in normal operation of the
- * program, except perhaps that it removes a window when e.g. SIGINT
- * would be handled bizarrely. The original motivation was that some
- * memory corruption problems in OpenBSD ca sbcl-0.6.12.12 became
- * unnecessarily hard to debug when they ended up back in gencgc.c
- * code (courtesy of the gencgc SIGSEGV handler) after exit() was
- * called. */
+ * The "undoably" aspect is because we also arrange with atexit() for
+ * the handler to be restored to its old value. This is for tidiness:
+ * it shouldn't matter much ordinarily, but it does remove a window
+ * where e.g. memory fault signals (SIGSEGV or SIGBUS, which in
+ * ordinary operation of SBCL are sent to the generational garbage
+ * collector, then possibly onward to Lisp code) or SIGINT (which is
+ * ordinarily passed to Lisp code) could otherwise be handled
+ * bizarrely/brokenly because the Lisp code would try to deal with
+ * them using machinery (like stream output buffers) which has already
+ * been dismantled. */
void
undoably_install_low_level_interrupt_handler (int signal,
void handler(int,
LDSO_STUBIFY(send)
LDSO_STUBIFY(setitimer)
LDSO_STUBIFY(setpgrp)
- LDSO_STUBIFY(setregid)
- LDSO_STUBIFY(setreuid)
LDSO_STUBIFY(sigblock)
LDSO_STUBIFY(sigpause)
LDSO_STUBIFY(sigsetmask)
/* LDSO_STUBIFY(setpriority) */
/* LDSO_STUBIFY(setprotoent) */
/* LDSO_STUBIFY(setpwent) */
-/* LDSO_STUBIFY(setregid) */
-/* LDSO_STUBIFY(setreuid) */
/* LDSO_STUBIFY(setrlimit) */
/* LDSO_STUBIFY(setrpcent) */
/* LDSO_STUBIFY(setservent) */
}
os_vm_page_size = getpagesize();
- /* this could just as well be in arch_init, but it's not */
-#ifdef i386
+ /* This could just as well be in arch_init(), but it's not. */
+#ifdef __i386__
SET_FPU_CONTROL_WORD(0x1372|4|8|16|32); /* no interrupts */
#endif
}
os_context_t *context = (os_context_t*)void_context;
os_vm_address_t addr;
-#ifdef i386
+#ifdef __i386__
interrupt_handle_now(signal,contextstruct);
#else
-#define CONTROL_STACK_TOP (((char*)CONTROL_STACK_START)+CONTROL_STACK_SIZE)
+ char *control_stack_top = (char*)CONTROL_STACK_START + CONTROL_STACK_SIZE;
addr = arch_get_bad_addr(signal,info,context);
*/
*os_context_register_addr(context,reg_ALLOC) -= (1L<<63);
interrupt_handle_pending(context);
- } else if (addr > CONTROL_STACK_TOP && addr < BINDING_STACK_START) {
- fprintf(stderr, "Possible stack overflow at 0x%016lX: CONTROL_STACK_TOP=%lx, BINDING_STACK_START=%lx\n",addr, CONTROL_STACK_TOP,BINDING_STACK_START);
- /* try to fix control frame pointer */
+ } else if (addr > control_stack_top && addr < BINDING_STACK_START) {
+ fprintf(stderr,
+ "Possible stack overflow at 0x%016lX:\n"
+ "control_stack_top=%lx, BINDING_STACK_START=%lx\n",
+ addr,
+ control_stack_top,
+ BINDING_STACK_START);
+ /* Try to fix control frame pointer. */
while ( ! (CONTROL_STACK_START <= *current_control_frame_pointer &&
- *current_control_frame_pointer <= CONTROL_STACK_TOP))
+ *current_control_frame_pointer <= control_stack_top))
((char*)current_control_frame_pointer) -= sizeof(lispobj);
ldb_monitor();
} else if (!interrupt_maybe_gc(signal, info, context)) {
}
#endif
-
-
void
os_install_interrupt_handlers(void)
{
--- /dev/null
+/*
+ * a utility for experimenting with mmap()-at-absolute-address-ranges
+ * as a crude way of checking whether it's reasonable for SBCL to
+ * reserve those address ranges for itself
+ */
+
+/*
+ * 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.
+ */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mman.h>
+
+long
+hexparse(char *s)
+{
+ long result;
+ if (1 != sscanf(s, "%lx", &result)) {
+ fprintf(stderr, "can't parse \"%s\" as hexadecimal integer\n", s);
+ exit(1);
+ }
+ return result;
+}
+
+int
+main(int argc, char *argv[])
+{
+ char *addr;
+ char *requested_addr;
+
+ /* FIXME: It would be nice to make the no-command-line-arguments
+ * case of this program automatically check all the spaces that
+ * SBCL likes to map. Then we could execute this program as a
+ * sanity check in make-target-2.sh before we try to execute sbcl
+ * itself. */
+ if (argc != 3) {
+ fprintf(stderr, "usage: %s $addr $size\n", argv[0]);
+ exit(1);
+ }
+
+ requested_addr = (char*)hexparse(argv[1]);
+ addr = mmap(requested_addr,
+ hexparse(argv[2]),
+ 0x7,
+ MAP_PRIVATE | MAP_ANON | MAP_FIXED,
+ -1,
+ 0);
+
+ /* FIXME: It would be nice to make this a stronger test. E.g.
+ * besides just trying to mmap() the area, we could check that the
+ * area is not already mapped (perhaps by checking that attempts
+ * to reference the to-be-mapped area cause SIGSEGV or SIGBUS).
+ * (At least on OpenBSD, "A successful mmap deletes any previous
+ * mapping in the allocated address range.") */
+ if (addr != requested_addr) {
+ perror("mmap");
+ }
+
+ exit(0);
+}
#if !defined(SVR4) || defined(SOLARIS25)
F(setpriority)
#endif
-#if !defined(hpux) && !defined(SVR4) || defined(SOLARIS25)
-F(setregid)
-F(setreuid)
-#endif
F(setrlimit)
F(setsockopt)
F(settimeofday)
;;; versions, and a string like "0.6.5.12" is used for versions which
;;; aren't released but correspond only to CVS tags or snapshots.
-"0.6.12.15"
+"0.6.12.16"