How to register a user-space function as an interrupt handler ?
Garcia Jérémie
GARCIAJ at 3il.fr
Thu May 26 20:09:51 EST 2005
Hi everybody, I'm tryin to adapt a vxWorks-designed application to a Linux montavista 3.1 on a board
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 = BS_RET_OK;
/* Connect interrupt handler for each channel */
rc = intConnect((VOIDFUNCPTR *)INT_VEC_DMA, my_handler, (int)my_param);
if(!rc)
/* Enable interrupt for first channel in the interrupt controller */
intEnable(INT_LVL_DMA_CH0);
else
rc1 = BS_RET_ERROR;
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() <==> request_irq()
intEnable() <==> 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.
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
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
code (my team does not want to support versions).
Please help or give me a clue.
Thanks for your precious help.
Jérémie
More information about the Linuxppc-dev
mailing list