摘要 |
A method and apparatus for handling interrupts after transition of a mask flag is provided. In x86 processors, if the IF flag is set, interrupts are to be handled. However, if the IF flag transitions from a clear state to a set state, and the instruction which sets the IF bit is an STI instruction, then a pending interrupt is to be delayed for one instruction, unless the following instruction is a floating point instruction, and then the interrupt is to be handled immediately. The invention allows an interrupt to cause a branch to an exception handler if the IF bit is set. The exception handler determines whether the prior instruction was an STI instruction, and whether the prior state of the IF bit was clear. If both these conditions are true, the exception handler branches back to the main program. If either condition is not true, the exception handler branches to an interrupt service routine. If the instruction following STI is a floating point instruction, a floating point error condition causes program flow to branches to a floating point exception handler which clears the error flag and handles the interrupt if the prior instruction was STI.
|