man rtl_stop_interrupts () - control the CPU interrupt state

NAME

rtl_no_interrupts, rtl_restore_interruptsrtl_restore_interrupts, rtl_stop_interruptsrtl_stop_interrupts, rtl_allow_interruptsrtl_allow_interrupts - control the 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 Realtime 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_allow_interrupts enables the interrupts.

EXAMPLE

The following example demonstrates a typical usage.

CW    { 
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 (link to URL mailto:baraban@fsmlabs.com) )

SEE ALSO

rtl_request_irq(3) (link to URL rtl_request_irq.3.html) , rtl_free_irq(3) (link to URL rtl_free_irq.3.html) , rtl_hard_enable_irq(3) (link to URL rtl_hard_enable_irq.3.html) , rtl_hard_disable_irq(3) (link to URL rtl_hard_disable_irq.3.html)

©2001 FSMLabs Inc.

All rights reserved.