On Tue, Aug 03, 2004 at 10:43:22PM +0200, Philippe Gerum wrote:
> > > > > 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.
Not good. As this is pod code (so probably yours) here's a fix:
> > > > > return nkpod->svctable.faulthandler(fltinfo);
> > > > > }
Marc
--
#!/bin/sh
set - `type $0` 'tr "[a-zA-Z]" "[n-za-mN-ZA-M]"';while [ "$2" != "" ];do \
shift;done; echo 'frq -a -rc '`echo "$0"| $1 `'>$UBZR/.`rpub signature|'`\
echo $1|$1`'`;rpub "Jr ner fvtangher bs obet. Erfvfgnapr vf shgvyr!"'|$1|sh
Index: nucleus/pod.c
===================================================================
RCS file: /cvs/rtai/fusion/nucleus/pod.c,v
retrieving revision 1.24
diff -u -p -r1.24 pod.c
--- nucleus/pod.c 3 Aug 2004 19:18:56 -0000 1.24
+++ nucleus/pod.c 3 Aug 2004 20:59:35 -0000
@@ -2422,7 +2422,7 @@ void xnpod_check_context (int mask)
int xnpod_trap_fault (void *fltinfo)
{
- if (nkpod == NULL || xnpod_idle_p())
+ if (nkpod == NULL || (xnpod_idle_p() && !xnpod_interrupt_p()))
return 0;
return nkpod->svctable.faulthandler(fltinfo);