All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Questions about IRQ
@ 2018-04-17 14:59 Jean-Marc Lenoir
  2018-04-17 16:38 ` Greg Gallagher
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Marc Lenoir @ 2018-04-17 14:59 UTC (permalink / raw)
  To: xenomai

Hello,

I would like to make a program which handle the interrupt requests of a 
PCI board with Xenomai 3. I'm trying to use this Xenomai API: 
https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__cobalt__core__irq.html 
but there are some points that are not clear at all for me.

1) There is already a Linux driver that handle the IRQ of this board and 
I need to keep this driver running because I use it for the board 
configuration. So, if both a Linux driver and a Xenomai program try to 
handle the same IRQ, what happen? Does Xenomai always have the priority? 
Or do I need to configure something to give the priority to Xenomai?

2) This API works on kernel mode or user mode? (Actually, I'm not sure 
there is a kernel mode, I'm a beginner with Xenomai.)

3) When I'm trying to make a simple program with this API (in user 
mode), I am unable to compile it: there is some missing definitions like 
the structure xnintr. I think I need to change something when I build 
the Xenomai libraries but I don't know what (the current libraries are 
compiled with the options "./configure --with-core=cobalt --enable-smp 
--enable-pshared"). Any idea?

4) If someone know where I can find an example of program using this 
API, it could help me a lot.

Thanks for your help,
Jean-Marc



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Questions about IRQ
  2018-04-17 14:59 [Xenomai] Questions about IRQ Jean-Marc Lenoir
@ 2018-04-17 16:38 ` Greg Gallagher
  2018-04-18  9:16   ` Jean-Marc Lenoir
  0 siblings, 1 reply; 4+ messages in thread
From: Greg Gallagher @ 2018-04-17 16:38 UTC (permalink / raw)
  To: Jean-Marc Lenoir; +Cc: Xenomai@xenomai.org

    This API is the API for the cobalt kernel and used in kernel
space.  These functions aren't available in user space.  Your user
program is failing to build because the data structures exist in the
kernel and not in user space.
    You can create an RTDM driver to handle the IRQs from the PCI
board and then a user space program to read data from the driver.
Usually you can't have the Linux driver and the xenomai driver loaded
at the same time, for drivers like RTnet, serial and SPI I have to
unload the Linux driver or else the Xenomai probe function won't be
called because the Linux driver has registered itself for the
hardware.  I guess there could be exceptions to that rule.
    If you want examples for RTDM drivers look in the drivers
directory.  You can also look at using UDD driver to control the
device from user space. When I get time I'll look through the code
base and see if I can point you to some examples.  In the meantime the
UDD source files contain some documentation about how the functions
work if you want to get some more information.

-Greg

On Tue, Apr 17, 2018 at 10:59 AM, Jean-Marc Lenoir
<jean-marc.lenoir@univ-grenoble-alpes.fr> wrote:
> Hello,
>
> I would like to make a program which handle the interrupt requests of a PCI
> board with Xenomai 3. I'm trying to use this Xenomai API:
> https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__cobalt__core__irq.html
> but there are some points that are not clear at all for me.
>
> 1) There is already a Linux driver that handle the IRQ of this board and I
> need to keep this driver running because I use it for the board
> configuration. So, if both a Linux driver and a Xenomai program try to
> handle the same IRQ, what happen? Does Xenomai always have the priority? Or
> do I need to configure something to give the priority to Xenomai?
>
> 2) This API works on kernel mode or user mode? (Actually, I'm not sure there
> is a kernel mode, I'm a beginner with Xenomai.)
>
> 3) When I'm trying to make a simple program with this API (in user mode), I
> am unable to compile it: there is some missing definitions like the
> structure xnintr. I think I need to change something when I build the
> Xenomai libraries but I don't know what (the current libraries are compiled
> with the options "./configure --with-core=cobalt --enable-smp
> --enable-pshared"). Any idea?
>
> 4) If someone know where I can find an example of program using this API, it
> could help me a lot.
>
> Thanks for your help,
> Jean-Marc
>
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Questions about IRQ
  2018-04-17 16:38 ` Greg Gallagher
@ 2018-04-18  9:16   ` Jean-Marc Lenoir
  2018-04-18 13:48     ` Greg Gallagher
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Marc Lenoir @ 2018-04-18  9:16 UTC (permalink / raw)
  To: Greg Gallagher; +Cc: Xenomai@xenomai.org

Thanks for the explanations! It's clear for me now.
UDD seems to be exactly what I would like, so if you find some examples 
please tell me.

Jean-Marc

