[Mono-devel-list] Patches for FreeBSD (and other BSD flavors, likely)

Flash Dict flashdict at gmail.com
Mon Apr 4 12:23:30 EDT 2005


Nice.  I think that will help with the eventual migration to ucontext
and MONO_ARCH_USE_SIGACTION as well, but then some different mappings
will be reqd to handle the fact that BSD (at least FreeBSD) doesn't
have gregs[].

One, small nit, though:

===================================================================
--- mono/mini/exceptions-x86.c  (revision 42526)
+++ mono/mini/exceptions-x86.c  (working copy)
@@ -499,7 +499,7 @@
                }

                /* Pop EBP and the return address */
-               new_ctx->esp = ctx->SC_EBP + (2 * sizeof (gpointer));
+               new_ctx->esp = ctx->ebp + (2 * sizeof (gpointer));
                /* we substract 1, so that the IP points into the call
instruction */
                new_ctx->eip = *((int *)ctx->ebp + 1) - 1;
                new_ctx->ebp = *((int *)ctx->ebp);


Thanks Zoltan.

Bill Middleton

On Apr 4, 2005 3:57 PM, Zoltan Varga <vargaz at gmail.com> wrote:
>                                             Hi,
> 
>   I checked in a simpler fix for the sigcontext issues. Now all the
> sigcontext/ucontext madness is handled in the
> mono_arch_sigctx_to_monoctx
> function and its counterpart. Could you try whenever it works on BSD ?
> 
>             thanks
> 
>                       Zoltan
> 
> On Apr 3, 2005 4:22 PM, Bill Middleton <flashdict at gmail.com> wrote:
> > Zoltan Varga wrote:
> >
> > >  For the sigcontext stuff, I think it would be easier to define
> > >MONO_ARCH_USE_SIGACTION in mini-x86.h for *BSD as well. Could you try
> > >this ?
> > >
> > >
> > Both NetBSD and FreeBSD seem to be on their way towards ucontext{} and
> > away from sigcontext.  NetBSD completely hides sigcontext{} in the
> > latest 1.6.x source code, on the way to 2.0, except when __KERNEL is
> > defined.  FreeBSD > 5.4_PRERELEASE, however, has taken a different
> > approach to the migration, and is attempting to make a backwards
> > compatible union out of sigcontext{} and  ucontext_t{}.  Neither case
> > will support the ucontext code as currently written in exceptions-x86.c,
> > since the .gregs[] array isn't part of BSD ucontext at all.  In every
> > case, the older definitions for sigcontext must be supported to continue
> > to build on any but the absolute latest and most cutting-edge BSD
> > kernel/userlands with much futzing.
> >
> > I do agree though, that BSD* should eventually have it's own exception
> > code for signaling and exceptions based on ucontext_t{}, like s390 (for
> > example).  It will be a chore though, given the mutations and
> > intent/purpose between the BSD flavors.  Not to mention the likely loss
> > of at least some the x86 optimizations which are possible with direct
> > munging of sigcontext.
> >
> > I hope my patch can go in as is, and the future changes to the exception
> > code will support the older #define's for bsd -  it's just too early to
> > try to make the switch to MONO_ARCH_USE_SIGACTION right now, imho.
> >
> >  And we haven't even touched on the threads and the (almost there)
> > support for __thread on FreeBSD, nor sigaltstack(), but then I don't
> > want my head to explode today, either.
> >
> > Bill
> >
> >
>



More information about the Mono-devel-list mailing list