linux - Does the flag register need to be saved when an interrupt occurs, or a process scheduling happens? -


I know that all the normal registers are pushed onto the stack when there is an interrupt, but I do not have any code It is possible that the flag register is left to depend on the flag register, such as the assembly instruction, it is easy to make false results when restored with an interval, if the flag register becomes corrupted.

Yes, save the (e / r) flag register in the context switch is required.

Save all interrupts (hardware and software with exceptions) automatically on the stack and restore it by the iret instructions at the end of the ISR.

The system call uses the same or similar mechanism and preserves the register.

Scheduling is triggered by interrupt or system call. So, everything has been covered.

Comments