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

Accessors and modifiers of the IMASK state. More...

Macros

#define irq_disable_scoped()
 Disable interrupts with scope management.
 

Typedefs

typedef uint32_t irq_mask_t
 Type representing an interrupt mask state.
 

Functions

irq_mask_t irq_get_sr (void)
 Get status register contents.
 
irq_mask_t irq_disable (void)
 Disable interrupts.
 
void irq_enable (void)
 Enable all interrupts.
 
void irq_restore (irq_mask_t v)
 Restore IRQ state.
 

Detailed Description

Accessors and modifiers of the IMASK state.

This API is provided for managing and querying information regarding the interrupt mask, a series of bitflags representing whether each type of interrupt has been enabled or not.

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.

Typedef Documentation

◆ irq_mask_t

typedef uint32_t irq_mask_t

Type representing an interrupt mask state.

Function Documentation

◆ irq_disable()

irq_mask_t irq_disable ( void )

Disable interrupts.

This function will disable SH4 interrupts, but will leave SH4 general exceptions enabled.

Returns
The state of the SH4 interrupts before calling the function. This can be used to restore this state later on with irq_restore().
See also
irq_restore(), irq_enable()

Referenced by g2_lock().

◆ irq_enable()

void irq_enable ( void )

Enable all interrupts.

This function will enable ALL interrupts, including external ones.

See also
irq_disable()

◆ irq_get_sr()

irq_mask_t irq_get_sr ( void )

Get status register contents.

Returns the current value of the status register, as irq_disable() does. The function can be found in arch\dreamcast\kernel\entry.s

Note
This is the entire status register word, not just the IMASK field.
Return values
Statusregister word
See also
irq_disable()

◆ irq_restore()

void irq_restore ( irq_mask_t v)

Restore IRQ state.

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

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

Referenced by g2_unlock().