Hello,

I now found some time to test the latest release of RTnet with RTAI 3.0
(kilauea) on MPC 8xx. I realized the following problems:

o the RTnet configure is unable to detect RTAI if it has been installed
  with "make DESTDIR=/opt/eldk/ppc_8xx install". The "prefix" then
  points to a path valid on the target system e.g. "/usr/realtime".

o rtos_irq_enable/disable is OK to enable and disable interrupts but not
  to re-enable (unmask) the interrupt at the end of the ISR. On PowerPC
  I use "rt_unmask"irq()" for this purpose. Well, this name is a bit
  unlucky as it's used on i386 for a somehow different purpose.
  Nevertheless, if I look how Linux re-enables the interrupt at the end
  of the ISR I find (in 2.4.23):

    $ cat arch/ppc/kernel/irq.c
    ...
        /*
         * The ->end() handler has to deal with interrupts which got
         * disabled while the handler was running.
         */
        if (desc->handler) {
                if (desc->handler->end)
                        desc->handler->end(irq);
                else if (desc->handler->enable)
                        desc->handler->enable(irq);
        }

    $ cat arch/i386/kernel/irq.c
    ...
        /*
         * The ->end() handler has to deal with interrupts which got
         * disabled while the handler was running.
         */
        desc->handler->end(irq);

   Therefore rt_end_irq() might be a more appropriate name. Anyhow, I
   fixed it simply by adding the macro definition rtos_irq_unmask().

o some (one) minor compilation issues.

The patch to get RTnet working on MPC 8xx is attached.

Thanks a lot.

Wolfgang.
+ diff -u rtnet/driver/mpc8260_fcc_enet-rt.c.ORIG rtnet/driver/mpc8260_fcc_enet-rt.c
--- rtnet/driver/mpc8260_fcc_enet-rt.c.ORIG     Fri Jan 16 14:20:25 2004
+++ rtnet/driver/mpc8260_fcc_enet-rt.c  Thu Jan 29 16:23:59 2004
@@ -696,7 +696,7 @@
 
        if (packets > 0)
                rt_mark_stack_mgr(rtdev);
-       rtos_irq_enable(irq);
+       rtos_irq_unmask(irq);
        return;
 }
 
+ diff -u rtnet/driver/mpc8xx_enet-rt.c.ORIG rtnet/driver/mpc8xx_enet-rt.c
--- rtnet/driver/mpc8xx_enet-rt.c.ORIG  Fri Jan 16 14:20:25 2004
+++ rtnet/driver/mpc8xx_enet-rt.c       Thu Jan 29 16:23:23 2004
@@ -465,7 +465,7 @@
 
        if (packets > 0)
                rt_mark_stack_mgr(rtdev);
-       rtos_irq_enable(irq);
+       rtos_irq_unmask(irq);
        return;
 }
 
+ diff -u rtnet/driver/mpc8xx_fec-rt.c.ORIG rtnet/driver/mpc8xx_fec-rt.c
--- rtnet/driver/mpc8xx_fec-rt.c.ORIG   Fri Jan 16 14:20:25 2004
+++ rtnet/driver/mpc8xx_fec-rt.c        Thu Jan 29 16:25:40 2004
@@ -479,11 +479,12 @@
        int packets = 0;
        volatile fec_t  *fecp;
        uint    int_events;
-       fecp = (volatile fec_t*)rtdev->base_addr;
        rtos_time_t time_stamp;
 
        rtos_get_time(&time_stamp);
 
+       fecp = (volatile fec_t*)rtdev->base_addr;
+
        /* Get the interrupt events that caused us to be here.
        */
        while ((int_events = fecp->fec_ievent) != 0) {
@@ -520,7 +521,7 @@
 
        if (packets > 0)
                rt_mark_stack_mgr(rtdev);
-       rtos_irq_enable(irq);
+       rtos_irq_unmask(irq);
 }
 
 
+ diff -u rtnet/include/rtnet_sys_rtai.h.ORIG rtnet/include/rtnet_sys_rtai.h
--- rtnet/include/rtnet_sys_rtai.h.ORIG Thu Jan 29 14:17:35 2004
+++ rtnet/include/rtnet_sys_rtai.h      Thu Jan 29 16:22:55 2004
@@ -287,6 +287,7 @@
 
 #define rtos_irq_enable(irq)        rt_enable_irq(irq)
 #define rtos_irq_disable(irq)       rt_disable_irq(irq)
+#define rtos_irq_unmask(irq)        rt_unmask_irq(irq)
 
 
 

Reply via email to