[haiku-development] Re: ucontext_t?

  • From: Andreas Färber <andreas.faerber@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 2 Aug 2008 15:54:14 +0200


Am 02.08.2008 um 14:23 schrieb François Revol:

Hello,

Is there any thing such as ucontext_t on Haiku that provides access
to
registers for a signal handler? On Linux/*BSD there seem to be
structs
ucontext_t, mcontext_t etc. that provide access to registers for
saving and restoring them. In Haiku's libroot/posix/glibc/stdlib/
there is a ucontext.h that defines related functions, but it only
uses
and doesn't define the struct itself (no arch-specific sys/
ucontext.h).

Is there any alternative mechanism for user-level context switching,
or could I contribute to having it implemented for x86?

Just like BeOS, we already provide extra args, including a vregs array,
see
headers/posix/signal.h

But as this is totally non-standard we should probably also implement
ucontext, and use it instead when it's enabled.

Thanks to both of you for the quick answers.

I am investigating struct vregs, and it's been a long time that I've been in contact with x86 assembler, so... I'm wondering why there are no members ebx, esi, edi? Are there different names for them or another way to get+set their value? Are they "safe" to ignore?

François: It seems difficult to support both BeOS and Posix semantics here, briefly looking at it. Would that be a post-R1 change?

Andreas


Other related posts: