rtl_no_interrupts(3)

rtl_no_interrupts3

Control cpu interrupt state

Usage

#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();

Overview

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.

Examples

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 <[email protected]>

From rtlinux 2.0rel-1 in Debian 2.2 (Potato). Parsed by carta from the page's man source.