Hi I'm a learner of x86_64 kernel and trying to follow a beginner book to write a simple one.
With the chapter of task switch, the author used assembly to push and pop the execution registers. However, I'm using newer gcc which do have the "no_caller_saved_registers" and "interrupt" option.
I tested the attribute, and somehow find out instead of pushing all registers, it will only save few of them according to the code within the function.
So I would like to ask that if I jmp or retq to switch task, would the compiler be smart enough to save all the related registers??
Thanks