---
name: "rtl_request_irq"
section: "3"
platform: "linux"
package: "rtlinux"
version: "2.0rel-1"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/rtl_request_irq"
---

# rtl\_request\_irq(3)

install and remove real-time interrupt handlers

## NAME

rtl\_request\_irq, rtl\_free\_irq - install and remove real-time interrupt handlers

## SYNOPSIS

**#include \<rtl\_core.h\>**

**int rtl\_request\_irq(unsigned int irq, unsigned int (\*handler)(unsigned int irq, struct pt\_regs \*regs));**

**int rtl\_free\_irq(unsigned int irq);**

## DESCRIPTION

These functions are specific to Real-Time Linux. **rtl\_request\_irq** registers the function *handler* as the interrupt handler for IRQ level *irq.* The handler will be executed with hardware interrupts disabled. You need to enable the interrupt line with **[rtl\_hard\_enable\_irq(3)](/rtl_hard_enable_irq/3.md)** after a successful call to rtl\_request\_irq.

Note: the interrupt will be disabled during the handler execution. If it is necessary to receive further interrupts from this device, you must reenable the interrupt line with the **[rtl\_hard\_enable\_irq(3)](/rtl_hard_enable_irq/3.md)** function.

**rtl\_free\_irq** removes the interrupt handler for IRQ level *irq.*

## RETURN VALUE

All functions return 0 on success and a negative error code on error.

## ERRORS

- **-EBUSY**

  rtl\_request\_irq: interrupt handler is already installed for this interrupt level.

- **-EINVAL**

  rtl\_free\_irq: there is no handler currently installed for this interrupt level.

## AUTHOR

Michael Barabanov \<baraban@fsmlabs.com\>

## SEE ALSO

[**rtl\_hard\_enable\_irq**(3)](/rtl_hard_enable_irq/3.md), [**rtl\_hard\_disable\_irq**(3)](/rtl_hard_disable_irq/3.md)
