Defer HPET loading to after ACPI

This commit is contained in:
Baptiste Wicht 2016-08-05 21:14:15 +02:00
parent 3dec990e75
commit 1c7145dc2e
3 changed files with 17 additions and 1 deletions

View File

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

View File

@ -16,6 +16,8 @@
#include "arch.hpp"
#include "assert.hpp"
#include "drivers/hpet.hpp"
namespace {
// This is copied from acexcep.h
@ -104,6 +106,11 @@ void initialize_acpica(){
acpi_initialized = true;
logging::logf(logging::log_level::DEBUG, "acpi:: Finished initialization of ACPICA\n");
// Here we initialize the drivers that need ACPI
// TODO This is not good coupling: Find a better solution
hpet::late_install();
}
uint64_t acpi_read(const ACPI_GENERIC_ADDRESS& address){

View File

@ -25,5 +25,13 @@ bool hpet::install(){
logging::logf(logging::log_level::TRACE, "hpet: Found ACPI HPET table\n");
return false;
return true;
}
void hpet::late_install(){
if(hpet::install()){
logging::logf(logging::log_level::TRACE, "hpet: Late install suceeded\n");
//TODO Register the timer to the timer system
}
}