On Tue, 2004-08-03 at 21:42, Marc Kleine-Budde wrote:
> On Tue, Aug 03, 2004 at 08:52:06PM +0200, Philippe Gerum wrote:
> > > > > > .faulthandler = if a trap is rised by the cpu, and a xnthread is
> > > > > > active
> > > > > Yes, but a thread is not necessarily active at that moment. The
> > > > > handler
> > > > > should take care of identifying the faulting context.
>
> > > > Hmm - After winding though about 4-5 layers[1]....this function calls
> > > > the svctable.faulthandler, only if a xnthread is active.
>
> > > > int xnpod_trap_fault (void *fltinfo)
> > > > {
> > > > if (nkpod == NULL || xnpod_idle_p())
> > > > return 0;
>
> > If an IRQ preempts a real-time thread then triggers a fault,
> > xnpod_idle_p() returns false in this handler, since the current thread
> > before preemption was _not_ the root/idle one, but a RT one. Hence the
> > importance of using xnpod_interrupt_p() too.
>
> What happens if a RT-IRQ preempts the linux domaini then triggers a
> fault? Then the root-thread is active?
> And xnpod_idle_p() returns true.
>
>From the xnpod_root_p() / xnpod_idle() predicates, yes.
> If xnpod_idle_p() returns true, means that the svctable.faulthandler
> is not called. Am I right?
>
Yes. And that's a shortcoming; i.e. testing for !xnpod_interrupt_p() &&
xnpod_idle_p() would be more appropriate here.
> > > > return nkpod->svctable.faulthandler(fltinfo);
> > > > }
>
> Marc
--
Philippe.