All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Daniele Nicolodi <daniele@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Handling Linux Signals in primary domain context
Date: Wed, 02 Jun 2010 15:47:53 +0200	[thread overview]
Message-ID: <4C066109.9040902@domain.hid> (raw)
In-Reply-To: <4C06485B.3000500@domain.hid>

Daniele Nicolodi wrote:
> On 02/06/10 11:15, Philippe Gerum wrote:
> 
>> Actually, we could extend this logic and forge a stack frame to return
>> to the preempted application code via some userland trampoline code,
>> doing the switch:
>>
>> [watchdog trigger]
>> 	forge_return_frame(on =regs->sp, to =regs->pc);
>> 	regs->pc = __oops_I_did_it_again;
>>
>> __oops_I_did_it_again:
>> 	__xn_migrate(LINUX_DOMAIN);
>> 	ret (via forged frame)
>>
>> The thing is, that this brings in some arch-dep code to forge a stack
>> frame (like the kernel uses for signals), that should rather live in the
>> pipeline core.
> 
> Am I to naive thinking that this solution would let the user space
> choose what to do when the watchdog interrupts the current thread? In
> your example, it would be enough to assign to __ops_I_did_it_again a
> function pointer to the function that has to be executed.
> 
> Probably there will be hard constraint on what this function can do, but
> it would be a nice feature for debugging and for solving application
> specific issues.

You already have that with SIGDEBUG. You can register whatever signal
handler you want for the SIGDEBUG signal. The same goes for SIGSEGV. The
only issue we are talking about here is that the SIGDEBUG mechanism does
not work when a piece of code is blocked in an infinite loop without
calling any syscall. But that should be a pretty rare case.

-- 
					    Gilles.


  reply	other threads:[~2010-06-02 13:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01 13:50 [Xenomai-help] Handling Linux Signals in primary domain context Tschaeche IT-Services
2010-06-01 13:52 ` Gilles Chanteperdrix
2010-06-01 13:59 ` Gilles Chanteperdrix
2010-06-01 14:32 ` Philippe Gerum
2010-06-01 15:54   ` Tschaeche IT-Services
2010-06-01 16:52     ` Tschaeche IT-Services
2010-06-01 16:58     ` Jan Kiszka
2010-06-02  8:36       ` Gilles Chanteperdrix
2010-06-02  9:14         ` Jan Kiszka
2010-06-02  9:15         ` Philippe Gerum
2010-06-02  9:20           ` Jan Kiszka
2010-06-02  9:28             ` Philippe Gerum
2010-06-02  9:37               ` Gilles Chanteperdrix
2010-06-02 10:06                 ` Philippe Gerum
2010-06-02 10:19                   ` Gilles Chanteperdrix
2010-06-02 10:42                     ` Philippe Gerum
2010-06-02 10:51                       ` Gilles Chanteperdrix
2010-06-02 10:29                   ` Gilles Chanteperdrix
2010-06-02  9:21           ` Gilles Chanteperdrix
2010-06-02  9:23             ` Jan Kiszka
2010-06-02 10:19               ` Tschaeche IT-Services
2010-06-02 10:48                 ` Gilles Chanteperdrix
2010-06-02  9:34             ` Philippe Gerum
2010-06-02  9:43               ` Gilles Chanteperdrix
2010-06-02 12:02           ` Daniele Nicolodi
2010-06-02 13:47             ` Gilles Chanteperdrix [this message]
2010-06-02 15:14             ` Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C066109.9040902@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=daniele@domain.hid \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.