Implemented shutdown & reboot

This commit is contained in:
Alex 2022-10-11 00:03:45 +03:00
parent 19e810653a
commit ab1972627e
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 31 additions and 11 deletions

View File

@ -9,13 +9,8 @@
namespace Power
{
void Power::Reboot()
{
}
void Power::Shutdown()
{
}
void Power::Reboot() { ((ACPI::DSDT *)this->dsdt)->Reboot(); }
void Power::Shutdown() { ((ACPI::DSDT *)this->dsdt)->Shutdown(); }
Power::Power()
{

View File

@ -8,17 +8,42 @@ namespace Power
class Power
{
private:
// specific for 64 and 32 bit
void *acpi;
void *dsdt;
void *madt;
void *acpi = nullptr;
void *dsdt = nullptr;
void *madt = nullptr;
public:
/**
* @brief Get Advanced Configuration and Power Interface. (Available only on x32 and x64)
*
* @return void*
*/
void *GetACPI() { return this->acpi; }
/**
* @brief Get Differentiated System Description Table. (Available only on x32 and x64)
*
* @return void*
*/
void *GetDSDT() { return this->dsdt; }
/**
* @brief Get Multiple APIC Description Table. (Available only on x32 and x64)
*
* @return void*
*/
void *GetMADT() { return this->madt; }
/**
* @brief Reboot the system.
*/
void Reboot();
/**
* @brief Shutdown the system.
*/
void Shutdown();
Power();
~Power();
};