Alchemy
Loading...
Searching...
No Matches

irqlock.h File Reference

Saving, disabling and restoring the interrupt master enable. More...

Go to the source code of this file.

Macros

#define IME_SAVE(ime, saved)
 Saves the original IME value in saved.
#define IME_DISABLE(ime)
 Disables interrupts.
#define IME_RESTORE(ime, saved)
 Restores IME from saved.
#define IRQ_LOCK(saved)
 Disables interrupts and saves IME in saved; IRQ_UNLOCK restores it.
#define IRQ_UNLOCK(saved)
 Restores the IME value saved by IRQ_LOCK.

Detailed Description

Saving, disabling and restoring the interrupt master enable.

Definition in file irqlock.h.

Macro Definition Documentation

◆ IME_SAVE

#define IME_SAVE ( ime,
saved )
Value:
do { \
(saved) = *(ime); \
} while (0)

Saves the original IME value in saved.

Definition at line 17 of file irqlock.h.

Referenced by SerialRuntime_Initialize().

◆ IME_DISABLE

#define IME_DISABLE ( ime)
Value:
do { \
*(ime) = (u16)(u32)(ime); \
} while (0)
unsigned int u32
Definition types.h:15
unsigned short u16
Definition types.h:13

Disables interrupts.

Definition at line 23 of file irqlock.h.

Referenced by SerialRuntime_Initialize().

◆ IME_RESTORE

#define IME_RESTORE ( ime,
saved )
Value:
do { \
*(ime) = (saved); \
} while (0)

Restores IME from saved.

Definition at line 32 of file irqlock.h.

◆ IRQ_LOCK

#define IRQ_LOCK ( saved)
Value:
do { \
volatile u16 *ime_ = &REG_IME; \
\
IME_SAVE(ime_, saved); \
IME_DISABLE(ime_); \
} while (0)
#define REG_IME
Definition io_reg.h:308

Disables interrupts and saves IME in saved; IRQ_UNLOCK restores it.

Definition at line 38 of file irqlock.h.

Referenced by BattlePresentation_AppendLinkedActions(), LinkLobby_InitializeSerial(), Runtime_SetIrqHandler(), Scheduler_AddOrUpdateCallback(), Scheduler_FindCallback(), Scheduler_RemoveCallback(), Scheduler_ResumeOverlayTasks(), Scheduler_ResumeTasks(), Scheduler_SetTaskFlags(), Scheduler_SuspendOverlayTasks(), Scheduler_SuspendTasks(), SerialRuntime_BeginReceive(), and SerialRuntime_BeginSend().

◆ IRQ_UNLOCK