Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

9.3.1.8.1. Nested Hardware Interrupts with the Internal Interrupt Controller

To implement nested hardware interrupts with the IIC, use the alt_irq_interruptible() and alt_irq_non_interruptible() legacy functions to bracket code in a processor-intensive ISR.
Note: The legacy API is deprecated. Write new drivers using the enhanced API, even if they are only intended to support the IIC. Drivers for devices supporting an EIC must use the enhanced API. Existing legacy drivers continue to be supported until further notice. Make plans to port them to the enhanced API.

If you choose to continue using the legacy APIs, you must first comment out #define ALT_ENHANCED_INTERRUPT_API_PRESENT in system.h.

The call to alt_irq_interruptible() adjusts the interrupt mask so that higher-priority interrupts can take control from the running ISR. When your ISR calls alt_irq_non_interruptible(), the interrupt mask is returned to its previous state.

Note: If your ISR calls alt_irq_interruptible(), it must call alt_irq_non_interruptible() before returning. Otherwise, the HAL exception handling system might lock up.