Nios® V Processor Software Developer Handbook

ID 743810
Date 10/31/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

12.1.1.36. alt_ic_isr_register()

Prototype

int alt_ic_isr_register (alt_u32 ic_id,


alt_u32 irq,

alt_isr_func isr,

void* isr_context,

void* flags)

Commonly Called By

C/C++ programs

Device drivers

Thread-safe

Yes.

Available from ISR

No.

Include

<sys/alt_irq.h>

Description

The alt_ic_isr_register() function registers an ISR. If the function is successful, the requested interrupt is enabled on return, and isr and isr_context are inserted in the vector table.

The function arguments are as follows:

  • ic_id is the interrupt controller ID as defined in system.h, identifying the external interrupt controller in the daisy chain. This argument is ignored if the external interrupt controller interface is not implemented.
  • irq is the IRQ number, as defined in system.h, identifying the interrupt to register.
  • isr is the function that is called when the interrupt is accepted.
  • isr_context is the input argument to isr. isr_context points to a data structure associated with the device driver instance.
  • flags is reserved.

    The ISR function prototype is defined as follows:

    typedef void (*alt_isr_func) (void* isr_context);

    Calls to alt_ic_isr_register() replace previously registered handlers for interrupt irq.

    If isr is set to null, the interrupt is disabled.

Return

This function returns zero if successful, or nonzero otherwise. The function fails if the irq parameter is greater than the maximum interrupt port number supported by the interrupt controller.