Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2005 20:19:17 -0500 (EST)
From:      Etienne Robillard <granted14@yahoo.com>
To:        freebsd-arch@freebsd.org
Subject:   question about ucontext_t and friends 
Message-ID:  <20050208011917.56324.qmail@web30203.mail.mud.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have a c++ application implementing a user-level
hardware abstraction (L4 ­µ-kernel in user-mode linux)
bu I am missing a few arch backbones.

Afaiu, the application must find some ways to
manipulate registers in user-context, after having the
request traced by ptrace(2). 

So far, interfaces are prototyped in similar manners: 

...
kernel_entry( *context, ... )

Where *context is a pointer to a `struct ucontext', 
but I suspect its because the relevant ucontext_t
type wasnt available for some reasons. 

Question 1: 

Concerning the 'missing members' in ucontext_t, may I
suspect that conformant applications needs not to
alter things in uc_mcontext (machine context) ?? [1]

The docs are saying that:

"The ucontext_t type that ucp points to defines the
user context and includes the contents of the calling
thread's machine registers, the signal mask, and the
current execution stack."
 
Therefore this is almost okay but doesnt work on
freebsd as-is:

// save it to <machine/reg.h>
regs.foo = context->uc_mcontext.gregs[REG_FOO]

TIA
-erob

1.
http://www.opengroup.org/onlinepubs/009695399/functions/getcontext.html
 

=====
JabberID: incidah (at) njs (dot) netlab (dot) cz

-----BEGIN PGP SIGNATURE-----

iD8DBQBBvMMiwi4xwWEgKqERAsAAAJ0anaSvffwamXLuJnIwH5GRsTjM1wCdGHpa
BqtF2n/eBawNURrU1t/9FDA=
=tuy/
-----END PGP SIGNATURE-----

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050208011917.56324.qmail>