Kernel: Add support for power button shutdown
This patch implements basic support for power button using ACPI fixed events. I still need to implement general purpose events and embedded controller for full power button support.
This commit is contained in:
@@ -1198,7 +1198,7 @@ namespace Kernel
|
||||
IDT::force_triple_fault();
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::sys_poweroff(int command)
|
||||
BAN::ErrorOr<long> Process::clean_poweroff(int command)
|
||||
{
|
||||
if (command != POWEROFF_REBOOT && command != POWEROFF_SHUTDOWN)
|
||||
return BAN::Error::from_errno(EINVAL);
|
||||
@@ -1215,6 +1215,11 @@ namespace Kernel
|
||||
return BAN::Error::from_errno(EUNKNOWN);
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::sys_poweroff(int command)
|
||||
{
|
||||
return clean_poweroff(command);
|
||||
}
|
||||
|
||||
BAN::ErrorOr<long> Process::sys_readdir(int fd, DirectoryEntryList* list, size_t list_size)
|
||||
{
|
||||
LockGuard _(m_process_lock);
|
||||
|
||||
Reference in New Issue
Block a user