System Built-in routines CLI () and STI ()

Source: Internet
Author: User

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]

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.