Hi,

long pending in my tree, I finally decided to role this one out as it is
quite lone-standing:

This patch avoids to additionally switch off the local IRQs in
rthal_timer_program_shot for the PIPELINE_HEAD case - the caller is
expected to hold the nucleus lock with IRQs off anyway. Applies to i386
and ia64.

Jan
Index: include/asm-i386/hal.h
===================================================================
--- include/asm-i386/hal.h	(Revision 1135)
+++ include/asm-i386/hal.h	(Arbeitskopie)
@@ -177,9 +177,13 @@ rthal_time_t rthal_get_8254_tsc(void);
 
 static inline void rthal_timer_program_shot (unsigned long delay)
 {
+/* With head-optimization, callers are expected to have switched off
+   hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     unsigned long flags;
 
     rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 #ifdef CONFIG_X86_LOCAL_APIC
     if (!delay) {
         /* Kick the timer interrupt immediately. */
@@ -201,7 +205,9 @@ static inline void rthal_timer_program_s
 	outb(delay >> 8,0x40);
     }
 #endif /* CONFIG_X86_LOCAL_APIC */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 }
 
 static const char *const rthal_fault_labels[] = {
Index: include/asm-ia64/hal.h
===================================================================
--- include/asm-ia64/hal.h	(Revision 1135)
+++ include/asm-ia64/hal.h	(Arbeitskopie)
@@ -65,11 +65,18 @@ static inline unsigned long long rthal_r
 
 static inline void rthal_timer_program_shot (unsigned long delay)
 {
+/* With head-optimization, callers are expected to have switched off
+   hard-IRQs already -- no need for additional protection in this case. */
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     unsigned long flags;
-    if (!delay) { delay = 10; }
+
     rthal_local_irq_save_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
+    if (!delay) { delay = 10; }
     ia64_set_itm(ia64_get_itc() + delay);
+#ifndef CONFIG_XENO_OPT_PIPELINE_HEAD
     rthal_local_irq_restore_hw(flags);
+#endif /* CONFIG_XENO_OPT_PIPELINE_HEAD */
 }
 
     /* Private interface -- Internal use only */

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to