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

Tyson Dowd trd at cs.mu.OZ.AU
Wed Sep 30 13:16:46 AEST 1998


On 30-Sep-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 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.

That's what I thought.  But Roman said it would work.  Perhaps he
expected me to know what esp was on the m68k (leaving ESP joke
out in the interest of good taste.

I'll get back to Roman 

> 
> > --- 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(...)'?
> 

Yep.

-- 
Those who would give up essential liberty to purchase a little temporary
safety deserve neither liberty nor safety.     - Benjamin Franklin

Tyson Dowd   <tyson at tyse.net>   http://tyse.net



More information about the developers mailing list