Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22148

Can I use "no_caller_saved_registers" or "interrupt" attribute to write a task switching process?

$
0
0

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


Viewing all articles
Browse latest Browse all 22148

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>