[m-dev.] for review: Linux-m68k port.

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Sep 30 04:30:47 AEST 1998


On 29-Sep-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> 
> runtime/mercury_goto.h:
> 	Add support for non-local gotos with Linux-68k.
...
> +++ mercury_goto.h	1998/09/29 08:45:11
> @@ -111,10 +111,12 @@
>    #define ASM_FALLTHROUGH(label) \
>    	goto skip(label);
>  
> -#elif defined(__i386__)
> +#elif defined(__i386__) || defined(__mc68000__)
>  
>    /*
>    ** The following hack works around a stack leak on the i386.
> +  ** (and apparently the 68000 too).
> +  **
>    ** The problem is that gcc pushes function parameters onto
>    ** the stack when calling C functions such as GC_malloc(),
>    ** and only restores the stack pointer in the epilogue.

The code there wouldn't work for mc68000, I think,
because it refers explicitly to the `esp' register
in the ASM_JUMP macro.

> --- mercury_memory_handlers.c	1998/09/29 05:11:00	1.8
> +++ mercury_memory_handlers.c	1998/09/29 08:26:03
> @@ -306,11 +317,15 @@
>  }
>  
>  #if defined(HAVE_SIGCONTEXT_STRUCT)
> -
> -static void
> -complex_sighandler(int sig, struct sigcontext_struct sigcontext)
> +  #if defined(HAVE_SIGCONTEXT_STRUCT_BSD)
> +    static void
> +    complex_sighandler(int sig, int code, struct sigcontext_struct sigcontext)

Shouldn't that be `complex_sighandler_bsd(...)'?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list