yaco2k wrote:
> --- In Jim Jackson <> wrote:
>> This looks like a userspace program. AFAIK you can only do interupt
>> handling in the Kernel, using a suitable kernel driver.
>>
>> Why don't you just poll and forget interrupts?
>
> thanx Jim for your replay..
>
> polling wont be efficient for my mobile application especialy in terms
> of power consumption so i am trying to make the interrupt thing work
> and i've been searching for more than two weeks but resourses about
> interrupts in TS7200 are raely small.
>
> I think i opened the registers to the user space by setting the
> protection registers of the VIC to 0x0 and I used :
>
> int fd = open("/dev/mem", O_RDWR|O_SYNC);
> vic = (unsigned int *)mmap(0, getpagesize(),
> PROT_READ|PROT_WRITE, MAP_SHARED, fd, vic_baddr);
>
> in my code.
>
> even though I still agree with you that user space could be the
> problem, so plz if u have any toturials or sample code of a kernal
> driver plz send it to me and i'll try to change this code into a
> kernal driver.
>
> Thanx...
>
>
>
Doing interrupt handling in userland isn't possible at least in linux.
Even by setting the right registers, like you did at your program, won't
help you. Imagine creating an interrupt handler in a program which later
gets swapped to the disk!
The kernel driver solution will help you handle interrupts. There is an
online version of the third edition of "Linux Device Drivers" at
http://lwn.net/Kernel/LDD3/ which covers kernel version 2.6 and the
second edition at http://lwn.net/Kernel/LDD2/ which covers kernel
version 2.4. There is a whole chapter about interrupt handling at both
editions and how you can write drivers like the one you want.
But, since you have a very specific application you could try another os
like ecos. I believe it will be much easier to create an interrupt
handler with ecos than to create a linux kernel driver. It isn't
difficult to learn it and it is very good for embedded applications. Of
course you won't have the option to run other things there like an
apache server if you want to serve web content!
Fotis
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|