Kernel: Add support for ACPI Control Method Batteries
The implementation is kinda weird but it exposes some battery information to userspace!
This commit is contained in:
@@ -28,6 +28,8 @@ namespace Kernel::ACPI
|
||||
// 2: SAPIC
|
||||
BAN::ErrorOr<void> enter_acpi_mode(uint8_t mode);
|
||||
|
||||
BAN::ErrorOr<void> initialize_acpi_devices();
|
||||
|
||||
BAN::ErrorOr<void> poweroff();
|
||||
BAN::ErrorOr<void> reset();
|
||||
|
||||
|
||||
26
kernel/include/kernel/ACPI/BatterySystem.h
Normal file
26
kernel/include/kernel/ACPI/BatterySystem.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <kernel/ACPI/AML/Namespace.h>
|
||||
#include <kernel/FS/TmpFS/Inode.h>
|
||||
|
||||
namespace Kernel::ACPI
|
||||
{
|
||||
|
||||
class BatterySystem
|
||||
{
|
||||
BAN_NON_COPYABLE(BatterySystem);
|
||||
BAN_NON_MOVABLE(BatterySystem);
|
||||
public:
|
||||
static BAN::ErrorOr<void> initialize(AML::Namespace& acpi_namespace);
|
||||
|
||||
private:
|
||||
BatterySystem(AML::Namespace&);
|
||||
|
||||
BAN::ErrorOr<void> initialize_impl();
|
||||
|
||||
private:
|
||||
AML::Namespace& m_acpi_namespace;
|
||||
BAN::RefPtr<TmpDirectoryInode> m_directory;
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user