mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Decouple HPET init from ACPI
This commit is contained in:
parent
450e45bf31
commit
e99326db0e
@ -13,6 +13,8 @@ namespace hpet {
|
||||
bool install();
|
||||
void late_install();
|
||||
|
||||
void init();
|
||||
|
||||
} //end of namespace hpet
|
||||
|
||||
#endif
|
||||
|
@ -16,8 +16,6 @@
|
||||
#include "arch.hpp"
|
||||
#include "assert.hpp"
|
||||
|
||||
#include "drivers/hpet.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
// This is copied from acexcep.h
|
||||
@ -106,11 +104,6 @@ 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){
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "logging.hpp"
|
||||
#include "mmap.hpp"
|
||||
#include "arch.hpp"
|
||||
#include "scheduler.hpp" // For async init
|
||||
|
||||
namespace {
|
||||
|
||||
@ -43,6 +44,11 @@ void clear_register_bits(size_t reg, uint64_t bits){
|
||||
|
||||
} //End of anonymous namespace
|
||||
|
||||
void hpet::init(){
|
||||
// HPET needs ACPI
|
||||
scheduler::queue_async_init_task(hpet::late_install);
|
||||
}
|
||||
|
||||
bool hpet::install(){
|
||||
// Find the HPET table
|
||||
auto status = AcpiGetTable(ACPI_SIG_HPET, 0, reinterpret_cast<ACPI_TABLE_HEADER **>(&hpet_table));
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "network.hpp"
|
||||
#include "vfs/vfs.hpp"
|
||||
#include "fs/sysfs.hpp"
|
||||
#include "drivers/hpet.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
@ -100,6 +101,7 @@ void kernel_main(){
|
||||
|
||||
// Asynchronously initialized drivers
|
||||
acpi::init();
|
||||
hpet::init();
|
||||
|
||||
//Install drivers
|
||||
timer::install();
|
||||
|
Loading…
x
Reference in New Issue
Block a user