X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fruntime%2Fmain%2FSignals.lc;h=2f376aef649ce9cdfd417806e09251e2071df869;hb=967cc47f37cb93a5e2b6df7822c9a646f0428247;hp=866f102dc700ca4a350ff478ff487043a94ab62b;hpb=e2f1d3a5be17307c07018c76a7b64b6bc66c08b1;p=ghc-hetmet.git diff --git a/ghc/runtime/main/Signals.lc b/ghc/runtime/main/Signals.lc index 866f102..2f376ae 100644 --- a/ghc/runtime/main/Signals.lc +++ b/ghc/runtime/main/Signals.lc @@ -76,7 +76,9 @@ much pain. # ifndef LINUX_VERSION_CODE # include # endif -# if (LINUX_VERSION_CODE < 0x020000) +/* Snaffled from drivers/scsi/eata.c in 2.0.30 sources */ +#define LinuxVersionCode(v, p, s) (((v)<<16)+((p)<<8)+(s)) +# if ( LINUX_VERSION_CODE < LinuxVersionCode(2,0,0) ) # include # else # include @@ -133,22 +135,36 @@ segv_handler(int sig, # if defined(aix_TARGET_OS) int code, struct sigcontext *scp) # else /* linux */ + /* sigcontext_struct has been renamed to sigcontext. If + compiling this code elicits a bunch of warnings about + "struct sigcontext_struct" being undeclared, check to + see whether you've got "struct sigcontext" in . + or not. + + If you do, lower the version number below to fit the version + you're running (and pass us a note saying that you had to - thx!) + */ +# if LINUX_VERSION_CODE >= LinuxVersionCode(2,1,51) + /* sigcontext_struct has been renamed to sigcontext */ + struct sigcontext scp) +# else struct sigcontext_struct scp) +# endif # endif # endif { extern void StackOverflow(STG_NO_ARGS) STG_NORETURN; # if defined(linux_TARGET_OS) || defined(linuxaout_TARGET_OS) - caddr_t addr = scp.cr2; + unsigned long addr = scp.cr2; /* Magic info from Tommy Thorn! */ # endif # if defined(aix_TARGET_OS) caddr_t addr = scp->sc_jmpbuf.jmp_context.o_vaddr; /* Magic guess by andre */ # endif - if (addr >= (caddr_t) stks_space - && addr < (caddr_t) (stks_space + RTSflags.GcFlags.stksSize)) + if ( (char *)addr >= (char *)stks_space + && (char *)addr < (char *)(stks_space + RTSflags.GcFlags.stksSize)) StackOverflow(); fflush(stdout);