9 Nov
2023
9 Nov
'23
9:37 p.m.
On 2023-11-09 01:11, chenpingyuan--- via Devel wrote:
And will interrupts be enabled again automatically after exiting trapping? (Is this done automatically by the CPU? So invisible from the source code.)
That depends on the platform, but usually yes, as the hardware state is restored to what it was before taking the trap. ARM has ERET and x86 has IRET to return from interrupts exactly to restore the state. On x86 when returning from a system call via the sysexit instruction, interrupts do need to be enabled manually with sti. Greetings, Indan