LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* How to register a user-space function as an interrupt handler ?
@ 2005-05-26 10:09 Garcia Jérémie
  2005-05-26 12:35 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Garcia Jérémie @ 2005-05-26 10:09 UTC (permalink / raw)
  To: linuxppc-dev

Hi everybody, I'm tryin to adapt a vxWorks-designed application to a =
Linux montavista 3.1 on a board=20
running a powerPC 405 EP. In our application, that will be run from the =
linux user-space, we connect a
routine to an interrupt vector as the example below:

/**************************/
/* /home/JG/appli/ppcos.c */
/**************************/

RET_CODE_TYPE enable_and_connect_DMA(MY_DMA_CTRL * my_param)
{
    BS_RET_CODE_TYPE rc1 =3D BS_RET_OK;=20

    /* Connect interrupt handler for each channel */
    rc =3D intConnect((VOIDFUNCPTR *)INT_VEC_DMA, my_handler, =
(int)my_param);
  =20
    if(!rc)
        /* Enable interrupt for first channel in the interrupt =
controller */
        intEnable(INT_LVL_DMA_CH0);

    else
        rc1 =3D BS_RET_ERROR;
    =20
    return rc1;
}

What I would like to do is to make an emulation of both vxWorks routines =
(intConnect() and intEnable()) in the linux world
cause I'm not allowed to change that code.
I guess that I will have to use :
   intConnect() <=3D=3D> request_irq()
   intEnable()  <=3D=3D> enable_irq()
(Is that correct??).
Furthermore, I'm a newbie in linux developpment and if I understand =
well, I need to be in kernel-space to call those routines.=20
But here is my problem: the interrupt handler that we call is part of =
the application and uses a lot of #define,semaphores and other=20
ressources of the user-application. So can I implement a new linux =
system call, that will register our user-space-function (my_handler())
as the interrupt handler for the given vector?? Indeed, we do that for =
several interrupts (each with a different handler) and it would
be comfortable to have a system call that would take (the handler + the =
interrupt vector + the parameters) as parameters.
Don't forget that I have to respect two conditions: my application must =
be run from user-space and I cannot modify the=20
code (my team does not want to support versions).

Please help or give me a clue.

Thanks for your precious help.
J=E9r=E9mie

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

end of thread, other threads:[~2005-05-26 12:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-26 10:09 How to register a user-space function as an interrupt handler ? Garcia Jérémie
2005-05-26 12:35 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox