osSetIntMask osSetIntMask (function)

osGetIntMask, osSetIntMask

Gets/sets the enabled interrupt mask


#include <ultra64.h>     /* ultra64.h */
OSIntMask osGetIntMask(void);
OSIntMask osSetIntMask(OSIntMask im);


The osGetIntMask call returns the mask of currently enabled hardware interrupts, and the osSetIntMask call allows the application to enable and disable interrupts based on the provided mask. Following are the bits of the mask. The interrupt is enabled if the associated definition below is bitwise OR'ed into the final mask.

OS_IM_SW1 : CPU software interrupt 1
OS_IM_SW2 : CPU software interrupt 2
OS_IM_CART : Pak interrupt
OS_IM_PRENMI : Pre-NMI interrupt
OS_IM_COUNTER : CPU timer interrupt
OS_IM_SP : RCP Signal Processor (SP) interrupt
OS_IM_SI : RCP Serial Interface (SI) interrupt
OS_IM_AI : RCP Audio Interface (AI) interrupt
OS_IM_VI : RCP Video Interface (VI) interrupt
OS_IM_PI : RCP Parallel Interface (PI) interrupt
OS_IM_DP : RCP Display Processor (DP) interrupt
OS_IM_NONE : No interrupts enabled
OS_IM_ALL : All interrupts enabled

The interrupt mask is part of the thread context and is thus saved and restored as threads yield and regain the CPU. All interrupts are enabled for the thread at creation time by osCreateThread. These routines are used sparingly by system threads and should not be needed by application threads. Instead, applications should exploit thread priorities for real time behavior and protection of critical regions.

See Also


Revision History

1999/04/30 Changed format