I would just like to point out that you should probably not save xmm registers on every context switch, but rather leverage the use of #NM exception. For more info look at http://www.dumais.io/index.php?article= ... e8f88ee169bzt wrote:First, you need to save and restore ALL registers for a context switch. This also includes xmm,sse etc. registers if you use float or double in your C++ code.
Context switch on timer interrupt
Re: Context switch on timer interrupt
Re: Context switch on timer interrupt
Not saving them on every context switch is just on optimization, so doesn't really matter that much. Of course later you'll want to take advantage of that optimization, but if you keep it in mind it shouldn't be difficult to implement later as well.xmm15 wrote:I would just like to point out that you should probably not save xmm registers on every context switch, but rather leverage the use of #NM exception. For more info look at http://www.dumais.io/index.php?article= ... e8f88ee169bzt wrote:First, you need to save and restore ALL registers for a context switch. This also includes xmm,sse etc. registers if you use float or double in your C++ code.
Once you realize why you don't have to save these regs on every context switch you hopefully realize that it (partially) applies to all the regs, including general purpose and segment regs as well.