On 05/25/2011 12:09 AM, Stefan Hajnoczi wrote:
> On Tue, May 24, 2011 at 9:51 PM, Jamie Lokier <ja...@shareable.org> wrote:
>> Stefan Hajnoczi wrote:
>>> My current plan is to try using sigaltstack(2) instead of
>>> makecontext()/swapcontext() as a hack since OpenBSD doesn't have
>>> makecontext()/swapcontext().
>>
>> sigaltstack() is just a system call to tell the system about an
>> alternative signal stack - that you have allocated yourself using
>> malloc().  According to 'info libc "Signal Stack"'.  It won't help you
>> get a new stack by itself.
> 
> Issue sigaltstack() with the malloced new stack.  Send yourself a
> signal and in a custom signal handler setjmp() to stash away the state
> (you're now on the new stack).

Is any of this really easier than simply writing 20-30 lines of
assembly to do what you Really Want And Nothing Else?

Honestly, this is qemu we're talking about, and we assume you've
already ported TCG to the host cpu plus abi.  How hard is it to
just DTRT with a qemu-specific routine, anyway?


r~

Reply via email to