Allow the PIT driver to be removed

This commit is contained in:
Baptiste Wicht 2016-08-06 16:12:47 +02:00
parent c273940e74
commit 10b05a994f
2 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,7 @@
namespace pit {
bool install();
void remove();
} //end of namespace pit

View File

@ -32,7 +32,7 @@ bool pit::install(){
timer::frequency(1000);
if(!interrupt::register_irq_handler(0, timer_handler, nullptr)){
logging::logf(logging::log_level::ERROR, "Unable to register PIT 0\n");
logging::logf(logging::log_level::ERROR, "Unable to register PIT IRQ handler 0\n");
return false;
}
@ -41,3 +41,11 @@ bool pit::install(){
return true;
}
void pit::remove(){
if(!interrupt::unregister_irq_handler(0, timer_handler)){
logging::logf(logging::log_level::ERROR, "Unable to unregister PIT IRQ handler 0\n");
}
logging::logf(logging::log_level::TRACE, "PIT Driver Removed\n");
}