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