OSDev.org

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

All times are UTC - 6 hours




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: NVMe: NVM capacity and unallocated capacity are zero?
PostPosted: Sun Mar 28, 2021 9:36 pm 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1593
Octocontrabass wrote:
Have your scheduler provide a generic "sleep until my IRQ has arrived" function for driver threads to call, and a "wake my driver" function for ISRs to call. Hiding all of the ugly architecture-specific bits will make it feel much less like a hack. The only trick is that the IRQ may arrive before the driver tries to sleep.
Note that this is essentially a semaphore. Take a semaphore, initialize it to zero. Driver waits on the semaphore, ISR posts to it. If the IRQ occurs before the wait, the semaphore will be non-zero, and therefore the wait will not block. Therefore it is no longer necessary to ensure the right order with CLI and STI.

_________________
Carpe diem!


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 55 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