src/ppe/pk/gpe/gpe_irq_init.c
/// (Re)define the IRQ handler and priority for an interrupt.
/// Return values other then PK_OK (0) are errors; see \ref pk_errors
///
/// Note that PK allows this API to be called from any context, and changes
/// to the interrupt controller are made from a critical section.
///
/// \retval 0 Successful completion
///
/// \retval -PK_INVALID_ARGUMENT_IRQ_HANDLER One or more arguments are
/// invalid, including an invalid \a irq, a  null (0) \a handler,
/// or invalid \a priority.
(Re)define the IRQ handler and priority for an interrupt.
Return values other then PK_OK (0) are errors; see \ref pk_errors

Note that PK allows this API to be called from any context, and changes
to the interrupt controller are made from a critical section.

\retval 0 Successful completion

\retval -PK_INVALID_ARGUMENT_IRQ_HANDLER One or more arguments are
invalid, including an invalid \a irq, a  null (0) \a handler,
or invalid \a priority.
( Re ) define the IRQ handler and priority for an interrupt . Return values other then PK_OK ( 0 ) are errors ; see \ ref pk_errors Note that PK allows this API to be called from any context and changes to the interrupt controller are made from a critical section . \ retval 0 Successful completion \ retval - PK_INVALID_ARGUMENT_IRQ_HANDLER One or more arguments are invalid including an invalid \ a irq a null ( 0 ) \ a handler or invalid \ a priority .
int
pk_irq_handler_set(PkIrqId      irq,
                   PkIrqHandler handler,
                   void*          arg)
{
    PkMachineContext ctx;
    if (PK_ERROR_CHECK_API)
    {
        PK_ERROR_IF(!OCCHW_IRQ_VALID(irq) ||
                    (handler == 0),
                    PK_INVALID_ARGUMENT_IRQ_HANDLER);
    }
    pk_critical_section_enter(&ctx);
    __ppe42_irq_handlers[irq].handler = handler;
    __ppe42_irq_handlers[irq].arg = arg;
    pk_critical_section_exit(&ctx);
    return PK_OK;
}
int pk_irq_handler_set ( PkIrqId irq , PkIrqHandler handler , void * arg ) { PkMachineContext ctx ; if ( PK_ERROR_CHECK_API ) { PK_ERROR_IF ( ! OCCHW_IRQ_VALID ( irq ) || ( handler == 0 ) , PK_INVALID_ARGUMENT_IRQ_HANDLER ) ; } pk_critical_section_enter ( & ctx ) ; __ppe42_irq_handlers [ irq ] . handler = handler ; __ppe42_irq_handlers [ irq ] . arg = arg ; pk_critical_section_exit ( & ctx ) ; return PK_OK ; }
(Re)define the IRQ handler and priority for an interrupt.
( Re ) define the IRQ handler and priority for an interrupt .