Export (0) Print
Expand All

IntrMask (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.

USHORT intrMask;

Parameters

None.

Return Values

A value of one (1) indicates the interrupt at that bit is masked.

The value is negated and shifted before programming the status register.

Remarks

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 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 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 the 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
    IntrMask:
    .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 of 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 table shows the defaults that support nested interrupts.

InterruptMask
0x2000xf
0x2200xe
0x2400xd
0x2600xc
0x2800xb
0x2a00xa
0x2c00x9
0x2e00x8
0x3000x7
0x3200x6
0x3400x5
0x3600x4
0x3800x3
0x3a00x2
0x3c00x1
0x3e00x0

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.

Requirements

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

See Also

IntrPrio | OEMInit


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft