Re: [Xenomai-core] [rt shared irqs] ipipe-related changes (draft)

2005-12-26 Thread Jan Kiszka
Dmitry Adamushko wrote:
> Hi everybody,
> 
> the enclosed patches (the first version, hence it's still raw) are
> supposed to build the basis needed on the ipipe layer for adding
> support of real-time shared interrupts. As a side effect, the
> irq_trampoline() layer has been eliminated and the irq processing
> chain has become shorter.

Great!

> 
> Some points are more likely to be changed in the next iteration (e.g.
> __ipipe_irq_cookie() vs. changing the ipipe_virtualize_irq()
> interface).
> The struct rthal_realtime_irq::hits[per-IRQ] is missed so far.
> 
> Anyway, comments are very wellcome.
> 

Only one so far: please update your Xenomai base - or is your Internet
link really /that/ slow ATM? ;)

Merry Christmas,
Jan


signature.asc
Description: OpenPGP digital signature


Re: [Xenomai-core] [rt shared irqs] ipipe-related changes (draft)

2005-12-26 Thread Jan Kiszka
Dmitry Adamushko wrote:
> Hi everybody,
> 
> the enclosed patches (the first version, hence it's still raw) are
> supposed to build the basis needed on the ipipe layer for adding
> support of real-time shared interrupts. As a side effect, the
> irq_trampoline() layer has been eliminated and the irq processing
> chain has become shorter.

Great!

> 
> Some points are more likely to be changed in the next iteration (e.g.
> __ipipe_irq_cookie() vs. changing the ipipe_virtualize_irq()
> interface).
> The struct rthal_realtime_irq::hits[per-IRQ] is missed so far.
> 
> Anyway, comments are very wellcome.
> 

Only one so far: please update your Xenomai base - or is your Internet
link really /that/ slow ATM? ;)

Merry Christmas,
Jan


signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] [rt shared irqs] ipipe-related changes (draft)

2005-12-26 Thread Dmitry Adamushko
Hi everybody,

