Imask values
Unsigned CLI (void)/* close interrupt */
Void STI (unsigned mask)/* setup interrupt */
The CLI () function retrieves the old value of imask, and disables interrupts by setting imask to all zeros. the STI () function installa new value into imask, enabling the interrupt system according to the new mask stored.
Core Interrupt Mask register (imask)
This register indicates which interrupt levels are allowed to be serviced. the imask register may be read and written in supervisor mode. bits15-5 have significance; bits4-0 are hard-coded to 1, and events of these levels are always enabled. if imask [N] = 1 and ilat [N] = 1, then interrupt n will be taken if a higher priority is not already recognized. if imask [N] = 0, and ilat [N] gets set by interrupt N, the interrupt will not be taken, and ilat [N] will remain set.
Core interrupt latch register (ilat)
Each bit in ilat indicates that the corresponding event is latched, but not yet accepted into the processor. the bit is reset before the first instruction in the corresponding ISR is executed. at the point the interrupt is accepted, ilat [N] will be cleared and ipend [N] will be set simultaneously. the ilat register can be read in supervisor mode. writes to ilat are used to clear bits only (in supervisor mode ). to clear Bit n from ilat, first make sure that imask [N] = 0, and then write ilat [N] = 1. this write functionality to ilat is provided for cases where latched interrupt requests need to be cleared (canceled) instead of serviced.
The raise instruction can be used to set ilat [15] Through ilat [5], and also ilat [2] Or ilat [1].
Only the JTAG trst pin can clear ilat [0]