Hi,
Crazed123 wrote:
I quote the four properties of precise interrupts, straight from textbook:
Quote:
1. The PC (Program Counter) is saved in a known place.
2. All instructions before the one pointed to by the PC have fully executed.
3. No instruction beyond the one pointed to by the PC has been executed.
4. The execution state of the instruction pointed to by the PC is known.
In the case of an x86, the PC would be the eip register. According to these properties, at least, it's easier to deal with precise interrupts for an operating system coder, and far harder for imprecise interrupts that don't give you a known state on interrupt.
Ahh - OK. In this case, all 80x86 CPUs do or don't support precise interrupts, depending on how much execution state you expect to be saved. All 80x86 CPUs behave in a similar way.
For interrupts, the CPU always saves CS, EIP and EFLAGS, and may save SS, ESP (if the interrupted code wasn't running at CPL=0 and the interrupt handler isn't using a conforming code segment), and might also save DS, ES, FS, GS (if virtual 8086 was interrupted).
Of course this depends on the IDT descriptor too - for an interrupt task gate it does a full hardware task switch, where everything is saved (except the FPU/MMX/SSE/SSE2 state), but most people never use these for performance reasons.
Typically the general registers (except for the interrupt task gate option) are not saved or restored by the CPU - this must be done by the interrupt handler itself.
Cheers,
Brendan