Loren Frank wrote:
> Hi all. I am new to rtlinux and I have a problem I need help with.
>
> Briefly, I need to take the bttv driver for a framegrabber card and modify it
> so that, every time an interrupt is generated, the interrupt service routine is
> serviced by the real time kernel and a timestamp is read from another card. I
> have the real time driver for the other card working, but when I tried to
> convert the interrupt service routine from the bttv-driver.c source, I just
> ended up hanging the machine. I had hoped that a simple modification where I
> changed the request_irq to a rtl_request_irq and changed the interrupt service
> routine would do it....
>
> Can anyone point me toward a solution?
>
> thanks,
>
> Loren Frank
>
> Here is the (modified) driver code. I've modified the module init and clean
> functions as well as the intr_handler routine.
>
> /*
> bttv - Bt848 frame grabber driver
>
> Copyright (C) 1996,97,98 Ralph Metzler ([EMAIL PROTECTED])
> & Marcus Metzler ([EMAIL PROTECTED])
> (c) 1999,2000 Gerd Knorr <[EMAIL PROTECTED]>
>
> This program is free software; you can redistribute it and/or modify
> it under the terms of the GNU General Public License as published by
> the Free Software Foundation; either version 2 of the License, or
> (at your option) any later version.
>
> This program is distributed in the hope that it will be useful,
> but WITHOUT ANY WARRANTY; without even the implied warranty of
> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> GNU General Public License for more details.
>
> You should have received a copy of the GNU General Public License
> along with this program; if not, write to the Free Software
> Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> */
>
> #include <linux/version.h>
> #include <linux/module.h>
> #include <linux/delay.h>
> #include <linux/errno.h>
> #include <linux/fs.h>
> #include <linux/kernel.h>
> #include <linux/major.h>
> #include <linux/slab.h>
> #include <linux/mm.h>
> #include <linux/poll.h>
> #include <linux/pci.h>
> #include <linux/signal.h>
> #include <asm/io.h>
> #include <linux/ioport.h>
> #include <asm/pgtable.h>
> #include <asm/page.h>
> #include <linux/sched.h>
> #include <asm/segment.h>
> #include <linux/types.h>
> #include <linux/wrapper.h>
> #include <linux/interrupt.h>
> #include <linux/kmod.h>
> #include <linux/vmalloc.h>
> #include <linux/init.h>
>
> /* includes for RT-Linux version */
> #include <rtl.h>
> #include <rtl_core.h>
> #include <rtl_sched.h>
> #include <rtl_fifo.h>
> #include "../../spike_rtl.h"
>
>
> #include "bttvp.h"
> #include "tuner.h"
>
> #define DEBUG(x) /* Debug driver */
> #define MIN(a,b) (((a)>(b))?(b):(a))
> #define MAX(a,b) (((a)>(b))?(a):(b))
well, I do not have the golden ansver, but I might have I reason way
this is wrong.
When you call funktions from the linux kernel you break the assumtion
-> Runnning task can not be preemt.
But when you call Linux kernel funktion from a RTLinux thread this
breakes. I think
this will happen when you call funktions from
> #include <linux/sched.h>
this I would not use in a RTLinux thread. The rusult must bee that the
thread use both schedulars. That must fail.
> #include <linux/interrupt.h>
I think this header is just defines but...
there could also be a lot of other problems in some other includes so
this is just a hint.
I am sorry, but I think you have to go thrugh the code change it quit
a bit.
PS.
I have also worked with this. I would bee wery interrested in the
result. I might start working on this issue to.
It would be a big step to include picture analysis in RTLinux.
Anders Gnistrup
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/