mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 14:10:36 -04:00
Initialize ACPICA in an asynchronous thread
This commit is contained in:
parent
3beff6ac02
commit
fe40319cdc
@ -10,7 +10,7 @@
|
||||
|
||||
namespace acpi {
|
||||
|
||||
bool init();
|
||||
void init();
|
||||
void shutdown();
|
||||
|
||||
bool initialized();
|
||||
|
@ -12,10 +12,11 @@
|
||||
#include "paging.hpp"
|
||||
#include "console.hpp"
|
||||
#include "logging.hpp"
|
||||
#include "scheduler.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
bool acpi_initialized = false;
|
||||
volatile bool acpi_initialized = false;
|
||||
|
||||
uint32_t SMI_CMD; //ptr
|
||||
uint8_t ACPI_ENABLE;
|
||||
@ -272,32 +273,22 @@ int init_acpi(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool initialize_acpica(){
|
||||
void initialize_acpica(){
|
||||
auto status = AcpiInitializeSubsystem();
|
||||
if(ACPI_FAILURE(status)){
|
||||
logging::logf(logging::log_level::ERROR, "Impossible to initialize ACPICA subsystem\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO COntinue
|
||||
|
||||
|
||||
acpi_initialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
} //end of anonymous namespace
|
||||
|
||||
bool acpi::init(){
|
||||
if(!initialize_acpica()){
|
||||
logging::logf(logging::log_level::ERROR, "Impossible to initialize ACPICA\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
//Nothing else to init for now
|
||||
|
||||
return true;
|
||||
void acpi::init(){
|
||||
// ACPICA needs scheduling to be started
|
||||
scheduler::queue_async_init_task(initialize_acpica);
|
||||
}
|
||||
|
||||
void acpi::shutdown(){
|
||||
|
@ -87,10 +87,12 @@ void kernel_main(){
|
||||
virtual_allocator::finalize();
|
||||
kalloc::finalize();
|
||||
|
||||
// Asynchronously initialized drivers
|
||||
acpi::init();
|
||||
|
||||
//Install drivers
|
||||
serial::init();
|
||||
timer::install();
|
||||
//acpi::init();
|
||||
keyboard::install_driver();
|
||||
disks::detect_disks();
|
||||
pci::detect_devices();
|
||||
@ -118,7 +120,7 @@ void kernel_main(){
|
||||
scheduler::start();
|
||||
}
|
||||
|
||||
}
|
||||
} //end of extern "C"
|
||||
|
||||
void suspend_boot(){
|
||||
k_print_line("Impossible to continue boot...");
|
||||
|
Loading…
x
Reference in New Issue
Block a user