Le 17/04/2018 à 18:38, Greg Gallagher a écrit :
>      This API is the API for the cobalt kernel and used in kernel
> space.  These functions aren't available in user space.  Your user
> program is failing to build because the data structures exist in the
> kernel and not in user space.
>      You can create an RTDM driver to handle the IRQs from the PCI
> board and then a user space program to read data from the driver.
> Usually you can't have the Linux driver and the xenomai driver loaded
> at the same time, for drivers like RTnet, serial and SPI I have to
> unload the Linux driver or else the Xenomai probe function won't be
> called because the Linux driver has registered itself for the
> hardware.  I guess there could be exceptions to that rule.
>      If you want examples for RTDM drivers look in the drivers
> directory.  You can also look at using UDD driver to control the
> device from user space. When I get time I'll look through the code
> base and see if I can point you to some examples.  In the meantime the
> UDD source files contain some documentation about how the functions
> work if you want to get some more information.
>
> -Greg
>
> On Tue, Apr 17, 2018 at 10:59 AM, Jean-Marc Lenoir
> <jean-marc.lenoir@univ-grenoble-alpes.fr> wrote:
>> Hello,
>>
>> I would like to make a program which handle the interrupt requests of a PCI
>> board with Xenomai 3. I'm trying to use this Xenomai API:
>> https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__cobalt__core__irq.html
>> but there are some points that are not clear at all for me.
>>
>> 1) There is already a Linux driver that handle the IRQ of this board and I
>> need to keep this driver running because I use it for the board
>> configuration. So, if both a Linux driver and a Xenomai program try to
>> handle the same IRQ, what happen? Does Xenomai always have the priority? Or
>> do I need to configure something to give the priority to Xenomai?
>>
>> 2) This API works on kernel mode or user mode? (Actually, I'm not sure there
>> is a kernel mode, I'm a beginner with Xenomai.)
>>
>> 3) When I'm trying to make a simple program with this API (in user mode), I
>> am unable to compile it: there is some missing definitions like the
>> structure xnintr. I think I need to change something when I build the
>> Xenomai libraries but I don't know what (the current libraries are compiled
>> with the options "./configure --with-core=cobalt --enable-smp
>> --enable-pshared"). Any idea?
>>
>> 4) If someone know where I can find an example of program using this API, it
>> could help me a lot.
>>
>> Thanks for your help,
>> Jean-Marc
>>
>>
>> _______________________________________________
>> Xenomai mailing list
>> Xenomai@xenomai.org
>> https://xenomai.org/mailman/listinfo/xenomai



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Xenomai] Questions about IRQ
  2018-04-18  9:16   ` Jean-Marc Lenoir
@ 2018-04-18 13:48     ` Greg Gallagher
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Gallagher @ 2018-04-18 13:48 UTC (permalink / raw)
  To: Jean-Marc Lenoir; +Cc: Xenomai@xenomai.org

Take a look at this header file, it will eventually be documented properly.

https://git.xenomai.org/xenomai-3.git/tree/include/cobalt/kernel/rtdm/udd.h?id=33dd9ce1b5765e3f9da6de21ea647ea3cd454ba9

I keep meaning to do an example, hopefully I'll make some time sooner
than later.

-Greg

On Wed, Apr 18, 2018 at 5:16 AM, Jean-Marc Lenoir
<jean-marc.lenoir@univ-grenoble-alpes.fr> wrote:
> Thanks for the explanations! It's clear for me now.
> UDD seems to be exactly what I would like, so if you find some examples
> please tell me.
>
> Jean-Marc
>
>
> Le 17/04/2018 à 18:38, Greg Gallagher a écrit :
>>
>>      This API is the API for the cobalt kernel and used in kernel
>> space.  These functions aren't available in user space.  Your user
>> program is failing to build because the data structures exist in the
>> kernel and not in user space.
>>      You can create an RTDM driver to handle the IRQs from the PCI
>> board and then a user space program to read data from the driver.
>> Usually you can't have the Linux driver and the xenomai driver loaded
>> at the same time, for drivers like RTnet, serial and SPI I have to
>> unload the Linux driver or else the Xenomai probe function won't be
>> called because the Linux driver has registered itself for the
>> hardware.  I guess there could be exceptions to that rule.
>>      If you want examples for RTDM drivers look in the drivers
>> directory.  You can also look at using UDD driver to control the
>> device from user space. When I get time I'll look through the code
>> base and see if I can point you to some examples.  In the meantime the
>> UDD source files contain some documentation about how the functions
>> work if you want to get some more information.
>>
>> -Greg
>>
>> On Tue, Apr 17, 2018 at 10:59 AM, Jean-Marc Lenoir
>> <jean-marc.lenoir@univ-grenoble-alpes.fr> wrote:
>>>
>>> Hello,
>>>
>>> I would like to make a program which handle the interrupt requests of a
>>> PCI
>>> board with Xenomai 3. I'm trying to use this Xenomai API:
>>>
>>> https://xenomai.org/documentation/xenomai-3/html/xeno3prm/group__cobalt__core__irq.html
>>> but there are some points that are not clear at all for me.
>>>
>>> 1) There is already a Linux driver that handle the IRQ of this board and
>>> I
>>> need to keep this driver running because I use it for the board
>>> configuration. So, if both a Linux driver and a Xenomai program try to
>>> handle the same IRQ, what happen? Does Xenomai always have the priority?
>>> Or
>>> do I need to configure something to give the priority to Xenomai?
>>>
>>> 2) This API works on kernel mode or user mode? (Actually, I'm not sure
>>> there
>>> is a kernel mode, I'm a beginner with Xenomai.)
>>>
>>> 3) When I'm trying to make a simple program with this API (in user mode),
>>> I
>>> am unable to compile it: there is some missing definitions like the
>>> structure xnintr. I think I need to change something when I build the
>>> Xenomai libraries but I don't know what (the current libraries are
>>> compiled
>>> with the options "./configure --with-core=cobalt --enable-smp
>>> --enable-pshared"). Any idea?
>>>
>>> 4) If someone know where I can find an example of program using this API,
>>> it
>>> could help me a lot.
>>>
>>> Thanks for your help,
>>> Jean-Marc
>>>
>>>
>>> _______________________________________________
>>> Xenomai mailing list
>>> Xenomai@xenomai.org
>>> https://xenomai.org/mailman/listinfo/xenomai
>
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-18 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 14:59 [Xenomai] Questions about IRQ Jean-Marc Lenoir
2018-04-17 16:38 ` Greg Gallagher
2018-04-18  9:16   ` Jean-Marc Lenoir
2018-04-18 13:48     ` Greg Gallagher

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.