Gilles Chanteperdrix wrote:
> Ok, found the bug (actually, Philippe did), as almost expected, the way
> it is related to the latency program period is not really obvious. The
> bug is that in the macro "irq_handler" in entry-armv.S, the return value
> (in r0) of __ipipe_grab_irq is overriden by the subsequent call to
> get_irqnr_and_base.
> 

Here comes a patch. Note that it will only work correctly with
CONFIG_PREEMPT disabled for now.

-- 
                                                 Gilles Chanteperdrix
--- arch/arm/kernel/entry-armv.S~	2007-02-26 11:55:18.000000000 +0100
+++ arch/arm/kernel/entry-armv.S	2007-02-26 12:07:45.000000000 +0100
@@ -29,12 +29,16 @@
  * Interrupt handling.  Preserves r7, r8, r9
  */
 	.macro	irq_handler
-1:	get_irqnr_and_base r0, r6, r5, lr
+#ifdef CONFIG_IPIPE
+	mov r0, #2
+#endif
+1:	get_irqnr_and_base r4, r6, r5, lr
 	movne	r1, sp
 	@
 	@ routine called with r0 = irq number, r1 = struct pt_regs *
 	@
 	adrne	lr, 1b
+	movne   r0, r4
 #ifdef CONFIG_IPIPE
 	bne	__ipipe_grab_irq
 #else
@@ -48,19 +52,23 @@
 	 * this macro assumes that irqstat (r6) and base (r5) are
 	 * preserved from get_irqnr_and_base above
 	 */
-	test_for_ipi r0, r6, r5, lr
+	test_for_ipi r4, r6, r5, lr
 	movne	r0, sp
 	adrne	lr, 1b
 	bne	do_IPI
 
 #ifdef CONFIG_LOCAL_TIMERS
-	test_for_ltirq r0, r6, r5, lr
+	test_for_ltirq r4, r6, r5, lr
 	movne	r0, sp
 	adrne	lr, 1b
 	bne	do_local_timer
 #endif
 #endif
-
+#ifdef CONFIG_IPIPE
+	cmp	r0, #2
+	moveq	r0, sp
+	bleq	__ipipe_check_root
+#endif	
 	.endm
 
 /*
_______________________________________________
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core

Reply via email to