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

# rtl\_no\_interrupts(3)

control CPU interrupt state

## NAME

rtl\_no\_interrupts, rtl\_restore\_interrupts, rtl\_stop\_interrupts, rtl\_allow\_interrupts - control CPU interrupt state

## SYNOPSIS

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

**void rtl\_no\_interrupts(rtl\_irqstate\_t state);**

**void rtl\_restore\_interrupts(rtl\_irqstate\_t& state);**

**void rtl\_stop\_interrupts();**

**void rtl\_allow\_interrupts();**

## DESCRIPTION

These functions are non-portable Real-Time Linux extensions.

**rtl\_no\_interrupts** saves the current state of the processor interrupt flags in the variable *state* and then disables the interrupts on this processor.

**rtl\_restore\_interrupts** is defined as a macro. It uses its argument to restore the  interrupt state previously saved with rtl\_no\_interrupts.

**rtl\_stop\_interrupts** disables the interrupts.

**rtl\_stop\_interrupts** enables the interrupts.

## EXAMPLE

The following example demonstrates a typical usage.

```
{
	rtl_irqstate_t irqstate;
	rtl_no_interrupts(irqstate);
	/* this code runs with interrupts disabled! */
	rtl_restore_interrupts (irqstate);
	/* interrupt state is back to what it was before */
}
```

## NOTES

These functions have effect only on the interrupt flags of the **current** processor.

Be sure to only disable hardware interrupts for short periods of time.

## AUTHOR

Michael Barabanov \<baraban@fsmlabs.com\>

## SEE ALSO

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