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 namespace Power
{ {
void Power::Reboot() void Power::Reboot() { ((ACPI::DSDT *)this->dsdt)->Reboot(); }
{ void Power::Shutdown() { ((ACPI::DSDT *)this->dsdt)->Shutdown(); }
}
void Power::Shutdown()
{
}
Power::Power() Power::Power()
{ {

View File

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