Change malloc.h to slab.h. Minor fixes for RTAI on PPC.
authorDavid Schleef <ds@schleef.org>
Sat, 1 Dec 2001 04:45:54 +0000 (04:45 +0000)
committerDavid Schleef <ds@schleef.org>
Sat, 1 Dec 2001 04:45:54 +0000 (04:45 +0000)
comedi/comedi_fops.c
comedi/drivers.c
comedi/kvmem.h
comedi/rt.c

index 7773d9f1fbaaf0ceff2322c52fac7b48f6ad490e..93f9323284f6aa0a5e817aa80e973f80f5c287e0 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/kmod.h>
 #include <linux/poll.h>
 
index 50dc6b71707205677b77ad7ed8170d53bef45ecc..f98a07d1e42dd29735a7a2dc14bb68a537ce872a 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/comedidev.h>
 
 #include <asm/io.h>
index 9b1960a7c8c038e54d751406ea270d0525a61922..fdcb19e0b9f040d9575ca643d02e6ad5d725b07a 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef _KVMEM_H
 #define _KVMEM_H
 #include <linux/version.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/vmalloc.h>
 #include <linux/wrapper.h>
 #include <asm/pgtable.h>
index f382a54a97506c8f5819f1821060d24be1229a22..4ca63814da0aafcd77b44d2560d340ffdde9e8ae 100644 (file)
 #include <linux/delay.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
 #include <linux/irq.h>
 #include <asm/io.h>
 
 #include "rt_pend_tq/rt_pend_tq.h"
 
 #ifdef CONFIG_COMEDI_RTAI
-#include <rtai/rtai.h>
+#include <rtai.h>
 
 #define RT_protect()   hard_cli()
 #define RT_unprotect() hard_sti()
@@ -146,12 +146,14 @@ void comedi_switch_to_rt(comedi_device *dev)
        struct comedi_irq_struct *it=comedi_irqs[dev->irq];
 
        // this prevents crashes with comedi_rt_timer
-       if(it == NULL)
+       if(it == NULL){
+               printk("BUG: comedi_switch_to_rt() called with bogus interrupt %d\n",dev->irq);
                return;
+       }
 
        // rt interrupts and shared interrupts don't mix
        if(it->flags & SA_SHIRQ){
-               rt_printk("comedi: cannot switch shared interrupt to real time priority\n");
+               printk("comedi: cannot switch shared interrupt to real time priority\n");
                return;
        }
 
@@ -204,6 +206,9 @@ void comedi_rt_pend_wakeup(wait_queue_head_t *q)
 /* RTAI section */
 #ifdef CONFIG_COMEDI_RTAI
 
+#ifdef CONFIG_PPC
+#define HAVE_RT_REQUEST_IRQ_WITH_ARG
+#endif
 #ifndef HAVE_RT_REQUEST_IRQ_WITH_ARG
 #define DECLARE_VOID_IRQ(irq) \
 static void handle_void_irq_ ## irq (void){ handle_void_irq(irq);}
@@ -286,8 +291,14 @@ static int rt_release_irq(struct comedi_irq_struct *it)
 
 static int rt_get_irq(struct comedi_irq_struct *it)
 {
-       rt_request_global_irq_arg(it->irq,it->handler,it->flags,
+       int ret;
+
+       ret = rt_request_global_irq_arg(it->irq,it->handler,it->flags,
                        it->device,it->dev_id);
+       if(ret<0){
+               rt_printk("rt_request_global_irq_arg() returned %d\n",ret);
+               return ret;
+       }
        rt_startup_irq(it->irq);
        
        return 0;