KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
IRQ state handling

API for handling IRQ state More...

Macros

#define irq_disable_scoped()
 Disable interrupts with scope management.
 

Functions

static void irq_enable (void)
 Enable all interrupts.
 
static irq_mask_t irq_disable (void)
 Disable interrupts.
 
static void irq_restore (irq_mask_t state)
 Restore interrupt state.
 
static bool irq_inside_int (void)
 Returns whether inside of an interrupt context.
 

Detailed Description

API for handling IRQ state

The following functions can be used to disable or enable interrupts, restore a previously saved interrupt state, or query whether or not the calling function is running in an interrupt context.

Macro Definition Documentation

◆ irq_disable_scoped

#define irq_disable_scoped ( )
Value:
__irq_disable_scoped(__LINE__)

Disable interrupts with scope management.

This macro will disable interrupts, similarly to irq_disable(), with the difference that the interrupt state will automatically be restored once the execution exits the functional block in which the macro was called.

Referenced by do_dma_transfer().

Function Documentation

◆ irq_disable()

static irq_mask_t irq_disable ( void )
inlinestatic

Disable interrupts.

This function will disable interrupts (not exceptions).

Returns
An opaque token containing the interrupt state. It should be passed to irq_restore() in order to restore the previous interrupt state.
See also
irq_restore(), irq_enable()

Referenced by draw_sphere(), and g2_lock().

◆ irq_enable()

static void irq_enable ( void )
inlinestatic

Enable all interrupts.

This function will enable ALL interrupts, including external ones.

See also
irq_disable()

Referenced by draw_sphere().

◆ irq_inside_int()

static bool irq_inside_int ( void )
inlinestatic

Returns whether inside of an interrupt context.

Return values
non-zeroIf inside an interrupt handler.
0If normal processing is in progress.

Referenced by spinlock_lock_irqsafe().

◆ irq_restore()

static void irq_restore ( irq_mask_t state)
inlinestatic

Restore interrupt state.

This function will restore the interrupt state to the value specified. This should correspond to a value returned by irq_disable().

Parameters
stateThe IRQ state to restore. This should be a value returned by irq_disable().
See also
irq_disable()

Referenced by g2_unlock().