the enclosed patches (the first version, hence it's still raw) are
supposed to build the basis needed on the ipipe layer for adding
support of real-time shared interrupts. As a side effect, the
irq_trampoline() layer has been eliminated and the irq processing
chain has become shorter.

Some points are more likely to be changed in the next iteration (e.g.
__ipipe_irq_cookie() vs. changing the ipipe_virtualize_irq()
interface).
The struct rthal_realtime_irq::hits[per-IRQ] is missed so far.

Anyway, comments are very wellcome.


--
Best regards,
Dmitry Adamushko
diff -urp linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-core.c 
linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-core.c
--- linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-core.c   2005-12-22 
14:15:17.0 +0100
+++ linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-core.c   
2005-12-23 16:37:32.0 +0100
@@ -98,13 +98,14 @@ static void (*__ipipe_cpu_sync) (void);
 "pushl %%edx\n\t" \
 "pushl %%ecx\n\t" \
 "pushl %%ebx\n\t" \
+"pushl %2\n\t" \
  "pushl %%eax\n\t" \
  "call *%1\n\t" \
-"addl $4,%%esp\n\t" \
+"addl $8,%%esp\n\t" \
 "jmp ret_from_intr\n\t" \
 "1:\n" \
 : /* no output */ \
-: "a" (irq), "m" ((ipd)->irqs[irq].handler))
+: "a" (irq), "m" ((ipd)->irqs[irq].handler), "r" 
((ipd)->irqs[irq].cookie))
 
 static __inline__ unsigned long flnz(unsigned long word)
 {
@@ -125,7 +126,7 @@ int __ipipe_ack_system_irq(unsigned irq)
 
 /* Always called with hw interrupts off. */
 
-void __ipipe_do_critical_sync(unsigned irq)
+void __ipipe_do_critical_sync(unsigned irq, void *cookie)
 {
ipipe_declare_cpuid;
 
@@ -301,7 +302,7 @@ void fastcall __ipipe_sync_stage(unsigne
local_irq_disable_hw();
} else {
__clear_bit(IPIPE_SYNC_FLAG, &cpudata->status);
-   ipd->irqs[irq].handler(irq);
+   ipd->irqs[irq].handler(irq, 
ipd->irqs[irq].cookie);
__set_bit(IPIPE_SYNC_FLAG, &cpudata->status);
}
 
@@ -415,7 +416,7 @@ int fastcall __ipipe_send_ipi (unsigned 
 
 int ipipe_virtualize_irq(struct ipipe_domain *ipd,
 unsigned irq,
-void (*handler) (unsigned irq),
+ipipe_irq_handler_t handler,
 int (*acknowledge) (unsigned irq),
 unsigned modemask)
 {
diff -urp linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-root.c 
linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-root.c
--- linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-root.c   2005-12-22 
14:15:17.0 +0100
+++ linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-root.c   
2005-12-23 16:57:25.0 +0100
@@ -78,7 +78,7 @@ static int __ipipe_ack_common_irq(unsign
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-static void __ipipe_null_handler(unsigned irq)
+static void __ipipe_null_handler(unsigned irq, void *cookie)
 {
/* Nop. */
 }
@@ -124,19 +124,19 @@ void __init __ipipe_enable_pipeline(void
 
ipipe_virtualize_irq(ipipe_root_domain,
 LOCAL_TIMER_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_apic_timer_interrupt,
+(ipipe_irq_handler_t)&smp_apic_timer_interrupt,
 &__ipipe_ack_system_irq,
 IPIPE_STDROOT_MASK);
 
ipipe_virtualize_irq(ipipe_root_domain,
 SPURIOUS_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_spurious_interrupt,
+(ipipe_irq_handler_t)&smp_spurious_interrupt,
 &__ipipe_noack_irq,
 IPIPE_STDROOT_MASK);
 
ipipe_virtualize_irq(ipipe_root_domain,
 ERROR_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_error_interrupt,
+(ipipe_irq_handler_t)&smp_error_interrupt,
 &__ipipe_ack_system_irq,
 IPIPE_STDROOT_MASK);
 
@@ -167,7 +167,7 @@ void __init __ipipe_enable_pipeline(void
 #ifdef CONFIG_X86_MCE_P4THERMAL
ipipe_virtualize_irq(ipipe_root_domain,
 THERMAL_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_thermal_interrupt,
+(ipipe_irq_handler_t)&smp_thermal_interrupt,
 &__ipipe_ack_system_irq,
 

[Xenomai-core] [rt shared irqs] ipipe-related changes (draft)

2005-12-26 Thread Dmitry Adamushko
Hi everybody,

the enclosed patches (the first version, hence it's still raw) are
supposed to build the basis needed on the ipipe layer for adding
support of real-time shared interrupts. As a side effect, the
irq_trampoline() layer has been eliminated and the irq processing
chain has become shorter.

Some points are more likely to be changed in the next iteration (e.g.
__ipipe_irq_cookie() vs. changing the ipipe_virtualize_irq()
interface).
The struct rthal_realtime_irq::hits[per-IRQ] is missed so far.

Anyway, comments are very wellcome.


--
Best regards,
Dmitry Adamushko
diff -urp linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-core.c 
linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-core.c
--- linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-core.c   2005-12-22 
14:15:17.0 +0100
+++ linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-core.c   
2005-12-23 16:37:32.0 +0100
@@ -98,13 +98,14 @@ static void (*__ipipe_cpu_sync) (void);
 "pushl %%edx\n\t" \
 "pushl %%ecx\n\t" \
 "pushl %%ebx\n\t" \
+"pushl %2\n\t" \
  "pushl %%eax\n\t" \
  "call *%1\n\t" \
-"addl $4,%%esp\n\t" \
+"addl $8,%%esp\n\t" \
 "jmp ret_from_intr\n\t" \
 "1:\n" \
 : /* no output */ \
-: "a" (irq), "m" ((ipd)->irqs[irq].handler))
+: "a" (irq), "m" ((ipd)->irqs[irq].handler), "r" 
((ipd)->irqs[irq].cookie))
 
 static __inline__ unsigned long flnz(unsigned long word)
 {
@@ -125,7 +126,7 @@ int __ipipe_ack_system_irq(unsigned irq)
 
 /* Always called with hw interrupts off. */
 
-void __ipipe_do_critical_sync(unsigned irq)
+void __ipipe_do_critical_sync(unsigned irq, void *cookie)
 {
ipipe_declare_cpuid;
 
@@ -301,7 +302,7 @@ void fastcall __ipipe_sync_stage(unsigne
local_irq_disable_hw();
} else {
__clear_bit(IPIPE_SYNC_FLAG, &cpudata->status);
-   ipd->irqs[irq].handler(irq);
+   ipd->irqs[irq].handler(irq, 
ipd->irqs[irq].cookie);
__set_bit(IPIPE_SYNC_FLAG, &cpudata->status);
}
 
@@ -415,7 +416,7 @@ int fastcall __ipipe_send_ipi (unsigned 
 
 int ipipe_virtualize_irq(struct ipipe_domain *ipd,
 unsigned irq,
-void (*handler) (unsigned irq),
+ipipe_irq_handler_t handler,
 int (*acknowledge) (unsigned irq),
 unsigned modemask)
 {
diff -urp linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-root.c 
linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-root.c
--- linux-2.6.14.2-ipipe-1.0-10/arch/i386/kernel/ipipe-root.c   2005-12-22 
14:15:17.0 +0100
+++ linux-2.6.14.2-ipipe-1.0-10-ext/arch/i386/kernel/ipipe-root.c   
2005-12-23 16:57:25.0 +0100
@@ -78,7 +78,7 @@ static int __ipipe_ack_common_irq(unsign
 
 #ifdef CONFIG_X86_LOCAL_APIC
 
-static void __ipipe_null_handler(unsigned irq)
+static void __ipipe_null_handler(unsigned irq, void *cookie)
 {
/* Nop. */
 }
@@ -124,19 +124,19 @@ void __init __ipipe_enable_pipeline(void
 
ipipe_virtualize_irq(ipipe_root_domain,
 LOCAL_TIMER_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_apic_timer_interrupt,
+(ipipe_irq_handler_t)&smp_apic_timer_interrupt,
 &__ipipe_ack_system_irq,
 IPIPE_STDROOT_MASK);
 
ipipe_virtualize_irq(ipipe_root_domain,
 SPURIOUS_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_spurious_interrupt,
+(ipipe_irq_handler_t)&smp_spurious_interrupt,
 &__ipipe_noack_irq,
 IPIPE_STDROOT_MASK);
 
ipipe_virtualize_irq(ipipe_root_domain,
 ERROR_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_error_interrupt,
+(ipipe_irq_handler_t)&smp_error_interrupt,
 &__ipipe_ack_system_irq,
 IPIPE_STDROOT_MASK);
 
@@ -167,7 +167,7 @@ void __init __ipipe_enable_pipeline(void
 #ifdef CONFIG_X86_MCE_P4THERMAL
ipipe_virtualize_irq(ipipe_root_domain,
 THERMAL_APIC_VECTOR - FIRST_EXTERNAL_VECTOR,
-(void (*)(unsigned))&smp_thermal_interrupt,
+(ipipe_irq_handler_t)&smp_thermal_interrupt,
 &__ipipe_ack_system_irq,