mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
Kernel: Allow to reboot in ACPI via PCI or MMIO access
Also, we determine if ACPI reboot is supported by checking the FADT flags' field.
This commit is contained in:
parent
8639ee2640
commit
0f45a1b5e7
Notes:
sideshowbarker
2024-07-19 08:49:08 +09:00
Author: https://github.com/supercomputer7
Commit: 0f45a1b5e7
Pull-request: https://github.com/SerenityOS/serenity/pull/1385
Reviewed-by: https://github.com/awesomekling
9 changed files with 183 additions and 25 deletions
|
@ -107,11 +107,30 @@ void PCI::Access::disable_bus_mastering(Address address)
|
|||
}
|
||||
|
||||
namespace PCI {
|
||||
|
||||
void enumerate_all(Function<void(Address, ID)> callback)
|
||||
{
|
||||
PCI::Access::the().enumerate_all(callback);
|
||||
}
|
||||
|
||||
void raw_access(Address address, u32 field, size_t access_size, u32 value)
|
||||
{
|
||||
ASSERT(access_size != 0);
|
||||
if (access_size == 1) {
|
||||
PCI::Access::the().write8_field(address, field, value);
|
||||
return;
|
||||
}
|
||||
if (access_size == 2) {
|
||||
PCI::Access::the().write16_field(address, field, value);
|
||||
return;
|
||||
}
|
||||
if (access_size == 4) {
|
||||
PCI::Access::the().write32_field(address, field, value);
|
||||
return;
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
ID get_id(Address address)
|
||||
{
|
||||
return PCI::Access::the().get_id(address);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue