From: Jan Kiszka <jan.kiszka@domain.hid>
To: Keinen Namen <GSM909@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] isr
Date: Mon, 10 Jul 2006 10:58:07 +0200 [thread overview]
Message-ID: <44B2169F.7070205@domain.hid> (raw)
In-Reply-To: <20060710084549.4390@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 3408 bytes --]
Keinen Namen wrote:
> Sorry here is my source code.
>
> My Problem ist how can I call the ISR.
Well, the basic idea behind IRQs is that the hardware "call" them for
you, isn't it? :)
See /proc/xenomai/irq if something is happening on your IRQ line.
>
> Regards Memory
>
>
> #include <linux/kernel.h>
> #include <linux/init.h>
> #include <linux/module.h>
> #include <linux/fs.h>
>
> #include <native/intr.h>
>
> MODULE_DESCRIPTION("My kernel module");
> MODULE_AUTHOR("Nobody");
> MODULE_DESCRIPTION("Dei Mudda");
> MODULE_LICENSE("my own");
>
>
> RT_INTR my_rt_intr;
>
> int helloworld_isr(rt_intr_t *intr){
> printk( KERN_ALERT "IRQ\n");
> return IRQ_HANDLED;
> }
>
> struct file_operations helloworld_fops = {
> .owner = THIS_MODULE,
> .llseek = NULL,
> .read = NULL,
> .write = NULL,
> .readdir = NULL,
> .poll = NULL,
> .ioctl = NULL,
> .mmap = NULL,
> .open = NULL,
> .flush = NULL,
> .release = NULL,
> .fsync = NULL,
> .fasync = NULL,
> .lock = NULL,
> .readv = NULL,
> .writev = NULL,
> };
What's this for? Keep in mind that mixing Linux file operations with
Xenomai is almost always not cleanly working. That's also what RTDM is
for: providing a stripped down file operations interface to real-time users.
>
>
> static int helloworld_init_module(void) {
> int x;
> printk( KERN_ALERT "Module helloworld init startet Version 0.1\n" );
> x = rt_intr_create(&my_rt_intr,"ein Name",SIU_INT_TIMER2,&helloworld_isr,NULL,0);
Are you sure your hardware is already set up to fire on SIU_INT_TIMER2?
If you are looking for some working examples, check the new irqbench
test over RS232 or the timer-related part of Hannes' example driver on
http://www.captain.at/xenomai-real-time-driver-example-driver-source-code.php
What's your goal, BTW?
> if(!x){
> printk( KERN_ALERT "Interrupt erfolgreich erstellt\n");
> if(!(rt_intr_enable(&my_rt_intr))){
> printk( KERN_ALERT "Interrupt erfolgreich aktiviert\n");
> }
> }else{
> printk( KERN_ALERT "Interrupt Erstellung fehlgeschlagen %i\n",x);
> }
> }
>
> static void helloworld_exit_module(void) {
>
> if(!(rt_intr_disable(&my_rt_intr))){
> printk( KERN_ALERT "Interrupt Cleared !\n" );
> if(!(rt_intr_delete(&my_rt_intr))){
> printk(KERN_ALERT "Interrupt deleted\n" );
> }
> }
>
> printk( KERN_ALERT "Module helloworld exit\n" );
> }
>
> module_init(helloworld_init_module);
> module_exit(helloworld_exit_module);
>
> -------- Original-Nachricht --------
> Datum: Mon, 10 Jul 2006 10:30:16 +0200
> Von: Jan Kiszka <jan.kiszka@domain.hid>
> An: Keinen Namen <GSM909@domain.hid>
> Betreff: Re: [Xenomai-help] isr
>
>> Keinen Namen wrote:
>>> Hi I useing Xenomai 2.1 and the native skin
>>>
>>> I want create a intr in kernel space with rt_intr_create, the 4th
>> argument is the pointer is the ISR.
>>> My Question is which form does the ISR must have
>>>
>>> rt_isr_t myisr ( ??? )
>>> {
>>> ...
>>> }
>>>
>> int my_isr(rt_intr_t *intr);
>>
>> That's indeed undocumented, you had to browse the code for this
>> information. :-/
>>
>> [Note: unless you are writing some specialised or experimental code,
>> developing drivers over the RTDM skin is recommended now. This aims at
>> unifying the device interfaces for all skins.]
>>
>> Jan
>>
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]
next prev parent reply other threads:[~2006-07-10 8:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-10 8:07 [Xenomai-help] isr Keinen Namen
2006-07-10 8:30 ` Jan Kiszka
2006-07-10 8:45 ` Keinen Namen
2006-07-10 8:58 ` Jan Kiszka [this message]
2006-07-10 11:40 ` [Xenomai-help] ISR Again Keinen Namen
2006-07-10 14:00 ` [Xenomai-help] " Bernhard Walle
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=44B2169F.7070205@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=GSM909@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.