예제 #1
0
파일: fnet_isr.c 프로젝트: ErikZalm/fnet
/************************************************************************
* NAME: fnet_isr_vector_init
*
* DESCRIPTION: Sets 'handler' for the interrupt vector with number 
*              'vector_number' at the internal vector queue and interrupt 
*              handler 'fnet_cpu_isr' at the real vector table
*************************************************************************/
int fnet_isr_vector_init( unsigned int vector_number, void (*handler_top)(void *cookie),
                                   void (*handler_bottom)(void *cookie), unsigned int priority, void *cookie )
{
    int result;

    /* CPU-specific initalisation. */
    result = fnet_cpu_isr_install(vector_number, priority);

    if(result == FNET_OK)
    {
        result = fnet_isr_register(vector_number, handler_top, handler_bottom, cookie);
    }

    return result;
}
예제 #2
0
/************************************************************************
* NAME: fnet_isr_vector_init
*
* DESCRIPTION: Sets 'handler' for the interrupt vector with number
*              'vector_number' at the internal vector queue and interrupt
*              handler 'fnet_cpu_isr' at the real vector table
*************************************************************************/
fnet_return_t fnet_isr_vector_init(fnet_uint32_t vector_number,
                                   void (*handler_top)(fnet_uint32_t cookie),
                                   void (*handler_bottom)(fnet_uint32_t cookie),
                                   fnet_uint32_t priority,
                                   fnet_uint32_t cookie)
{
    fnet_return_t result;

    /* Register handler. */
    result = fnet_isr_register(vector_number, handler_top, handler_bottom, cookie);

    if (result == FNET_OK)
    {
        /* CPU-specific initalisation. */
        result = fnet_cpu_isr_install(vector_number, priority);
    }

    return result;
}