Update of /cvsroot/sbcl/sbcl/src/runtime
In directory sc8-pr-cvs1:/tmp/cvs-serv5025/src/runtime
Modified Files:
linux-os.c sparc-arch.c
Log Message:
0.pre8.109
#+sb-threads check for Linux 2.4, because it won't work in 2.2
In the process, rename early_kernel to linux_sparc_siginfo_bug,
just to make its purpose a little more obvious
Export WITH-TIMEOUT and TIMEOUT from SB-EXT. TIMEOUT is now a
SERIOUS-CONDITION not an ERROR
Index: linux-os.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/linux-os.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- linux-os.c 7 Apr 2003 17:56:18 -0000 1.21
+++ linux-os.c 26 Apr 2003 22:32:30 -0000 1.22
@@ -40,6 +40,7 @@
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <linux/version.h>
#include "validate.h"
#include "thread.h"
@@ -47,33 +48,35 @@
#include "gc.h"
+int linux_sparc_siginfo_bug = 0;
-#ifdef sparc
-int early_kernel = 0;
-#endif
void os_init(void)
{
- /* Early versions of Linux don't support the mmap(..) functionality
- * that we need. */
+ /* Conduct various version checks: do we have enough mmap(), is
+ * this a sparc running 2.2, can we do threads? */
{
struct utsname name;
int major_version;
-#ifdef sparc
int minor_version;
-#endif
+ char *p;
uname(&name);
- major_version = atoi(name.release);
- if (major_version < 2) {
- lose("linux major version=%d (can't run in version < 2.0.0)",
+ p=name.release;
+ major_version = atoi(p);
+ p=strchr(p,'.')+1;
+ minor_version = atoi(p);
+ if (major_version<2) {
+ lose("linux kernel version too old: major version=%d (can't run in
version < 2.0.0)",
major_version);
}
-#ifdef sparc
- /* KLUDGE: This will break if Linux moves to a uname() version number
- * that has more than one digit initially -- CSR, 2002-02-12 */
- minor_version = atoi(name.release+2);
- if (minor_version < 4) {
- FSHOW((stderr,"linux minor version=%d;\n enabling workarounds for
SPARC kernel bugs in signal handling.\n", minor_version));
- early_kernel = 1;
+#ifdef LISP_FEATURE_SB_THREAD
+ if ((major_version <2) || (major_version==2 && minor_version < 4)) {
+ lose("linux kernel 2.4 required for thread-enabled SBCL");
+ }
+#endif
+#ifdef LISP_FEATURE_SPARC
+ if ((major_version <2) || (major_version==2 && minor_version < 4)) {
+ FSHOW((stderr,"linux kernel %d.%d predates 2.4;\n enabling
workarounds for SPARC kernel bugs in signal handling.\n", minor_version));
+ linux_sparc_siginfo_bug = 1;
}
#endif
}
Index: sparc-arch.c
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/runtime/sparc-arch.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- sparc-arch.c 5 Apr 2003 13:04:15 -0000 1.8
+++ sparc-arch.c 26 Apr 2003 22:32:30 -0000 1.9
@@ -25,7 +25,7 @@
#include "monitor.h"
#ifdef LISP_FEATURE_LINUX
-extern int early_kernel;
+extern int linux_sparc_siginfo_bug;
#endif
void arch_init(void)
@@ -192,7 +192,7 @@
if ((siginfo->si_code) == ILL_ILLOPC
#ifdef LISP_FEATURE_LINUX
- || (early_kernel && (siginfo->si_code == 2))
+ || (linux_sparc_siginfo_bug && (siginfo->si_code == 2))
#endif
) {
int trap;
@@ -241,7 +241,7 @@
}
else if ((siginfo->si_code) == ILL_ILLTRP
#ifdef LISP_FEATURE_LINUX
- || (early_kernel && (siginfo->si_code) == 192)
+ || (linux_sparc_siginfo_bug && (siginfo->si_code) == 192)
#endif
) {
if (pseudo_atomic_trap_p(context)) {
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
|