forked from lkl/lkl-linux-2.6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lkl: env: ntk: add lkl_env_fini to correctly unload ntk driver
1. We must cancel the timer before we unload: * cancel further launches of the timer: KeCancelTimer * wait for any DPC that are currently running timer routines: KeFlushQueuedDpcs Failure to do this will lead to panics when the kernel wants to run the timer routine, but the routines code has been unloaded. 2. Wait for the timer and the init thread to finish. Again, failure to do this will lead to kernel panics due to code for threads being unloaded. 3. To be able to terminate the timer thread we need to notify it by some other means than the timer object because the timer gets deactivated. We use a semaphore 'timer_killer_sem' to issue this notification. This is released at timer deactivation, and other places would not be good: we must ensure that the timer does not get signaled after the timer_killer_sem gets notified. 4. LKL users must call lkl_env_fini() to unload the kernel. lkl_sys_halt() is not good because it leaves allocated resources. Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@cs.pub.ro> ammendme
- Loading branch information
Showing
2 changed files
with
107 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters