[Xenomai-git] Jan Kiszka : nucleus: Improve shadow epilogue documentation

2011-06-21 Thread GIT version control
Module: xenomai-head
Branch: master
Commit: 69f72ec502879b0ddfac7e2c4b0a0699e5fdcfc4
URL:
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=69f72ec502879b0ddfac7e2c4b0a0699e5fdcfc4

Author: Jan Kiszka 
Date:   Mon Jun 20 23:09:07 2011 +0200

nucleus: Improve shadow epilogue documentation

Leave a XENO_BUGON behind to underline that I-pipe has to ensure
interrupts were disabled on start of switch_to which ends in the
epilogue.

Reindent to whole block while at it.

Signed-off-by: Jan Kiszka 

---

 ksrc/nucleus/pod.c |   30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 9f75092..2ca83ff 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -2331,22 +2331,22 @@ reschedule:
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
   shadow_epilogue:
-   {
-   /* Shadow on entry and root without shadow extension on exit?
-  Mmmm... This must be the user-space mate of a deleted 
real-time
-  shadow we've just rescheduled in the Linux domain to have it
-  exit properly.  Reap it now. */
-   if (xnshadow_thrptd(current) == NULL) {
-   splnone();
-   xnshadow_exit();
-   }
-
-   /* Interrupts are disabled here, but it is what
-  callers expect, specifically the reschedule of an
-  IRQ handler that hit before we call xnpod_schedule in
-  xnpod_suspend_thread when relaxing a thread. */
-   return;
+   /* Shadow on entry and root without shadow extension on exit?
+  Mmmm... This must be the user-space mate of a deleted real-time
+  shadow we've just rescheduled in the Linux domain to have it
+  exit properly.  Reap it now. */
+   if (xnshadow_thrptd(current) == NULL) {
+   splnone();
+   xnshadow_exit();
}
+
+   /* Interrupts must be disabled here (has to be done on entry of the
+  Linux [__]switch_to function), but it is what callers expect,
+  specifically the reschedule of an IRQ handler that hit before we
+  call xnpod_schedule in xnpod_suspend_thread when relaxing a
+  thread. */
+   XENO_BUGON(NUCLEUS, !irqs_disabled_hw());
+   return;
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
 }
 EXPORT_SYMBOL_GPL(__xnpod_schedule);


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git


[Xenomai-git] Jan Kiszka : nucleus: Improve shadow epilogue documentation

2011-06-20 Thread GIT version control
Module: xenomai-jki
Branch: for-upstream
Commit: 69f72ec502879b0ddfac7e2c4b0a0699e5fdcfc4
URL:
http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=69f72ec502879b0ddfac7e2c4b0a0699e5fdcfc4

Author: Jan Kiszka 
Date:   Mon Jun 20 23:09:07 2011 +0200

nucleus: Improve shadow epilogue documentation

Leave a XENO_BUGON behind to underline that I-pipe has to ensure
interrupts were disabled on start of switch_to which ends in the
epilogue.

Reindent to whole block while at it.

Signed-off-by: Jan Kiszka 

---

 ksrc/nucleus/pod.c |   30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/ksrc/nucleus/pod.c b/ksrc/nucleus/pod.c
index 9f75092..2ca83ff 100644
--- a/ksrc/nucleus/pod.c
+++ b/ksrc/nucleus/pod.c
@@ -2331,22 +2331,22 @@ reschedule:
 
 #ifdef CONFIG_XENO_OPT_PERVASIVE
   shadow_epilogue:
-   {
-   /* Shadow on entry and root without shadow extension on exit?
-  Mmmm... This must be the user-space mate of a deleted 
real-time
-  shadow we've just rescheduled in the Linux domain to have it
-  exit properly.  Reap it now. */
-   if (xnshadow_thrptd(current) == NULL) {
-   splnone();
-   xnshadow_exit();
-   }
-
-   /* Interrupts are disabled here, but it is what
-  callers expect, specifically the reschedule of an
-  IRQ handler that hit before we call xnpod_schedule in
-  xnpod_suspend_thread when relaxing a thread. */
-   return;
+   /* Shadow on entry and root without shadow extension on exit?
+  Mmmm... This must be the user-space mate of a deleted real-time
+  shadow we've just rescheduled in the Linux domain to have it
+  exit properly.  Reap it now. */
+   if (xnshadow_thrptd(current) == NULL) {
+   splnone();
+   xnshadow_exit();
}
+
+   /* Interrupts must be disabled here (has to be done on entry of the
+  Linux [__]switch_to function), but it is what callers expect,
+  specifically the reschedule of an IRQ handler that hit before we
+  call xnpod_schedule in xnpod_suspend_thread when relaxing a
+  thread. */
+   XENO_BUGON(NUCLEUS, !irqs_disabled_hw());
+   return;
 #endif /* CONFIG_XENO_OPT_PERVASIVE */
 }
 EXPORT_SYMBOL_GPL(__xnpod_schedule);


___
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git