IntrPrio (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This global variable array provides the MIPS and SHx kernel with information about which nested interrupts are masked while the current interrupt is being handled.

extern BYTE IntrPrio[];



Return Values



MIPS Kernel

Because there is no hard-coded priority scheme in MIPS architecture, the kernel uses two structures that provide information about nested interrupts.

These structures, IntrPriority and IntrMask, provide the kernel with information about which interrupts are masked while the current interrupt is being handled:

  • The IntrPriority table determines, for a given combination of simultaneously pending interrupts, which interrupt is to be given the highest priority. The resulting interrupt is then serviced first.

    IntrPriority contains one entry for each combination of bits in the 6-bit interrupt field. The entry defines which interrupt should be serviced. The value is the bit number multiplied by four.

    For example, if interrupts 1 and 3 are both pending, IntrPriority[0xA] = 1*4 indicates that interrupt 1 should be serviced first. Multiplying the bit number by four speeds indexing into the IntrMask array in the kernel code.

  • The IntrMask table defines how to set the interrupt mask while servicing that particular interrupt. Access to IntrMask is gained by declaring the IntrMask variable in the OAL.

    The IntrMask table tells the kernel which interrupt mask to set in the CPU during execution of the interrupt service routine. A one (1) indicates the interrupt at that bit is masked (the value is negated and shifted before programming the status register).

    The following code example shows how IntrMask is used.

    // OEM Review : Disabled nested interrupts
    .byte   0x3f   // 00 0000   // for spurious interrupt
    .byte   0x3f   // 00 0001
    .byte   0x3f   // 00 0010
    .byte   0x3f   // 00 0100
    .byte   0x3f   // 00 1000
    .byte   0x3f   // 01 0000
    .byte   0x3f   // 10 0000
    .byte   0x00   // padding

SHx Kernel

In the SHx architecture, the kernel uses the IntrPriority structure to provide the kernel with information on which nested interrupts are masked when the current interrupt is being handled.

Access to IntrPriority is gained by declaring the IntrPrio variable in the OAL.

IntrPrio represents an array of 112 possible interrupts. The interrupts are values from 0x200 to 0xfe0: interrupt 0x200 is equivalent to IntrPrio[0] and 0xfe0 is equivalent to IntrPrio[111].

In the current version the SHx kernel only initializes nesting for the first 16 interrupts. The value in each array entry identifies which interrupts are to be disabled when the current interrupt is being handled.

The following defaults support nested interrupts.


To disable nested interrupts, 0xF can be assigned to each array element according to the following code example.

// OEMREVIEW : This disables interrupt nesting
    extern BYTE IntrPrio[];
    int i;

    // for each INTEVT 0x200 - 0xfe0 (0=0x200, 1=0x220, etc)
    for (i = 0; i < 0x70; i++) {
        IntrPrio[i] = 0xF;  // Mask all interrupts

The IntrPriority table must be modified in the OEMInit function before normal operations begin.


OS Versions: Windows CE 3.0 and later.
Header: Developer-defined.

See Also

IntrMask | OEMInit

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.