* [Xenomai-help] isr
@ 2006-07-10 8:07 Keinen Namen
2006-07-10 8:30 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Keinen Namen @ 2006-07-10 8:07 UTC (permalink / raw)
To: xenomai
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 ( ??? )
{
...
}
Regards
Memory
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai-help] isr 2006-07-10 8:07 [Xenomai-help] isr Keinen Namen @ 2006-07-10 8:30 ` Jan Kiszka 2006-07-10 8:45 ` Keinen Namen 0 siblings, 1 reply; 6+ messages in thread From: Jan Kiszka @ 2006-07-10 8:30 UTC (permalink / raw) To: Keinen Namen; +Cc: xenomai [-- Attachment #1: Type: text/plain, Size: 603 bytes --] 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 --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Re: [Xenomai-help] isr 2006-07-10 8:30 ` Jan Kiszka @ 2006-07-10 8:45 ` Keinen Namen 2006-07-10 8:58 ` Jan Kiszka 0 siblings, 1 reply; 6+ messages in thread From: Keinen Namen @ 2006-07-10 8:45 UTC (permalink / raw) To: Jan Kiszka; +Cc: xenomai Sorry here is my source code. My Problem ist how can I call the ISR. 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, }; 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); 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 > -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] isr 2006-07-10 8:45 ` Keinen Namen @ 2006-07-10 8:58 ` Jan Kiszka 2006-07-10 11:40 ` [Xenomai-help] ISR Again Keinen Namen 0 siblings, 1 reply; 6+ messages in thread From: Jan Kiszka @ 2006-07-10 8:58 UTC (permalink / raw) To: Keinen Namen; +Cc: xenomai [-- 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 --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Xenomai-help] ISR Again 2006-07-10 8:58 ` Jan Kiszka @ 2006-07-10 11:40 ` Keinen Namen 2006-07-10 14:00 ` [Xenomai-help] " Bernhard Walle 0 siblings, 1 reply; 6+ messages in thread From: Keinen Namen @ 2006-07-10 11:40 UTC (permalink / raw) To: xenomai hi Again witch from have a RT_ISR? I simply want a Programm that run helloworld_isr when Interrupt 13 is fired. #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; static int helloworld_isr(rt_intr_t *intr){ printk( KERN_ALERT "IRQ\n"); return IRQ_HANDLED; } 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,"einName",13,helloworld_isr,NULL,0); 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); -- "Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Xenomai-help] Re: ISR Again 2006-07-10 11:40 ` [Xenomai-help] ISR Again Keinen Namen @ 2006-07-10 14:00 ` Bernhard Walle 0 siblings, 0 replies; 6+ messages in thread From: Bernhard Walle @ 2006-07-10 14:00 UTC (permalink / raw) To: xenomai Hi Keinen, "Keinen Namen" <GSM909@domain.hid> [2006-07-10]: > hi Again > > witch from have a RT_ISR? > > I simply want a Programm that run helloworld_isr when Interrupt 13 is fired. Why not using the RTDM? Just use: rtdm_irq_t rt_irq_handle; err = rtdm_irq_request(&rt_irq_handle, 13, helloworld_isr, 0, "your_driver", NULL); if (unlikely(err != 0)) { /* error handling here */ } err = rtdm_irq_enable(&rt_irq_handle); if (unlikely(err != 0)) { /* error handling here */ } And in the cleanup function: rtdm_irq_free(&rt_irq_handle); And the ISR: static int helloworld_isr(rtdm_irq_t *irq_handle) { return RTDM_IRQ_HANDLED; } Regards, Bernhard -- "Mankind invented the atomic bomb, but no mouse would ever construct a mousetrap." -- Albert Einstein ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-07-10 14:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 2006-07-10 11:40 ` [Xenomai-help] ISR Again Keinen Namen 2006-07-10 14:00 ` [Xenomai-help] " Bernhard Walle
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.