OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 11:06 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Context switch on timer interrupt
PostPosted: Thu Jul 13, 2017 9:25 am 
Offline
Member
Member

Joined: Mon Dec 16, 2013 6:50 pm
Posts: 27
bzt 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.


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=2aa66f0c1b5391997f2615e8f88ee169


Top
 Profile  
 
 Post subject: Re: Context switch on timer interrupt
PostPosted: Thu Jul 13, 2017 9:43 am 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
xmm15 wrote:
bzt 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.


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=2aa66f0c1b5391997f2615e8f88ee169

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.

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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot], Majestic-12 [Bot], Octocontrabass and 78 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group