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

Bill Middleton flashdict at gmail.com
Sun Apr 3 10:22:57 EDT 2005

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.


More information about the Mono-devel-list mailing list