niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
(forw) Prototype for libc-provided signal trampolines
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
Author Message
Alfred Perlstein
*nix forums addict


Joined: 19 Mar 2002
Posts: 67

PostPosted: Sat Jun 22, 2002 9:08 pm    Post subject: (forw) Prototype for libc-provided signal trampolines Reply with quote

In case you haven't seen this, it was recently posted on the NetBSD
lists about how they seem to return from the scheduler activation
upcall...

----- Forwarded message from Jason R Thorpe <thorpej@wasabisystems.com> -----

From: Jason R Thorpe <thorpej@wasabisystems.com>
To: tech-kern@netbsd.org
Subject: Prototype for libc-provided signal trampolines
Date: Sat, 22 Jun 2002 15:10:14 -0700
Message-ID: <20020622151014.I6276@dr-evil.shagadelic.org>
Mail-Followup-To: Jason R Thorpe <thorpej@wasabisystems.com>,
tech-kern@netbsd.org
User-Agent: Mutt/1.2.5i
Organization: Wasabi Systems, Inc.
Sender: tech-kern-owner@netbsd.org

The following is a prototype implementation of the userland signal
trampoline I mentioned in my "nathanw_sa TODO list". This strategy
for signal trampolines can (and, I think, should) be used for the
SA upcall trampoline, as well.

Here are the rules of the new interface:

* Arch-dependent code in libc provides sigaction(2) entry point
(we get to keep the current entry point, __sigaction14()) and
the signal trampolines. The trampolines are arch-dependent.

* Signal trampolines are versioned, so that if arch-dependent
code in the kernel or in libc needs to change it at some point,
it can be handled without interfering with other architectures.

* Signal trampolines have a well-defined naming scheme:

__sigtramp_<flavor>_<version>

where:

<flavor> The flavor of the handler, the
traditional sigcontext type or
POSIX siginfo type.

<version> The version of the trampoline.

So, for example, all platforms right now would provide
a trampoline named "__sigtramp_sigcontext_1"

The reason for this naming scheme: Debuggers, like gdb,
need this info:

* They need to know if a PC is in a signal trampoline,
and having access to a symbol name REALLY helps in
this regard.

* They need to know if they have a sigcontext (for
sigcontext flavor) or a ucontext_t (for siginfo
flavor), so they can unwind the call graph through
the signal handler. Having this indicated by the
trampoline's name REALLY helps in this regard.

* They need the version info to know what format the
sigcontext/ucontext_t is in.

* The signal trampoline should be invoked with the arguments
already set up for the handler. For example, in the case of
Alpha, the 3 handler args should already been in registers
a0, a1, and a2. For the VAX, the args should already be pushed
onto the stack.

* The pointer to the signal handler should simply be passed in a
"4th argument" slot, for simplicity. This more or less mirrors
what the SA upcall trampoline does on the nathanw_sa branch. For
platforms which provide a special register for this (e.g. the "pv"
register on the Alpha), that register should be used instead.

Now, it so happens that the changes required to do this are quite small.
Attached are the changes for the Alpha port (I've left out changes to
the compat modules, which are simple adjustments to the sigaction1() call),
and all of the generated files.

I'd like to get feedback on this ASAP. It's a simple change we can make
to the mainline before bringing down the SA branch which will make dealing
with forward compatibility much easier.

--
-- Jason R. Thorpe <thorpej@wasabisystems.com>

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [1 Post] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 6:06 am | All times are GMT
navigation Forum index » *nix » BSD » FreeBSD » mail-lists » Architecture
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Bug#379054: ITP: lisaac -- Lisaac is the first object-ori... picca frederic devel 0 Thu Jul 20, 2006 9:30 pm
No new posts Function Prototype - different argument names cybernerdsx2 C 3 Tue Jul 18, 2006 4:50 am
No new posts panic/killed by signal 6/bad state 2/softfail? Larry Vaden Postfix 6 Fri Jul 14, 2006 12:20 pm
No new posts Where are screen saver functionality provided Tong Sun Debian 2 Mon Jul 10, 2006 11:00 pm
No new posts Simple C++ function prototype extraction tool? Robbie Hatley C++ 6 Wed Jun 28, 2006 2:26 am

Loans | Mortgages | Loans | Unsecured Credit Cards | Magazine Subscriptions
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1004s ][ Queries: 16 (0.0297s) ][ GZIP on - Debug on ]