rtl_stop_interrupts

Name

rtl_no_interrupts, rtl_restore_interrupts, rtl_stop_interrupts, rtl_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.

    {
    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_free_irq(3), rtl_hard_enable_irq(3), rtl_hard_disable_irq(3)

2001 FSMLabs Inc.

All rights reserved.